realpart strangeness, was: besselarray bug, was: Bessel plotting problem
Subject: realpart strangeness, was: besselarray bug, was: Bessel plotting problem
From: Mario Rodriguez
Date: Fri, 13 Jun 2008 12:25:05 +0200
Richard Hennessy escribi?:
> I think then the idea is not to tell draw where the points came from so I tried this and it works.
>
> (%i2) expr:expand(sum((-1)^k*2^(-v-2*k)*z^(v+2*k)/(k!*gamma(v+k+1)),k,0,100))$
> (%i3) myf(v,z):=''expr$
> (%i21) mypoints:makelist([t/2, float(realpart(myf(1/6,t/2))), float(imagpart(myf(1/6,t/2)))], t, -30,30);
> (%i20) draw3d(color=royalblue,point_size=1, points_joined=true,point_type = dot, points(mypoints));
>
> Now draw has no idea that the points were coming from a complex valued function, so it works.
>
Not exactly. In general, package draw should accept complex expressions,
plotting their real parts. The problem appears in some cases.
I have just commited a new draw version which tries to fix this:
http://maxima.cvs.sourceforge.net/maxima/maxima/share/draw/draw.lisp
Now, the following code works:
draw2d(explicit(bessel_j(1/6,-t), t, -3, 3)) $
--
Mario Rodriguez Riotorto
http://www.telefonica.net/web2/biomates