[Maxima] plotting numeric functions
robert.dodier at gmail.com
Tue May 25 00:22:27 CDT 2010
On 5/24/10, Leo Butler <l.butler at ed.ac.uk> wrote:
> James, after playing around a bit, I think the problem is simply that
> compiling your function exhausts all heap space (1G in my case). I don't
> know if this is a bug in Maxima's compiler (probably),
I kind of wonder what you mean by this, since the translator and
compiler are not invoked by plotting. I'm pretty sure the problem
is that abs(f(x, y)) fails when x and y are symbols since abs then
attempts to construct an expression which is either too big or
takes too long to construct.
Here's another attempt to forestall evaluation of abs(f(x, y)) until
x and y are numbers. I think this one works.
matchdeclare ([xx, yy], numberp);
tellsimp (g (xx, yy), f (xx, yy));
plot3d (abs (g (nr, ni)), [nr, 1, 2], [ni, 1, 2]);
This makes g a simplifying function; for anything other than
numerical argument, it doesn't simplify. For numerical arguments
g(x, y) simplifies to f(x, y).
Now it is certainly unfortunate that any workaround is needed
to get the example to work. The main problem is that computing
abs is a pretty difficult problem. I don't know what we could do to
avoid running out of time or memory.
More information about the Maxima