Why not just fscanf the input into a typedef structure (defined before main() starts so it's global) in the main function before you start your ode solver? Then it'll only do it once instead of multiple times. Then label that structure "param(s)" and pass it's base address as the last argument of the function (rhs) subroutine. Inside the subroutine, you can use the "->" logical operator on the pointer to the structure to retreive the elements of "params" into another typedef struct of the same type declared locally in the function (rhs) subroutine.
BTW, it'd be nice if they (Galassi et al) could clarify this in the gsl manual in the ODE chapter as it seems to be a fairly standard method of passing multiple parameters into the func() & jac() subroutines. On 3/19/06, pakosal <[EMAIL PROTECTED]> wrote: > > > Hi again > According to your suggestions i did the following... > At every time step I read every record from the input.dat file through > fscanf > then, i pass the acceleration to my system as a parameter. > However, the process is very time consuming, > Could you give me some hints about how to improve this? > Id appreciate an example of external forces in odes. > Thanks in advance > Pakosal > -- > View this message in context: > http://www.nabble.com/external-force-in-ode-t1294358.html#a3484541 > Sent from the Gnu - Gsl - Help forum at Nabble.com. > > > > _______________________________________________ > Help-gsl mailing list > [email protected] > http://lists.gnu.org/mailman/listinfo/help-gsl > _______________________________________________ Help-gsl mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gsl
