_{1}

^{*}

The continuous approximations play a vital role in
*N*-body simulations. We constructed three different types, namely, one-step (cubic and quintic Hermite), two-step, and three-step Hermite interpolation schemes. The continuous approximations obtained by Hermite interpolation schemes and interpolants for ODEX2 and ERKN integrators are discussed in this paper. The primary focus of this paper is to measure the accuracy and computational cost of different types of interpolation schemes for a variety of gravitational problems. The gravitational problems consist of Kepler’s two-body problem and the more realistic problem involving the Sun and four gas-giants—Jupiter, Saturn, Uranus, and Neptune. The numerical experiments are performed for the different integrators together with one-step, two-step, and three-step Hermite interpolation schemes, as well as the interpolants.

Explicit Runge-Kutta-Nyström methods (ERKN) were introduced by E. J. Nyström in 1925 [^{*} was used to approximate the solutions,

For the direct numerical approximation of systems of second-order ODEs, Hairer, Nørsett and Wanner [^{−}^{20} or 10^{−}^{30}. For ODEX2 integrator we used the built-in interpolant.

Störmer methods are an important class of numerical methods for solving systems of second-order ordinary differential equations. Störmer methods were introduced by Störmer [

Hermite interpolation uses derivative and function values and is named after Charles Hermite (1822-1901). We used four schemes: one-step (cubic and quintic Hermite), two-step and three-step Hermite interpolation schemes. The cubic Hermite interpolation polynomial is of degree 3, while the quintic, two-step and three-step Hermite interpolation polynomials are of degrees 5, 8 and 11, respectively. The interpolation schemes are derived using a Newton divided difference approach, which is described in Section 1.1.1. There is a second approach, which we call the direct approach that is frequently used by other researchers; for example, see [

To determine the interpolating polynomial

where the a’s are calculated from the divided differences. The i^{th} divided difference can be calculated using

see

Similarly, for the second-order differences in

Hence, for Hermite interpolation schemes we can use the NDD approach if the derivatives replace the corresponding divided differences.

In this section and the next, we describe the direct approach for obtaining the cubic and quintic Hermite polynomials. The cubic Hermite interpolation polynomial

0 | |||||||

1 | |||||||

2 | |||||||

3 | |||||||

4 | |||||||

5 |

where,

and

The quintic Hermite interpolation polynomial

where,

and

The two-step Hermite interpolation polynomial

where the coefficients

Similarly, the three-step Hermite interpolation polynomial interpolates the data

As for the two-step Hermite interpolation polynomial, the coefficients

We compared the maximum error in position and the CPU-time for P_{3} and P_{5} evaluated using NDD and the direct approach. The comparison was done for one period of Kepler problem for eccentricities of 0.05 to 0.9 (see Section 2.1 for more details on the experiment), and the Jovian problem [

For the two-body problem, no significant differences in the maximum error as CPU-time were observed between these two approaches. For the Jovian problem, the direct approach takes approximately half the CPU-time of the NDD approach. The coefficients of the polynomial for the NDD approach depend on the components of the solution vector. For the direct approach the coefficients are independent of the components, so they can be used as a vector to approximate polynomials and that will save CPU-time.

In the rest of the paper, cubic and quintic Hermite interpolation schemes are implemented using the direct approach. For two-step and three-step Hermite interpolation schemes we implemented the NDD approach, because it is really difficult to find the coefficients for the direct approach.

Here, we examine the error growth in the position and velocity for the Kepler problem. The experiments for short-term integrations are performed using four different types of interpolation schemes applied to the Kepler problem over the interval of 2π.

The solution to the Kepler problem is periodic with period 2π. We do not have to calculate the reference solution, so the Kepler problem is well suited for testing the accuracy of integration over a short time interval. This assumes the step-size is chosen so that

The error in the position and velocity of the Kepler problem is given by the L_{2}-norm

where

The graphs in

From

N_{sub} | Cubic | Quintic | 2-step | 3-step |
---|---|---|---|---|

17 | ||||

79 | ||||

255 | - | |||

1080 | - | - |

where

y_{1}-component of this solution can be written as_{1} are

It is clear that these and all subsequent derivatives are expected to involve the factor_{2}-component. Indeed, for all interpolation schemes the minimum error in the position occurs at eccentricity 0.05 and the maximum error at eccentricity 0.9 in ^{−}^{15} and 1.67 × 10^{−}^{14}, respectively. We conclude that the interpolation schemes are not affected a great deal by the round-off error when using 30 evenly spaced sub-intervals.

As mentioned earlier, the same sets of experiments described in ^{−}^{16} and an average time-step of approximately 260 days over one million years. Since Jupiter’s orbital period is approximately 4320 Earth days, a time-step of 260 days gives approximately 17 steps.

The results in ^{−}^{08} mentioned in

From ^{−}^{15} and 17 sub-intervals are used. For 79 sub- intervals (used for ERKN101217) only the 2-step and 3-step Hermite interpolation schemes achieve the required accuracy. Similarly, for ERKN689, the quintic and 2-step interpolation schemes achieve the required accuracy, whereas for the

Let us now consider the CPU-time by looking at individual interpolation schemes. Our expectation, at least for the interpolation schemes, is that the CPU-time is proportional to the number of multiplications. If one interpolation scheme uses twice as many multiplications then the CPU-time is expected to be twice as large. There will not be many divisions, and the number of subtractions and additions is typically proportional to the number of multiplications. Normally, when timing a program, an overhead is introduced. Therefore, care has been taken not to include such overheads in the final results. We also checked reproducibility of the results and observed a maximum variation of not more than 2.5%.

As discussed earlier, there are two different approaches to form interpolation schemes. Here, the experiments are performed using a direct approach for cubic and quintic Hermite interpolation, and the Newton divided difference approach for 2-step and 3-step Hermite interpolation schemes. In most cases, interpolation schemes are split into two subroutines, one for finding the coefficients and one for evaluating the polynomials. For ERKN689 and ERKN101217, with the interpolants we have additional stage derivatives (function evaluations). Overall, we have three different groups of interpolation schemes:

1) For cubic and quintic Hermite interpolation schemes, we evaluate the coefficients of the polynomial, which are independent of the components, and the polynomial as one subroutine.

2) For 2-step and 3-step Hermite interpolation schemes, we have two subroutines:

a) The calculation of the coefficients by forming a Newton divided difference table;

b) The evaluation of the polynomial.

3) For the interpolants, we have three subroutines:

a) The evaluation of the coefficients

b) The evaluation of the additional stage derivatives;

c) The evaluation of the polynomial using a) and b).

For ODEX2, the pieces of information required to form the interpolant are considered part of the integration, and we only consider the evaluation of the polynomial; see

Since the coefficients of the polynomials for cubic and quintic interpolations are independent of the components, the experiments for these interpolation schemes are performed as one unit. As can be seen from the formulae in Sections 1.1.2 and 1.1.3, the quintic Hermite interpolation scheme uses approximately 93% more multiplications than cubic Hermite interpolation when applied to the Jovian problem. When we did our experiment, we found that the quintic Hermite interpolation scheme uses approximately 96% more CPU-time than cubic Hermite interpolation, which is in good agreement with the expected value.

^{−}^{07} and 8.71 × 10^{−}^{07} for ERKN689 and ERKN101217, respectively. Therefore, the expected CPU-time for ERKN689 with a 12-stage interpolant is approximately 9.61 × 10^{−}^{06}. For ERKN101217, the expected CPU-time for finding coefficients is approximately 2.00 × 10^{−}^{05}, 2.26 × 10^{−}^{05}, and 2.52 × 10^{−}^{05} with 23-stage, 26-stage, and 29-stage interpolants, respectively.

Integrator | ERKN689 | ERKN101217 |
---|---|---|

9-stage | 17-stage | |

CPU-time |

Interpolation | ERKN689 | ERKN101217 | ||||
---|---|---|---|---|---|---|

Polynomial | 2-step | 3-step | 12-stage | 23-stage | 26-stage | 29-stage |

CPU-time |

Interpolation | ERKN68 | ERKN101217 | ODEX2 | ||||
---|---|---|---|---|---|---|---|

Polynomial | 2-step | 3-step | 12-stage | 23-stage | 26-stage | 29-stage | Interpolant |

CPU-time |

CPU-time between the 23-stage and 29-stage interpolants is twice the difference between the 23-stage and 26- stage interpolants which is in good agreement with the difference observed in

The primary objective of this paper was to discuss the accuracy and computational cost of different interpolation schemes while performing N-body simulations. The interpolation schemes play a vital role in these kinds of simulations. We constructed three different types, namely, one-step (cubic and quintic Hermite), two-step and three-step Hermite interpolation schemes. For short-term simulations, we investigated the performance of these interpolation schemes applied to the Kepler problem over the interval [0, 2] for eccentricities in the range [0.05, 0.9]. We observed that the maximum error in position was monotonically increasing as a function of eccentricity. For a given number of sub-intervals we used in this paper, the higher-order interpolation schemes achieve better accuracy and for a given interpolation scheme the accuracy improves if the number of sub-intervals is increased. We also investigated the CPU-time by looking at individual interpolation schemes. Our expectation, at least for the interpolation schemes, was that the CPU-time was proportional to the number of multiplications. For example, the quintic Hermite interpolation scheme uses approximately 93% more multiplications than cubic Hermite interpolation when applied to the Jovian problem. When we did our experiment, we found that the quintic Hermite interpolation scheme used approximately 96% more CPU-time than cubic Hermite interpolation, which was in good agreement with the expected value. We also checked reproducibility of the results and observed a maximum variation of not more than 2.5%.

The author is grateful to the Higher Education Commission (HEC) of Pakistan for providing the funding to carry out this research. Special thanks go to Dr. P. W. Sharp and Prof. H. M. Osinga for their valuable suggestions, discussions, and guidance throughout this research.

Shafiq UrRehman,11, (2014) Accuracy and Computational Cost of Interpolation Schemes While Performing N-Body Simulations. American Journal of Computational Mathematics,04,446-454. doi: 10.4236/ajcm.2014.45037