This is the mail archive of the gsl-discuss@sourceware.org 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]
Other format: [Raw text]

Re: [Bug-gsl] Error in manual: forcing ode minimum step size


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

--
Tuomo.Keskitalo@iki.fi
http://iki.fi/tuomo.keskitalo


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