This question follows my earlier question How can I call the Boost C++ odeint Runge-Kutta integrator for a system of ODEs?

I'm still considering the system: $$ \ddot x = - \frac{Ax}{||x||^3} $$

My intention was to use a classical Runge-Kutta 45 method to solve ODEs of my system. However, I have seen recommendations for using symplectic integrators, because they do a better job at conserving the total energy of the system.

How do I know if a symplectic integrator is a better choice for my system? And either way, what are the downsides of using symplectic integrators over, say, RK45 ?

  • $\begingroup$ @GeoffOxberry - A is a scalar constant indeed. I apologize if the question is off-topic. It truly is more a programming question than purely theoretical. But since the subject ( numerical analysis ) is so specific, I thought no other site is better suited than this one. $\endgroup$
    – James C
    Nov 19, 2014 at 3:57
  • 2
    $\begingroup$ @GeoffOxberry - I have edited my question in attempt to make it suitable for this SE site. $\endgroup$
    – James C
    Nov 19, 2014 at 4:09
  • 1
    $\begingroup$ Your system is Hamiltonian (looks like Kepler's central force problem). You might start by measuring the change in energy of your system over your integration period. Then don't just use the default tolerances. This will at least give you a baseline and possibly avoid "premature optimization" if the results are good enough for your application. $\endgroup$
    – horchler
    Nov 19, 2014 at 4:49
  • $\begingroup$ A very useful reference on symplectic integrators from another answer here: scicomp.stackexchange.com/a/29154/23791. It may be enough to close this question as a duplicate. $\endgroup$
    – Tyberius
    Dec 20, 2021 at 21:09


Browse other questions tagged or ask your own question.