This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Stepping to negative direction in ODE
- To: Timo Laitinen <timolai at green dot srl dot utu dot fi>
- Subject: Re: Stepping to negative direction in ODE
- From: Brian Gough <bjg at network-theory dot co dot uk>
- Date: Wed, 3 Oct 2001 11:32:14 +0100 (BST)
- Cc: gsl-discuss at sources dot redhat dot com
- References: <Pine.LNX.4.10.10110031239010.15403-100000@green.srl.utu.fi>
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