This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Stepping to negative direction in ODE


Timo Laitinen writes:
 >  I found a problem with the step size evolution mechanism in the
 > functions
 >  gsl_odeiv_evolve_apply and std_control_hadjust
 >  The problem is that they cannot handle negative step sizes, ie
 > they cannot be used for solving an equation backwards in time (or
 > in space!!!). My solution for the problem is to change in
 >  evolve.c, line 147

Thanks, I'll make those changes.

 >  There is also another problem in function gsl_odeiv_evolve_apply.
 > If the initial h0 is larger than the remaining time dt, the
 > final_step flag is set, on line 150. BUT, if the step is now
 > decreased by gsl_odeiv_control_hadjust, line 182, and the new step
 > h0<dt, the final_step flag is NOT RESET!. Thus, you end up taking a
 > small step *h, and updating the time *t to t1, which would give
 > strange results.

Right, you may want to grab the latest version from CVS as I checked
in a fix for this recently (also some improvements to the BSIMP algorithm).
Here it is,

Index: evolve.c
===================================================================
RCS file: /cvs/gsl/gsl/ode-initval/evolve.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -r1.11 -r1.12
21c21
<  * RCS:     $Id: evolve.c,v 1.11 2001/06/25 10:27:45 bjg Exp $
---
>  * RCS:     $Id: evolve.c,v 1.12 2001/09/29 20:34:09 bjg Exp $
150a151,154
>     }
>   else
>     {
>       final_step = 0;


best regards
Brian Gough


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]