Integration of Few Body Celestial Systems Implementing Explicit Numerical Methods
Abstract
The -body problem is of historical significance because it was the first implementation of the Newtonian dynamical laws for the description of our Solar System. Motivated by this, the project’s goal is to revisit this problem for small and find a solution for the trajectories of specific two-body and three-body configurations as well as the planetary orbits of our Solar System using a fourth order Runge-Kutta explicit iterative method. We find an adequate agreement in our results with planetary trajectories found online.
I Introduction
The two-body problem is one of the most well-known problems in the literature and can be found in most classical mechanics textbooks and reviews, for instance in collins ; arnold ; mayer ; landau . Analytical methods can be invoked for the solution to the two-body problem and be given in a closed form. In the three-body problem, there exists a slowly converging power-series solution only under certain conditions as was demonstrated early on by sundman ; poincare . However, under a more general setting, the solution to the three-body, let alone the many body problem, can be addressed numerically and simple methods can be invoked to solve the few body problem anagnostopoulos ; ydri .
In the past there have been various numerical aarseth ; szebehely ; bettis ; nacozy ; ahmaad ; zadunoisky ; mikkola and semi-analytical musielak ; naoz ; laves ; becker ; arenstorft ; wang surveys on the -body problem and its applications hayli ; wielen . Stability szebehelyStab ; scheeres ; marchal ; elmabsoutStab and error analysis studies baba ; dejonghe was also investigated. The study of the -body problem has become popular especially after the advent of modern technology and computer power, resulting in the development of advanced algorithmic techniques and parallel computing Hertz ; belleman . Regularization schemes have also been developed to overcome singularities encountered in numerical simulations szszodr ; heggie ; zare ; MikkolaReg . For a comprehensive book on the study of N-body systems and their numerical simulations see aarsethBOOK .
In this project, we aim at integrating the few body problem implementing low order explicit numerical methods. Specifically, we define the -body problem in three dimensions and apply for small (here at most ). We consider two-body and three-body bounded systems like the Pluto-Charon pair and a star-planet-comet triple. Finally, we simulate the Solar System taking into account only the eight planets and the Sun. We test whether the well-known 4-stage explicit Runge-Kutta iterative method (RK4) butcherBook ; butcherRunge , which is of relatively low computational expense and of non-significant stability, can be justified and sufficiently approximate this problem, instead of applying more heavy computational or greater stability-wise algorithms such as implicit, Predictor-Corrector (PECE) freed , and semi-unconditional methods butcherImplicit ; butcherStabImplicit ; gautchi . Here, we have developed our own numerical codes writing the RK4 algorithm routine from scratch in FORTRAN language.
II Method
II.1 The N-body gravitational problem
An -body configuration, composed of point masses, is determined by the time-dependent positions, , and the momenta, , for each member of the system. Here, is the time, denotes the components and labels each particle. Such a configuration whose members interact solely via gravitational forces, is defined as a Hamiltonian system of the from
(1a) | ||||
(1b) |
where is the gravitational constant, which we take to be unity. This system is conservative and theoretically speaking the total energy, E, and total angular momentum, L, are conserved and constant in time. They are constants of motion. Monitoring the time evolution of the values of E and L given a particular system throughout a simulation, is of importance. Because, if E and L are not constant in time, this indicates that the simulation failed. Small deviations are expected, as long as they are in agreement with the error of the respective numerical method. Finally, the -body configuration is a “stiff” problem, thus not all numerical methods give reliable solutions and we would need a special type of stability. (A differential system is said to be stiff, when the Jacobian has at least a large negative eigenvalue.)
II.2 The numerical algorithm
The -body problem is quite complicated for it cannot always be solved analytically and a complete analytic solution exists only for . For this reason, we resort to numerical solutions. In this project, we are going to use the 4-stage Runge-Kutta explicit iterative method (RK4) to solve the few body problem () in three dimensions butcherBook ; butcherRunge ; gautchi . As it will be noted, this is not the best fitted numerical solution for this problem, mainly if one is interested in long running simulations. Due to the fact that it is explicit and not an (semi-)unconditional method, it is not suitable for stiff problems. We would need an unacceptably small step size level in order to better approximate the theoretical solution, which would make the process quite slow. So, for this reason we will mainly use a relatively small step size. But it is intriguing nonetheless to see how a method, with relatively low computational expense and no noteworthy stability, fairs with such a problem, as an alternative for methods with heavy computational needs and greater stability (e.g. A-stability).
As we can see from Appendix A, by choosing the node and weight parameters , we can produce Runge-Kutta methods butcherCoeff that are consistent and have sufficient stability in order to achieve the maximum possible order. Therefore, choosing the parameters in the form of Matrices as below,
(7) |
we get the 4-stage explicit Runge-Kutta formulae. Best written as,
(13) |
It has been proven by M. W. Kutta in the 1900s, that such explicit methods of stage , attain maximum order of exactly . That means that, our method has global order of 4 (), since we used 4-stages. This can be proven by application of Taylor’s expansion for (vector-valued) functions, though for high orders like our method it is technically much more demanding than the lower ones. Therefore, one can use graph-theoretical tools, as established by J.C. Butcher butcherRungeTree .
III Results
In the previous sections we defined the N-body problem, as well as the numerical integration algorithm that we are going to use. In this section, we are going to present numerical solutions to three celestial systems for bodies (Pluto-Charon couple), bodies (star-planet-comet triple) and bodies (our Solar System). The correct choice of initial conditions is of importance for all the following examples, so that we have a bounded and periodic movement in which there are no collisions. In case the bodies get too close and collide, the gravitational force will become huge and the equation will diverge to infinity. This is a type of singularity, as the position vectors are inversely proportional to the square of the distances between two interacting bodies. Reminder, for all of the solutions that follow below, we have worked in a unit system in which the gravitational constant is equal to one ().
III.1 Pluto-Charon
In this example, we are going to simulate the celestial system of Pluto and its moon Charon, neglecting the gravitational effects from other moons, other celestial objects and planets as they are irrelevant. It is a unique pair, since Charon is such a large moon compared to its parent body that the barycenter of the system lies outside of Pluto which is the primary mass. This means that Pluto orbits about a point which lies at a distance larger than its radius. Charon orbits in an opposite fashion to Pluto about the center of mass, always respecting the conservation laws. From data known, the mass of Charon is the mass of Pluto (null , https://solarsystem.nasa.gov/moons/pluto-moons/charon/by-the-numbers/). As for the initial conditions we take those seen in Table 1 and assume that the center of mass is at the point . Pluto’s initial position is taken to be at the arbitrary and by use of momentum conservation, we determine the initial position and velocity of Charon. We present part of the trajectory (about three quarters to a complete period) in Fig. 1.
Since the total angular momentum of a bounded system of -bodies is an integral of motion, we get that the third component of the total angular momentum equals
with . We notice that it is constant and independent of time. As we can also see from Fig. 2, this conservation is respected in our simulation, while small changes in values are of order , which is in agreement with the error predicted by the RK4 method. The conservation of the angular momentum vector is also consistent with the plane movement seen in Fig. 3, as it is orthogonal to the subspace created by the vectors and . Further, the energy of the system has also been checked to be constant within the errors of the method used.



III.2 Star-Planet-Comet
Often, in -body systems, one seeks for a simplistic solution of the problem for a qualitative description of the orbits. As an example, for a more precise calculation of the Earth’s orbit, it would suffice to take into consideration only the Sun and the large planets while we may ignore the gravitational effect of smaller celestial objects, like moons, dwarf planets, asteroids and comets. Motivated by such an approximation, in this sub-section we consider a system of three masses with a hierarchy in their values. This is often referred to as the restricted three-body problem pojoman . In particular, we consider a central heavy object representing a star, along with a light planet orbiting around that star and a third even lighter body, which could represent a comet. So, we have the case . To find an approximate numerical solution to the differential system in Eq. (1) we utilize this mass hierarchy to our benefit. For instance, to calculate the force acted on the planet or the comet we only take into consideration the contribution from the star while the effect of the planet on the comet is a small perturbation which we can be neglected. Such a planet-comet interaction would only affect the orbit of the comet in case the latter encounters the planet closely, in which case the forces would be larger. The corresponding differential system is given by,
(14a) | ||||
(14b) | ||||
(14c) |
The condition for which a planet-comet interaction is not negligible is when the force of the planet on the comet is of the same order as the force of the star on the same comet; i.e. . However, since , the deviation of the planet’s trajectory due to a strong planet-comet interaction will not be affected significantly, and thus we neglect the force of the comet on the planet (the second term in the right-hand-side of Eq. (14b)). Nevertheless, in the time interval for which we have integrated Eq. (14) there are no strong encounters between the planet and the comet and therefore the second term in the right-hand-side of Eq. (14c) is irrelevant in our case. Initial conditions for Eq. (14) are shown in Table 2.

III.3 Solar System
In this last example, we attempt to calculate the orbits of the planets in our Solar System. The Sun comprises nearly all of the matter in the Solar System, reaching up to of total mass and is expected to have a nearly zero acceleration in the Solar System frame, https://solarsystem.nasa.gov/solar-system/sun/overview/. According to Kepler’s laws of planetary motion, each object will travel along an ellipse with the Sun being approximately stationary at one of the focal points. Consequently, the closer a planet is to the Sun, the faster it will revolve around it and the smaller its orbital period. Therefore, by the time an outer planet (e.g. Jupiter) completes a full revolution, an inner planet (like Venus) will have already completed several orbits. In particular, in our simulations, we have integrated the system over such a time interval such that Uranus and Neptune orbits have not closed (see the black and purple lines in Fig. 5).
We treat the Solar System as a body problem, where the initial conditions and masses of the planets have all been normalized in terms of the Earth’s. We consider a system of units in which the mass of the Earth is taken to be . The mass of the Sun and of the other planets are then computed according to the relative mass ratio normalized to , https://solarsystem.nasa.gov/planets/overview/. The initial conditions are given in Table 3, where the conversion factor of for the mass has been used so that the ratio between distances and masses is realistic in our numerical model. In order to conserve momentum at the center of mass frame (which almost coincides with the position of the Sun), we take the initial positions and momenta of the planets to cancel out. Finally, we present the trajectories obtained from the numerical calculation in Fig. 5.
We also give the energy over time in Fig. 6, where we notice that the fluctuations displayed are within the error margin of the 4-stage Runge-Kutta method. Nevertheless, it is approximately constant as expected from a theoretical standpoint. The angular momentum was also monitored and found to be conserved within errors and fluctuates like the energy in a similar manner, but it is not depicted here.


Moreover, in Fig 7 we compare the orbits of the inner planets (Mercury, Venus, Earth and Mars) obtained from our numerical model with orbits found online (https://theskylive.com/3dsolarsystem). Looking at Fig. 7, we notice that there are the small differences in the trajectories of the planets. More generally, planets nearest to the Sun do not stray as much as planets that are further away (like Uranus, which is not depicted in Fig. 7) for which we find that the difference in their orbits is larger. Nevertheless, our trajectories were calculated using a computational inexpensive scheme with relatively small step size. Since, as we already said the initial conditions affect our solution curves, they also play a significant role in the deviation of the two sets of orbits. For that reason it was relatively a successful simulation. For better results, a smaller step size would probably not suffice in the long run and a more sophisticated analysis would be needed (see Sec. IV).

IV Discussion
To summarize, in this project we implemented the RK4 method in the context of few-body celestial systems and observed the solution curves and the behavior of the bodies in those systems. We aimed to simulate these models by using a relatively low computational cost numerical method with fast results and easy programming. So we settled with the explicit 4-stage Runge-Kutta method and saw whether it could be efficient enough to solve stiff problems, with the -body problem being one them. Eventually, we noticed that for celestial systems with fewer interaction terms (e.g. Pluto-Charon system), that is with small, this method had sufficient and quick results as seen in the Sec. III. However, since the equations are stiff, after a certain number of periods, the orbits eventually diverge, unless we use some step-size control scheme, where we would only delay this effect and make the whole process too slow. This is the biggest downside of this numerical method, as it lacks in stability, being a 0-stable and not unconditionally stable, which is needed in our case. Albeit the fact that with few interactions the results where ample, when more celestial bodies came into play, the stiffness became more predominant altering the orbits (e.g. in the Solar System example) before finishing a full period. Although, the simulation, as already mentioned was somewhat successful, one cannot but notice the difference in the trajectory of the planets with the orbits found elsewhere (see Fig. 7). Making the step-size smaller with some step-size control schemes, seemed to fix the problem for the first few periods only, but it needed way too much time to finish, which is something we wanted to avoid from the beginning. So, we came to the conclusion that a more efficient way to solve this problem, was to not simulate it with the RK4 method, as it was too unreliable, as expected, for that many bodies. A general method that could be used instead, is an implicit Runge-Kutta method, but the considerable computational expense involved with it cannot be justified for this problem. More fitted well-known numerical schemes would be the semi-implicit Runge-kutta or PECE methods, which, again, are more expensive than a regular RK4 method. Since, for the former in each step we would need to solve a system of equations, and for the latter one, twice the evaluation of the function per step would be required. An even better treatment of this problem, would be to implement a semi-unconditional method, like the non-trivial backward differentiation formula methods (BDF-s for ).
In conclusion, the results of this project showed that, for few body systems and for few periods, the explicit RK4 is sufficient, but when the problem has more interactions, then we believe that an unconditional or semi-unconditional method is required for its simulation.
This work was developed in the summer of 2019 and was translated into English by the authors in the winter of 2020.
Object | mass | ||||||
---|---|---|---|---|---|---|---|
Pluto | 100 | -1 | 0 | 0 | 0 | 31.1 | 0 |
Charon | 12 | 8.197 | 0 | 0 | 0 | -31.1 | 0 |
Object | mass | ||||||
---|---|---|---|---|---|---|---|
Star | 0 | 0 | 0 | 0 | 0 | 0 | |
Planet | 1 | 1 | 0 | 0 | 0 | 0 | |
Comet | 1 | 0.5 | 0 | -2.5 | -3 | 0 |
Object | mass | ||||||
---|---|---|---|---|---|---|---|
Sun | 333043.1 | 0 | 0 | 0 | 28.2 | -134.94 | 0 |
Mercury | 0.055 | 4 | 0 | 0 | 0 | 0.0875 | 0 |
Venus | 0.815 | 0 | 7 | 0 | -0.95844 | 0 | 0 |
Earth | 1 | -10 | 0 | 0 | 0 | -1 | 0 |
Mars | 0.1075 | 0 | -15 | 0 | 0.08686 | 0 | 0 |
Jupiter | 317.82 | 52 | 0 | 0 | 0 | 139.2 | 0 |
Saturn | 95.081 | 0 | 95 | 0 | -30.42 | 0 | 0 |
Uranus | 14.54 | -198 | 0 | 0 | 0 | -3.3442 | 0 |
Neptune | 17.148 | 0 | -300 | 0 | 3.087 | 0 | 0 |
Appendix A Formulation of Runge-Kutta types
In this appendix we formulate the general Runge-Kutta method for random coefficients considering an ordinary differential equation (ODE) of the form :
(17) |
We begin by applying a uniform discretization at the interval . So if we separate the interval into sub-intervals, we get that the discretized time-step is , where . Then by integrating Eq. (17) from to we get :
(18) |
Then considering the approximations , and the change in coordinates , we conclude that
(19) |
Then according to Gauss-Legendre numerical integration with nodes , on the interval and the corresponding weights , it can be rewritten as
(20) |
where and are chosen accordingly. In order to calculate the remaining term we once again integrate Eq. (17), this time from to with the same change in coordinates, extracting the following set of equations
(21) |
Repeating the Gauss-Legendre numerical integration for every node , and considering the approximations , we get
(22) |
where the coefficients are the corresponding weights at every node , . So the above relation represents a non-linear system of equations with unknown parameters. Summarizing, the method can be written as
(26) |
where every tuple of , is chosen accordingly so that it represent a specific Runge-Kutta method of intermediate stages. These number are very often written in form of a matrix, according to the symbolism of Butcher J.C. butcherBook ; butcherCoeff .
Depending on how we choose we are able to obtain new Runge-Kutta methods. Specifically, if for such Runge-Kutta methods are called explicit and can be solved with simple substitutions. While otherwise they are called implicit and in order to calculate the terms we need to solve a non-linear system for each time-step. For more information see butcherBook ; butcherRunge ; butcherCoeff .
Also an equivalent and more used form of the system in Eq. (26) is
(29) |
where we set . This is the form that we are also going to use when we talk about the 4th order Runge-Kutta method.
References
- (1) G. W. Collins II, “The foundations of celestial mechanics II.”, 1989.
- (2) V. I. Arnold, “Mathematical methods of classical mechanics”, 1989.
- (3) K. R. Meyer and G. R. Hall, “Introduction to Hamiltonian dynamical systems and the N-body problem”, 1992.
- (4) L. D. Landau and E. M. Lifshitz (Trans. by J. B. Sykes and J. S. Bell), “Mechanics: course of theoretical physics”, 2007.
- (5) K. F. Sundman, Acta Math. 36 (1913), 105-179.
- (6) H. Poincaré, “The three-body problem and the equations of dynamics”, 2017.
- (7) K. N. Anagnostopoulos, “Computational physics: a practical introduction to computational physics and scientific computing”, 2014.
- (8) B. Ydri, doi:10.1142/10283, arXiv:1506.02567 [hep-lat].
- (9) S. J. Aarseth and F. Hoyle, Astrophysica Norvegica 9 (1964), 313.
- (10) V. Szebehely and D. G. Bettis, Astrophys. Space Sci. 13 (1971), 365-376.
- (11) D. G. Bettis, Celes. Mech. 8 (1973), 229-233.
- (12) P. E. Nacozy, Apps 14 (1971), 40-51.
- (13) A. Ahmad and L. Cohen, Journal of Computational Physics 12 (1973), 389-402.
- (14) P. E. Zadunaisky, Celes. Mech. 20 (1979), 209-230.
- (15) S. Mikkola and J. Hietarinta, Celest. Mech. and Dyn. Astron. 51 (1991) no.4, 379-394.
- (16) Z. E. Musielak and B. Quarles, Reports on Progress in Physics 77 (2014), 065901, arXiv:1508.02312 [astro-ph.EP].
- (17) S. Naoz, W. M. Farr, Y. Lithwick, F. A. Rasio and J. Teyssandier, Mon. Not. Roy. Astron. Soc. 431 (2013), 2155, arXiv:1107.2414 [astro-ph.EP].
- (18) L. Kurt, Astron. J. 19 (1898), 97-104.
- (19) L. Becker, MNRAS 80 (1920), 787.
- (20) R. F. Arenstorf, Celes. Mech. 14 (1976), 5-9.
- (21) Q. D. Wang, Acta Astronomica Sinica 10 (1985), 135-142.
- (22) S. J. Aarseth, J. R. Gott III and E. L. Turner, ApJ 228 (1979), 664-683.
- (23) R. Wielen, Celes. Mech. 2 (1970), 353-354.
- (24) V. Szebehely, Celes. Mech. 22 (1980), 7-12.
- (25) D. J. Scheeres, Celest. Mech. Dyn. Astron. 104 (2009), 103-128.
- (26) C. Marchal, Acta Astronautica 7, 555-565.
- (27) B. Elmabsout, Academie des Sciences Paris Comptes Rendus Serie B Sciences Physiques 13 (1989), 1153-1156.
- (28) L. K. Babadzhanyants, Pisma v Astronomicheskii Zhurnal 7 (1981), 752-755.
- (29) H. Dejonghe and P. Hut, Lecture Notes in Physics 267 (1986), 212, doi:10.1007/BFb0116416.
- (30) P. Hertz and S. L. W. McMillan, Celes. Mech. 45 (1989), 77.
- (31) R. G. Belleman, J. Bedorf and S. Portegies Zwart, New Astron. 13 (2008), 103-112, arXiv:0707.0438 [astro-ph].
- (32) B. Szczodrowska, Postepy Astronomii Krakow 17 (1969), 375-386.
- (33) D. C. Heggie, Celes. Mech. 10 (1974), 217-241.
- (34) K. Zare, Celes. Mech. 10 (1974), 207–15.
- (35) S. Mikkola and K. Tanikawa, Mon. Not. R. Astron. Soc. 310 (1999), 745–9.
- (36) S. J. Aarseth, Gravitational N-body simulations: tools and algorithms, 2003.
- (37) J. C. Butcher, “Elementary differential equations and boundary value problems”, 2012.
- (38) J. C. Butcher, Scholarpedia 2 (2007), 3147.
- (39) A. D. Freed, arXiv:1707.02125 [cs.NA].
- (40) J. C. Butcher, Mathematics of Computation 18 (1964), 50-64.
- (41) J. C. Butcher, MBIT Numerical Mathematics 15 (1964), 358-361.
- (42) W. Gautschi, “Numerical Analysis, 2nd edition”, 2012.
- (43) J. C. Butcher, Journal of the Australian Mathematical Society 3 (1963), 185-201.
- (44) J. C. Butcher, Numer Algor 53 (2010), 153-170.
- (45) G. W. Null, W. M. Owen and S. P. Synnott, Astron. J. 105 (1993), 1993.
- (46) J. Pojman and V. Szebehely, ASIC 246 (1988), 277-288.