help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] odeiv2 rk2imp driver time step


From: Juan Pablo Amorocho
Subject: Re: [Help-gsl] odeiv2 rk2imp driver time step
Date: Wed, 21 Dec 2011 23:56:16 +0100

Illes,

It seems you have a stiff problem. If I read correctly you are setting the time 
step yourself. If you are, maybe you might want to try letting gsl figure out 
what is the best time step. The documentation on odes gives and example on how 
to this. 

I think section 3.4(stiffnes:backward Euler) of the book could help. Good luck!

-- Juan Pablo

Sent from my iPad

On Dec 21, 2011, at 11:07 PM, "Farkas, Illes" <address@hidden> wrote:

> Thanks, Tuomo
> 
> I just ran into something unexpected. I am trying to find out where exactly
> I'm making a mistake.
> 
> I'm integrating with rk2imp a 3d ODE that has constants, linear and second
> order polynomial terms on the r.h.s. I use gsl_odeiv2_driver_apply to
> evolve the ODE in steps of 0.125s. After 10s or so (the exact time varies
> with the parameters) all three variables converge (very little relative
> change). However, some time ( > 5s ) later there is an update
> when gsl_odeiv2_driver_apply returns the FAILURE value: -1. After logging
> the current time directly from the "function" and "jacobian" (used by
> the gsl_odeiv2_system, which is driver by the driver), I found that this
> particular update fails, because the time step is halved again and again
> until it reaches the limit of numerical precision.
> 
> Have you seen a similar error before ?
> 
> I have the Ascher Petzold book. Will sections 5.4.3 (modified Newton
> iteration) and 4.7 (implicit methods) be helpful for this problem or shall
> I use a different resource ?
> 
> Thanks
> 
> 
> 
> 2011/12/1 Tuomo Keskitalo <address@hidden>
> 
>> Hello,
>> 
>> rk2imp (among other implicit methods) in ode-initval2 uses a modified
>> Newton iteration instead of old functional iteration in solving the system
>> of non-linear equations. E.g. for stiff problems Newton iteration is quite
>> more powerful. Because of that, the ODE-solver can use larger step sizes.
>> Newton iteration converges with larger step sizes, while functional
>> iteration does not.
>> 
>> 
>> On 12/01/2011 08:42 PM, Farkas, Illes wrote:
>> 
>> Hi,
>>> 
>>> I just tested the speed of rk2imp with the simple harmonic oscillator
>>> (dx/dt=-y, dy/dt=x). In the first test I used
>>> gsl_odeiv_step/control/evolve
>>> (does *not* use Jacobian) and in the 2nd test I used
>>> simply gsl_odeiv2_driver (uses Jacobian). With the same parameters the
>>> first version ran for 26s and the second version finished below 1s. Is
>>> this
>>> test wrong? Or is there really such a big difference?
>>> 
>>> Thanks
>>> Illes
>>> ______________________________**_________________
>>> Help-gsl mailing list
>>> address@hidden
>>> https://lists.gnu.org/mailman/**listinfo/help-gsl<https://lists.gnu.org/mailman/listinfo/help-gsl>
>>> 
>>> 
>> 
>> --
>> address@hidden
>> http://iki.fi/tuomo.keskitalo
>> 
> 
> 
> 
> -- 
> http://hal.elte.hu/fij
> _______________________________________________
> Help-gsl mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-gsl



reply via email to

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