I hope you'll forgive a completely non-Fortran question. I have been
unable to find useful information with Google. Does anyone know an
online reference that explains when Runge-Kutta is the best way to
solve an ODE and when the Bulirsch–Stoer works best?
All I can find is pages explaining how they work, but nothing that
compares them.
Thanks.
Daniel.
Well, Press et al write that B_S is the "best known way to obtain
high-accuracy solutions... with minimal computational effort". I
don't know how they reached that conclusion though.
--
Dieter Britz (dieterhansbritz<at>gmail.com)
> > I hope you'll forgive a completely non-Fortran question. I have been
> > unable to find useful information with Google. Does anyone know an
> > online reference that explains when Runge-Kutta is the best way to
> > solve an ODE and when the Bulirsch-Stoer works best?
> >
> > All I can find is pages explaining how they work, but nothing that
> > compares them.
Why not just try them out with your own problem? It could be that what
works best for most people doesn't work best for you.
B-S can be a lot faster if the equation is reasonably well behaved, but
if not, R-K could be better. You really have to suck it and see.
Why not ask in sci.math.num-analysis?
--
*********** To reply by e-mail, make w single in address **************
I'll do that, but I also hoped to have a general sense of when each
method is likely to do best.
> B-S can be a lot faster if the equation is reasonably well behaved, but
> if not, R-K could be better. You really have to suck it and see.
Thanks.
Daniel.
Will do. Thanks.
Years ago, when Numerical Recipes was recently out in its 1st edition, I
was modelling a sludge digester. The digester was operated as draw and
fill - i.e., a fraction of the volume was withdrawn, then fresh sludge
added to make up the volume. This resulted in a discontinuous aspect to
the equations. BS failed miserably, while the RK4 technique - using
step-halving for accuracy control - perfromed quite well. I had access to
the NAg library, and used their RK4 method - RK-Merson - and that also
failed. I have since used the RK23 code in Netlib, and RKF45, and both
have performed well.
So: BS failed for a problemwhere it should fail. BS is advised for the
case where the following holds:
1. Smooth differential equations. (I had many discontinuities)
2. High accuracy required. (Modelling sewage sludge moderate accuracy was
good enough)
3. Not too much output. (I wanted to track what was happening at c. 15
minute intervals for a period of several weeks to a year)
Rather longer ago that that, I was working on multi-dimensional
scaling, which has the property that it has a set of fairly
well-defined local minima, but where discontinuities are dense
(but in the same direction as the slope). Steepest descents
worked; little else did.
There is a fairly general rule that the less well-behaved the
problem you have, the cruder a method you must use, because all
fancy methods need to make more assumptions. Runge-Kutta is a
bit odd, but also blows up quite spectacularly given a hostile
enough function. For some, there is little option but simple
step-by-step approximation.
As a side-note, IBM SSP contained the only matrix inversion code
that I have ever seen that succeeded in inverting a singular 3x3
matrix - AND returning elements of the same order as the input!
Impressive. Harwell and NAG didn't like the matrix at all :-)
Regards,
Nick Maclaren.
> As a side-note, IBM SSP contained the only matrix inversion code
> that I have ever seen that succeeded in inverting a singular 3x3
> matrix - AND returning elements of the same order as the input!
> Impressive.
Yes, that does sound like a, umm, truly remarkable accomplishment.
:-)
$.02 -Ron Shepard
> Rather longer ago that that, I was working on multi-dimensional
> scaling, which has the property that it has a set of fairly
> well-defined local minima, but where discontinuities are dense
> (but in the same direction as the slope). Steepest descents
> worked; little else did.
> There is a fairly general rule that the less well-behaved the
> problem you have, the cruder a method you must use, because all
> fancy methods need to make more assumptions. Runge-Kutta is a
> bit odd, but also blows up quite spectacularly given a hostile
> enough function. For some, there is little option but simple
> step-by-step approximation.
I always liked Gaussian quadrature, though its assumptions
likely cause problems with some functions. With no prediction,
it shouldn't get too confused. The old trick of running with
different order and checking that the result isn't too different
should still work.
> As a side-note, IBM SSP contained the only matrix inversion code
> that I have ever seen that succeeded in inverting a singular 3x3
> matrix - AND returning elements of the same order as the input!
> Impressive.
The code is still around, if anyone wants to try it.
> Harwell and NAG didn't like the matrix at all :-)
-- glen