This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ODE's again (sorry)



I'm afraid I can't comment on why the code doesn't work
as expected, but I don't think you're solving your problem
in the most sensible way.

"Sam Halliday" <plendily@hotmail.com> writes:

> ok, what i am tryign to do is to use the runge-kutta algorithm to
> project out a function which i can already describe by formula, and i
> have the initial conditions fo the system (all fairly normal).
> 
> but what is different to the normal case, is that i must solve 3 such
> equations needing the results of each to calculate the next step, so i
> must only solve one step at a time.

Does this not simply mean that instead of one second-degree
differential equation (ie two simultaneous first-degree
equations), you have three second-degree diff. eqs. (ie
six simultaneous first-degree diff. eqs.)? So you can
just use one instance of the differential solver, but
with six dimensions, and propagate forward as many steps
as you like.

Furthermore, I'm not quite sure what you mean by Newtonian
equation; if you mean as in Newtonian equations of motion,
then firstly there's something wrong with them, since
it's dimensionally incorrect in your code; and secondly
in this case you'd get better results by using a Verlet-type
algorithm rather than RK (which doesn't conserve phase space[1])
(If you actually mean some other sort of Newtonian equation
that I don't know of, ignore this bit.)

Toby White

[1] Or at least has not been shown to, as opposed to Verlet.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]