plotdf questions: tstep, Runge-Kutta and singular points
Subject: plotdf questions: tstep, Runge-Kutta and singular points
From: Ilya Schurov
Date: Fri, 19 Apr 2013 23:03:44 +0400
Hi, Jaime,
> I see to problems with that approach: the value of vmin (or tmin or
> something else) would have to be given by the user because it is not easy to
> find a good estimate automatically and in the regions where the phase
> velocity is almost constant, the trajectory would move very slowly (with
> velocity vmin) making the algorithm as inefficient as it was when a fixed
> value of tstep was used.
I see the point. If one multiply the vector field by a constant (or
even scalar function), phase curves will be the same, but the lengths
of the vector will change. As far as I understand, we want an
algorithm that will be efficient even if we multiply vector field by a
very small constant.
> I think that the major problem near the equilibrium points is not only that
> the phase velocity is small but that it changes direction abruptly. What I
> was planning to do is to detect those abrupt changes of direction to triger
> the end of the trajectory. But I will try out your suggestion anyway.
I see two different ways to check that we are near the equilibrium:
first, as you suppose, is to check that directions changes quickly
(e.g. we can try to calculate the partial derivatives of
ux^2/(ux^2+uy^2) and uy^2/(ux^2+uy^2), which are sine and cosine of
normalized phase speed), and the other (supposed by my colleague) is
to consider the derivative of the phase speed in current point and
estimate the distance to the singular point assuming that the vector
field is linear (a kind of Newton method). For example, in dimension
1, we are estimating the distance to the equilibrium by the value
-ux/(d(ux)/dx)
(which is exact distance to the root of ux if ux=k*x+b linear).
If that distance is small, we have to decrease h.
One can use some multidimensional counterpart of this method.
I'm not sure which one is better suit our needs.
> plotdf is written in Tcl. The lisp part is just a front end that prepares
> the expressions and options into a form that Tcl can understand. You can see
> the source code for the current Runge-Kutta algorithm in:
>
> interfaces/xmaxima/Tkmaxima/rk4.tcl
>
> In the same directory I also kept the original programs of William Shelter,
> which are not being used:
>
> interfaces/xmaxima/Tkmaxima/Rk.tcl
> interfaces/xmaxima/Tkmaxima/Adams.tcl
Oh, that's great! I found Rk.tcl but missed rk4.tcl :)
Tcl seem to be a bit easier than Lisp though I'm not familiar with it
either :) I'll try to tweak it when time permit.
Thanks again!
--
With best regards,
Ilya V. Schurov.