Subject: using plot2d with numerical integration function
From: Stavros Macrakis
Date: Mon, 28 May 2007 10:23:38 -0400
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