plot2d of romberg-integrating functions?



On Wed, Dec 14, 2005 at 11:56:55PM +0100, Gloeckner, Robert wrote:
> Hello,
> 
> how can i plot functions which do romberg-integrals? 
> 
> h(x) := 3 * x;
> h1(x) := integrate(h(xx), xx, 0, x); /* not possible in my case */
> h2(x) := romberg(h(xx), xx, 0, x); /* i need this for my functions */
> 
> plot2d(h1(x), [x, 0, 10]); /* works */
> plot2d(h2(x), [x, 0, 10]); /* does not work */
> 
> how can i plot h2(x)?

I did this and it worked:
(%i9) h(x):= 3*x;

(%o9) 				  h(x) := 3 x
(%i10) h2(x) := romberg(h(xx),xx,0,x);

(%o10) 		       h2(x) := romberg(h(xx), xx, 0, x)
(%i11) h2(1);

(%o11) 				      1.5
(%i12) plot2d(h2,[x,0,1]);

(%o12) 
(%i13) plot2d(h2(x),[x,0,1]);

Maxima encountered a Lisp error:
.....

I think your problem comes from the fact that the expression h2(x) is
not what plot2d is expecting, instead if you give it a function to
plot and it will do the evaluation at the various points, then it will
work. There's something in the html manual about this I think.


-- 
Daniel Lakeland
dlakelan@street-artists.org
http://www.street-artists.org/~dlakelan