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!

-- 
tuomo.keskit...@iki.fi
http://iki.fi/tuomo.keskitalo


Reply via email to