[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gsl] Error in manual: forcing ode minimum step size
From: |
Tuomo Keskitalo |
Subject: |
Re: [Bug-gsl] Error in manual: forcing ode minimum step size |
Date: |
Wed, 06 Oct 2010 18:52:13 +0300 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100915 Thunderbird/3.0.8 |
Hello,
On 10/04/2010 04:02 PM, Taneli Kalvas wrote:
The manual has the following comment and suggestion for ODE evolve:
>
> Evolving the system directly through a discontinuity with a strict
> tolerance may result in extremely small steps being taken at the edge of
> the discontinuity (e.g. down to the limit of machine precision). In this
> case it may be necessary to impose a minimum step size hmin suitable for
> the problem:
>
> while (t < t1)
> {
> gsl_odeiv_evolve_apply (e, c, s, &sys, &t, t1, &h, y);
> if (h < hmin) { h = hmin; } ;
> }
>
> The value of h returned by gsl_odeiv_evolve_apply is always a suggested
> value and can be modified whenever needed.
Generally speaking:
In my opinion, that part should not be in the manual in the first place.
It describes a potentially harmful numerical tweak. If step size
decreases due approaching of a singluarity, then forcing a large step
over it might introduce a very large error that makes your results
garbage. On the other hand, if the user knows what is really happening
in the system, it can be OK. It depends on the case.
Still... it would be nice to have a possibility for forcing a minimum
step size.
Currently this is possible by using the step_apply routine directly.
This way you can choose to ignore the error estimate of the step, at
your own risk.
You are the second person to ask for it, so I think I'll write a
separate evolve_apply routine that forces evolution of a system with a
user specified step size.
BR,
Tuomo
--
address@hidden
http://iki.fi/tuomo.keskitalo