the "dynamics" package and numerical solution of DEs



On Sun, Jan 21, 2007 at 03:56:49PM -0500, Dan Solomon wrote:
> I'm trying to run rk on an ODE, and the manual says to load 
> ("dynamics"); but maxima can't find the file in the share folders.   
> Any help where I can get it?
> 
> I want to solve an ODE in 3-space numerically; that is, I want to  
> integrate step by step from a given initial vector.  How can I get an  
> education of the options for such a task?

I've been doing nothing but this for the last week or so :-)

The first thing you should do is get a relatively up to date
maxima. 5.10.0 at least. If you're running Debian, that's what's in
the "testing" or "unstable" distribution. If you're running windows
get the newest 5.11 from the maxima.sf.net website. Other systems I
don't know anything about.

If you're running Debian, you'll also need the "maxima-share" package
which has all the "non-core" maxima stuff. I'm not sure why the Debian
packager does this, but I think it's a debian policy to split out
"nonessential" portions of packages...

This might be a reason why it doesn't find the "dynamics" package,
because you will need to "load(dynamics);" before getting rk.

"? rk" is supposed to give you info on how to use the runge-kutta ODE
integrator. It works for me on windows, but on Debian it doesn't find
the docs, so here's a quick rundown in case you have the same problem:

rk(derivs, vars, inits, integrationrange);

will do what you want if you set it up as follows:

integrationrange is a 4 element list: [t,0,1,.01] for example, to
integrate with respect to t from t=0 to t=1 in steps of .01

derivs should be a list of expressions for the derivatives of the
vector components with respect to your parameter. The only variables
allowed in these expressions are your independent variable, and the
various dependent variables.

vars are a list of symbols naming the dependent variables.

inits are the initial conditions.

To give a very simple example:

rk([x*t,y/t,(x+y)/t],[x,y,z],[1,1,1],[t,0.01,1,.01]);

[[0.01, 1, 1, 1], [0.02, 1.0, 2.0, 2.694], [0.03, 1.0, 3.0, 4.1], 
[0.04, 1.001, 4.0, 5.388], [0.05, 1.001, 5.0, 6.611], 
[0.06, 1.002, 6.0, 7.794], [0.07, 1.002, 7.0, 8.948], 
....

-- 
Daniel Lakeland
dlakelan at street-artists.org
http://www.street-artists.org/~dlakelan