[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gsl] passing multiple parameters to func() & jac() while integrati
[Help-gsl] passing multiple parameters to func() & jac() while integrating ODE's in gsl
Sun, 19 Feb 2006 04:43:01 -0600
PS: Sorry if this is a repeat post, having some minor problems with my
localhost mail transport agent...
I need to solve a multidimensional ODE system that has many (~1600)
parameters. So far, I've been taking the coward's way out on & using global
macros for the 2 or 3 parameters in my programs, but can't do that anymore.
So I decided to do a little test program (classical simple harmonic
oscillator) with 2 parameters (mass & omega).
I RTFM'ed and saw p282 and P287 of the gsl manual to see how to pass
parameters into the function & jacobian subroutines. The text and example
show how to do it for one parameter. I assumed that, in order to do it for
multiple parameters, I'd have to put the parameters in an array and pass the
base address to the gsl_odeiv_system datatype, then use pointer arithmetic
in the function & jacobian subroutines to get the values there, but it's not
working (ie getting wrong values while the function/jacobian is running).
I'd be mighty grateful if a fresh pair of eyes could look at my disastrous
handiwork and point out what I'm doing wrong.
More details of what I did and my source code are posted here:
also, the pastebin for the C-source file is:
Thanks in advance,