Skip to content

Add check test for Runge Kutta Cash Karp 54 time integrator

In this merge request I am adding checkGravityRungeKuttaCashKarp54.py very similar to checkGravity.py except that error tolerance is much lower. In our gitlab CI test with 150 decimal places (mkHP_mpfr150) error tolerance is a very small number 1e-147, huge improvement compared to previous commit which had tolerance only 1e-10 (recently reduced from 1e-3 in !555 (merged) :). There are no deliberations [1] if position or velocity is initialized at time dt/2 or zero or -dt/2. It is initialized at time=0.

However when using higher precision we have to be careful. Ad hoc writing g = -9.81 will lead to errors after 15th decimal place (default python precision). And we have to write instead g = yade.math.toHP1("-9.81"), so that the number will be correct even if yade is compiled with default precision HP1 different than double [2].

For more information about Runge Kutta Cash Karp 54 time integrator see [3] and [4].

In fact [4] was added over 6 years ago 😃 Didn't seem to be much noticed since then. Well, now it can shine.

Although it looks like it needs better documentation. It seems to me that it is propagating the simulation from time to time+O.dt using over thousand or more (self adjusted by that routine) super small timesteps. And reruns these timesteps [5][6] back and forth until requested error tolerance (parameters rel_err, abs_err) is reached.

[1] [2] [3] [4] [5] [6]

EDIT: From commit history I see that RungeKuttaCashKarp54Integrator was written by Burak Er in 2014, do you know if he wrote any publication about this? Would be great to cite his work.

Edited by Janek Kozicki

Merge request reports

Loading