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)


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.

so i have used the 3rd example in the documentation (rewritten slightly, and 
changed into a function call) and i solve for 1 projected point, and then 
reinsert this as the initial value in another call to the same function... 
you see i am only solving forward 1 value every time i call the runge-kutta 
as opposed to using the call to solve for ALL 't'. this is needed due to the 
nature of the function i am trying to solve.

but what i am gettign is that when i reinsert these results as initial 
conditions... my results seems to lag behind waht is expected, as the 
derivative seems to be slightly lower than it is suppossed to be. i thereby 
conclude that the said 'output' of the call is not what it says it is, or 
that the 'input' is faulty. they may be outputting values of y or dy/dt 
slightly off what is asked of them.

i haev attached my source, there are instructions on how to compile for both 
cases...

i hope somebody can explain what is wrong, if even it is a problem with my 
source,

i have removed the other 2 equations (which i am also trying to solve in 
sync) for simplicity sake..

cheers,
and many many thanks,
Sam
---
If you wish to be happy for one hour, get drunk.
If you wish to be happy for three days, get married.
If you wish to be happy for a month, kill your pig and eat it.
If you wish to be happy forever, learn to fish.
                -- Chinese Proverb

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

Attachment: rkhelp.c
Description: Binary data


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