COMPARISON AMONG CORRECTION METHODS OF ... - IOPscience

42 downloads 0 Views 847KB Size Report
ABSTRACT. We develop a brand-new method of manifold correction that extends Nacozy's approach to correcting individual. Kepler energies that vary with time ...
A

The Astronomical Journal, 133:2643Y2653, 2007 June # 2007. The American Astronomical Society. All rights reserved. Printed in U.S.A.

COMPARISON AMONG CORRECTION METHODS OF INDIVIDUAL KEPLER ENERGIES IN n-BODY SIMULATIONS Xin Wu,1,2 Tian-Yi Huang,1 Xiao-Sheng Wan,1 and Hong Zhang1 Received 2006 November 3; accepted 2007 February 20

ABSTRACT We develop a brand-new method of manifold correction that extends Nacozy’s approach to correcting individual Kepler energies that vary with time in n-body problems of planetary dynamics. Besides discussing this method, we also closely study other existing manifold correction techniques, including the two scaling methods of Fukushima and Liu & Liao. We give a detailed discussion about them analytically and numerically. Our numerical experiments show that all three methods are effective and work almost equivalently in raising the precision of the numerical integration when the adopted basic integrators can give sufficient precision to chosen integrals or quasi-integrals. For simplicity of application, Liu & Liao’s approach is worth recommending. However, this approach cannot improve the orbital eccentricity at all. Because of this, we prefer to use this brand-new extension, as well as the scaling method of Fukushima. Key words: celestial mechanics — methods: n-body simulations — methods: numerical Online material: color figure 1. INTRODUCTION

accumulation of in-track error of its orbit according to Kepler’s third law (Huang & Innanen 1983). In cases like this, the technique is sometimes called the ‘‘energy correction’’ method. However, there are the following two problems in this manifold correction approach. First, using conservation of the total energy in planetary dynamics does have a certain effectiveness, but it cannot yet completely raise the numerical precision. Hairer et al. (1999) noted this fact in a five-body integration of the Sun and four outer planets.3 So did Wu et al. (2006b), who compared the validity of the correction of the total energy with the correction of one of two independent energies for a Hamiltonian system consisting of two conservative components. For further exploration, this idea is extended to a multidimensional Hamiltonian system with many conservative components (Wu & He 2006). The results are as follows. Correction of only the total energy does not improve the precision of the numerical integration in most cases, while correction of all the individual energies does. It should be emphasized that the latter method is fully suitable for an n-body problem in the solar system, although the Kepler energy of each planet or asteroid is not a constant of motion. In a similar way, it is easy to understand what Hairer et al. (1999) have found. For this reason, Fukushima (2003) proposed the ‘‘scaling method,’’ which consists of performing one kind of correction to every Kepler energy. The second difficulty is that Nacozy’s original approach, which is confined to cases with at least one constant of motion, fails to work in dissipative or other nonconservative systems. But this approach still works well if an accurate reference value of a physical quantity is known at any time. One possible path for obtaining such a reference value is to use a better numerical method. However, this will bring in additional computational overhead. In quasiKeplerian motion, an efficient way to obtain a ‘‘standard’’ value of a varying individual Kepler energy with time is to use an integralinvariant relation (Huang & Innanen 1983; Mikkola & Innanen 2002). A main objective of the present paper is to extend Nacozy’s manifold correction to adjust the varying individual Kepler energy

Numerical integrators have played an important role in the study of complicated dynamical systems (Wu & Zhang 2006). One kind of numerical integrator, a symplectic integrator with no long-term accumulation of energy error, has been widely used to explore the qualitative evolution of n-body Hamiltonian systems in planetary dynamics. However, they are not ideal for quantitative studies. In addition, their applications generally require that the Hamiltonian system can be split into integrable parts (Wisdom & Holman 1991; Duncan et al. 1998; Beust 2003). Furthermore, symplectic integrators do not conserve integrals of motion besides the energy integral in general (Minesaki & Nakamura 2002, 2004; Yoshida 2001, 2002; Liu et al. 2006). It is then desirable to use conventional high-order integration methods and to find powerful tools to keep various constraints. Nacozy (1971) introduced a ‘‘manifold correction’’ scheme, which adopts invariant manifolds to monitor and correct numerical errors in coordinates and velocities. This method applies Lagrange multipliers to find a least-squares shortest path to bring the coordinates and the velocity back to the hypersurface connected with a constraint. In practice, the least-squares correction leads the constraint to be conserved numerically in second-order accuracy, as a contrast to its uncorrected counterpart (Chin 1995; Zhang 1996; Ascher 1997). Nacozy’s manifold correction has different names in different references, for example, the ‘‘poststabilization’’ (Chin 1995) or the ‘‘projection’’ method ( Hairer et al. 1999). As a merit, this approach requires only a small amount of additional computational cost and improves the numerical accuracy drastically. It is usually easier to perform than other methods of stabilization, such as that of Baumgarte (1972). Its application and development can be widely found (Murrson 1989a, 1989b; Fukushima 2003, 2004; Wu et al. 2006b; Wu & He 2006; Zhu & Wu 2007). It should be emphasized that the energy integral is usually chosen as the control term in order to get the most valid manifold correction, since the energy of a body is connected with its orbital semimajor axis, and an error in this axis will cause the 1 Department of Astronomy, Nanjing University, Nanjing 210093, China; [email protected]. 2 Department of Physics, Nanchang University, Nanchang 330031, China.

3 In this paper we use the planet definition from before 2006 August 24, when IAU passed a resolution redefining the planets of the solar system.

2643

2644

WU ET AL.

for improving numerical accuracy in n-body simulations. Further, we check the effectiveness of this method, as well as of two scaling methods ( Fukushima 2003; Liu & Liao 1987, 1988, 1994). This paper is organized as follows: In x 2 the brand-new extension of Nacozy’s method is given, and the two scaling methods are discussed in detail. Then we compare them by several numerical examples in x 3. Finally, x 4 summarizes our conclusions. As an illustration, an analytical explanation of the catastrophe of total energy correction in n-body simulations is given in Appendix A, and the two scaling methods are introduced in Appendix B. 2. THREE METHODS OF CORRECTING INDIVIDUAL KEPLER ENERGIES IN AN n-BODY SYSTEM In this section we present a new approach of correction as an extension of Nacozy’s approach. Also, we pay attention to other correction schemes, including the two scaling methods of Fukushima (2003) and Liu & Liao (1994). In particular, the scaling factors between them are discussed. 2.1. A Brand-New Extension of Nacozy’s Approach As is well known, the motion of a body is confined to a hypersurface in phase space when an integral exists. However, numerical errors may cause the body to deviate from this hypersurface. Nacozy’s approach is to pull the body back to this integral hypersurface after every integration step. Some details are given here. Let the first-order system x˙ ¼ f (t; x) have an invariant quantity (t; x) of the form (t; x)  c (c being constant). Then we set (t; x) ¼ (t; x)  c. At a given moment, (t; x)  0 analytically, but this is not true in the computation. Thus, it is vital to apply the control term (t; x) to adjust the numerical solution x at the end of each time step so that the readjusted solution x¯ satisfies the relation ( Nacozy 1971) x¯

 2 @  @  : x   @x  @x 

ð1Þ

Obviously, the gradient of  vanishes at its extremum. This leads to the failure of this technique. But this occurs only rarely, and in this case we can stop using this correction scheme and recover it in the later steps. Taking the corrected solution x¯ as a new initial condition, we continue the numerical integration. As a result, the accuracy of the corrected invariant becomes about the square of the uncorrected one (Chin 1995; Zhang 1996), that is, (t; x¯ )  2 (t; x):

ð2Þ

This is the fundamental reason that this approach is valid for keeping an invariant manifold. As mentioned in x 1, this approach by correction of the total energy is very successful for circular-type, restricted three-body problems, but it fails for generic n-body problems. A detailed analysis of the failure is provided in Appendix A. To obtain a valid correction scheme, we have no choice but to frequently adjust individual Kepler energies like Fukushima (2003) did. Now we can extend Nacozy’s approach, which is limited to the maintenance of invariant manifolds, to the correction of varying individual Kepler energies. A demonstration is given below. In fact, there are two ways to compute each Kepler energy, given in Appendix A (where the suffix j is dropped). One is to di-

Vol. 133

rectly obtain the value K of the Kepler energy from equation (A2) with the numerical solution (v; r) by integrating the equations of motion: dv  ¼  3 r þ a; dt jrj

ð3Þ

where a is the perturbing acceleration and  ¼ G(m0 þ m). Another is to use the fact that the Kepler energy is a constant when perturbation is absent; therefore, the variation of the Kepler energy depends on the magnitude of the perturbation and should have a much better precision in numerical integration. Huang & Ding (1981) proposed to directly integrate the equation of the Kepler energy to control the error accumulation in numerical integration. Later, several authors (Huang & Innanen 1983; Liu & Liao 1987, 1988, 1994; Mikkola & Innanen 2002; Fukushima 2003) used this technique in numerical integration. The time derivative of the individual Hamiltonian in equation (A2) can be written as (Fukushima 2003) d K0 ¼ v  a: dt

ð4Þ

Here K0 ¼ Kˆ  K0 and K0 is the initial value of the Kepler energy. Simultaneously integrating equations (3) and (4) with the initial condition  K0 ¼ 0, we can get K0 and then Kˆ ¼ K0 þ K0 :

ð5Þ

In general, the accuracy of Kˆ is higher than that of K computed from the coordinates and velocity. The Kˆ is adopted as the reference value of the Kepler energy. ˆ we can modify the Following equation (1) and the known K, values of velocity and position for each body except the primary one by @K 1  ; @v @K 1  ; r¯ ¼ r  K @r

v¯ ¼ v  K

ð6Þ

with  K ¼ K  Kˆ and  ¼ j@K/@vj2 þ j@K/@rj2 . Of course, equation (6), as well as equation (1), has uncertainties in principle; that is, it depends on the choice of unit system or on the definition of the gradient norm. If the variables are nondimensional, then this expression for  is reasonable. But if any components have different dimensions, such as the velocity and the position, the situation will be complicated. For example, the expression of  is the sum of two different quantities with different dimensions. One is the square of @K/@v ¼ v, while the other is the square of @K/@r ¼ (/r 3 )r. This is completely similar to the calculation of Lyapunov exponents (Wu & Huang 2003). In order to make the sum physically meaningful, one must choose a unit system or nondimensionalize the expression by scaling with nominal values,      @K=@v 2  @K=@r 2    þ  2  ;  ¼ na  na where n and a are the mean motion and the semimajor axis. This is one way to treat the problem. On the other hand, a much simpler way that we find, similar to the calculation of Lyapunov exponents ( Wu & Huang 2003; Wu et al. 2006a), is to correct only

No. 6, 2007

COMPARISON AMONG CORRECTION METHODS

2645

Fig. 1.— Semimajor axes of two planets in various numerical approaches. Left panels: Jupiter. Panel a shows RK4 in the uncorrected case, while panels c and e represent RK4 with the total energy correction ( TEC) and RK4 with the correction of each Kepler energy ( M1KE ), respectively. The integration times in panels c and e reach 2 ; 106 yr. Right panels: Same as the left panels, but for Saturn.

the velocity. In detail,  ¼ j@K/@vj2 , and the second expression of equation (6) can be dropped. In other words, we have v¯ ¼ v  K

@K 1  : @v

ð7Þ

Thus, we can avoid the sum of two different quantities with different dimensions. In this case the analysis in Appendix A is still valid. Also, we can note a difference between equation (A8) and equation (7) in that the former refers to a paramount object because it must use a barycentric coordinate system as a medium,

2646

WU ET AL.

Vol. 133

TABLE 1 Scale Factors at Selected Step Points with Various Numerical Approaches Time (yr) 1..............................................

1000........................................

3755........................................

5590........................................

6666........................................

7096........................................

9550........................................

10000......................................

Method

-1

-1

Method

-1

-1

RK4 M1 M2 M3 RK4 M1 M2 M3 RK4 M1 M2 M3 RK4 M1 M2 M3 RK4 M1 M2 M3 RK4 M1 M2 M3 RK4 M1 M2 M3 RK4 M1 M2 M3

4.15E11 0 1.93E11 7.67E11 8.43E8 0 1.89E11 7.49E11 2.39E7 0 2.38E11 9.31E11 2.22E7 0 2.37E11 9.50E11 9.93E7 0 1.75E11 9.50E11 1.94E7 0 2.38E11 9.11E11 1.53E7 0 2.36E11 9.48E11 1.71E6 0 1.85E11 7.45E11

2.76E12 3.87E11 1.93E11 3.83E11 4.29E8 3.78E11 1.89E11 3.75E11 8.23E8 4.67E11 2.38E11 4.65E11 9.69E9 4.75E11 2.37E11 4.75E11 7.17E7 3.50E11 1.75E11 4.75E11 1.01E7 4.57E11 2.38E11 4.55E11 2.41E7 4.71E11 2.36E11 4.74E11 1.29E6 3.70E11 1.85E11 3.72E11

RKF5 M1 M2 M3 RKF5 M1 M2 M3 RKF5 M1 M2 M3 RKF5 M1 M2 M3 RKF5 M1 M2 M3 RKF5 M1 M2 M3 RKF5 M1 M2 M3 RKF5 M1 M2 M3

5.84E12 0 2.90E12 1.15E11 1.28E8 0 2.90E12 1.15E11 2.31E8 0 3.01E12 1.18E11 1.52E8 0 2.98E12 1.19E11 1.60E7 0 2.97E12 1.19E11 1.04E8 0 2.94E12 1.17E11 1.29E9 0 3.03E12 1.22E11 2.70E7 0 3.02E12 1.21E11

1.99E13 5.82E12 2.90E12 5.76E12 6.61E9 5.83E12 2.90E12 5.77E12 4.13E10 6.01E12 3.01E12 5.90E12 1.95E8 5.95E12 2.98E12 5.96E12 1.18E7 5.95E12 2.97E12 5.94E12 3.38E8 5.88E12 2.94E12 5.85E12 5.77E8 6.04E12 3.03E12 6.08E12 2.07E7 6.04E12 3.02E12 6.07E12

Notes.—Several numerical approaches are used to numerically integrate the Sun-Neptune two-body problem. In cols. (2)Y(4) we adopt four approaches: RK4 with a fixed step size of 1 yr (labeled as RK4) and RK4 with M1, M2, and M3 (labeled as M1, M2, and M3, respectively). For RK4 we take the real scale factors  ¼ jˆrj/jrj and  ¼ jˆvj/jvj, where (ˆr; vˆ ) is the true vector in position and velocity and (r; v) is from the corresponding numerical solution. Scale factors  and  for M1, M2, and M3 are the ratios of the corresponding after-corrected counterparts to the before-corrected ones. Cols. (5)Y(7) are the same as cols. (2)Y(4), but the adopted basic integrator is RKF5.

but the latter does not. Equation (7) is a brand-new extension of Nacozy’s approach. Still, we can easily arrive at  K  O(( K )2 ), similar to equation (2). This may imply that the individual Kepler energy correction yields a better effect on the numerical accuracy of velocity and position for each object. Hereafter we call the new extension ‘‘method 1’’ ( M1). As expected, our numerical results in Figures 1e and 1f do clearly display that M1 is more effective at improving the semiaxes than the total energy correction scheme. Besides M1, there are other manifold correction techniques: for example, the two different scaling methods of Fukushima (2003) and Liu & Liao (1987, 1988, 1994). The two scaling methods are labeled ‘‘M2’’ and ‘‘M3,’’ respectively. The next subsection will concentrate on a discussion about them. 2.2. Discussion of Two Scaling Methods Some details of the two scaling methods M2 and M3 are listed in Appendix B. It is evident that the two scaling methods seem to be in contradiction. With M3,  2 ¼ 1, but  ¼  with M2. To understand this completely, we demonstrate the related numerical integrations in the following. For comparison, we employ two integrators, RK4 and the fifthorder Runge-Kutta-Fehlberg scheme (RKF5), with the above three manifold corrections to work out the two-body problem of

the Sun-Neptune system. Table 1 lists some results for the scale factors in the various cases. Obviously, the real scale factors  and  (see RK4 and RKF5) do depend on the state variables at a given time and the type and order of integrators adopted. At some times, one scale factor may be slightly larger than 1 and the other slightly smaller than 1 for an integrator. This seems to satisfy Liu & Liao’s idea. However, they may both become larger than 1 at other times for the same integrator. Furthermore, we point out the fact that they differ for different integrators. In this sense, the two scale factors for M3 are not exactly correct, and neither are they for M2 or M1. As an illustration, if only the velocity is corrected, this does not mean that the accuracy of the corrected position vector cannot be improved. More detailed numerical research on this issue is given in the next section. Let us pay attention to the two scaling methods M2 and M3. Fukushima (2003) chose  ¼  because he found that it is true when using Euler’s method. We now see that it is not true when another integrator is adopted. Liu & Liao (1994) chose  2 ¼ 1 by the constraints of the two-body problem. Actually, numerical integrations do not strictly follow this constraint, and the elements besides the semimajor axis also have numerical errors. Consequently, Table 1 has not given us a surprise.

No. 6, 2007

COMPARISON AMONG CORRECTION METHODS

2647

TABLE 2 Errors j rj and jvj in the Numerical Integration of the Two-Body System of Neptune and the Sun Revolution Method

Error

1

10

50

100

1000

RKF5......................................

jrj jvj jrj jvj jrj jvj jrj jvj

2.25E6 2.29E10 1.10E7 1.11E11 1.10E7 1.11E11 1.10E7 1.11E11

2.12E4 2.18E8 3.87E7 3.54E11 3.81E7 3.49E11 3.57E7 3.32E11

5.29E3 5.48E7 1.46E5 1.57E9 1.48E5 1.57E9 1.53E5 1.60E9

2.13E2 2.22E6 7.39E5 7.73E9 7.41E5 7.74E9 7.47E5 7.77E9

2.12E+00 2.21E4 8.64E3 9.00E7 8.47E3 8.83E7 8.46E3 8.82E7

M1 .......................................... M2 .......................................... M3 ..........................................

Notes.—All the computations are performed with RKF5. Four algorithms are executed for comparison. They are RKF5 with an invariant time step of 1.5 yr without any correction and RKF5 with manifold correction methods M1, M2, and M3.

In our opinion, none of the scale factors among the three correction methods coincide with the corresponding real scale factors. Clearly, the three techniques originate from distinct corrections intended to pull the numerical solution of an orbit back to the energy hypersurface on which it should lie. Since there is not a dramatic difference in the corresponding scale factors (except  in M1), the three approaches appear to have nearly the same effectiveness in the improvement of numerical accuracy. The following numerical experiments will prove whether this is true. 3. NUMERICAL COMPARISONS In this section we employ several simple physical models to evaluate the effectiveness of the three methods mentioned above. 3.1. Kepler Problems Here we are mainly interested in the estimation of the effect of orbital eccentricity on the effectiveness of the three methods. 3.1.1. The Sun-Neptune System

A typical example with small eccentricity is the two-body system of Neptune and the Sun. As in Table 1, we apply RKF5 and its manifold methods M1, M2, and M3 to the system. The errors of the relative position and velocity are listed in Table 2. As expected, we see that the errors with the three correction methods of constant Kepler energy are decreased by about 3 orders of magnitude compared with those without any readjustment. This shows that they are all effective in improving the orbital accuracy. On the other hand, all these calculations show that they achieve almost the same accuracy in position and velocity. More numerical investigations have been performed, and the conclusion is the same. One may wonder why the three methods have almost the same effect. The concept of manifold correction in numerical integration is that ‘‘to force the numerical path to go back to the energy manifold can diminish effectively the expansion of the in-track error’’ (Huang & Innanen 1983). All three methods, M1, M2, and M3, use this concept. Evidently, there is wide freedom in the path to the energy manifold when no other constraints can be applied. The correction of M1 goes along the direction of the steepest descent to the energy hypersurface, but the corrected solution does not fall exactly on that hypersurface. The corrections of M2 and M3 cause the corrected solution to fall exactly on the energy hypersurface along particular, but not the shortest, directions. When no other integrals can give further constraint, all the paths are almost equivalent in their effectiveness as long as the correction is not large enough to diminish the precision of the elements

besides the semimajor axis. In other words, all three methods are equal in the sense of improving the orbit precision. It should be emphasized that the numerical effect, which all three methods may have, depends on the adopted numerical integrations. This is because there is a point of difference between M1 and M2/M3 in that the correction of M1 is a first-order approximation, while those of M2 and M3 are exact. In detail, the values of  (or  K) after the corrections are nonzero in M1, while they are zero (except for round-off errors) in M2 and M3. In other words, equation (2) is valid only for M1. For M2 and M3 the corrected  becomes on the order of machine error, . This difference becomes negligible if the numerical integrations give sufficient precision to , say, on the order of 108 or higher in a double-precision environment. On the contrary, it is rather apparent if one uses a middle- or low-precision integrator or adopts a large step size. This fact has also been verified by our numerical tests. Hereafter we consider only integrators with a sufficiently precise  as a basic test tool. To check this fact further, we shall consider test two-body problems with various orbital eccentricities. 3.1.2. Test Two-Body Problems

For simplicity we consider a test two-body problem of the form H ¼ jvj2 /2  1=jrj. At first we fix initial orbital elements: a ¼ 2, i ¼ 20 , ¼ 50 , ! ¼ 30 , and M ¼ 40 . Then we take orbital eccentricity e according to the following two cases. Case I: e ¼ 0:3.—Let a sixth-order Runge-Kutta-Fehlberg integrator (RKF6) with an invariant time step of T /100 (where T is the orbital period) be taken as a test tool. Figure 2a shows that the error jaj of the semimajor axis becomes of nearly linear growth with time, and reaches 2:5 ; 105 when the integration time spans 10,000T. However, the corrected value of a arrives at about the actual value when any of M1, M2, or M3 is employed. In particular, the three correction methods have nearly the same accuracy of a. Similarly, they improve the accuracy of the mean anomaly greatly. As seen in Figure 2f, M2 is the best, and M1 is next. For other orbital elements, Figures 2bY2e show their error evolution with time. As shown in Figure 2b, the three methods M1, M2, and M3 apparently do not raise the accuracy of the eccentricity. In detail, M1 is the best, slightly better than M2, while M3 seems to agree with RKF6. Perhaps because of this fact, M3 does not work at all when the eccentricity is larger than 0.88, but both M2 and M3 are valid up to eccentricities of 0.93. Of course, they all work well, even for e ¼ 0:99, if a fifth- to sixth-order Runge-Kutta-Fehlberg algorithm of variable time step [RKF5(6)] is adopted. In addition, one can note that none of them compared with the uncorrected case decrease the error of the inclination/node (see Figs. 2c and 2d). As for the error of

2648

WU ET AL.

Vol. 133

Fig. 2.— Growth of long-term errors for a pure Keplerian orbit with eccentricity e of 0.3. The unit of all angle variables is radians, and the unit of time is the orbital period T. The step size of each method is T /100. For M2 and M3 the errors jaj are multiplied by factors of 10 and 1000, respectively. [See the electronic edition of the Journal for a color version of panels c and d of this figure.]

perihelion (Fig. 2e), M1/M2 becomes slightly better, but M3 does not alter at all. Case II: e ranging from 0 to 0.99 at intervals of 0.01.—Now let e run from 0 to 0.99 at intervals of 0.01. Since integrators with a fixed step size are not suitable for high-eccentricity trajectories,

we consider RKF5(6) and its correction schemes, M1, M2, and M3. Figure 3 plots the related errors of orbital elements as functions of eccentricity for various numerical approaches after 10,000 orbital periods. The larger the eccentricity becomes, the poorer the accuracy of a or M. As in case I, M1, M2, and M3

No. 6, 2007

COMPARISON AMONG CORRECTION METHODS

2649

Fig. 3.— Eccentricity dependence of errors after 10,000 Keplerian orbit periods with RKF5(6) of variable step sizes. The unit of all angle variables is radians. For M2 and M3 the errors jaj are enlarged by 10 and 1000 times, respectively.

have basically the same effect on the improvement of orbital elements. We emphasize that still we find that M1 is close to M2, but M3 resembles RKF5(6) for the errors of the eccentricity (Fig. 3b). Now let us compare the CPU times with respect to the above methods. Adopting the same fixed step size as in case I, we choose e from 0 to 0.5 at intervals of 0.01. After the computation of 50 orbits, we find that the CPU times of RKF6, M1, M2, and M3 are

674.1, 703.6, 693.3, and 689.0 s, respectively. Here, each of the CPU times for M1, M2, and M3 is slightly more than that of RKF6. In particular, the three correction methods do not have a great difference in computational cost. On the other hand, for case II with a computation of 99 orbits by variable step sizes, RKF5(6) needs slightly more CPU time than any of M1, M2, or M3, but there is still no dramatic differences between the CPU times of M1, M2, and

2650

WU ET AL.

Vol. 133

equilateral triangle with Neptune and the Sun. The Kepler energy EN of Neptune is a constant, but the Kepler energy EQ for QR322 is not. The integrator we adopt is RKF5, with a fixed time step of 1.5 yr, about 1/110 of QR322’s orbital period. Let EN and EQ both be independently readjusted. The integration time for each integrator reaches 10,000 orbital periods of QR322. We apply a 12th-order Cowell method to get a high-precision reference orbit for the construction of the relative position error, log (j rj/jrj), of QR322. As a result, Figure 4 shows that M1, M2, and M3 achieve almost the same high effectiveness in controlling the errors of QR322’s position and velocity. This fact can be seen again in a restricted five-body problem made with the Sun, Jupiter, Neptune, Pluto, and the Plutino 1993 RO. 3.3. Three-Body Problem Fig. 4.— Relative position errors as a function of time for Trojan 2001 QR322 in the Sun-Neptune-QR322 restricted three-body problem with RKF5 and manifold correction schemes M1, M2, and M3. Here we use the orbital period T of QR322 as the unit of time. For M2 and M3 we replace jrj with 0:1jrj and 0:01j rj, respectively. In fact, M1, M2, and M3 are almost the same.

M3 [the detailed CPU times of RKF5(6), M1, M2, and M3 are 10,656.5, 10,648.0, 10,643.3 and 10,642.8 s, respectively]. In summary, case I and case II give the following results: the three methods M1, M2, and M3 have nearly the same effect on the dramatic correction of elements a and M for any eccentricity orbit, but in most cases they fail to greatly improve other elements, such as e, i, , and !. The reason is that M1, M2, and M3 conserve only the energy integral rather than other integrals, such as the angular momentum integral or Laplace integral. In spite of this fact, M1, M2, and M3 can greatly raise the accuracy of the position and velocity, which is chiefly controlled by the semimajor axis rather than by other elements. This is what we have seen in Table 2. Without loss of generality, next we shall use other real physical models to check the accuracy of the position and velocity in the various methods. 3.2. Restricted Three-Body Problem We consider the restricted three-body problem of the SunY NeptuneY2001 QR322 system, where the small body 2001 QR322 (abbreviated as QR322 hereafter), one of the Neptunian Trojans, leads Neptune around its orbit and on average maintains an

Following Figure 1, we use RK4 and its corrections to get the relative position error for each planet in the Sun-Jupiter-Saturn three-body problem. As seen from Figure 5, the individual Kepler energy corrections M1, M2, and M3 are still useful for controlling the errors. For Jupiter in particular, compared to the errors of the uncorrected counterpart, the errors of the corrected integrations with M1, M2, and M3 are decreased by nearly 3 or 2 orders of magnitude when the integration time reaches 105 yr. Consequently, M1, M2, and M3 turn out to have the same effect as above. For Saturn, there is a similar effect on the correction. Meanwhile, one can see that each of them is better for Jupiter than for Saturn. This is because the period of Saturn is longer than that of Jupiter, such that the orbital accuracy of Saturn becomes higher when the same step size is used. This shows sufficiently that the poorer the accuracy an integrator has, the better the corresponding correction approach becomes. In addition, we used these corrections to integrate the 10 body problem made with the Sun and the nine giant planets. The results are still the same. The results obtained in the above numerical experiments have proven not only that the three methods have almost the same effectiveness in correcting position and velocity errors but also the following fact: For a two-body problem, the energy is exactly a constant, and there is only one frequency of the system, the mean motion. Even in this case correction with only the energy integral, which can correct the semimajor axis and further control the in-track error but not the other elements, is not complete.

Fig. 5.— Same as Fig. 4, but in the Sun-Jupiter-Saturn three-body problem. The basic integrator adopted is RK4 with a fixed step size of 0.1 yr. Panel a is related to Jupiter’s errors, and panel b depends on Saturn’s errors.

No. 6, 2007

COMPARISON AMONG CORRECTION METHODS

For an n-body problem with n > 2, the individual Kepler energy is not an exact integral anymore but a quasi-integral, and there are more frequencies. In the general case, the correction procedure would be more restrictive with an increase in perturbation. 4. SUMMARY From a theoretical point of view, we argued about the invalidity of correcting the total energy integral for n-body problems in planetary dynamics. However, it is quite successful to employ individual Kepler energy corrections to improve the orbital accuracy. An important point to mention is the difficulty in the implementation of this idea because each Kepler energy is not a constant, as in a two-body problem. As a key to the problem, we employed a simple device: direct integration of a quasi-integral to obtain a more precise reference value of the Kepler energy at any time. This is a brand-new method of manifold correction. Numerical tests reveal the validity of this approach and our analysis. There are three methods for correcting the numerical solution back to the Kepler energy hypersurfaces: the new extension of Nacozy’s steepest descending method ( M1) and the two scaling methods of Fukushima (2003; M2) and Liu & Liao (1987, 1988, 1994; M3). Our numerical tests have shown that they are all valid for raising the precision of numerical integrations, and they attain a similar improvement in precision when the adopted basic integrators can give a sufficient precision to chosen integrals or quasi-integrals. No method shows superiority over the others in its increase in precision. We have given a detailed explanation of this phenomenon. Considering that a dynamical orbit is generally in a system with multiple dimensions and frequencies, these results are quite reasonable. There are not great differences in the computational efficiency among the three methods. Because M3 is the simplest to use, we recommend M3 to be used step-by-step as a correction procedure in the numerical integration of n-body problems. However, M3 cannot improve the orbital eccentricity at all. In these cases we choose M1 or M2. Of course, other manifold correction methods similar to the series of works by Fukushima (e.g., Fukushima 2004) can be obtained by going further along the direction of M1 or M3.

We would like to thank Toshio Fukushima for his honest review and significant suggestions. X. W. is grateful to his undergraduate Jian-Qing Wu in the Department of Physics, Nanchang University, for his numerical experiments, which forced the author to consider some problems in this paper. This research is supported by the Natural Science Foundation of China under contracts 10233020, 10303001, and 10563001. It is also supported by Jiangsu Planned Projects for Postdoctoral Research Funds, Science Foundation of Jiangxi Education Bureau (200655), Science Foundation of Jiangxi Province (0612034), and the Program for Innovative Research Team of Nanchang University. APPENDIX A WHY THE TOTAL ENERGY CORRECTION DOES NOT ALWAYS WORK WELL IN n-BODY SIMULATIONS In an inertial (center-of-mass) coordinate system, an n-body problem in the solar system corresponds to the following Hamiltonian: H¼

n1 n1 X n2 X mm 1X  i j ; mi jui j2  G   2 i¼0 j>i i¼0 qj  qi

ðA1Þ

2651

where mi , ui , and qi are the mass, velocity, and position of body i, respectively, and i ¼ 0 stands for a centered body such as the Sun. Obviously, the total energy is equal to a conservative quantity E. Usually numerical integrations are implemented in the heliocentric coordinate system. In this case, the jth planet has Kepler energy of the form   1  2   1 Kj vj ; rj ¼ vj   G m0 þ mj   : 2 rj

ðA2Þ

Here (vj ; rj ) ( j ¼ 1, : : : , n  1) denotes a set of state variables of the body in the heliocentric coordinate system. For a massless particle moving in a gravitational field, for example, an asteroid, its Kepler energy is defined as Kas ðvas ; ras Þ ¼

1 Gm0 : jvas j2  2 jras j

ðA3Þ

Certainly, the Kepler energy is not actually an exact integral and can be called a ‘‘quasi-integral’’ because it is a function of time t but changes with time more slowly than the coordinates or the velocity of the body. Next let us demonstrate a complete course of the total energy correction in terms of Nacozy’s approach. 1. Given initial state variables for each body in the heliocentric coordinate system, a certain classical numerical integrator is adopted to integrate the equations of motion. Hence, a numerical solution (vj ; rj ) is obtained. 2. Then we get the barycentric coordinates x and velocity h, Pn1 Pn1 j¼1 mj rj j¼1 mj vj x ¼ Pn1 ; h ¼ Pn1 : ðA4Þ i¼0 mi i¼0 mi Thus, in the barycentric system we have q0 ¼ x; qj ¼ rj  x;

u0 ¼ h;

ðA5Þ

uj ¼ vj  h:

ðA6Þ

3. Now we use equation (1) to carry out the total energy correction in the following expressions: @H 1  ; @ui @H 1  : q¯ i ¼ qi   H @qi

u¯ i ¼ ui   H

ðA7Þ

In the above equations,  H ¼ H  E (wherePH is the numerical 2 value of the Hamiltonian in eq. [A1]) and  ¼ n1 i¼0 (j@H/@ui j þ 2 j@H/@qi j ). 4. Finally, we have the corrected heliocentric variables: v¯ j ¼ u¯ j  u¯ 0 ; r¯ j ¼ q¯ j  q¯ 0 :

ðA8Þ

5. Go to step 1 and do the next round of integration. Let us estimate the accuracy of each Kepler energy with the total energy correction. An important difference to emphasize is that the Kepler energies are not constants of motion under perturbation. Here we assume that a Kepler energy obtains its numerical value Kj from a certain integrator and corresponds to its reference value Kˆ j at time t. In addition, we specify energy errors

2652

WU ET AL.

as  Kj ¼ Kj  Kˆ j in the uncorrected case and  H ¼ H  E and  K j ¼ K j  Kˆ j after the implementation of the correction technique. Using a Taylor expansion around the point (vj ; rj ) of phase space, we have the error relation   ðA9Þ  K j ¼ Kj þ 1 (N0j  j )H þ O (H )2 ; where

Vol. 133

values (ˆv; rˆ ) corresponding to the actual Kepler energy Kˆ associated with equation (5), equation (A2) can be rewritten as Kˆ ¼ T (ˆv) þ U (ˆr):

However, the numerical solution (v; r) at each integration step is not equal to (ˆv; rˆ ) because of various errors. Now let us assume v¯ ¼ sv;

@H @K @H @K   N0j ¼ þ ; @u0 @vj @q0 @rj j ¼

@H @K @H @K   þ @uj @vj @qj @rj

(where the open circle denotes the Euclidean inner product). As a special case, we have H  K and @H /@u0 ¼ @H /@q0  0 for a pure Kepler two-body problem in a relative coordinate system. Clearly,  K ¼ O((H ) 2 ), as in equation (2). This means that the energy error is decreased greatly. Thus, the energy correction is successful for the two-body problem. Nevertheless,  Kj þ  H(N0j  j )/ 6¼ 0 is equivalent to  K j 6¼ O(( H ) 2 ) in the general case. Conclusively,  K j ,  Kj , and  H seem to be of the same order of magnitude. This tells us that the accuracy of each Kepler energy does not improve under only the total energy correction. To prove the above analysis, we choose the classical fourthorder Runge-Kutta method ( RK4) to integrate the Sun-JupiterSaturn system. The fixed time step is 36.525 days, about 1/120 of Jupiter’s orbital period, and the integration spans 106 or 2 ; 106 yr. Here all the initial conditions and the related physical parameters are obtained from JPL’s planetary ephemeris DE405 at J2000.0. Figures 1aY1d show the evolution of the semimajor axes a of Jupiter and Saturn with time t for the two cases: without and with the total energy manifold correction. It can be easily seen in Figure 1a that the semimajor axis begins to have secular variations at some instant in the case without any correction because of the dissipation caused by RK4. When correction of the total energy in the center-of-mass coordinate system is considered, Figure 1c shows that it has an explicit effect on raising the numerical accuracy within a time span of 106 yr. However, the numerical instability becomes more and more apparent with the growth of time. In detail, the semimajor axis of Jupiter damps spuriously when the integration time adds up to 2 ; 106 yr, but that of Saturn increases in Figure 1d. The above analysis and numerical experiments corroborate the following fact. For a dynamical system with n frequencies, one integral can only control one frequency, but the remaining n  1 frequencies are not controlled, so that the numerical error will still increase unrestrictedly. For a two-body problem, n ¼ 1, and the precision of the numerical integration can be raised by using the energy integral. APPENDIX B TWO EXISTING DIFFERENT SCALING METHODS A brief introduction to the two scaling methods M2 and M3 is offered below. B1. FUKUSHIMA’S SCALING METHOD For convenience, we omit the suffix j in equation (A2) and relabel the kinetic energy and the potential energy as T (v) and U (r), respectively. If the velocity and the position have true

ðB1Þ

r¯ ¼ sr:

ðB2Þ

If (¯v; r¯ ) is regarded as an approximate solution of (ˆv; rˆ ), then the scale factor s should satisfy the cubic equation ˆ þ U ¼ 0: Ts 3  Ks

ðB3Þ

At once, equation ( B2) is determined. Thus, we can get the corrected solution (¯v; r¯ ). This is Fukushima’s scaling method ( Fukushima 2003). M2 (eq. [B2]) looks simpler than M1 (eq. [6]) in its expression. However, the scale factors are not simple to provide, since some iterations with Newton’s method are necessary to solve the cubic equation. Before this method, Liu & Liao (1987) proposed a scaling method in which the scale factors are easy to compute. B2. LIU & LIAO’S SCALING METHOD The original Liu & Liao (1987) paper and its main reference ( Huang & Ding 1981) are both published in Chinese. Their purpose was to improve the precision of the numerical integration of artificial satellites, but this idea can easily be applied in an n-body problem. Here we use an approach different from that of the original authors to introduce their basic idea and algorithm. As in the above operation, we suppose that the relations between the numerical and ‘‘true’’ solutions for a certain body are r¯ ¼ r;

ðB4Þ

v¯ ¼ v;

ðB5Þ

where  and  are two scale constants. Using equation (A2) and the two solutions, we have 1 2  jvj  ; 2 jrj 1  Kˆ ¼ j¯vj2  ; 2 j¯rj K¼

ðB6Þ ðB7Þ

with  ¼ G(m0 þ m) and K the numerical value of the Kepler energy, while Kˆ is the actual value and is still given by equation (5). From equations ( B6) and ( B7) there is an explicit solution for  and : ˆ  ¼ K=K;

 1=2 ˆ ;  ¼ K=K

ðB8Þ

and they are connected with the relation   2 ¼ 1:

ðB9Þ

Then the formulae for correcting the numerical results of the state variables after each integral step are   r¯ ¼ K=Kˆ r; ðB10Þ  1=2 ˆ v: ðB11Þ v¯ ¼ K=K

No. 6, 2007

COMPARISON AMONG CORRECTION METHODS

This is another scaling method M3 unlike the M2 method given by equation ( B2). As an illustration, M3 (eqs. [B10] and [B11]) is based on the following fact. According to the constraints of a two-body problem, the position and velocity vectors of a body, r and v, have scale factors a and a1/2, respectively, in which a is the semi-

2653

major axis of the body. On the other hand, the Kepler energy of the body is inversely proportional to its semimajor axis. The correction from K to Kˆ is equivalent to a correction of the semimajor axis. With all these factors, equations (B10) and (B11) are constructed. This is the original idea of Liu & Liao (1987, 1988, 1994).

REFERENCES Ascher, U. M. 1997, Numer. Algorithms, 14, 1 Minesaki, Y., & Nakamura, Y. 2002, Phys. Lett. A, 306, 127 Baumgarte, J. 1972, Celest. Mech., 5, 490 ———. 2004, Phys. Lett. A, 324, 282 Beust, H. 2003, A&A, 400, 1129 Murrson, M. A. 1989a, AJ, 97, 1496 Chin, H. 1995, Ph.D. thesis, Univ. British Columbia ———. 1989b, Celest. Mech., 45, 175 Duncan, M. J., Levison, H. F., & Lee, M. H. 1998, AJ, 116, 2067 Nacozy, P. E. 1971, Ap&SS, 14, 40 Fukushima, T. 2003, AJ, 126, 1097 Wisdom, J., & Holman, M. 1991, AJ, 102, 1528 ———. 2004, AJ, 128, 920 Wu, X., & He, J. Z. 2006, Int. J. Mod. Phys. C, 17, 1613 Hairer, E., Lubich, C., & Wanner, G. 1999, Geometric Numerical Integration Wu, X., & Huang, T.-Y. 2003, Phys. Lett. A, 313, 77 ( Berlin: Springer) Wu, X., Huang, T.-Y., & Zhang, H. 2006a, Phys. Rev. D, 74, 083001 Huang, T.-Y., & Ding, H. 1981, Acta Astron. Sinica, 22, 328 Wu, X., & Zhang, H. 2006, ApJ, 652, 1466 Huang, T.-Y., & Innanen, K. 1983, AJ, 88, 870 Wu, X., Zhu, J. F., He, J. Z., & Zhang, H. 2006b, Comput. Phys. Commun., Liu, F.-Y., Wu, X., & Lu, B.-K. 2006, Chinese Astron. Astrophys., 30, 87 175, 15 Liu, L., & Liao, X.-H. 1987, Acta Astron. Sinica, 28, 225 Yoshida, H. 2001, Phys. Lett. A, 282, 276 ———. 1988, Chinese Astron. Astrophys., 12, 26 ———. 2002, Celest. Mech. Dyn. Astron., 83, 355 ———. 1994, Celest. Mech. Dyn. Astron., 59, 221 Zhang, F. 1996, Comput. Phys. Commun., 99, 53 Mikkola, S., & Innanen, K. 2002, AJ, 124, 3445 Zhu, J. F., & Wu, X. 2007, Chinese Astron. Astrophys., 31, 45