* Re: [Bug-gsl] Error in manual: forcing ode minimum step size
[not found] <4CA9D064.7040502@jyu.fi>
@ 2010-10-06 15:52 ` Tuomo Keskitalo
2010-10-16 11:20 ` Tuomo Keskitalo
0 siblings, 1 reply; 2+ messages in thread
From: Tuomo Keskitalo @ 2010-10-06 15:52 UTC (permalink / raw)
To: Taneli Kalvas; +Cc: bug-gsl, GSL Discuss Mailing List
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
^ permalink raw reply [flat|nested] 2+ messages in thread