From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brian Gough To: Timo Laitinen Cc: gsl-discuss@sources.redhat.com Subject: Re: Stepping to negative direction in ODE Date: Wed, 19 Dec 2001 13:20:00 -0000 Message-id: <15290.59694.223528.165356@debian> References: X-SW-Source: 2001/msg00555.html 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 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