[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] Problem when using gsl_odeiv2_evolve_apply

From: Nino S
Subject: [Help-gsl] Problem when using gsl_odeiv2_evolve_apply
Date: Mon, 18 May 2015 16:22:13 -0500


I am a newbie and having trouble in applying gsl ode solvers.

I am solving an ode system using rkf45 algorithm. I  use
to evolve the system:


gsl_odeiv2_system sys = {mysystem, jac, DIM, params};

const gsl_odeiv2_step_type * T= gsl_odeiv2_step_rkf45;

gsl_odeiv2_step * s = gsl_odeiv2_step_alloc (T, DIM);

gsl_odeiv2_control * c = gsl_odeiv2_control_y_new (1e-4, 1e-4);

gsl_odeiv2_evolve * e = gsl_odeiv2_evolve_alloc (DIM);


while (t < tend)
    int status = gsl_odeiv2_evolve_apply (e, c, s,
                                         &t, tend,
                                         &h, y);

    if (status != GSL_SUCCESS)
        printf ("error, return value=%d\n", status);


However the while loop never stops and after I check the output of 't', I
found a strange behavior:

't' goes like


It is looping from 0 to 200 and never get to 10000.

Within the loop, IMO the solver status checking forces the code to stop if
the return is not 'GSL_SUCCESS'. However it's looping infinitely from 0 to
200. Does it mean there are some weird cases where the
'gsl_odeiv2_evolve_apply' will stop before 'tend', resetting 't' to 0 and
returning a 'GSL_SUCCESS'?

Have no idea what's going on here. Could you give me some help?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]