implicit_plot gives an error



Ray's idea about quad_qags helps.
I found the following adhockery useful to work around
a bug in listofvars (which is called by plotting code to
determine the free variables in the plotting expression).

foo (x, y) := quag_qags (...) [1];
matchdeclare ([xx, yy], numberp);
tellsimpafter (%foo (xx, yy), foo (xx, yy));
contour_plot (%foo (x, y), [x, ...], [y, ...]);

which is just postponing any mention of quad_qags until
the arguments are bound to numbers.

Interested parties will probably need to experiment with
the number of grid points and contour levels and other parameters.

HTH

Robert Dodier

On 3/22/11, Raymond Toy <toy.raymond at gmail.com> wrote:
> On 3/21/11 12:01 PM, Jaime Villate wrote:
>> On Mon, 2011-03-21 at 14:25 +0100, Michael Kogan wrote:
>>> implicit_plot(1=integrate(1/sqrt(1+(1/z-1)*x
>>> +(z^2-1)*y),z,0,1),[x,-5,5],[y,-5,5]);
>>>
>>> Output
>>>
>>> Maxima encountered a Lisp error:
>> Hi,
>> the problem is not with implicit_plot, but with integrate which cannot
>> solve that integral. Even using one of the numerical methods in Maxima
>> that integral will fail, because in z=0 the term 1/z gives you an
>> overflow.
> Agree with the part about maxima not being able to do the symbolic
> integration.  The integrand is the square root of a cubic, which leads
> to elliptic integrals, which maxima doesn't know how to do.
>
> However, the 1/z term is no problem.  quad_qags easily evaluates the
> integral once values for x and y are substituted.  I thought that
> perhaps changing the call to implicit plot to something like
>
> f(x,y):= quad_qags(<integrand>,z,0,1)[1];
>
> implicit_plot(f(x,y)-1,[x-5,5],[y,-5,5])
>
> would work, but it doesn't.
>
> Ray
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>