[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gsl_odeiv2 steppers and drivers

From: Tuomo Keskitalo
Subject: Re: gsl_odeiv2 steppers and drivers
Date: Thu, 1 Apr 2021 18:07:54 +0300


please keep list in cc in replies. OK I see, you want single steps, sorry
my confusion. The way to carry out a single adaptive step via driver is
show in test.c, function sys_driver(). After allocation of
gsl_odeiv2_driver *d, you can call evolve_apply like so:
s = gsl_odeiv2_evolve_apply (d->e, d->c, d->s, sys, &t, t1, &h, y);


On Wed, Mar 31, 2021 at 5:52 PM Tuomo Keskitalo <>

> Hello Andrei,
> I think you could use the driver and let it handle step size control. You
> can check the usage examples here:
> If you want to see more examples, there are some functions in the test.c
> file:
> The idea of the driver level is to hide the low-level objects from the
> users who don't need to have manual control over solution process. You can
> access them via the driver struct if needed. The driver level is documented
> here:
> BR,
> Tuomo
> On Tue, Mar 30, 2021 at 4:59 PM Andrei Kramer <> wrote:
>> Hello,
>>  I have a question regarding ODE steppers. I would like to integrate a
>> stiff system, and obtain output which is fine grained where needed and
>> has bold time steps where the trajectory is more flat. This is ideal
>> for plotting the result I think, and gives me some insight into which
>> step sizes the integrator thought reasonable.
>> So, I wanted to try to use the low-level evolve_apply functions (is
>> that the right way to go about this?). But the really good solvers for
>> stiff problems require a driver object, which allocates all of the
>> arguments for the evolve_apply function internally. I don't see any way
>> to access those objects. So, I don't know how to call the evolve_apply
>> function at all, other than making those objects a second time
>> (manually) and hoping that they are similar enough (i.e. that I don't
>> specify two very different control functions by accident). It just
>> seems unatural to have the driver internal step/control function and
>> another (manually made) step/control function.
>> Should I... not try to obtain adaptively spaced output and just pick a
>> fixed time-step for the trajectory? (this is what I'm doing now)
>> This would probably mean that I won't know which steps the solver made.
>> Currently I pick a safe (small) step size so that the plotted curves
>> look smooth enough.
>> I suspect that I don't fully understand the reasoning behind the odeiv2
>> interface.
>> Best,
>> Andrei Kramer
> --


reply via email to

[Prev in Thread] Current Thread [Next in Thread]