Hostname: page-component-77f85d65b8-9nbrm Total loading time: 0 Render date: 2026-03-28T09:29:19.099Z Has data issue: false hasContentIssue false

A COMPARISON OF EXPLICIT RUNGE–KUTTA METHODS

Published online by Cambridge University Press:  19 October 2022

STEPHEN J. WALTERS*
Affiliation:
Mathematics Department, University of Tasmania, Tasmania 7005, Australia; e-mail: ross.turner@utas.edu.au and larry.forbes@utas.edu.au.
ROSS J. TURNER
Affiliation:
Mathematics Department, University of Tasmania, Tasmania 7005, Australia; e-mail: ross.turner@utas.edu.au and larry.forbes@utas.edu.au.
LAWRENCE K. FORBES
Affiliation:
Mathematics Department, University of Tasmania, Tasmania 7005, Australia; e-mail: ross.turner@utas.edu.au and larry.forbes@utas.edu.au.
Rights & Permissions [Opens in a new window]

Abstract

Recent higher-order explicit Runge–Kutta methods are compared with the classic fourth-order (RK4) method in long-term integration of both energy-conserving and lossy systems. By comparing quantity of function evaluations against accuracy for systems with and without known solutions, optimal methods are proposed. For a conservative system, we consider positional accuracy for Newtonian systems of two or three bodies and total angular momentum for a simplified Solar System model, over moderate astronomical timescales (tens of millions of years). For a nonconservative system, we investigate a relativistic two-body problem with gravitational wave emission. We find that methods of tenth and twelfth order consistently outperform lower-order methods for the systems considered here.

Information

Type
Research Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution, and reproduction in any medium, provided the original work is properly cited.
Copyright
© The Author(s), 2022. Published by Cambridge University Press on behalf of Australian Mathematical Publishing Association Inc.
Figure 0

Figure 1 The Butcher tableau is a standard way of displaying the coefficients for RK methods. For ERK methods, the $a_{ij}$ coefficients are displayed in lower-triangular matrix form, with their row-sums, $c_i$, as a column on the left and the integration weights, $b_j$, as a row underneath. The general form for ERK methods is shown in the left panel, the “classic” RK4 method is in the centre panel and one of Butcher’s RK6 methods is shown in the right panel.

Figure 1

Table 1 The seven methods investigated in this work are listed below, showing number of stages and order of accuracy. The number of stages increases rapidly with increasing order of accuracy.

Figure 2

Figure 2 The orbital paths of the two- and three-body simulations, showing the initial locations of the bodies, along with an indication of their initial velocities, represented by the arrows. The left panel shows the simplified two-body orbit, where the mass is all located at the origin and a much lighter body orbits in an elliptical path. The ellipse shown here has eccentricity of $0.6$. The central panel shows the orbits of two massive bodies orbiting a more massive central body. The right panel shows the path of three equal mass bodies chasing each other around a figure-eight path. Initially, the central body has twice the speed of the other two bodies, but in the opposite direction, so that the system has zero total momentum.

Figure 3

Figure 3 The n-body 3D code to utilize any of the ERK methods, is shown here in modern Fortran. The initial values are loaded into the variables $xi$ etc. Next, the intermediate integration point is determined, based on the $a_{ij}$ values. The accelerations at that point are determined, based on the masses and positions of all the other bodies. Finally, the positions and velocities are updated based on all the integrated values at each stage, weighted by the $b_j$ weights.

Figure 4

Figure 4 The code snippet used to update the position of each body. The “cycle” statement skips the calculation where $m=j$. That is, the body’s acceleration is not affected by its own position and mass.

Figure 5

Figure 5 Display of error level due to different stepsize $\Delta t$. Both the error and $\Delta t$ are displayed using log scales, which appears as a linear relation, demonstrating the power law dependence of accuracy on $\Delta t$. This graph compares results at different step-sizes for a simple circular orbit using quad-precision (128-bit floats) integrated by the 16-stage $10$th-order method. The error is relative to the analytically determined position for the final orbit after 1000 orbits.

Figure 6

Figure 6 Maximum variation of position for each of the RK methods for elliptical orbits. The eccentricity varies from 0 to 0.9. The legend shows the different RK methods by their number of stages. The x-axis shows the number of function evaluations per orbit. The y-axis shows the variation relative to the analytic value for the final orbit. Both axes use $\log _{10}$ scaling. The upper figures show results using double precision (64-bit floats), the lower using quad-precision (128-bit floats).

Figure 7

Figure 7 Comparison of the fourth-order symplectic method with the four- and seven-stage RK methods. The x-axis shows the total number of function evaluations for an elliptical system with eccentricity of 0.6. The y-axis shows the variation relative to the analytic value for the orbit. Both axes use $log_{10}$ scaling. The upper panel shows results using 64-bit floats, the lower using 128-bit floats.

Figure 8

Figure 8 Maximum variation of position for each of the RK methods for the circular three-body problem. The legend shows the different RK methods by their number of stages. The x-axis shows the number of function evaluations per orbit. The y-axis shows the variation relative to the analytic value for the final orbit. Both axes use $\log _{10}$ scaling. The upper panel shows results using 64-bit floats, the lower using 128-bit floats.

Figure 9

Figure 9 Final maximum absolute value of the variation of angular momentum for each of the RK methods for the figure-eight three-body problem. The legend shows the different RK methods by their number of stages. The x-axis shows the number of function evaluations per orbit. The y-axis shows the maximum absolute value of the total angular momentum for the final orbit. Both axes use $log_{10}$ scaling. The upper panel shows results using 64-bit floats, the lower using 128-bit floats.

Figure 10

Figure 10 Variation in the z-component of angular momentum for each of the nine Solar System bodies over 500 000 years, smoothed with a 25-year moving average. The variation is dominated by Jupiter (black) and Saturn (red online), exchanging momenta over a 50 000-year period. The total momentum of the system should remain zero.

Figure 11

Figure 11 Final maximum absolute value of the variation in the total system z-component of angular momentum for each of the RK methods for the nine-body Solar System. The legend shows the different RK methods by their number of stages. The x-axis shows the number of function evaluations per orbit. The y-axis shows the maximum absolute value of the total angular momentum for the final orbit. Both axes utilize $\log _{10}$ scaling. The upper panel shows results using double precision (64-bit), the lower using quad-precision (128-bit).

Figure 12

Figure 12 Variation in z-component of angular momentum for the nine-body Solar System. The upper panel show the results using 85 time-steps per earth year, which become unstable at 4.9 million years. The lower panel used 90 time-steps per year and became unstable at 13.4 million years.

Figure 13

Figure 13 Comparison of the variation in the z-component of angular momentum for the nine-body Solar System using Feagin’s RK10 method. In the upper panel, we have used dotted lines (with squares) and dashed lines (with circles) for 90 or 95 points per year, respectively. It may be seen that the two methods diverge at $1.338\times 10^7$ years. A fourth-order symplectic method has been added in the lower panel, shown with a dash-dot line, with “+” markers. This symplectic simulation used 80 points per year, with four function calls per point. Additional magnification is used in the lower panel. By observing that the “+” and circle markers stay together, it is apparent that the symplectic method maintains the angular momenta terms better than a much slower (90 points per year) RK method.

Figure 14

Figure 14 The number of years until numerical failure of the Solar System model, plotted using a $\log _{10}$ scale, against the number of points per year used in the simulation. While the graph has a strong linear correlation, there is significant variability, as seen in the data at 62, 64 and 65 points per year.

Figure 15

Figure 15 Accuracy of the Binary Black Hole simulation. The top left panel shows the orbital paths of the two equal mass black holes. The top right panel shows the value over time of the gravitational wave component $h_+$. The bottom panels compare the accuracy of the RK methods using double-precision (left) and quad-precision (right). The final value of $h_+$ in each simulation is compared against the value of $h_+$ calculated using high precision and very small time-steps. Both axes use $\log _{10}$ scaling.