help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] ode version and compilers


From: Tuomo Keskitalo
Subject: Re: [Help-gsl] ode version and compilers
Date: Wed, 06 Nov 2013 18:40:46 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

Hi,

On 11/06/2013 05:25 PM, Rhys Ulerich wrote:

> full-order accuracy to be achieved.  However, between RK4 steps one is
> permitted to change the parameters however one likes.
> 
> Along that line of reasoning, I would expect
>      gsl_odeiv2_evolve_apply (e, c, s, &sys, &t, t+1, &h, y);
>      // modify system parameters in some fashion
>      gsl_odeiv2_evolve_apply (e, c, s, &sys, &t, t+1, &h, y);
> to behave identically pre- and post-4771 as line 1 completes some
> number of full steps of the chosen scheme.  That is, the modification
> in line 2 is not done in between substeps.
..
> Tuomo, is this use case supported and, if so, does 4771 break it in
> some fashion?

Indeed, it is not supported directly like that. You must call
evolve_reset (or driver_reset) in between to let the evolve system know
that your ODE system has been changed:

      gsl_odeiv2_evolve_apply (e, c, s, &sys, &t, t+1, &h, y);
      // modify system parameters in some fashion
      gsl_odeiv2_evolve_reset (e);
      gsl_odeiv2_evolve_apply (e, c, s, &sys, &t, t+1, &h, y);

Adding evolve_reset to Alan's case did speed it up magnificently, so I
think this was the culprit.

Reading the manual, I see that the need to call reset function is not
explicitly stated in this kind of a situation. I will add it to the manual.

Thanks for your bug report!

-- 
address@hidden
http://iki.fi/tuomo.keskitalo




reply via email to

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