Computational Science Asked on October 23, 2021
I would like to use Runge-Kutta 8th order method (89) in a celestial mechanics / astrodynamics application, written in C++, using a Windows machine. Therefore I wonder if anyone knows a good library / implementation that is documented and free to use ? It is ok if it is written in C, as long as there aren’t any compilation problems to be expected.
So far I have found this library ( mymathlib ). The code seems ok, but I haven’t found any information on licensing.
Can you help me by revealing some of the alternatives you might know and would suit my problem ?
EDIT :
I see that there aren’t really that many C/C++ source codes available as I expected. Therefore a Matlab/Octave version would be ok too (still has to be free to use).
summarizing some points:
DP5
) when you're looking at 4 digits of accuracy (tolerances are wayyyy lower for this though. Tolerances are only a ballpark in any problem). As you pull the tolerances even lower the improvement from a high order RK method grows, but you may need to start using higher precision numbers.dop853
and DifferentialEquations.jl's DP8
(which are the same). The latter 853 method cannot be implemented in standard tableau version of an Runge-Kutta method since it's error estimator is non-standard. But this method is much more efficient and I wouldn't recommend even using the older Fehlberg 7/8 or DP 7/8 methods.Answered by Chris Rackauckas on October 23, 2021
I would like to add that while what Geoff Oxberry suggests for long-term integration (using symplectic integrators) is true, in some cases it won't work. More specifically, if you have dissipative forces, your system does not preserve the energy anymore, and therefore you cannot resort to symplectic integrators in that case. The person asking the question was talking about low Earth orbits, and such orbits exhibit a big amount of atmospheric drag, that is a dissipative force that precludes using such symplectic integrators.
In that specific case (and for cases where you cannot use /do not have access to/do not want to use symplectic integrators), I would recommend the use of Bulirsch-Stoer integrator if you need precision and efficiency over long timescales. It works well by experience, and is also recommended by the Numerical Recipes (Press et al., 2007).
Answered by viiv on October 23, 2021
If you're doing celestial mechanics over long time scales, using a classical Runge-Kutta integrator will not preserve energy. In that case, using a symplectic integrator would probably be better. Boost.odeint also implements a 4th-order symplectic Runge-Kutta scheme that would work better for long time intervals. GSL does not implement any symplectic methods, as far as I can tell.
Answered by Geoff Oxberry on October 23, 2021
Both GNU Scientific Library (GSL) (C) and Boost Odeint (C++) feature 8th order Runge-Kutta methods.
Both are opensource, and under linux and mac they should be directly available from the package manager. Under windows, it will probably be easier for you to use Boost rather than GSL.
GSL is published under the GPL license, and Boost Odeint under the Boost license.
Edit: Ok, Boost Odeint does NOT have the Runge-Kutta 89 method, only the 78, but it does provide a recipe for making arbitrary Runge-Kutta steppers.
8th order methods are quite high however, and most likely overkill for your problem.
Prince-Dormand refers to a specific kind of Runge-Kutta, and is not directly related to the order but the most common is 45. Matlabs ode45, which is their recommended ODE algorithm is a Prince-Dormand 45 implementation. This is the same algorithm as implemented in Boost Odeint Runge_Kutta_Dopri5.
Answered by LKlevin on October 23, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP