plotdf questions: tstep, Runge-Kutta and singular points



Hi, Jaime,

Thanks a lot for your reply!

I believe that the docs should be updated to avoid such questions in the future.

As far as I understand, in order to keep length of the segment fixed
in the phase space, you have to divide your tstep by the length of the
vector of the vector field in current point (it's just a guess, I
didn't check the code), and therefore you have instability near the
equilibrium point. Is it really necessary to keep this length strictly
fixed? I mean, why not just say something like

tstep=tstep0/max(vmin, len(v))

instead of

tstep=tstep/len(v)

?

Sorry for stupid questions :)

Actually, I really appreciate plotdf functionality (I'm encouraging my
ODE students to use Maxima to draw phase portraits during they study),
and I'd be happy if I'll be able to help it to become even better :)
Equilibrium points are crucial in ODE study, you know.

(Unfortunately, I'm not familiar with Lisp at the moment.)

On Thu, Apr 18, 2013 at 10:41 PM, Jaime Villate <villate at fe.up.pt> wrote:
> Hi,
> ?'m sorry that the documentation is outdated. The adaptive step Runge-Kutta
> method is now used always and  therefore, the tstep value is ignored; the
> value of tstep will changed in order to keep steps with a fixed
> length in the phase plane. That method introduces the instabilities that you
> have seen near the equilibrium points; I have some ideas to improve that
> behavior in future versions, but in the meantime I suggest that
> you try using the option direction -> forward (either add
> [direction,forward] in the plotdf command, or changing
> it in the menu); that way the trajectories will not move back to the
> equilibrium point. You can also try changing
> the value of nsteps.
> Regards,
> Jaime
>
>
>
> On 04/18/2013 05:46 PM, Ilya Schurov wrote:
>>
>> Hi there,
>>
>> I have some problems with plotdf command. I'd like to plot some nice
>> phase portraits of singular points. However, it seems that integration
>> algorithm becomes inaccurate near singular points (e.g. nodes).
>>
>> Here is an example.
>>
>> plotdf([x**2-y,log(1-x+x**2)-log(3)],[x,1,3],[y,3,5]);
>>
>> The output looks like this:
>>
>> http://schurov.com/maximassode.png
>>
>> One can see artifacts near the singular point.
>>
>> I tried to overcome this issue by setting tstep parameter as described
>> in the docs (http://maxima.sourceforge.net/docs/manual/de/maxima_66.html).
>> However, it seems that the system simply ignores tstep parameter. At
>> least, I tried commands
>>
>> plotdf([x**2-y,log(1-x+x**2)-log(3)],[x,1,3],[y,3,5],[tstep,100000]);
>>
>> and
>>
>> plotdf([x**2-y,log(1-x+x**2)-log(3)],[x,1,3],[y,3,5],[tstep,0.000001]);
>>
>> I believe that the first command should give very inaccurate picture,
>> and the second one have to produce much more accurate pictures. In
>> fact, they are identical to each other. Note also, that I do not have
>> "tstep" parameter in the "Plot setup" window.
>>
>> The other idea was to switch to Runge-Kutta method. The docs says it's
>> possible ("The Adams Moulton method is used for the integration; it is
>> also possible to switch to an adaptive Runge-Kutta 4th order method"),
>> but I didn't found such an option in the options list.
>>
>> Version of my Maxima:
>>
>> Maxima 5.29.1 http://maxima.sourceforge.net
>> using Lisp SBCL 1.0.55.0.debian
>>
>> Any ideas?
>>
>> --
>> With best regards,
>> Ilya V. Schurov.
>> _______________________________________________
>> Maxima mailing list
>> Maxima at math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>



-- 
With best regards,
Ilya V. Schurov.