simulation and visualization of few-body systems and the ... · problems interacting via...

9
42 Computing in Science & Engineering 1521-9615/14/$31.00 © 2014 IEEE Copublished by the IEEE CS and the AIP January/February 2014 FEW-BODY SYSTEMS Simulation and Visualization of Few-Body Systems and the Differential Precession of Mercury Brett Marmaras and J. Jay Wang | University of Massachusetts, Dartmouth This study investigates the applicability of a modified, symplectic leapfrog method with self-adjusted step-size control to the accurate simulations of few-body Hamiltonian systems. The method is then applied to the direct calculation of Mercury’s differential precession due to general relativity and other planets. U nderstanding the dynamics of few-body systems is of fundamental interest in the classical and quantum studies of these systems. On the one hand, few-body systems are ideal systems that can provide a severe test of fundamental theories. On the other hand, few-body systems enable us to delineate how the behavior of complex systems can be understood in terms of simpler subsystems. However, in both classical and quantum physics, even the three-body problems interacting via inverse-square law of force (gravitational or Coulombic) still remain unsolved analytically; that is, no closed-form solutions are known. erefore, numerical solutions are neces- sary to study these systems. e Hamilton’s equations of motion can be expressed as a set of ordinary differential equations (ODE): p H q q H p =- =- , , (1) where H is the Hamiltonian, and p and q are the generalized momenta and coordinates, respectively. In physical simulations from the few-body classical trajectory Monte Carlo method to large N-body astrophysical systems, these equations can be integrated numerically using standard ODE algorithms such as the popular Runge-Kutta schemes. 1 Accuracy can be achieved by using a combination of high-order methods or small step size, including extrapolation if necessary. Often, accuracy from the mathematical point of view is only one factor in the overall consid- eration of a numerical method. Other character- istics might be equally or more important. For example, Equation 1 shows that the generalized momenta and coordinates are intertwined; that is, they form a so-called symplectic manifold. 2 As such, Hamiltonian systems have several sym- plectic properties, such as phase-space volume conservation and time-reversibility. For precision simulations of physical systems, it’s essential that we respect and preserve these special properties in the numerical scheme. Symplectic methods pre- serve these structural properties of Hamiltonian systems. In particular, the symplectic leapfrog method (also known as the Verlet method) 3 has proven to be a popular first choice due to its sim- plicity, easy implementation in practice, and ro- bustness. Its disadvantage is that it has relatively low accuracy—second-order only—and is insuf- ficient for precision simulations. For increased accuracy, higher-order symplectic methods can be considered, such as the explicit fourth-order method 4 and a systematic approach for constructing higher-order symplectic schemes. 5 Recently, methods for improved accuracy have been reported, including the splitting and composition methods 6 for increasing the order from a low-order integrator, and a modified leapfrog method, 7 which involved self-adjusted step-size control via a time- transformation. e modified leapfrog method

Upload: buihanh

Post on 13-Apr-2018

219 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Simulation and Visualization of Few-Body Systems and the ... · problems interacting via inverse-square law of force (gravitational or Coulombic) still remain unsolved ... Often,

42 Computing in Science & Engineering 1521-9615/14/$31.00 © 2014 IEEE Copublished by the IEEE CS and the AIP January/February 2014

Few-Body SyStemS

Simulation and Visualization of Few-Body Systems and the Differential Precession of Mercury

Brett Marmaras and J. Jay Wang | University of Massachusetts, Dartmouth

This study investigates the applicability of a modified, symplectic leapfrog method with self-adjusted step-size control to the accurate simulations of few-body Hamiltonian systems. The method is then applied to the direct calculation of Mercury’s differential precession due to general relativity and other planets.

Understanding the dynamics of few-body systems is of fundamental interest in the classical and quantum studies of these systems. On the one hand, few-body

systems are ideal systems that can provide a severe test of fundamental theories. On the other hand, few-body systems enable us to delineate how the behavior of complex systems can be understood in terms of simpler subsystems. However, in both classical and quantum physics, even the three-body problems interacting via inverse-square law of force (gravitational or Coulombic) still remain unsolved analytically; that is, no closed-form solutions are known. Therefore, numerical solutions are neces-sary to study these systems.

The Hamilton’s equations of motion can be expressed as a set of ordinary differential equations (ODE):

p Hq

q Hp

=−∂∂

= −∂∂

, , (1)

where H is the Hamiltonian, and p and q are the generalized momenta and coordinates, respectively. In physical simulations from the few-body classical trajectory Monte Carlo method to large N-body astrophysical systems, these equations can be integrated numerically using standard ODE algorithms such as the popular Runge-Kutta schemes.1 Accuracy can be achieved by using a combination of high-order methods or small step size, including extrapolation if necessary.

Often, accuracy from the mathematical point of view is only one factor in the overall consid-eration of a numerical method. Other character-istics might be equally or more important. For example, Equation 1 shows that the generalized momenta and coordinates are intertwined; that is, they form a so-called symplectic manifold.2 As such, Hamiltonian systems have several sym-plectic properties, such as phase-space volume conservation and time-reversibility. For precision simulations of physical systems, it’s essential that we respect and preserve these special properties in the numerical scheme. Symplectic methods pre-serve these structural properties of Hamiltonian systems. In particular, the symplectic leapfrog method (also known as the Verlet method)3 has proven to be a popular first choice due to its sim-plicity, easy implementation in practice, and ro-bustness. Its disadvantage is that it has relatively low accuracy—second-order only—and is insuf-ficient for precision simulations.

For increased accuracy, higher-order symplectic methods can be considered, such as the explicit fourth-order method4 and a systematic approach for constructing higher-order symplectic schemes.5 Recently, methods for improved accuracy have been reported, including the splitting and composition methods6 for increasing the order from a low-order integrator, and a modified leapfrog method,7 which involved self-adjusted step-size control via a time-transformation. The modified leapfrog method

CISE-16-01-marmaras.indd 42 29/01/14 3:40 PM

Page 2: Simulation and Visualization of Few-Body Systems and the ... · problems interacting via inverse-square law of force (gravitational or Coulombic) still remain unsolved ... Often,

www.computer.org/cise 43

was applied to few-body astrophysical systems with strong interactions (close encounters) and the results were promising. Its premise was to increase precision without proportionally increasing the number of function calls in computing the core system dynamics (pair-wise forces). However, its applicability, sensitivity, and performance have not been tested in precision simulations of systems in which perturbations are small but their effects are crucial.

In this article, we investigate the applicability of the modified, self-adjusted leapfrog method in the direct simulation of Mercury’s precession due to general relativity. We study differential, rather than integral, precession in time. Because of the small effect, direct simulation requires high preci-sion and extreme sensitivity. We choose to follow the Runge-Lenz vector to calculate the differential precession instantaneously. The use of the Runge-Lenz vector also enables us to visualize instanta-neous precession. We show that, by combining the three elements—namely, the self-adjusted leapfrog method, the Runge-Lenz vector, and the use of in situ visualization techniques—our methodology can be successfully applied to sensi-tive simulations of few-body systems with small perturbations. With enhanced sensitivity, we find a remarkable effect: the differential precession of Mercury is not monotonic. Rather, it’s back and forth in time—that is, the differential precession is prograde for part of the orbit (in the same di-rection of Mercury’s motion) and retrograde (op-posite Mercury’s orbital motion) for most of the orbit. The prograde and retrograde precessions leapfrog each other. The rate of prograde preces-sion is greater than that of retrograde such that the net precession is prograde.

Our study indicates the modified leapfrog method to be highly accurate and efficient, and suggests that it can be a viable approach toward similar modifications to higher-order symplectic schemes. Our simulation with built-in visualization using visual Python (VPython) lets users explore and identify the dynamic effects in real-time animation, and it can serve as an effective teaching tool.

Precession of Mercury and Runge-Lenz VectorIt’s well known that the elliptic orbits of planets precess (rotate) with time. Two components contribute to precession: kinematic effects due to relative motion (called precession of equinoxes), and dynamic effects due to interactions. We are interested in the latter here. For the inner-most

planet, Mercury, the (dynamic) precession has been observed to be 574 seconds of arc per century in the (heliocentric) space frame (1 arcsecond [or ″] = 1/3600°). In other words, the perihelion (or aphelion) of Mercury slowly rotates through an angle of 0.16 degrees per century. The bulk of it is due to the interaction of Mercury with other planets, which alter the inverse-square law of force. Taking into account all the known perturbations on Mercury due to these planets within the Newtonian theory of gravity, it accounts for 531″ of the total. The remaining amount, ~43″, stood unaccounted for until the advent of Einstein’s theory of general relativity. The discrepancy has been explained beautifully by a relativistic correction. It’s one of the major triumphs of Einstein’s theory of gravity.8

In general relativity, the central force is slightly modified as2

F r GMmr r

( ) ,

( .

=− +

= × −

2 2

8

1

1 096 10

λ

λ AU22 for Mercury), (2)

where M is the mass of the sun, m the mass of Mercury, and GM = 4p2 AU3/year2. The additional term in Equation 2, though small, destroys the perfect inverse-square law. It causes the orbit to precess.

For observational purposes, it’s natural to want to track the change of the perihelion (or aphelion) to discern any precession. If we tracked the perihelion in simulations, it would amount to integral precession (time-averaged), because it would be necessary to wait at least one period to find the orbital position of the perihelion, and differential information would be lost. We need a different way if we are interested in differential precession in time. Fortunately, we can use a quantity known as the Runge-Lenz vector for our purpose. The Runge-Lenz vector is defined as2

A p L mkr= × − ,

where p mv= is the momentum,

L r p= × the

angular momentum, and k = GMm.Along with energy E and

L , A is also a

constant of motion in a pure inverse-square law of force—that is, dA dt

/ = 0 and A = GMm2e.2 For

circular orbits, e = 0 and A= 0. For ellipses,

A

points in the direction from the origin (center of force) to the perihelion (see Figure 1).

When the force is not a pure inverse-square law, as in Equation 2, the Runge-Lenz vector is no

CISE-16-01-marmaras.indd 43 29/01/14 3:40 PM

Page 3: Simulation and Visualization of Few-Body Systems and the ... · problems interacting via inverse-square law of force (gravitational or Coulombic) still remain unsolved ... Often,

44 January/February 2014

Few-Body SyStemS

longer a constant of motion (see Equation B1 in Appendix B, which is available as a Web Extra at doi:10.1109/MCSE.2013.73). Rather, it will rotate with the perihelion. We can now just follow

A

directly in our simulation, and the angle it sweeps through gives the amount of precession.

Numerical Method and VisualizationNow, let’s discuss the self-adjusted leapfrog method, as well as VPython for visualization.

Self-Adjusted Leapfrog MethodWe chose to study the suitability of a modified leapfrog method due to its simplicity and ease of

implementation. Because of Mercury’s relatively large eccentricity (e = 0.2056), its orbit is the most elliptic (aside from Pluto’s). Close to the perihelion, the force and speed are much larger than the averages. This large variation indicates that, to maintain precision and efficiency, we should implement variable step size in the modified method. The physical effect is to smooth out, or regularize, the region near the singularity.

A method was proposed to deal with the problem by a time transformation. The idea is that the step size should be adjusted such that smaller steps are taken near the closest approach

Figure 1. Snapshots (in enumerated order) of the Runge-Lenz vector A, represented by block arrows, for an

exaggerated perturbation parameter l = 0.01 AU2.

x

x

x

x

y

1

2 3

4

y

y

y

CISE-16-01-marmaras.indd 44 29/01/14 3:40 PM

Page 4: Simulation and Visualization of Few-Body Systems and the ... · problems interacting via inverse-square law of force (gravitational or Coulombic) still remain unsolved ... Often,

www.computer.org/cise 45

(perihelion), and greater steps away from the singularity (aphelion). We briefly outline the method.7 Let us consider the equations of motion

drdt

v dvdt

a r

= =, ( ). (3)

The standard leapfrog method for solving Equation 3 is as follows:3

r r v h1 2 2,/ /= +0 0 (4)

and

v v a r h1 0 1 2= + ( ) ,/ (5)

and

r r v h1 1 2 1 2= +/ / . (6)

The subscripts 0,1/2,1 denote values at the beginning, middle, and the end of a time step h, respectively.

To adjust the step size h, a time transformation from the real-time t to a fictitious time s is introduced as

dsdt

r=Ω( ). (7)

Now, we rewrite Equation 3 in terms of s using the chain rule d/dt = W d/ds as

drds

v r dvds

a r r

= =/ ( ), ( ) / ( ).Ω Ω (8)

For a nontrivial choice of W(r), it’s not straightforward to simultaneously solve Equations 7 and 8 on two time scales and preserve symplectic properties. Instead, an auxiliary variable is introduced, W = W(r), to be solved together on the s-scale. Using dW ds r v r/ /=∇Ω( )⋅ Ω( )

and the inverse of Equation 7, we can add two auxiliary equations to Equation 8:

drds

v W dtds

W

= =/ , / ,1 (9)

and

dvds

a r r dWds

r v r = =∇ ⋅( ) / ( ), ( ) / ( ).Ω Ω Ω (10)

Equations 9 and 10 are in the proper form for the leapfrog method if we treat

r , t as

the generalized coordinates, and v , W as the

generalized velocities. We are free to choose any form of W(r), as long as baby steps are taken near the singularity and bigger strides away from the

singularity. A physics-based choice for planetary motion (and other 1/rn forces) is

Ω( ) .rr

=1 (11)

This approach ensures that when r is small, W(r) is large, and dt is small. Furthermore, it’s easy to calculate the gradient, ∇Ω =−( ) /r r r

3. With Equation 11, we can write the self-adjusted leapfrog (SALF) algorithm as

r r v h

Wt t h

W1 2 0 00

1 2 002 2/ /, ,= + = + (12)

v v a r r h W W rv v

1 0 1 2 1 2 1 0 1 20 1

2= + = − ⋅

+( ) ,/ / /hhr1 22/

,

(13)

and

r r v h

Wt t h

W1 1 2 11

1 1 212 2

= + = +/ /, . (14)

Here, the step-size h refers to the fictitious (transformed) time s, not the actual time t. The actual time is returned in t1. The difference t1 - t0 is not constant, giving us the desired effect of smoothing out the singularity near the origin. If a trivial choice is made of W(r) = 1, then the transformed Equations 9 and 10 and the SALF algorithm in Equations 12, 13, and 14, respectively, reduce to the original equations of motion (Equation 3) and the standard leapfrog method (Equations 4, 5, and 6) as expected. For N-body systems, the W(r) needs to be replaced by W = S aij/rij for all particle pairs in the system, where aij are weights chosen to better suit the system (not all are necessarily one).

Visualization with VPythonWe implement the SALF method using the Python programming language in actual calculations. Py-thon is object-oriented and is used in a wide range of applications including scientific computing.9,10 For our work, we choose Python not only because it’s easy to use, but also because it has many open-source libraries that extend its capabilities and make it flex-ible. We are primarily interested in the VPython li-brary,11 which adds 3D visualization capability with full ray-tracing and hidden surface removal. We can create visualization effects with ease because VPython is object oriented. Once objects, such as balls, are cre-ated with simple function calls, we just need to up-date their physical attributes, such as positions, in the simulation. With this method, we don’t have to deal

CISE-16-01-marmaras.indd 45 29/01/14 3:40 PM

Page 5: Simulation and Visualization of Few-Body Systems and the ... · problems interacting via inverse-square law of force (gravitational or Coulombic) still remain unsolved ... Often,

46 January/February 2014

Few-Body SyStemS

with demanding low-level graphics programming. Instead, we can focus on modeling and using proper visualization techniques to help with interpreting and understanding the results.

Results and DiscussionsWe discuss below the accuracy and performance of the algorithm and present the results on the differential precession of Mercury.

Analysis of Accuracy and PerformanceBefore applying the SALF method to differential precession studies, we’re interested in the analysis of accuracy and efficiency of the self-adjusted and the standard leapfrog methods. Figure 2a shows the relative error of energy for Mercury using these two methods.

The magnitude of the relative error for SALF is ~10-14, practically reaching machine accuracy for double precision. In comparison, the magnitude for the standard leapfrog with the same step size is ~10-5 (see Figure 2a). The SALF improves the accuracy by about nine orders of magnitude over the standard leapfrog method. It even out-performs a fourth-order symplectic method by six orders of magnitude (not shown in the figure). This shows that the automat-ic step-size adjustment with the transformation in Equation 11 is accurate for inverse-square-law forces. It effectively regularizes the 1/r singularity. Similar observations were reported for a 10-body system.7

In terms of performance, the SALF method took four times as much CPU time as the standard leapfrog method to complete the test. Profiling

program execution revealed that the number of calls to the SALF cycle (Equations 12, 13, and 14) was more than that to the leapfrog cycle (Equations 4, 5, and 6) by a factor of approximately g ~ 2.5. The increased number of calls is due to the self-adjustment of step size near the singularity, and the factor is nearly constant for different step sizes. Because of the relatively simple force shown in Equation 2, only about one-quarter of the computing time within a SALF cycle was spent in the calculation of acceleration,

a r( ), so most of the time was spent

in algebraic manipulations (bookkeeping).For an N-body system, the bulk of computing

time is expected to be spent in calculating the N(N - 1) pairs of forces. For a moderate N ~ 4, the bookkeeping time will be minor compared to the time required for computing the acceleration. The latter will be more dominant for larger N. In this case, the SALF method should be about 2.5 times (g-factor) slower than the standard leapfrog method, but with much higher accuracy. In fact, its speed should be the same as or slightly faster than the fourth-order method, which requires three function calls to calculate the acceleration,4,5 and still provides much higher precision (six more significant digits) in the present case.

As a further test, we calculated the precession of unperturbed Mercury (see Figure 2b) with SALF, the standard leapfrog (LF), and a fourth-order symplectic integrator (SI4), which is based on the Baker-Campbell-Hausdorff splitting scheme.6 We used the same number of function calls for

Figure 2. (a) Relative error of energy with the self-adjusted leapfrog (SALF) and standard leapfrog (LF) methods. Scaling factors are applied to show the results on the same scale. (b) Precession of unperturbed Mercury by SALF, LF, and fourth-order symplectic integrator (SI4).

8

6

4

2

0

–2

–4

–6

–80 5 10

Time (year)

(a) (b)

SALF ×10–14

LF ×10–5

ΔE/E

15 20

103

102

101

100

10–1

10–2

10–3

10–4

10–5

10–6

10–7

10–8

10–9

10–10

10–11

0 5 10Time (year)

SALF

S14

Pre

cess

ion

angl

e (a

rcse

c)

LF

15 20

CISE-16-01-marmaras.indd 46 29/01/14 3:40 PM

Page 6: Simulation and Visualization of Few-Body Systems and the ... · problems interacting via inverse-square law of force (gravitational or Coulombic) still remain unsolved ... Often,

www.computer.org/cise 47

evaluating the acceleration in all three methods, so the computational cost is the same. There is no precession because the force in the unperturbed system obeys a pure inverse-square law. Therefore, the artificial precession in the numerical results is an indicator of accuracy level. The SALF method is much more accurate than the standard LF, as expected. SALF performs even better than the higher-order SI4 by a surprising margin of six or seven orders of magnitude. Furthermore, the SALF results fluctuate between positive and negative values (Figure 2 graphs their absolute values), resulting in an overall flat trend. In contrast, both LF and SI4 show a slight but steady increase in time.

The tradeoff between speed and accuracy depends on the simulation. High accuracy is needed for the calculation of differential precession from below. Given the required high accuracy, the step-size needed for the standard leapfrog would be so small that its running time would far exceed that of the SALF method.

Differential Precession Due to Relativistic CorrectionFigure 3a shows the differential precession of Mercury, that is, the angle of rotation of the Runge-Lenz vector as a function of time for one century. Over the full scale, the angle of precession appears to increase linearly with time. Right at the century mark, the precession is exactly 42.97″, in agreement with the prediction of Einstein’s theory of relativity.8

On a finer scale, we see in Figure 3b that a remarkable phenomenon becomes visible: the

differential precession has small-scale periodic oscillations with an approximate amplitude of 0.1″ and a period of 0.24 years. Rather than being monotonic, the differential precession moves back and forth in time. It’s prograde for part of the orbit (in the same direction of Mercury’s motion), and retrograde (opposite Mercury’s orbital motion) for the rest, even though the perturbation force remains attractive throughout. The rate of prograde precession is greater than that of retrograde such that the net precession is prograde.

Because these oscillations are small, we performed numerical checks to make sure they were real and not numerical artifacts. We varied the perturbation strength and the step size, and found the calculations converged to the same results. This shows that the SALF method is sensitive and robust enough to accurately reveal such a delicate effect due to small perturbations.

We increased the perturbation parameter l to exaggerated values and verified that similar oscillatons were reproduced with pronounced amplitudes, of course. With large l values, the movement of the Runge-Lenz vector is visibly noticeable, thus affording us the opportunity to directly visualize the dynamics of the precession. Figure 1 shows several animated frames using VPython.

At the start (see Figure 1, frame 1), the Runge-Lenz vector

A points in the −x direction (toward

perihelion). As Mercury moves counterclockwise in the first quadrant,

A starts to rotate clockwise (retro-

grade). When Mercury crosses the y-axis (see Figure 1, frame 2), the motion of

A reverses direction

50

40

30

20

10

00 20 40 60

Time (year)

Pre

cess

ion

angl

e (a

rcse

c)

80 100

43.0

42.8

42.6

42.4

42.2

98.0 98.5 99.0

Time (year)

Pre

cess

ion

angl

e (a

rcse

c)

99.5 100.0

(a) (b)

Figure 3. Differential precession of Mercury. (a) The angle of rotation of the Runge-Lenz vector as a function of time for one century. (b) Zoom-in of the last two years.

CISE-16-01-marmaras.indd 47 29/01/14 3:40 PM

Page 7: Simulation and Visualization of Few-Body Systems and the ... · problems interacting via inverse-square law of force (gravitational or Coulombic) still remain unsolved ... Often,

48 January/February 2014

Few-Body SyStemS

and becomes prograde. It remains prograde for all of quadrants 2 and 3 (Figure 1, frames 2 and 3). Shortly after Mercury crosses the y-axis again from below, the precession changes direction to be retrograde again, until Mercury is diametrically opposite the Runge-Lenz vector (Figure 1, frame 4). The cycle repeats after that. The leapfrogging between prograde and retrograde precession can be more directly observed with a real-time animated visualization using the code shown in Appendix A (available at doi:10.1109/MCSE.2013.73).

Overall, the precession is retrograde when Mercury is approximately in the rear hemisphere relative to the Runge-Lenz vector ( )

A r⋅ <0 and

prograde when in the front hemisphere ( ) A r⋅ >0 .

This means that, for small l values where A deviates

little from the −x direction, the precession is prograde for Mercury in the negative (x < 0) half space (second and third quadrants), and retrograde in the positive (x > 0) half space (first and fourth quadrants). These observations can be traced to the rate of change of A for small perturbations. To first order in the

perturbation f(r), our results show that the rate of rotation of the Runge-Lenz vector is given by

ω

θθ

r f rGMme

z2 ( ) cos , (15)

where q is the polar angle, and θ the angular velocity of Mercury (see Appendix B, available at doi:10.1109/MCSE.2013.73).

Substituting the relativistic perturbation from Equation 2 into Equation 15, we obtain

ω

λθθ−

erz2 cos . (16)

With the help of Equation 16, we can draw several conclusions. First, because q

. is always

positive, the sign of ω as determined by cosq is

positive ( )+z for p/2 < q < 3p/2 and negative for −p/2 < q < p/2. Therefore, the precession is prograde in the second and third quadrants, and retrograde in the first and fourth quadrants, in agreement with the previously discussed observations. Furthermore, the precession rate is greater during the prograde phase because the averages ⟨r⟩ and ⟨q

.⟩ in the prograde phase

are smaller and greater, respectively, than those in the retrograde phase. As a result, the net precession is prograde. Second, both q and r vary periodically with the same orbital period (0.24 years for l = 0). This explains why the period of oscillations coincides with the orbital period. Third, we can estimate the amplitude of oscillations roughly as l⟨q

.⟩τ1/2/e ⟨r⟩2

from Equation 16, with τ1/2 being half the orbital period. Assuming (during the retrograde phase around aphelion) that ⟨q

.⟩ = 16 rad/year, ⟨r⟩ = 0.4

AU, e = 0.2, ⟨r⟩ = 0.4 AU, and e = 0.2, the amplitude is approximately 0.13″. This is in reasonably good agreement with the result in Figure 3.

Precession Due to Newtonian GravityIn addition to precession by relativistic effects discussed previously, other planets interacting with Mercury causes it to precess as well.12 These pair-wise forces are not central relative to the sun. In fact, this amount of precession within the Newtonian theory of gravity accounts for 531″ of the total, as stated earlier.

We are mainly interested in calculating the integral precession in the central field approxi-mation.13 In this approximation, we assume the mass of a planet, Mp, to be distributed uniformly over a coplanar ring of radius a (semimajor axis), neglecting small inclination angles. By symmetry, the force between Mercury and the ring is central, that is,

f f r r= ( ) . The force can be expressed in

terms of an elliptic integral.12,13 When expanded in powers r/a, we obtain the first three terms as f

GM ma

ra

ra

rp= + + +

2

1 98

75643

2

2

4

4 ... . (17)

This force is repulsive (radially outward), and the leading term behaves like Hooke’s law with a negative spring constant. Two factors determine the

Figure 4. The precession of Mercury per century due to other planets as a function of the scaled variable Mp/a3. The dashed line indicates the trend of a linear scaling law expected for small perturbations in the central field approximation.

103

102

101

100

Neptune

Uranus

Mars

Saturn

EarthJupiterVenus

10–1

10–3 10–2 10–1 100

Mp /a3 ( 10–6 M / AU3 )

Pre

cess

ion

angl

e (a

rcse

c)

10110–2

CISE-16-01-marmaras.indd 48 29/01/14 3:40 PM

Page 8: Simulation and Visualization of Few-Body Systems and the ... · problems interacting via inverse-square law of force (gravitational or Coulombic) still remain unsolved ... Often,

www.computer.org/cise 49

magnitude of the force: the mass of the planet Mp and its average radius a. Accordingly, with everything being equal, we expect either a larger mass or a smaller semimajor axis will cause a greater precession.

Figure 4 shows the results calculated with the SALF method for all the planets as a function of the scaled variable Mp/a3. These results show large variations over several orders of magnitude among the planets. On the one hand, Venus, the closest planet, has the largest effect, followed by Jupiter, the most massive one. In between, the order reflects the balance between the radius and mass. The linear scaling law, that is, precession ∝ Mp/a3 as indicated by the trend line in Figure 4, is satisfied for all planets except Venus. This is because Venus, being closest to Mercury, has a relatively large average ratio, ⟨r⟩/a ~ 0.54, so that higher order terms in Equation 17 give a significant contribution.

On the other hand, Neptune, the outer-most planet, gives the smallest contribution (0.0437″) because of its large radius and moderate mass. This is three orders of magnitude smaller than the relativistic contribution (43″). Even though the ratio of Neptune’s perturbative force to the sun’s central force is extremely small, ~10-11, the SALF method is still sensitive and robust enough to calculate the precession accurately and efficiently. It demonstrates SALF’s extreme sensitivity to small effects.

Still, a more sensitive test is afforded by the differential precession of Mercury by Neptune. We studied this question and found similar oscillations to those shown in Figure 3, with the same period but much reduced amplitude of 10-4″. However, compared to the relativistic force, the phases of the prograde and retrograde precession are swapped, for the perturbation force (see Equation 17) is repulsive in this case. Because the average radius ⟨r⟩ is larger in the positive half space than in the negative half space, the magnitude of the perturbation force is greater during the prograde phase (quadrants 1 and 4) than during the retrograde phase (quadrants 2 and 3). As a result, although the central field approximated force

is positive, the cumulative precession is still prograde (counterclockwise), the same as the relativistic case. Therefore, precession effects due to the relativistic force and Newtonian force by other planets are additive.

Table 1 summarizes the contribution by other planets. Compared to the results from Hestenes13 (which also neglected inclination), the substantial difference in the contribution by Venus indicates the importance of higher-order terms described previously. The results that account for inclination and eccentricity are included for completeness.8,12

We applied the self-adjusted leapfrog method to the study of differential precession of Mercury

due to both general relativity and other planets. The modified method proves to be highly accu-rate, efficient, and robust, with extreme sensitivity to small perturbations in our calculations. We also find that the differential precession of Mercury is non-monotonic: it consists of prograde and retro-grade movements leapfrogging each other, with the net precession being prograde. Combining the ele-ments—using the numerical method, Runge-Lenz vector, and built-in visualization with VPython—lets us visualize the precession dynamics with real-time animation. The methodology can be an effective approach both in research and in teaching.

Our analysis on the performance of the modified leapfrog method shows that it’s efficient because it makes the same number of calls per cycle to the function evaluating acceleration (core dynamics) as the unmodified method, and the overhead due to additional bookkeeping should become negligible in an N-body system for N ≥ 4. Judging from the g-factor discussed earlier, this approach should be as fast as or slightly faster than the fourth-order symplectic method. Our study suggests that this technique can be a promising framework to increase the accuracy of a method of a given order without increasing the per-cycle cost of evaluating the core dynamics. Further studies in this framework are needed to investigate the

Table 1. Precession of Mercury due to the planets (arcseconds/century).

Method Venus Earth Mars Jupiter Saturn Uranus Neptune Total

Our approach 267.4 94.7 2.38 157.2 7.58 0.141 0.0437 529.4

Hestenes’ approach13 279.7 93.4 2.37 156.9 7.57 — — 540.0

Clemence’s approach8 277.8 90.0 2.53 153.5 7.30 0.141 0.042 531.3

Stewart’s approach12 277.4 90.8 2.48 153.9 7.32 0.14 0.04 532.1

CISE-16-01-marmaras.indd 49 29/01/14 3:40 PM

Page 9: Simulation and Visualization of Few-Body Systems and the ... · problems interacting via inverse-square law of force (gravitational or Coulombic) still remain unsolved ... Often,

50 January/February 2014

Few-Body SyStemS

application to higher-order methods—for instance, the explicit fourth- and higher-order approaches.

AcknowledgmentsWe thank Andreas Ernst for useful discussions on numerical algorithms and TCR Engineering for its partial support of this work.

References1. M.J. Romanelli, “Runge-Kutta Methods for the

Solution of Ordinary Differential Equations,” Mathematical Methods for Digital Computers, A. Ralston and H.S. Wiff, eds., Wiley, 1960, pp. 110–120.

2. H. Goldstein, C. Poole, and J. Safko, Classical Mechanics, Addison Wesley, 2002.

3. L. Verlet, “Computer ‘Experiments’ on Classical Fluids. I. Thermodynamical Properties of Lennard-Jones Molecules,” Physical Review, vol. 159, no. 1, 1967, pp. 98–103.

4. E. Forest and R. Ruth, “Fourth-Order Symplectic Integration,” Physica D, vol. 43, 1990, pp. 105–117.

5. H. Yoshida, “Construction of Higher Order Symplectic Integrators,” Physics Letters A, vol. 150, 1990, pp. 262–268.

6. S. Blanes, F. Casas, and A. Murua, “Splitting and Composition Methods in the Numerical Integration of Differential Equations,” Boletín de la Sociedad Española de Matemática Aplicada, vol. 45, 2008, pp. 89–145.

7. S. Mikkola and S. Aarseth, “A Time-Transformed Leap -frog Scheme. Integration of Few-Body Systems with Large Mass Ratios,” Celestial Mechanics and Dynamical Astronomy, vol. 84, no. 4, 2002, pp. 343–354.

The American Institute of Physics is an organization of physical science societies, representing scientists, engineers, and educators. Through its Physics Resources Center, AIP delivers valuable services and expertise in education and student programs, science communications, government relations, career services for science and engineering professionals, statistical research in physics employment and education, industrial outreach, and the history of physics and allied fields. AIP publishes Physics Today, the most influential and closely followed magazine of the physics community, and is also home to the Society of Physics Students and the Niels Bohr Library and Archives. AIP owns AIP Publishing LLC, a scholarly publisher in the physical and related sciences.

Governing Board*: Louis J. Lanzerotti (chair), Samuel H. Aronson, Malcolm R. Beasley, G. Fritz Benedict, J. Daniel Bourland, Robert L. Byer, Timothy A. Cohn, Beth Cunningham, Bruce H. Curran, Robert Doering, Michael D. Duncan, H. Frederick Dylla (ex officio), David Ernst, Janet Fender, Judith Flippen-Anderson, Brian J. Fraser, Jaime Fucugauchi, A. Jeffrey Giacomin, Timothy Grove, Mark Hamilton, Paul L. Kelley, Angela R. Keyser, James T. Kirby Jr, Kate Kirby, Frank Krause, Rudolf Ludeke, Jill Marshall, Kevin B. Marvel, Christine McEntee, Mary Beth Monroe, Elizabeth A. Rogan, Charles E. Schmid, Joseph Serene, Neal Shinn, Scott Sommerfeldt, Gene Sprouse, Gay Stewart, Hervey (Peter) Stockman, Michael Turner.*Board members listed in bold are members of the Executive Committee.

Management Committee: H. Frederick Dylla, Executive Director and CEO; Gigi Swartz, Treasurer and CFO; Theresa C. Braun, Vice President, Human Resources; Catherine O’Riordan, Vice President, Physics Resources.

8. G.M. Clemence, “The Relativity Effect in Planetary Motions,” Reviews Modern Physics, vol. 19, no. 4, 1947, pp. 361–364.

9. P.F. Dubois, “Python: Batteries Included,” Computing in Science and Eng., vol. 9, no. 3, 2007, pp. 7–9.

10. Computing in Science and Eng., special issue on scientific computing with Python, May/June 2007; www.computer.org/csdl/mags/cs/2007/03/index.html.

11. D. Scherer, P. Dubois, and B. Sherwood, “VPython: 3D Interactive Scientific Graphics for Students,” Computing in Science and Eng., vol. 2, no. 5, 2000, pp. 56–62.

12. M.G. Stewart, “Precession of the Perihelion of Mercury’s Orbit,” American J. Phys., vol. 73, no. 8, 2005, pp. 730–734.

13. D. Hestenes, New Foundations for Classical Mechanics, Kluwer, 1999.

Brett Marmaras is a master’s candidate in physics at the University of Massachusetts, Dartmouth. His research interests include computational physics and atomic physics. Marmaras has a BS in physics from the Uni-versity of Massachusetts, Dartmouth. Contact him at [email protected].

J. Jay Wang is on the physics faculty at the University of Massachusetts, Dartmouth. His research interests include atomic physics, computational modeling and visualiza-tion, and research-based curricula and pedagogy. Wang has a PhD in physics from the University of Tennessee. Contact him at [email protected].

CISE-16-01-marmaras.indd 50 29/01/14 3:40 PM