using plot2d with numerical integration function



Thanks a lot! 

Interestingly quoting works in plot2d but not in wxplot2d. (wxplot2d is
where I tried it before asking in this mailing list :-)

Detlef

plot2d('(quad_qag(ff,x,-100,100,6)[1]),[y,-5,5]);
wxplot2d('(quad_qag(ff,x,-100,100,6)[1]),[y,-5,5]);

Am Montag, den 28.05.2007, 10:23 -0400 schrieb Stavros Macrakis:
> On 5/28/07, Detlef Schmicker <d.schmicker at physik.de> wrote:
>         I try to plot2d (or wxplot2d) a function containing quad_qad
>         integration. This numerical function only works, if the
>         variable on the
>         x achses of my plot is defined. Now plot2d seems to call the
>         function
>         without defined variable once.
> 
> Try quoting the argument.  The argument is evaluate to allow things
> like
> 
>        expr:  x^2$
>        plot2d( expr , [x,0,1] )$
> 
> 
>         () ff:(sin(x)^2-1/2)*abs(x-y)*exp(-(x-y)^2/5);
>         () plot2d(quad_qag(ff,x,-100,100,6),[y,-5,5]);
> 
>  e.g.
> 
> plot2d( '(quad_qag(ff,x,-100,100,6) ) ,[y,-5,5]);
> 
> 
> Quad_qag should probably a) give its own error message, not a random
> internal error and b) return itself when its arguments are not numeric
> (with a warning message, perhaps). 
> 
>           -s
> 
>