Chapter 4

Planetary motion and few-body problems

In projectile motion discussed in Chapter 3, gravity is considered to be constant. This is an approximation, valid only for distances small compared to the size of Earth. Now imagine we stood atop Mt. Everest and fired a cannon horizontally. At low speed, the cannonball would travel just like projectile motion. With greater firing power and ever increasing speed, the cannonball would travel further and curve less. At some critical speed, it would fly all the way around Earth and come back from behind (ignoring drag, of course). This is exactly how the Moon moves around Earth, or the planets around the Sun. In a sense, planetary motion is akin to projectile motion in that a planet falls continuously toward the Sun. We can no longer treat gravity as a constant force, however.

The motion of planets, or the heavenly bodies as they were known, is a fascinating subject. Observations of planetary motion led to the discovery of Kepler's laws which, strictly speaking, are valid only for a two-body system (the planet and the Sun). The fact that these empirical laws could be successfully explained by Newton's theory of gravity confirmed the validity and universality of the classical theory of gravity. However, beyond two-body systems, no analytic solutions are known for the general configuration, even though simple three-body systems are still at the heart of physics at all scales, such as helium (two electrons plus the nucleus), water (one oxygen and two hydrogen atoms), or celestial systems. These systems, part of the so-called few-body problems, prove to be a fertile ground for numerical investigation.

We discuss several interesting cases in celestial mechanics ranging from differential precession of Mercury including correction from Einstein's theory of relativity, to exoplanets and three-body problems.

4.1 Motion of a planet

Planetary motion is by and large governed by Newton's theory of gravity. The force F obeys the inverse-square law

image

where r is the radial distance, and the constant k is

image

Here, M and m are the masses.

From Newton's second law image, the equations of motion are

image

Note that the mass of the planet, m, is canceled out, and the force components have 1/r3 dependence because of the image vector in the numerator. Assuming the motion is confined in the xy plane, the vectors have only x and y components.

To see what a typical motion is like, run the following program.

Program listing 4.1: Planetary motion (earth.py)

  1 import ode, numpy as np # get ODE solvers, numpy import visual as vp # get VPython modules for animation   3 def earth(id, r, v, t): # return the eqns of motion   5 if (id == 0): return v # velocity, dr/dt s = vp.mag(r) # s = image   7 return −GM*r/(s*s*s) # accel dv/dt, faster than s**3   9 def go(): r = np.array([1.017, 0.0]) # initial x,y position for earth 11 v = np.array([0.0, 6.179]) # initial vx, vy 13 # draw the scene, planet earth/path, sun/sunlight scene = vp.display(title =’Planetary motion’, # scene start 15 background=(.2,.5,1), forward=(0,2, −1)) planet= vp.sphere(pos=r, radius=0.1, make_trail=True, 17 material=vp.materials.earth, up=(0,0,1)) sun = vp.sphere(pos=(0,0), radius=0.2, color=vp.color.yellow, 19 material=vp.materials.emissive) sunlight = vp. local_light (pos=(0,0), color=vp.color.yellow) #scn end 21 t, h = 0.0, 0.001 23 while True: vp.rate(200) # limit animation speed 25 r, v = ode.leapfrog(earth, r, v, t, h) # integrate planet.pos = r # move planet 27 if (scene.kb.keys): scene.kb.getkey(), scene.kb.getkey() #pause 29 GM = 4*np.pi*np.pi # G*Msun go()

We should see planet Earth orbiting the Sun as shown in Figure 4.1.

image

Figure 4.1: Motion of Earth around the Sun.

Do not be too concerned if Program 4.1 seems to have increased complexity in a hurry, for we have yet to explain key elements such as the model or the units in it. By the time we finish Section 4.3, you should understand everything about this program. We put the program upfront because it serves as a central problem around which most problems are built subsequently. We note, however, that the program follows the basic templates and structure of programs we have seen so far, especially Programs 2.7, 3.1, and 3.8. For instance, Program 3.1 first sets up the visualization scene, then goes into the “while” loop for computation. This is basically what the main function go() does here. The difference is that the former uses Euler's method within the loop, while the latter calls the leapfrog method separately. As stated earlier, most programs generally follow this template, with problem specific differences.

In Program 4.1, the equations of motion (4.3) are computed by earth() in a form suitable to leapfrog integration (see Chapter 2, Section 2.4).1 It returns either the velocity or the acceleration depending on the flag id, which is requested by the leapfrog integrator. The function earth() is similar to oscillator() in Program 2.7 but is two-dimensional, so it uses two-element NumPy arrays to represent the position, velocity, and acceleration vectors (lines 10, 11, and 7, respectively). As a result, the acceleration is computed vectorially in identical expression as is written in Eq. (4.3). Besides simplifying the computation, it is also conceptually clearer with vector operations. The advantage of this approach, last used in Program 3.8, will be seen frequently in subsequent problems (see Programs 4.3, 4.5, and 4.7).

In the main code go(), the initial position and velocity vectors are given as two-component vectors (lines 10 and 11). These initial values represent the motion of Earth at the point farthest away from the Sun (aphelion, see Table 4.1). The next few lines (14 to 20) add visualization effects much like those in Program 3.1. In order, they set the display window and viewing direction, draw an Earth-like planet via material.earth attribute, put a glowing (emissive) Sun at origin, and add a light source representing sunlight (when attributes such as position are given as (x, y) pairs, the z value defaults to zero). Only the line for the “planet” is required, the rest are just bells and whistles, if you will. The make_trail attribute for the planet will leave a trail marking the path of VPython objects.

After setting the time and step size, the program enters the main loop, which is functionally similar to the loop in Program 2.7. Because this is a Hamiltonian system, the leapfrog integrator is called to advance the solution in time (line 25). The position of the planet is updated (line 26) after every step, leaving a trail automatically. The program pauses if a key has been pressed (line 27). It then calls scene.kb.getkey() twice, first to read the key and then to wait for the second key press before continuing.2 Finally, we define a constant GM=4π2 which sets the unit of mass (to be discussed shortly) before executing the main function. Earth should move around the Sun repeatedly over the same path. In other words, the orbit is closed.

I encourage you to play around with Program 4.1, e.g., change the initial position or velocity slightly, turn off (commenting out) the sunlight, disable the trail, or add spin to the planet (see Program 3.8), etc.

4.2 Properties of planetary motion

Since planetary motion falls under the broader scope of two-body central field problems, we will briefly review some helpful properties of motion with central forces for easy reference [40].

4.2.1 Reduction to an effective one-body problem

A general two-body problem can be reduced to an equivalent one-body problem in the center of mass (CM) coordinates. Figure 4.2 illustrates this.

Let image and image be the positions of the particles with mass m and M, respectively. We define the coordinates of the CM, image, and the relative coordinates, image, the usual way

image

It can be shown (see Exercise E4.1) that in the CM coordinate system, the equations of motion may be written as

image

where the force F is given by Eq. (4.1). The center of mass moves at constant velocity (can be set to zero for simplicity), and the relative motion is a one-body problem with the reduced mass, μ. If one mass (say M) is large compared to the other, i.e., M/m image 1 as in the case of Sun/planet mass ratio, the reduced mass takes on the value of the smaller mass, μ = m. In this case the bigger mass (Sun) can be regarded as infinitely heavy and frozen in space. Only the smaller mass (planet) moves. It is for this reason that the Earth-Sun system in Program 4.1 is effectively a one-body problem. Hereafter, we will use μ and m interchangeably except where confusion might occur.

image

Figure 4.2: The reduction of a two-body problem to a one-body problem in the center of mass coordinates. Left: the space-fixed coordinate system; Right: the center of mass coordinate system. In either case, the relative coordinate image is the same.

4.2.2 Angular momentum and effective potential

Let image and image be the radial and angular velocities, respectively. The angular momentum image will be in the z direction as

image

Since the torque is zero for a central force, image is a constant of motion. This is the basis of Kepler's second law which states that the radial vector sweeps an equal area in equal time.

The second constant of motion is energy, of course. From Eq. (4.5), we have

image

We can eliminate image in E by substituting image into Eq. (4.7) as

image

The term L2/2mr2 is the centrifugal potential, and it keeps the particle from falling into the origin. The effective potential Veff is the sum of the real potential plus the centrifugal potential. Equation (4.8) describes the motion as if it is one-dimensional along the radial direction only in the potential Veff. For bound motion in an attractive potential, the radius r usually oscillates between rminrrmax. The values rmin and rmax are called turning points because at those points, the radial velocity image.

4.2.3 Kepler orbits

Of course, the actual motion is two-dimensional, say in radius r and angle θ. The orbit is most conveniently expressed as r(θ). For the inverse-square law (4.1), r(θ) is

image

image

The constant θ0 determines the orientation of the orbit and can be chosen for convenience. The other constant e is called the eccentricity. Geometrically, Eq. (4.9) is the equation of a conic section (slice of a cone) with the focus at the origin.

The shape of the orbit is determined by the value of e as follows:

image

The unbound, hyperbolic motion corresponds to scattering of particles and will be discussed later (Chapter 12). For bound, elliptic motion, it is useful to introduce a, the semimajor axis, and rewrite e and L2/mk as

image

To be more definite, let us choose θ0 = π in Eq. (4.9), and with the equalities (4.12), Eq. (4.9) becomes

image

With this choice of θ0,3 it follows that r is bounded by

image

image

Figure 4.3: An elliptic orbit (e = 0.4) of a particle moving about the origin O (focus) with semimajor and semiminor axes a and b (b = image). The orbit is oriented such that r = rmax at θ = 0 (aphelion) and r = rmin at θ = π (perihelion). Note rmax + rmin = 2a by Eq. (4.14).

Figure 4.3 illustrates the parameters of an elliptic orbit. The particle moves around the center of force at the origin, which is also one focus of the ellipse. For planetary motion, the force center is at (very nearly) the Sun. The radial velocity (image) is zero at the maximum distance (aphelion) and also at the minimum distance (perihelion) from the force center. The velocity at these two positions is perpendicular to the x-axis and may be obtained from energy conservation (4.7) and (4.12) as

image

We list in Table 4.1 some properties of Kepler's orbits of the planets.4

Table 4.1: Properties of Kepler's orbits of the planets.

image

4.2.4 Units for planetary motion

As in Table 4.1, we will use the astronomical units (AU) for distance, 1 AU=1.496 ×1011 m. This is convenient for planetary motion in our solar system. It is equal to the semimajor axis of Earth's orbit, and represents the average distance between the Earth and the Sun. The natural unit of time is chosen to be one year (365.25 days), or 3.156 ×107 s. This is the characteristic time scale for planet motion. The unit of speed is 1 AU/year = 4740 m/s.

We now have two of the three basic units. The third one should be about mass. Often we need the ratio k/m = GM with M being the mass of the Sun, as in Eq. (4.3). If we assume circular motion such as the Earth around the Sun, then

image

With a mean radius r = 1 AU, the period is 1 year, and the speed is v = 2π AU/year (29.77 km/s). Using the reduced mass given by (4.2), we get

image

where we have used the condition that m/M image 1. In effect, Eq. (4.17) defines the mass of the Sun image as the unit of mass. We will use GM = 4π2 for planetary motion in our units system, as in Program 4.1. In absolute units (rarely needed), image kg, and GM = 1.327 × 1020 m3/s2.

Note that Eq. (4.17) is a special case of Kepler's third law

image

which states that the square of period T is proportional to the cube of semimajor axis a. For the purpose of setting the value of GM in our unit system, Eq. (4.18) is equivalent to Eq. (4.17).

Finally, in the unit system thus defined, everything becomes dimensionless. Distance and time are to be compared with 1, and the time step must satisfy h image 1 in numerical integration, as was the case in Program 4.1.

4.2.5 Open and closed orbits

We have seen from running Program 4.1 and Eq. (4.13) that Earth moves in a fixed orbit, retracing itself over the same path periodically (Figure 4.1). The orbit is said to be closed.

Closed orbits may seem ordinary at first, but they are extraordinary. They are the exception rather than the rule. Gravity is one of only two forces supporting them. To wit, slightly modify Program 4.1 by changing the force to 1/r2+δ with δ ~ 0.1, set the initial values for Mercury (so the effect is clearer), run it, and we should see an open orbit as shown in Figure 4.4. The small δ = 0.1 is such that the force deviates from the inverse-square law (4.1) only slightly. But significant differences are seen in the orbit after about two revolutions.

image

Figure 4.4: Open orbit of Mercury with a presumed force ∝ 1/r2+δ, δ = 0.1. The initial condition is [x, y] = [0.4667, 0.0], [vx, vy] = [0.0, 8.198].

We can understand qualitatively the nature of open and closed orbits by considering the stability of circular motion.5 Circular motion is possible for any attractive potential. One just has to adjust the energy such that Eq. (4.16) holds. But circular motion may be stable or unstable. If, by increasing the energy slightly from the condition (4.16), the orbit deviates only a small amount from the circular orbit, the motion is said to be stable (with a slightly deformed orbit). Since the full motion consists of radial r(t) and angular θ(t) motion, we can think of a deformed orbit as composed of radial oscillations and angular sweeps, illustrated in Figure 4.5.

The radial distance oscillates between the turning points rminrrmax, so the motion is restricted to the region between the concentric circles shown in Figure 4.5 (bottom). If the radius completes nr integer oscillations and the angle θ makes nθ integer sweeps (revolutions) in the same time interval, then the orbit is closed, since nr/nθ is rational (commensurate). As it turns out, of all the possible forces in the universe, only 1/r (gravitational and Coulombic) and r2 (harmonic, i.e., Hooke's law) potentials can produce closed orbits.

Other forms of potentials do not support stable circular motion, and an integer pair of (nr, nθ) cannot be found, i.e., nr/nθ is irrational. The orbit is open, as it does not repeat itself within a finite period of time. Furthermore, the orbit orientation rotates a bit with each revolution. This rotation is known as orbital precession, to be discussed next.

image

Figure 4.5: An open orbit for bound motion (E < 0) in an effective potential.

4.3 Precession of Mercury

Astronomers have long known that the orbits of planets precess with time [25]. Since observations are carried out on Earth which wobbles like a gyroscope (called precession of equinoxes, not our concern here), the data must be analyzed to separate the kinematic effects from true dynamic effects. This is equivalent to going to the fixed space frame where the Sun is at rest. Reduction of measurements of the inner-most planet, Mercury, indicates a precession rate of 574 seconds of arc per century in the space frame (1 arcsecond, or ″, is 1/3600°). In other words, the perihelion (or aphelion, Figure 4.3) of Mercury slowly rotates through an angle of 0.16 degrees per century.

4.3.1 Reconciliation of 43″

From our earlier discussion, we understand that planetary orbits should not be exactly closed because they do not move in a pure 1/r2 force field with a single center. Besides the Sun, the other planets pull and tug each other all the time, not to mention their moons [72]. What planet would have the largest effect on the precession of Mercury? It is probably not a surprise that Venus does, because it is closest to Mercury, so its force is largest (see Table 4.2). Farther out radially, the effect decreases except for Jupiter which has the second largest effect because of its mass. Beyond Saturn, the effects are negligible.

The problem is (or was), taking into account all the known perturbations present on Mercury due to these planets (within Newtonian theory of gravity), and after careful number crunching, the precession is expected to be about 531″ for Mercury per century (Table 4.2). That would leave 43″ unaccounted for, or 0.012 degrees/century. This is a very small amount, but well beyond observational uncertainties to be ignored.

As it turns out, the discrepancy can be explained only with Einstein's theory of general relativity. The relativistic correction beautifully accounts for the difference of 43″ exactly [16, 85]. It is one of the major triumphs of Einstein's theory of gravity.

In general relativity, the gravitational field is modified and can be construed as an effective force given by

image

The details of the ingredients going into producing Eq. (4.19) are rather involved, and beyond our scope [40]. Compared to Eq. (4.1), though, there is an additional 1/r4 term in the relativistically modified force. This term destroys the perfect inverse-square law. It causes the orbit to precess.

4.3.2 The Runge-Lenz vector

At first glance, it seems that we can calculate the precession of Mercury due to the relativistic effect by just tracking the rotation of the aphelion (Figure 4.5). While this is possible, it is harder than it sounds. Because the parameter λ in Eq. (4.19) is very small, it is like searching for a needle in a haystack. If we were to use the actual value of λ directly in our simulation, we would have found that, for any moderately practical step size h, the change of the aphelion after one revolution would be insignificant compared to the displacement in one time step. Careful fitting and extrapolation would be needed to find the exact position of the aphelion. Is there a better way? In this case, there is: the Runge-Lenz vector [39, 47].

For observational purposes, of course, it might be natural to want to track the change of the aphelion (or perihelion) in order to discern any precession. This would be unnecessary in a simulation if we have another way to measure the precession. Fortunately, we do. There is a quantity known as the Runge-Lenz vector that serves our purpose well. The Runge-Lenz vector is defined as [40]

image

where image is the momentum, image the angular momentum as usual, m the mass and k the force constant given in Eq. (4.1).

We know energy E and image are constants of motion, a fact very useful to test if our programs are performing correctly (see Project P4.1). As it turns out, image is also a constant of motion in a pure inverse-square law of force, i.e., image (see Exercise E4.4). Using vector product rules, we find that image for circular orbits. For ellipses, image points in the direction from the origin (center of force) to the perihelion, see Figure 4.6.

When the force is not a pure inverse-square in r, as is the case in Eq. (4.19), the Runge-Lenz vector is no longer a constant of motion. Rather it will rotate with the perihelion. This helps us greatly: unlike finding the aphelion, calculating the Runge-Lenz vector involves no fitting. We can now just follow image directly in our simulation, and the angle it sweeps through gives the amount of precession. For example, suppose we start our simulation with image pointing in the negative x-direction. In time, it will develop a y-component. We can evaluate image (both components Ax and Ay) at any time using Eq. (4.20). The angle of precession can be found by θ = tan−1(Ay/Ax).

image

Figure 4.6: The Runge-Lenz vector (arrows). It is constant in a closed orbit in a pure 1/r2 force field (left). For other forces where the orbit is open, it rotates with the perihelion (right).

4.3.3 The leapfrog method with time transformation

If we went ahead and calculated the Runge-Lenz vector with the leapfrog method, we would be disappointed with the results: we would see mostly noise for any meaningfully practical step size h. Again, the problem of the needle-in-a-haystack bites us. Decreasing h is not a preferred solution since it causes more round off error. But there is something more. Because Mercury's relatively large eccentricity (Table 4.1), its orbit is quite elliptic. Close to the perihelion, the force and speed are much larger than the averages. This large variation is what causes the noise. The physical reason, and the insight we gain, is that the force has a singularity at r = 0 and the leapfrog integrator somehow “feels” it. In fact, it is possible to induce artificial precession in a pure 1/r2 force law if the orbit is elliptic enough and the step size is not small enough. We need to smooth out, or “regularize”, the singularity.

An effective way to deal with the problem is by a time transformation. The idea is that the step size is adjusted so that near the closest approach (perihelion), we take smaller steps. Let us consider the vector equations of motion equivalent to Eqs. (2.39) and (2.40)

image

image

We introduce a time transformation from the real time t to a fictitious time s

image

Now rewrite Eqs. (4.21) and (4.22) in terms of s using the chain rule image,

image

image

Suppose we choose a function Ω(r). We would not be able to solve the above equations using the leapfrog method because the position also appears on the RHS of Eq. (4.24), not velocity alone (see Section 2.4). That means the method would not be area preserving.

What we need to do is to treat Ω(r) as a generalized “velocity” [63]. Let us introduce an auxiliary variable, W, as

image

We will regard W as a “velocity”. Using image and Eq. (4.23), we can add two auxiliary equations to Eqs. (4.24) and (4.25)

image

image

image

image

The above equations are in the proper form for the leapfrog method if we treat image and t as the generalized “coordinates”, and image and W as the generalized “velocities”. Equations (4.27a) and (4.27b) are the exact analogue to Eq. (2.44), and Eqs. (4.27c) and (4.27d) to Eq. (2.45). We are free to choose any form of Ω(r). A good choice for planetary motion (and other 1/rn forces) is

image

It ensures that when r is small, Ω(r) is large, and dt is small by Eq. (4.23). Furthermore, it is easy to calculate the gradient, image. With Eq. (4.28), we can write the leapfrog algorithm with time transformation analogous to Eqs. (2.41) to (2.43)

image

image

image

image

image

image

As usual, the subscripts 0 and 1 denote values at the beginning and the end of a time step h, respectively. However, here the time is the fictitious (transformed) time s, not the actual time t. The actual time is returned in t1. The difference t1t0 is not constant, giving us the desired effect of smoothing out the singularity near the origin.

Here is the leapfrog method with time transformation, Eqs. (4.29a) to (4.29f).

Program listing 4.2: Leapfrog with time transformation (leapfrog_tt.py)

  1 def leapfrog_tt (lfdiffeq, r0, v0, t0, w0, h): ””” vectorized leapfrog_tt with time transformation,   3 Omega=1/r, that solves general (r,v) ODEs as: dr[i]/dt = f[i](v), and dv[i]/dt = g[i](r).   5 User supplied lfdiffeq (id, r, v, t) returns f [i](r) if id=0, or g[i](v) if id=1 ”””   7 # 1st step: calc r at h/2 hw = h/(2.0*w0) # half h/2w0   9 t1 = t0 + hw r1 = r0 + hw*lfdiffeq(0, r0, v0, t0) # id=0, get image 11 r2 = np.dot(r1, r1) # get rˆ2=xx+yy+zz r12 = np.sqrt(r2) # r1/2 13 # 2nd step: calc v1 using r at h/2 15 v1 = v0 + h∗r12∗lfdiffeq(1, r1, v0, t1) # id=1 for g(r) at h/2 rdotv = np.dot(r1, v0+v1)/2. # image 17 w1 = w0 − rdotv∗h/r2 # w0imageh/r2 19 # 3rd step: calc r by another 1/2 step using v1 hw = h/(2.0∗w1) 21 t1 = t1 + hw r1 = r1 + hw∗lfdiffeq(0, r1, v1, t1) # get image at t+h 23 return r1, v1, t1, w1

The module leapfrog_tt() uses the same lfdiffeq format as required by the standard leapfrog (Section 2.4). Except for additional elements of time transformation and calculations of dot products with the NumPy function np.dot, it works very much the same way also. We will use the transformed leapfrog integrator for sensitive problems such as the precession of Mercury. As discussed in later chapters, it is also a very useful method for N-body systems, including molecular dynamics and atomic reactions (Section S:12.5.1). We include leapfrog_tt in the library file ode.py with other ODE solvers.

4.3.4 Simulation of differential precession

Precession due to the relativistic correction

Finally we have all the necessary parts to calculate the relativistic correction to the precession of Mercury. Putting it all together, we give the complete simulation in Program 4.3 (Section 4.D).

Run the simulation with animation on, and enter a λ large enough, say 0.01, to see exaggerated effect of precession. It should be similar to Figure 4.6. You should also see that the motion of the Runge-Lenz vector is not uniform: it rocks back and forth, with the mean motion forward (counterclockwise), in the same direction as the circulation of Mercury.

image

Figure 4.7: Differential precession of Mercury, i.e., the rotation of the Runge-Lenz vector. A zoom-in of the last two years is shown on the right.

Now set animation=False, and enter the true value λ = 1.1 × 10−8 when prompted. After the simulation ends, we should see a plot showing the angle of precession differential in time over one century in Figure 4.7. It is seen that right at the century mark, the precession is exactly 43″, a remarkable success of Einstein's theory of gravity. Equally remarkable is the precision of observational astronomy which allows the detection of this tiny amount. Numerically, the leapfrog method with time transformation is sufficiently accurate to pick up this amount, and at the same time, preserves the phase space properties. It is also quite robust. For example, we could increase the step size by a factor of 10 and still get reasonably accurate results.

The full curve (Figure 4.7, left) is not as straight as it looks. It has small-scale oscillations which become visible in the enlarged figure. Because these oscillations are so small (a fraction of an arcsecond), we should ask ourselves, are they real? Could they be artifacts of numerics due to such factors as limited accuracy or incorrect algorithm, for example?

In numerical work, we always have to be mindful of potential pitfalls which could produce artificial effects not present in the actual system. In our case, we can check whether the effect remains for a larger perturbation. As seen from the animation with λ ~ 0.01 discussed earlier, the back-and-forth rocking motion of the Runge-Lenz vector shows that the oscillations are not restricted to small perturbations. Other checks including conservation laws and step sizes can be performed to see if the oscillations are affected. The answer is no (see Project P4.1). In all likelihood, we can exclude numerical error (noise) as the cause.

Once we are certain that the oscillations are real, what is the physical reason for them? We note that there are about four oscillations per year, or the period is about 1/4 years. This is just the orbital period of Mercury (Table 4.1). Therefore, the oscillations might be connected to the orbital period. With animation turned on and with an artificially large λ ~ 0.01, we can observe the phenomenon visually. Let us assume that Mercury starts at the aphelion going counterclockwise, with the Runge-Lenz vector image pointing at the perihelion (Ay = 0). The y-component, Ay, has two terms from Eq. (4.86), Ay/m2 = −vxLGMy/r.

Roughly,6 when vx turns negative, Ay increases, and when y increases, Ay decreases. Near the aphelion, Mercury is farthest away from the Sun, and the attractive relativistic term causes vx to turn negative faster than the increase in y (more precisely y/r). The net effect is that Ay increases. This causes the clockwise (retrograde) rotation of image. Near the perihelion (past the x = 0 plane), the opposite occurs, and image rotates counterclockwise. Because the perturbation is greater near the perihelion, the counterclockwise rotation is larger than the clockwise rotation, resulting in a net precession in the same direction as Mercury's circulation (ccw, prograde). It then follows that if the sign of the perturbation is reversed (repulsive), the precession will be in the opposite direction. This can be verified through an exercise.

Central field approximation and precession due to other planets

Mercury interacts with other planets through pair-wise forces that are not central relative to the Sun. A general description would need to take into account all the planets simultaneously (a many-body problem). But if the effects are small, and if we are interested in only averaged values like precession over a period of time, we could approximate each pair-wise force as a central force and treat it individually. The idea is that Mercury moves around the origin (Sun) rapidly and the average force points in the radial direction. In such cases, we speak of central field (or mean field) approximations which are very useful and important in many areas of physics.

If we can construct the force between Mercury and a planet in a central field approximation, we can calculate the precession of Mercury due to that force with the same methodology as the relativistic effect discussed above. One way to obtain the force is as follows. Imagine the mass of a planet, Mp, is distributed uniformly over a coplanar ring of radius a (semimajor axis) [72]. By symmetry, the force between Mercury and the ring is central, i.e., image. The potential is given by an elliptic integral [49] (see Exercise E4.6)

image

Because Mercury is the inner-most planet and ρ < 1, this elliptic integral can be expanded in a power series. The first few terms are

image

The force can be found via the gradient −∇V as

image

This force is repulsive (radially outward), and the leading term behaves like Hooke's law with a negative spring constant. Two factors determine the 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. The actual amount depends on the interplay between the two parameters.

Using the force in the central field approximation (4.32) in Program 4.3 with the parameters from Table 4.1, we obtain the results of Table 4.2.

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

image

The results vary over three orders of magnitude. Venus, the closest one, has the largest effect, followed by Jupiter, the most massive one. In between, the order reflects the balance between the radius and mass. Note that the results for Earth are obtained with the combined mass of Earth and the moon. 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″). If 43″ was a needle in a hay stack, Neptune's contribution might be a drop in a lake. Yet, the leapfrog method with time transformation is robust enough to crunch it out accurately and efficiently. Also, although the central field approximated force (4.32) is positive, the precession is still counterclockwise, the same as the relativistic correction even though the force there (4.19) is negative. We will investigate these questions and related aspects in Project P4.3.

Scaling law in the central field approximation

As the numbers listed in Table 4.2 jump up and down with different planets, they are not particularly insightful for discovering trends or revealing more general properties. As Eq. (3.33) from Chapter 3 showed, scaling laws are very useful in this regard. Whenever possible, we should try to find scaled variables and plot the results in these variables to show the general trends.

What is a good scaled variable to use in this case? The amount of precession depends on the combination of the mass and radius. The prefactor in the potential (4.31) suggests Mp/a, but the force (4.32) points to Mp/a3. Since the force is directly involved in the simulation, the latter is more appropriate. Therefore, for small perturbations, we expect precession to scale linearly with Mp/a3, i.e., a linear scaling law.7

When we go ahead and calculate the scaled variable Mp/a3 for the planets using Table 4.1, we find that it also varies over three orders of magnitude similar to the precession results in Table 4.2. If we were to display precession versus the scaled variable as linear plots, the data points would be clustered at two locations, the lower-left and upper-right corners. Thus, to more evenly spread out the data points in the whole range and to help visually identify any trends, we should plot the data using log-log scales as we did with the semilog plot in Figure 2.7, for example. The results are shown in Figure 4.8.

image

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

Most data points in Figure 4.8 fall on a straight line (trend line), clearly showing a linear scaling law. Small deviations are seen for Venus, Earth, and Mars. This is due to their relative proximity to Mercury, causing the second order term in Eq. (4.32) to have a non-negligible effect on the deviation. Nonetheless, Venus and Jupiter, the closest and the most massive planets, are vastly different and yet nearly identical in the scaled variable, 6.47 vs. 6.78, respectively (Figure 4.8). Therefore, they cause similar amount of precession according to the scaling law. The predicative power and the physical insight of scaling laws make them very useful in practice and in our understanding.

Since each planet produces precession in the same counterclockwise direction, the total precession due to all planets is additive, and is equal to 529.4″ (Table 4.2). The result is in very good agreement with the accepted observational data of 531″ [72, 85]. The relative error is about 0.3%, with most of it coming from Venus. What are the sources of error? We have assumed the planets are coplanar with Mercury, which is only approximate. The inclination angles of the planets differ from each other by a few degrees. Another source is the assumption of circular orbits (rings). From the eccentricities in Table 4.1, except for Pluto which has negligible effects and Mercury itself, the perturbing planets are nearly, but not perfectly, circular. Lastly, we have included only a few terms in the series expansion (4.31). This will affect only the close planets though, such as Venus and Earth.

4.4 Star wobbles and exoplanets

We have seen from Section 4.2 that a two-body problem can be reduced to an effective one-body problem in the center of mass frame. The actual motion, of course, still consists of two bodies pulling on each other (with forces of equal magnitude and opposite direction) and revolving around the center of mass. In the case of a star-planet system, the star barely wobbles due to the large mass ratio.

Nonetheless, the star's wobbling is important to a current topic of considerable interest: the discovery and detection of extrasolar planets, or exoplanets, including Earth-like planets and planets in the habitable zone supporting an atmosphere and liquid water.8 Unlike planets at the doorstep in our solar system, direct observation of exoplanets is very difficult because they are at astronomical distances, small and faint, and in sharp contrast to the brightness of their host stars. Indirect methods of detection are necessary, including measuring the wobbles of stars (radial velocity), the light blocked off when exoplanets pass in front of the stars (transiting planets), and light bending and brightening due to gravitational fields (microlensing), among others.

4.4.1 Radial velocity method

We discuss the method of detecting the wobbles, known as the radial velocity (RV) method. The RV method relies on the fact that light from stars moving about the center of mass will be Doppler-shifted. The Doppler shifts depend on the velocity of the star along the line of sight, i.e., the radial velocity from the observer's perspective. Light from the star will be blue-shifted moving toward us, and red-shifted moving away. By measuring the Doppler profile, one can infer the velocity profile of orbital motion. From there, we can determine the orbital parameters of the exoplanets, including the period, eccentricity, and the lower limit of the mass. The RV method is responsible for a majority of exoplanets discovered early on [14].9

Referring to the position vectors in Figure 4.2 and Eq. (4.4) (with the results from Exercise E4.1), the wobbling velocity of the star, image, is related to the orbital velocity image as

image

image

Figure 4.9: The wobbling velocity of the Sun due to Jupiter (left) and of HD 139357 due to its exoplanet (right). The solid curve is a fit described in text.

For a given star-planet system, we can obtain image from Program 4.1 and therefore image. The result for the Sun-Jupiter system is shown in Figure 4.9. One component of the Sun's velocity is plotted, image in this case, which is equivalent to the edge-on view of the orbital motion. The velocity is periodic (~ 4330 days, Jupiter's period), and nearly sinusoidal because the orbit is almost circular (e = 0.0484, see Table 4.1). It would be sinusoidal for circular orbits. The magnitude of the velocity is roughly 10 m/s, typical of the pull by planets of Jupiter's size on a star of about one solar mass. For smaller planets like Earth, the magnitude is about 10 cm/s.

Also shown in Figure 4.9 is an observational RV dataset for a star in the Henry Draper catalog, HD 139357. It shows an almost sinusoidal curve, clearly indicating the presence of an exoplanet moving in a nearly circular orbit around the star, with a period ~ 1100 days. This exoplanet was discovered in 2009. From the RV dataset, the lower limit of the exoplanet's mass is determined to be about 9.8 Jupiter mass. The fact that only a mass limit can be established, and not the mass itself, has to do with observing geometry and information on the inclination angle, or lack thereof.

image

Figure 4.10: Observing geometry for radial velocity measurements.

The geometry is illustrated in Figure 4.10. The space-fixed coordinates (the sky) are denoted by XYZ, where the XY plane defines the space plane. We choose the X-axis along the line where the Kepler orbit of the exoplanet intersects the space plane (ascending node in astronomy nomenclature). The inclination angle, i, is the angle between the orbital plane and the space plane. It is equal to the angle between the Z-axis and the normal of the orbit (direction of angular momentum image). We use ω to denote the angle between the aphelion and the X-axis. Except for the azimuthal angle around Z (not shown), which is unimportant due to rotational symmetry, i and ω determine the orientation of the Kepler orbit. As usual, θ represents the angle between the radial vector of the exoplanet and the aphelion, the same as in Figure 4.3.

The observer's line of sight to the star runs parallel to the Z-axis. Therefore, only the Z component of the star's velocity, v*z, is relevant and measurable by Doppler shift methods. From the observer's perspective, v*z appears as a radial velocity (away or toward), thus the name of the RV method.10 We have to determine the relationship between the wobbling velocity v*z and the orbital velocity image in terms of orbital parameters and the angles i and ω.

The radial velocity of the star is derived in Section 4.C. For a star with a single planet, the result from Eq. (4.85) is

image

where C is a constant representing the velocity of the center of mass, T the period, and a the semimajor axis. The first term indicates that v*z oscillates with a period T and an amplitude |V|.

From fitting a given RV dataset like the one shown in Figure 4.9 according to Eq. (4.34), parameters such as T, e, and V can be obtained. If the mass of the star M is independently known, the mass of the exoplanet m can be determined from

image

We have assumed m/M image 1 and used Kepler's third law (4.18) to eliminate a. Equation (4.35) shows that we can determine the product m sin i only. Because the inclination angle i is generally unknown, the RV method yields only a lower limit for the exoplanet mass (sin i ≤ 1).

If the period T is given in years, M in solar masses, and V in m/s, the numerical value for the exoplanet mass in Earth masses is

image

This formula is useful for a rough estimate of an exoplanet's mass.

Take for instance the exoplanet of the star HD 139357. The star is known to be about 400 light-years away and a mass M ~ 1.3image. We can estimate the other parameters by inspecting Figure 4.9 to obtain: T ~ 1100 days = 3 years, and V ~ 160 m/s. The RV curve is almost sinusoidal, so the orbit is nearly circular, and e ~ 0. Substituting these numbers into Eq. (4.36), we obtain m sin i ~ 3000 Earth mass, or ~ 9.5 Jupiter mass. More careful data fitting gives m sin i = 9.8 Jupiter mass, which means that the exoplanet is at least 9.8 times more massive than Jupiter.

4.4.2 Modeling RV datasets

To accurately model observational RV datasets according to Eq. (4.34), we need to know θ as a function of time t, θ(t). However, this is not as straightforward as one might expect. Except for circular orbit where θ is linear in t, no simple closed-form solutions exist. We could obtain θ(t) numerically from simulation codes such as Program 4.3, but that would be the hard way. Fortunately, it is a two-way street here, a hard way and an easy way.

We first write image using conservation of energy from Eq. (4.8) and obtain t as

image

This equation can be solved by introducing a new variable ψ through

image

where ψ is called the eccentric anomaly.11 Substituting Eq. (4.38) into (4.37), and after some algebraic details left to Exercise E4.7, we obtain

image

This is the celebrated Kepler's equation relating t to ψ. We can solve for θ in terms of ψ by combining Eqs. (4.38) and (4.13) to get

image

We see from Eq. (4.40) that ψ has the same range as θ, i.e., when θ changes from 0 to 2π, so does ψ. Furthermore, the two variables are equal at 0, π, and 2π, no matter the eccentricity e.

The pair of equations (4.39) and (4.40) give the relationship between t and θ. For a given t, Eq. (4.39) can be solved for ψ, which can be substituted into Eq. (4.40) to obtain θ. The relationship for several eccentricities is depicted in Figure 4.11. The dependence is linear for e = 0 (circular orbit) as expected. For nonzero e, it becomes increasingly nonlinear. The figure was generated without actually solving Eq. (4.39). The trick is this: first generate a mesh for ψ in [0, 2π]; second, compute t from Eq. (4.39) for each mesh point and store it in an array; third, compute θ from Eq. (4.40) and store it in another array; finally plot the two arrays. This trick is easy and fast, but the drawback, of course, is that the t values calculated are not pre-determined and non-uniform. If we wanted to generate θ for a given t, we would have to solve Eq. (4.39) using a root solver. It's not necessary for our purpose here.

image

Figure 4.11: Left: The relationship between θ and t for four eccentricities. Right: an actual RV dataset of Fischer et al. [30] and a fit.

The effect of eccentricity on radial velocities is also shown in Figure 4.11. The dataset is for HD 3651 with an exoplanet reported in 2003 [30]. The curve is not sinusoidal at all. The sharp dip in the radial velocity can be reproduced only with a significant value of eccentricity. Physically, the planet moves much faster near the perihelion than anywhere else in a highly eccentric orbit. This causes a dip (or spike) in the velocity of the recoiling star.

A general best fit of Eq. (4.34) to a given RV dataset is not trivial because of the number of parameters involved. We use least square fitting, leastsq, from SciPy as a blackbox. It requires only an error function that returns the difference between our model and the actual data points. The details are given in Program 4.4, yielding the results in Figure 4.11.

The blackbox method is easy to use and gives satisfactory results, but leaves the modeling process a bit opaque. To see various factors at play, we outline an iterative fitting process by simple visual inspection that also works well for our purpose. Starting with an initial guess of parameters T, V, e, ω, C:

  1. generate a mesh grid for ψ
  2. adjust the appropriate parameters T, V, e, ω, C for better visual fit
  3. compute t from Eq. (4.39) and θ from Eq. (4.40)
  4. calculate v*z from Eq. (4.34) and plot the results
  5. inspect the match of the curve and the data, repeat step 2 as necessary

With code segments from Program 4.4, we can begin to model any datasets and visualize the process. We leave modeling of the dataset shown in Figure 4.11 to Project P4.6. Many other RV datasets can be found at the exoplanet archive [66].

4.5 Planar three-body problems

So far we have studied motion of two-body systems reducible to effective one-body motion. If we add just one more body to a two-body system, we have a three-body problem, the simplest of general N-body problems. Even if the pair-wise forces obey the pure inverse-square law (4.1), general analytic solutions to the three-body problem are still not possible at present, making simulations indispensable.

Since the early development of Newtonian mechanics, efforts have been made to reduce the intractability of the three-body problem. There are nine degrees of freedom in total, three for each body. Going to the center of mass frame reduces that number by three. Further reduction is possible by invoking conservation laws (energy, angular momentum, etc.), but the mathematical difficulties involved are still insurmountable. Special attention, therefore, has been devoted to finding solutions of the planar three-body problem: the motion of all bodies is confined to a two-dimensional plane. This is still an area of ongoing research, especially in the search of periodic orbits. We will discuss several numerical examples to get a glimpse of the planar three-body problem and its intricacies.

4.5.1 Equations of motion in the three-body problem

Qualitatively, the motion of three bodies is no more difficult to simulate than one-body motion. Let the three bodies be numbered as i = 1, 2, and 3. Their masses, coordinates, and velocities are mi, image, and image, respectively. The equations of motion are

image

image

It is understood that ijk, and {ijk} is a permutation of {123}. The relative coordinates between two bodies are image, and image image. Note that image, a relation useful in programming. Because the gravitational constant G always appears in the product Gmi, we can set G = 1 in our program. It is equivalent to setting the scale of mass.

Equations (4.41) and (4.42) are 12 first order differential equations of a Hamiltonian system in 2D. Given the initial condition, we can solve them using the leapfrog method. Of course, the more elaborate leapfrog method with time transformation discussed earlier may be extended to the three-body problem as well.12 However, we are not interested in very small or sensitive processes like precession of Mercury, so its use is unnecessary here. In addition, most of the periodic orbits are physically unstable, and there is little a numerical algorithm can do to rectify that. What remains is to determine the initial condition for a given numerical solution.

4.5.2 Euler's collinear motion

One of the simplest and most interesting systems is Euler's collinear motion of the three-body problem. It is illustrated in Figure 4.12.

At any given time, the three bodies are on a straight line, with one body, say m2, lying in-between the other two bodies, m1 and m3. Each moves in an ellipse with the same period. When they reach the aphelion simultaneously on the axis of the ellipses, the distances among them are the largest, and when they pass the perihelion, the distances are the closest. At other times, the distances oscillate between the extrema. The motion is periodic, but unstable. That is to say, if there is a slight deviation from the perfect configuration, the system flies apart from collinear motion.

image

Figure 4.12: Euler's collinear motion of the three-body problem.

To determine the initial condition, let us assume the bodies start from the x-axis, thus yi = 0, and only the horizontal positions xi are needed. To execute Euler's collinear motion, the distances between the bodies must obey certain proportions. Referring to Figure 4.12 (top), let a be the distance between m2 and m3, and λa between m1 and m2. It follows that

image

The equation of motion for a given body, say m1, is

image

where we have set G = 1 for convenience. Because of the oscillating nature of the distances, we seek a solution of the form d2x1/dt2 = −ω2x1 (simple harmonic oscillator). Substituting this into the above equation and dividing −m1ω2 on both sides, we obtain

image

Similarly, we have for the other two bodies

image

image

We can combine Eqs. (4.43) to (4.46) to obtain the parameter λ first,

image

This is known as Euler's quintic equation. We leave as an exercise the verification of Eq. (4.47) and the results below, Eqs. (4.48) to (4.50). Given a set of masses, there is one positive root. The variable a in terms of λ is

image

With both λ and a found, we can find the initial positions as

image

We recognize that the last term means that the center of mass is the origin. The initial velocities (all along y-axis) are

image

The procedure to simulate Euler's collinear motion is as follows. First, solve Eq. (4.47) for λ using a root finder such as bisection or Newton's methods in Chapter 3. Then compute the initial condition from Eqs. (4.49) and (4.50). Finally, solve the equations of motion (4.41) and (4.42) with the leapfrog method.

The code implementing this strategy is given in Program 4.5 listed in Section 4.D. The program animates the collinear motion of the three-body problem and snapshots are shown in Figure 4.13.

Watching the motion, we should see that at first the bodies move perfectly (to the naked eye) in their own ellipses, retracing over them periodically (Figure 4.13, left). After a while, typically three periods or so depending on the energy, two bodies will be so attracted to each other that they quickly move off the periodic orbits, forming a binary system. The binary partners usually perform choreographically beautiful (albeit mechanical) “dances” (Figure 4.13, right) as they move along. The third body, attracted to the binary system acting roughly as a single body, often turns around. If it does and moves in close, there is a high probability that the dancing partners switch, forming a new binary system. This may continue for a while, but eventually, the final outcome is that a tight binary is formed, and the third body is ejected, moving indefinitely away from the binary system. Gravitationally bound classical three-body systems are mostly unstable, and often so sensitive to the initial conditions that a small difference there can lead to totally different outcomes. This behavior is known as classical chaos, a topic we will discuss next in Chapter 5. Our knowledge at present seems to indicate that common many-body systems held by gravity are chaotic, including our solar system [58].

image

Figure 4.13: Euler's collinear motion of the three-body problem at different times. The camera in the right figure is tilted to keep the third body in view.

4.5.3 Three-body choreography

There are more elaborate periodic orbits that have been found. For example, the following initial condition [84] produces a heart-shaped choreographic orbit shown in Figure 4.14.

image

The three bodies rotate counterclockwise, so there is a net angular momentum. The starting position of each body is approximately at the position of the body immediately behind it (clockwise) in the left panel of Figure 4.14. The most delicate part occurs near the center of mass (CM, white dot) where the speed is the lowest. Referring to the animation (or Figure 4.14, right), as the red body (closest to the CM) moves in on the upper part of the inner orbit, it slows down, coming to a temporary stop right at the tip (the protrusion) of the inner orbit. At the same time, the other two bodies (light/green and dark/blue) are almost diametrically positioned on the outer orbit, so the net force on the red body is very small. But, there is a slight bend to the diametrical which provides just enough net force that allows the red body to step back from the tip and continue on to the lower part of the inner orbit (where the body immediately ahead (blue) was previously). However, the motion is unstable. After about two periods, the system breaks up, suffering the same fate of most three-body systems: a tight binary plus a runaway body (not shown in Figure 4.14). But, if we reversed the velocities at any time, the system would run backward to its original configuration precisely like rewinding a videotape (see Exercise E4.9). This is because the leapfrog method preserves time reversibility of the system, which may be unstable but not indeterministic.

image

Figure 4.14: Choreographic orbit of the three-body problem with the initial condition (4.51). The arrows are proportional to the velocities.

Another interesting orbit is a figure-8 orbit. It is shown in Figure 4.15 produced from the following initial condition [15],

image

image

Figure 4.15: Choreographic orbit of the three-body problem with the initial condition (4.52). The arrows are proportional to the velocities.

This orbit is symmetric both horizontally and vertically. Unlike the previous configuration, the bodies do not circulate uniformly in one direction. The motion is clockwise on the left half of the orbit (Figure 4.15), and counterclockwise on the right half. The combination is such that there is no net angular momentum. When one body is at the origin, the other two are symmetrically situated on the orbit, all on a straight (slanted) line. In this sense it is like Euler's collinear configuration (Figure 4.13), although the three bodies never line up horizontally. Whenever one body is at the edge of the figure-8 (Figure 4.15, middle), the other two are on the opposite half lined up vertically, forming an isosceles triangle. At this moment, the velocity of the first body is vertical, and the velocities of the other two bodies are such that their x components cancel each other and the sum of their y components cancels the y component of the first body, so that the center of mass velocity remains zero.

Numerical experiments show a rare but remarkable property of this orbit: it is stable. If the orbit is perturbed slightly, the motion remains close to the figure-8 shape. For example, if the position or the velocity of a body (or even its mass) is changed by a small amount, the orbit may be slightly deformed, or it may even precess, but the three-body system does not disintegrate (Exercise E4.9).

4.6 The restricted three-body problem

The planar three-body problem does not have any restrictions other than that the motion is confined to a plane. We impose now two additional constraints: the masses of two primary bodies are much larger than the mass of the third body, and the two primaries move in a circular orbit about their center of mass. As a result, the simplified system is called the restricted three-body problem. It is illustrated in Figure 4.16.

image

Figure 4.16: The restricted three-body coordinate system.

Let us call the third body of mass m the test body. Its mass is considered so small compared to the two primaries, i.e., m/M1,2 ~ 0, that it has no effect on the motion of the primaries, which rotate around the center of mass at constant angular velocity ω and constant separation. We are only concerned with the motion of the test body. Though the restricted three-body problem is an idealized situation and no actual systems behave exactly like it, it is still a very good approximation for many systems, including the motion of a satellite (test body) in the Earth-Moon system, or of the asteroids in the Sun-Jupiter system. The simplification allows us to gain much insight from studying such systems.

The motion of the test body may be best understood in the rotating coordinate system of the primaries. For example, if a and b are the respective distances of M1 and M2 from the center of mass (the origin, Figure 4.16), then the primaries appear as stationary points at (−a, 0) and (b, 0), respectively, in the rotating coordinates (x-y), though they are rotating in space-fixed coordinates (X-Y). The test body will move around the stationary force centers in the rotating coordinates.

4.6.1 Equations of motion in the rotating system

The force on the test body is

image

where (x, y) are the coordinates of the test body in the rotating system. The calculation of velocity or acceleration must take the rotating coordinates into account. Details are given in Appendix 4.A. For example, according to Eq. (4.72) the acceleration is,

image

Note that we have dropped the prime (′) according to our coordinate system in Figure 4.16 for clarity. Of course, all variables image, image, and image refer to the rotating coordinates.

Using the fact image and image, we can simplify the last term in Eq. (4.54) to

image

We have used image because image is perpendicular to the plane of motion (x-y plane). Substituting these results and Eq. (4.53) into (4.54), we obtain

image

The system can be readily integrated with our ODE solvers. However, before doing that, we would like to examine the rich structure contained within the effective potential which will help us better understand the motion.

4.6.2 The effective potential

There are four terms in Eq. (4.55). We recognize that the first two terms are actual forces due to the primaries M1 and M2, the third term due to the centrifugal force (or effect), a pseudo-force, and the last term due to the Coriolis effect. Except for the velocity-dependent Coriolis term, the other three terms may be obtained from the gradient of a scalar function of coordinates only, say V (x, y), such that the acceleration can be written as

image

We call V the effective potential given by

image

The effective potential consists of the actual gravitational potentials, and a centrifugal potential which resembles the harmonic oscillator potential but with a negative spring constant (see Eq. (4.32)). The force is therefore repulsive and pushes radially outward. This is because the motion is being described in the rotating system. We could imagine that, to keep the test body stationary in the rotating system, a real force toward the center, i.e., a centripetal force, would be needed to balance an extra (unseen) force to keep it in place. That extra force is called the centrifugal force.

Units for restricted three-body problems

The effective potential (4.57) (and equations of motion) are valid for any unit system. To further analyze its properties quantitatively, we should adopt a unit system most convenient for the restricted three-body (RTB) problem at hand. Analogous to planetary motion, we choose the RTB units as shown in Table 4.3.

Table 4.3: RTB unit system for the restricted three-body problem.

image

Consequently, it follows by definition that ω = 2π/T, and from Eqs. (4.16) and (4.17) that

image

This means that in actual calculations employing the RTB unit system (M = R = T = 1), we can set angular velocity ω = 2π and GM = 4π2, just as in the planetary unit system.

For the distances, because the center of mass is chosen as the origin (Figure 4.16), we have

image

Solving for a and b and introducing the mass parameter α, we have

image

It is customarily assumed that M2M1, so 0 < α ≤ 0.5. In terms of α, the primaries’ masses in our unit system can be expressed as

image

Consider the Earth-Moon system as an example. The primaries’ masses are M1 = 5.974 × 1024 kg and M2 = 7.348 × 1022 kg, respectively. The distance between them is 3.844 × 108 m, and the rotational period is about one month (27.3 days). The absolute units and the RTB units are listed in Table 4.4.

Table 4.4: RTB units of the Earth-Moon system.

image

We note that the RTB units are elastic. In other words, when the restricted three-body system changes, e.g., to the Sun-Jupiter system, the units of mass, length, etc., have different numbers on the absolute scale, even though they may all be 1 in the RTB units.

The Lagrange points

We can simplify the effective potential (4.57) by rewriting it in the newly introduced RTB unit system as

image

One single mass parameter α fully determines the effective potential. The potential surface for α = 0.121 is shown in Figure 4.17. This α is about ten times larger than that of the actual Earth-Moon system in order to show some fine features.

Figure 4.17 is produced with Program 4.6. The program is explained in detail there. However, the block (lines 21 to 34) can be used as a template for making surface and contour plots.

The surface plot (Figure 4.17, top) shows several expected features. The potential has two holes (singularities) at the primaries, M1 at (−a, 0) and M2 at (b, 0). It also goes to −∞ at large r due the centrifugal potential −r2/2. In between, there is a broad C-shaped ridge surrounding the bigger body M1. The formation of the ridge is due to the balance of the gravitational and centrifugal potentials. As the ridge nears the other body M2, a hole is “burned” into it, and a saddle point is created between M1 and M2.

image

Figure 4.17: The effective potential of a restricted three-body system with α = 0.121. The arrows on the contours indicate the force from the potential.

The contour plot (Figure 4.17, bottom) shows that there are finer structures embedded along the ridge. There are five points where the potential is locally maximum. They are known as the Lagrange points, labeled L1 to L5.13 Three of them, L1, L2 and L3, are located on the x-axis, and the other two, L4 and L5, are off the axis but symmetrically located about it, one above and one below. On closer look, the locations of the primaries and L4 (or L5) form an equilateral triangle.

The gradient of the potential is graphically illustrated by the arrows. Since image, the arrows are proportional to the force (hence acceleration) on the test body. We see large gravitational forces around each of the primaries, as well as large centrifugal forces at large distances. Near the Lagrange points, the forces are small. Right at the Lagrange points, the forces are exactly zero. If we were to place a test body at any point L1 to L5 exactly and perfectly at rest (in the rotating system), it would remain there indefinitely. However, the Lagrange points are unstable, because forces in the neighborhood point away from them. Any slight deviation (or perturbation) would most likely lead the test body to move away. The existence of Lagrange points is a result of balance between the attractive gravitational and the repulsive centrifugal forces. Without rotation, all Lagrange points but one would vanish. Only L2, the saddle point, would remain. The effect of the potential surface is wholly dynamic.

For small α, all five Lagrange points lie close to the unit circle r = 1. While the locations of L4 and L5 can be found analytically, the locations of L1, L2 and L3 need to be solved numerically. But for α image 1, the following series expansion can be used (Exercise E4.11)

image

Because the existence of the Lagrange points are due to the balance between gravity and rotation, it might appear curious that the locations (4.62) depend on α only, and not on other parameters such as the angular velocity ω. The reasons are two-fold. First, the mass parameter α as defined by Eq. (4.59) depends on the masses M1 and M2. Because ω also depends on the masses via Eq. (4.16), α is related to ω indirectly. Second, as discussed earlier, the RTB unit system (Table 4.3) is elastic. This hides some parameters which would be explicit if we used absolute units.

4.6.3 Motion around the Lagrange points

As discussed above, with the effective potential alone, none of the Lagrange points are stable. However, we must also consider the Coriolis effect (4.56), image, when the test body is not stationary. The combination of the force from the effective potential and the Coriolis effect makes it possible to have stable periodic orbits in the neighborhood of the Lagrange points.14

Let us examine that possibility by focusing on the equipotential island surrounding L4 in Figure 4.17 (bottom). All around the island, the force from the effective potential (the arrows) points away from L4. Suppose the test body moves clockwise around the edges. On the outer edge, it will be moving to the right. Recall that image points out of the page, and the Coriolis effect, image, points inward. It is thus possible for the Coriolis effect to cancel the outward force, such that the net acceleration is toward L4. On the inner edge, the velocity is reversed. So does the Coriolis effect. The net result is the same: it counter balances the inward force from the effective potential. Because no energy is added by the Coriolis effect, image, it should be possible for the test body to move about L4 periodically with the right initial conditions. As it turns out, stable periodic motion does happen if α < 0.03852 [79].

The Trojan asteroids

Both the Earth-Moon and the Sun-Jupiter systems support stable periodic orbits. We start with an actual example for the motion of asteroids in the Sun-Jupiter system. Most asteroids in our solar system are in the so-called asteroid belt. But there are two groups of asteroids that revolve around the Sun at about the same radius and with the same period as Jupiter (Figure 4.18, left). The two groups are symmetrically located with respect to the Sun-Jupiter radial vector: one group 60° ahead and another 60° behind. They are known as the Trojan asteroids (or simply Trojans) [95]. Because their locations form equilateral triangles with the Sun and Jupiter just like the Lagrange points L4 and L5 (Figure 4.18, right), we suspect there is a connection.

image

Figure 4.18: The Trojan asteroids and their connection to the Lagrange points L4 and L5.

Though Jupiter is the most massive planet, the mass parameter for the Sun-Jupiter system is α = 0.0009542 (see Table 4.1), still well within the limit for stable orbits. If the Trojans move in clockwise orbits around L4 and L5 as indicated in Figure 4.18 (right), stable orbits can be formed.

Program 4.7 (Section 4.D) simulates stable orbits around Lagrange points. Three orbits are shown in Figure 4.19. The first orbit (top left), also the smallest, corresponds to the initial condition as given in the program. It is a stable periodic orbit with a period of about 13 time units (Jupiter orbital periods), or about 150 years (using Table 4.1). The second orbit (top right) is produced with the initial condition

image

image

Figure 4.19: The orbits of Trojan astroids near the Lagrange point L4 (top) and along the C-ridge (bottom).

It is approximately periodic and has a period of about 15 (~ 180 years). Both orbits are within the Trojan group. We have seen that Jupiter has a significant effect on the precession of Mercury because it is the most massive planet (Table 4.2). Here it shows its influence again, only this time its lasting effect is on the asteroids.

The largest orbit (Figure 4.19, bottom) goes all the way around the C-shaped ridge. Its initial condition is image, image. It appears to be periodic with a period of 33 (~ 390 years). The motion is very delicate, navigating along the equipotential lines. It does not seem to be connected to any asteroid motion at present.

As for the Earth-Moon system, although there is no evidence like the Trojan asteroids, numerical results show that stable periodic orbits do exist (see Ref. [73] and Exercise E4.12). The mass parameter is α = 0.0121, much larger than the Sun-Jupiter mass parameter but still within the limit for the existence of stable periodic orbits. Therefore, it is theoretically possible to put a satellite or space station around L4 or L5. However, with the Sun being very close and perturbing the motion, the long term stability of these orbits is questionable.

All three orbits move clockwise (image) around the potential ridge. Motion in the restricted three-body system is highly directional. Reversing the velocity of a stable periodic orbit in the restricted three-body problem results in unstable and nonperiodic motion (see Project S:P4.2). In contrast, reversing the velocity would have no effect on a Kepler orbit.

4.6.4 Orbital resonance

As viewed in the space-fixed frame where the Sun is at rest, Jupiter and the Trojan asteroids have the same orbital period. We say their periods are commensurate. We can think of Jupiter's large effect on the Trojan asteroids as a result of the commensurability, or orbital resonance. If we consider the ratio of the orbital periods, we will find that orbital resonance exists if that ratio is a low rational number. In the case of Trojans and Jupiter, the ratio is 1/1. When orbits are in resonance, there is a periodic interaction (“kicks”) between the orbits, which does not get averaged out and can lead to enhanced effects in the long run.

Trojans are not the only asteroids in resonance with Jupiter, though they are the most prominent. There is another group of asteroids known as the Hilda group which has a period ratio of roughly 2/3 to Jupiter. The Hildas are in three clusters forming a triangle about the Sun (see Project P4.7).

Here we discuss another interesting case of orbital resonance between Pluto and Neptune.15 The mass parameter of the primaries, namely the Sun and Neptune, is very small, α = 0.0000515. The ratio of Pluto's period to Neptune's is very close to 3/2 (see Table 4.1). For every three revolutions of Neptune around the Sun, Pluto makes two revolutions. Like the Trojan asteroids, the motion of Pluto is mainly determined by the Sun. However, considering the low commensurability ratio, we expect significant orbital resonance effect from the perturbation of Neptune. Also, because of Pluto's relatively high eccentricity (see Table 4.1), its orbit near the perihelion is inside Neptune's orbit (Figure 4.20, top). The question arises as to whether Pluto's orbit is stable, and if an “accidental” collision may occur between Pluto and Neptune that might knock Pluto out.

image

Figure 4.20: Orbits of Pluto in the Sun-Neptune system, α = 0.0000515, overlaid on the equipotential contours. Top: after several periods. The dotted line is the circular orbit of Neptune (viewed in a nonrotating frame). Bottom: after one half of libration (60 time units, or ~ 10,000 years).

Let us investigate these questions by running our simulation (see details in Project S:P4.3). We can run Program 4.7 as is, with a different α and initial conditions, of course. But if we combine it with Program 4.6, we can observe the orbit in relation to the potential contours and the Lagrange points, which will be helpful in understanding what is going on. All we need to do is to copy parts of the code that does the numerical integration accel() and r3body(), integrate with RK4 as usual and record the positions x and y, and plot them on the same figure as the potential contours when the integration ends. The results are displayed in Figure 4.20. The initial condition used is [48]

image

This starting position is close to L5.

The top figure shows the orbit for four Pluto periods. Starting near L5 and the perihelion, we can see that Pluto's orbit dips inside Neptune's orbit by a small amount. It is about 0.013 length units when Pluto is closest to the Sun. The length unit is the distance between Neptune and the Sun, or 30 AU from Table 4.1. That means Pluto penetrates Neptune's orbit by about 0.39 AU, or nearly 40% the orbital radius of Earth. After one Pluto period, Pluto is again closest to the Sun but at the crossover loop diagonally opposite from the starting position near L5. It takes two periods for Pluto to return to the starting position. If we look carefully at the crossover loop near L5, we find that the orbit is not closed. The loop has rotated to the left. During this time, Neptune has revolved around the Sun three times.

Letting the program run for longer times, we obtain the complete orbit shown in Figure 4.20 (bottom). We see the continued pattern of the rotation of the orbit, or precession. The precession occurs over an angle of 76°, and remarkably, it reverses direction after that, and returns to the starting position to complete the cycle, which then repeats itself. The oscillatory back-and-forth precession is also called libration [17]. Half a libration cycle takes about 60 time units, or 10,000 years, making a full libration cycle approximately 20,000 years.

We can understand the reason of the precession as follows. When Pluto is at the crossover loop nearer to Neptune, say at the Lagrange point L5, it is behind Neptune (taking counterclockwise direction as the forward). The forward pull from Neptune increases Pluto's energy slightly. As a result, its period also increases. The next time Pluto comes back (two revolutions around the Sun), it will be at a later time, and Neptune will be farther ahead, so the distance between Neptune and Pluto's perihelion (tip of the crossover loop) increases. Thus, Pluto appears to precess to the left, or rotate clockwise. In effect, Neptune repels Pluto, or more accurately the nearer loop, away. Eventually, Pluto gets ahead of Neptune at the perihelion because of the commensurate orbital periods (the other crossover loop near L4). Then the backward pull from Neptune will decrease Pluto's energy and its period, which means that Neptune will be farther back, again effectively repelling the nearer loop. The cycles continues, giving rise to back and forth oscillations, or libration. The energy also oscillates with the libration period and an amplitude of about 0.4% (see Project S:P4.3).

Because of librational motion, at the closest approach to the Sun, Pluto gets no closer than 52° to Neptune in angular separation. Of course, they do line up radially when passing each other, for example, at (1.6, 0) in Figure 4.20 (bottom). But when that happens, they are radially far apart (~ 0.6 length units, or 18 AU). As a result, if Pluto and Neptune are close radially, they are far apart in angular separation, and vice versa. Therefore, a collision between them would not occur. In this case, orbital resonance adds dynamic stability to Pluto, and Pluto will stay in its current orbit for the foreseeable future.

We may then ask, how did Pluto end up in its current orbit? It is possible that Pluto, at the time it was formed, happened to be right where it is now, locked in a stable configuration due to Neptune's perturbation. It is also possible, arguably more likely, that Pluto evolved into its current orbit over a long period of time (billions of years). There is evidence which suggests that Pluto's motion may be chaotic [88]. It may well be that we are seeing a Pluto that has been marching on its chaotic path all along.

Chapter summary

Starting with an animated motion of a planet, we briefly reviewed useful properties of central field motion and Kepler's orbits. We then discussed precession of Mercury due to corrections of the general theory of relativity. Because the effect is small, we introduced the Runge-Lenz vector as a sensitive indicator of precession. An accurate and area-preserving method, the leapfrog method with time-transformation, was implemented to simulate this process. We found an interesting effect that precession is oscillatory, not monotonic. Precession of classical origin due to other planets was also discussed within the framework of central field approximation.

We also described the radial velocity method for the detection of exoplanets. We presented two ways to model RV datasets, least square and visual fit, and applied them to observational datasets.

The planar three-body problem has been discussed, including Euler's collinear motion and several interesting choreographic solutions of gravitational systems. We studied the restricted three-body problem, and analyzed in detail the structure of the Lagrange points. Motion around the Lagrange points was simulated. We presented the application to the Trojan asteroids in the Jupiter-Sun system. We also discussed orbital resonance and the stability of Pluto in the Neptune-Sun system.

Throughout this chapter, we have applied several visualization techniques using the 3D elements of VPython and Matplotlib. We have consistently presented the results as dynamic animations or informative graphs with these techniques. They are contained in blocks of sample codes that can be used as basic templates for integrating simple but effective visualization elements into other programs.

4.7 Exercises and Projects

Exercises

E4.1 With the coordinate transformation (4.4), show that (a) the equations of motion for two bodies interacting with the internal force (4.1) are given by Eq. (4.5); and (b)* the two-body Hamiltonian image image can be reduced to image, where image image is the center of mass motion, and H is the effective one-body Hamiltonian given by image.
E4.2 Write a program to plot the effective potential of the Earth-Sun system, Eq. (4.8). Use Table 4.1 to determine the angular momentum L. Use planetary motion units. Adjust the scales so the structure near the minimum is clearly displayed.
E4.3 (a) Modify Program 4.1 to simulate the motion of a planet under the force F = −k/r2+δ. Run the program using the same initial condition as in Figure 4.4, and with δ = 0.2 and 0.5. Compare your results with Figure 4.4. Optionally, add an arrow object to the animation of the planet to indicate instantaneous velocity using the arrow() function of VPython.

(b) When δ ≠ 0, open orbits are real. However, numerical problems can cause unphysical artifacts, including open orbits that should be closed. Let us use the same program, but set δ = 0 and the initial condition to image, image (for exaggerated effect). First run it with h = 0.001, then with h = 0.004. Discuss your observations. Should we always “trust” the computer results?

E4.4 (a) Prove that the Runge-Lenz vector is a constant, i.e., image, in the inverse-square law of force (4.1).

(b) Consider an additional perturbation force, image, such that the total force is image, where image is given by Eq. (4.1). Show that the Runge-Lenz vector obeys

image

As usual, image and image are the momentum and angular momentum, respectively.

E4.5 Suppose that, instead of Ω(r) = 1/r, we choose Ω(r) = 1/r2 as the time transformation. Rewrite the corresponding equations of the leapfrog method to Eqs. (4.29a) to (4.29f). Discuss the merits and shortcomings of this time transformation.
E4.6 (a) A total mass M is uniformly distributed over a ring of radius a. A point particle of mass m is placed at a distance r from the center and in the plane of the ring. Show that the potential energy between the particle and the ring is given by Eq. (4.30).

(b) Expand the potential for r/a < 1 and r/a > 1, keeping four terms in each case. Verify Eq. (4.31), and explain why only even terms appear. You may wish to use SymPy to expand the integrand,

In [1]:  from sympy import *
In [2]:  init_printing (pretty_print=True) # neater output
In [3]:  r, x = symbols(’rho x’)
In [4]:  f=series (1/sqrt(1+r*r−2*r*cos(x)), r, 0,7) # expand to 7th

Inspect f, then integrate x ∈ [0, 2π] in SymPy (see Exercise E2.7).

(c) Compute the value Mp/a3 for each planet in Table 4.2 using the parameters in Table 4.1. Plot precession vs. Mp/a3 on linear scales. Compare with Figure 4.8 and discuss the differences.

E4.7 (a) Obtain from Eq. (4.35) a relation similar to Eq. (4.36) but with m sin i given in Jupiter masses, T in days, M in solar masses, and V in m/s.

(b) Carry out the algebraic details to prove Eq. (4.39) from (4.37).

(c) Verify Eq. (4.79), and reduce it to Eq. (4.80) using conservation of angular momentum (4.6) and Kepler's third law (4.18).

E4.8 (a) Solve Eqs. (4.44) to (4.46) to obtain Euler's quintic equation (4.47).

(b) Write a program to plot Eq. (4.47) for a few sets of masses, say [m1, m2, m3] = [1, 1, 1] and [1, 2, 3]. How many positive roots are there in each case? Numerically solve for the positive root(s) in each case using either the bisection or Newton's methods discussed in Chapter 3.

E4.9 (a) The periodic orbit shown in Figure 4.14 is unstable but reversible. First find its period. One way to do so is to add a text box to Program 4.5 using the label() function of VPython, see Program 4.3 for an example. Output the time information, and record the period T when the three bodies return to their initial positions (4.51). To make it easier, you can pause the program by intercepting key presses with scene.kb.keys and scene.kb.getkey(). The system should start to come apart after roughly two periods. Wait until the bodies are well off their orbits, and reverse the velocities of all three bodies. This may be done as a conditional statement based on time or by detecting certain key strokes. You should observe that the bodies retrace their paths and go back to the initial positions in the same amount of time.

(b) The figure-8 orbit shown in Figure 4.15 is stable. It means that if we start the motion from a slightly different initial condition, the orbit will remain close to the original orbit. Verify that this is true. Run Program 4.5 with the initial condition (4.52). Next change the initial condition by a small amount, say image, and run the program again. Finally, repeat with image. Explain your observations.

E4.10 Make a table similar to Table 4.4 showing the units of various quantities in the restricted three-body units and in the absolute units for the Neptune-Sun system. You may need the data from Table 4.1.
E4.11 (a) Set up the equations for the Lagrange points where ∇V = 0 from Eq. (4.61). Solve these equations to obtain the lowest order expansions for the collinear ones L1, L2 and L3 and the exact expressions for L4 and L5. Show that they agree with Eq. (4.62).

(b) Write a program to solve the equations you obtained in part (a) for the collinear Lagrange points L1, L2 and L3. Use the Earth-Moon system as an example. Compare the numerical results with the series expansions.

E4.12 The Earth-Moon system supports stable periodic orbits around the Lagrange points L4 and L5. Explore these orbits with the following initial conditions,

image

(a) For each orbit, find the period, and estimate its length along the arc and its width where it is widest. Convert them to absolute units. From your estimates, find the approximate area of the smaller orbit. If that area were to be colonized, what would be the population density if the entire population on Earth (7 billion) were to be moved? Compare it with the current population density.

(b) Check the stability of the orbits by varying the initial positions slightly, say to ±10%. You may also play around with the velocities. Refer to [73] for a general strategy to finding initial conditions of periodic orbits.

Projects

P4.1 (a) The artificial precession as observed in Exercise E4.3 above could be eliminated by using a smaller h, which would lead to slower program speed and more round-off error. Though speed is not a problem in this case, it could be crucial in more complex situations. A better choice is to use a leapfrog method with time transformation. Repeat part (b) of Exercise E4.3 with leapfrog_tt(). Remember to initialize W0 before entering the loop (see Program 4.3). Try different step sizes. You should see that, no matter how large h is, there is no precession. Explain why.

(b) Perform checks to make sure that the program works correctly and the oscillations in Figure 4.7 are not numerical artifacts. First, modify Program 4.3 to calculate and record the energy and angular momentum in the main loop. Ignore mass since it is an overall scale factor (see Eq. (4.86)), and use a large λ ~ 10−2 for exaggerated effects. It is best to define a separate function for energy. Run the program for t < 10, and plot the energy and the z-component (Lz) of angular momentum as a function of t. Make sure your potential is correct.

To get a better view of the fluctuations, plot the relative error |E(t)−E0|/|E0| and |Lz(t) − L0|/L0, where E0 and L0 are the initial values computed before the loop. The output should be analogous to Figure 2.7. Are they conserved as expected?

(c) On the precession figure, use the zoom-in feature to expand the scale so the oscillations are clearly visible. Measure the amplitudes and periods. Repeat the simulation by doubling and halving h. Check whether the amplitudes or the periods change.

Perform the same checks by changing the sign of λ, i.e., enter the number −1.1 × 10−8 when prompted. Does the direction of precession change? Describe your observations and conclusions.

P4.2 Though Mercury has the largest precession due to general relativity, other planets also experience this effect to a lesser degree. For example, the parameter for Venus is λ = 2.1 × 10−8 AU2 (see Eq. (4.19)). Change Program 4.3 accordingly to calculate the precession of Venus per century due to relativistic correction. Refer to Table 4.1 for the initial condition at the aphelion. Plot the results in a similar fashion to Figure 4.7. Note the amount of precession and the amplitude and the period of oscillations. Expand the horizontal scale to observe the oscillations. They should be sinusoidal, so count the period carefully (two crests, for example).

For Earth, the parameter is λ = 2.9 × 10−8 AU2. Based on the above results for Venus and for Mercury (Figure 4.7), make a prediction about the amount of precession and the period of oscillations we would expect. Write down your predictions. Repeat the simulation for Earth. How do the results compare with your predictions? Briefly explain.

Compare the results for Venus and Earth with Mercury. The parameters λ for Venus and Earth are larger than for Mercury by a factor of 2 and 3, respectively. Why are the results not proportional to λ? Also discuss the differences in the amplitudes and periods of the oscillations. Explain why the oscillations are sharper (more sinusoidal) for Venus and Earth than for Mercury. Offer any other observations you may have.

P4.3 As we have discussed, the main contribution to the precession of Mercury is from other planets. This amount must be subtracted from the total precession in order to find the contribution from general relativity.

(a) Calculate the precession due to each planet in the central field approximation using the force (4.32) with the parameters from Table 4.1. Reproduce the results of Table 4.2. Make sure your results are converged with respect to the step size h. One way to check for convergence is to run the simulation with h = 0.002, for example, and then reduce it by half to h = 0.001. The results should agree to with certain error you set, say 1% for instance.

(b) Observe that the net precession is counterclockwise, which is in the same direction for the relativistic case. However, the force (4.32) in the central field approximation is repulsive, while the relativistic effect (4.19) is attractive. Investigate why forces of opposite signs produce precession in the same direction, because only then can we add them up. Do this by switching on the animation, and watch carefully how the Runge-Lenz vector swings in relations to where Mercury is in the orbit. Explain your observations. The results in Exercise E4.4 may help.

P4.4 If the force on a planet does not obey the inverse-square law, even for only a part of the trajectory, the orbit is open and will precess. Let us investigate this effect by modeling the Sun as a uniform sphere of radius R instead of a point source. If the planet is outside the sphere, the force is the usual gravity. But inside the sphere, the force will change to a form different from 1/r2.

(a) Show that the gravitational potential and force between a point mass m and a uniform sphere of radius R and mass M are given by

image

(b) Modify the force in mercury() in Program 4.3 according to the expression above. Set R = 0.3, leave everything else the same and run the program. Does the Runge-Lenz vector move? Why?

(c) Compute the perihelion distance of Mercury rmin from Eq. (4.14). Set R just above rmin and run the program. Does the Runge-Lenz vector move now? Experiment with R values slightly above rmin and determine the value that produces the same precession (43″) as the relativistic effect. Discuss your findings. Does it surprise you?

(d) Let us have fun making a Runge-Lenz clock. With the same initial conditions, find the value of R such that the hour hand (Runge-Lenz vector) ticks exactly 12 times in a full circle. Alternatively, you can achieve the same effect by varying the eccentricity of the orbit while keeping R fixed. Set R = 0.2 and vary the initial vertical velocity vy. Find the value of vy when the hour hand moves 12 times in one revolution. What would be the eccentricity of the corresponding Kepler orbit?

P4.5 Simulate the wobbling motion of a star-planet system with animation of the two-body problem, and discover a mystery planet.

(a) With Program 4.1 as a basic template, add the Sun as a movable object. Do not include the Sun as a dynamic body in the numerical integration. We still assume an effective one-body problem. We only need to obtain the positions of the Sun and the planet (image and image in Figure 4.2) in the center of mass (CM) from the relative planet position stored in r, which is already available in line 26 of Program 4.1.

Assume image = 0, and solve Eq. (4.4) for image and image in the CM (see Exercise E4.1). Animate the Sun and the planet by updating their positions in the CM. Make sure the modified code runs correctly for the Sun-Earth system.

(b) Note that due to the large Sun-Earth mass ratio, the Sun barely moves. Now change the mass of the planet, say 0.4 solar mass. Run the code again and observe the visible wobbles. You may also need to change the initial conditions depending on the mass ratio.

(c) Plot the radial velocity of the Sun, v*z, in the actual Sun-Earth system similar to Figure 4.9, assuming edge-on view. Discuss the results, such as the shape and magnitude of the curve.

(d) Make your own mystery planet by assuming certain mass, say anywhere from 1 to 10,000 Earth mass, and initial condition (For added challenge, choose your initial condition such that the orbit has a high eccentricity). Run your program and generate an RV dataset accordingly. Exchange your dataset with another classmate (or team), and try to visually fit the dataset according to Eq. (4.34). Calculate the planet mass from your fit. Compare your value with the value your classmate used to generate the dataset. Do they match? Why or why not?

P4.6 A subset of the radial velocity dataset for HD 3651 plotted in Figure 4.11 is given in the table below.

Table 4.5: Radial velocity (m/s) vs. time (day) for HD 3651.

image

The star has 0.8 solar masses, and the wobbling period is assumed to be 62 days. The data points were observations from Keck Observatory spread over the years. They are converted (phased) to fall within one period.

(a) Follow the procedure outlined in Section 4.4.2 to generate a visual fit similar to the curve shown in Figure 4.11. Use Program 4.4, but turn off least square fit by commenting out line 38 and set time shift to 0 (line 27). Vary V, e, ω, and C but keep T and time shift fixed. As the parameters are being adjusted, watch the effect of each parameter, and try to isolate them to achieve a better match. Once the curve takes the shape of the dataset, adjust the parameters separately and in small steps to visually fine tune the fit, focus on the shape and ignore an apparent horizontal shift for now. Describe the effect of each parameter.

(b) You should see that the fitted curve is shifted from the data, e.g., the dip should be at a different location, even though the overall shapes match very well. If you would just shift your curve left or right, it would look quite like the fit in Figure 4.11. Explain the physical reason for the shift. Adjust the time shift to get the best fit. Write down the parameters, and calculate the lower limit of the exoplanet's mass, in Earth and in Saturn masses. Compare with observed values [30].

(c) Run Program 4.4 in full to obtain a least square fit. Compare the best results between visual and automatic fits. Optionally, switch to the reduced dataset of Table 4.5 or the self-generated dataset from Project P4.5, and discuss any difference in the fit.

P4.7 Similar to the Trojans, there is another group of asteroids known as the Hildas whose motion around the Sun is heavily influenced by Jupiter. The Hildas (Figure 4.18) do not move around the Lagrange points L4 or L5. Rather, like Pluto, they are influenced by orbital resonance with Jupiter. The Hildas have a period ratio of roughly 2/3 to Jupiter.

(a) Explore the motion of the Hilda asteroids with the following initial condition

image

Find the period of motion. First plot the orbit in the rotating frame, then plot it in the nonrotating space frame where the Sun is at rest. You would need to make a coordinate transformation from the rotating frame to the space frame using the rotation matrix (4.74). Compare the orbits between the frames.

(b) Normally the orbit would also have a librational motion. The following initial condition will show substantial libration,

image

Run the program for 10 time units. Note the angles of libration. Modify the initial condition slightly, and describe how the librational motion changes.

4.A Rotating frames and rate of change of vectors

Consider the coordinate systems of a space-fixed reference frame and a reference frame rotating at constant angular velocity ω about the common z axis. Let the coordinates be (x, y) and (x′, y′) in these reference frames, respectively, as shown in Figure 4.21. We assume that at t = 0 the axes (e.g., x and x′) coincide, so the angle of rotation is θ = ωt at later times.

image

Figure 4.21: The space reference frame and the rotating reference frame.

From Figure 4.21, the relationship between the primed unit vectors in the rotating frame and the unprimed ones in the space frame can be written as

image

Because of rotation, the primed unit vectors î′ and ĵ′ change with time. By differentiating the above equation with the help of /dt = ω, the rate of change is

image

Now, let us consider a position vector image in the rotating frame with components x′ and y′. The same vector in the space frame will be denoted as image. Since we are talking about the same vector, only different notations, we have

image

To find the rate of change, we differentiate both sides simultaneously

image

The left side refers to the rate of change in the space frame. The first two terms on the right hand side are the rate of change due to the change of coordinates x′ and y′ as measured in the rotating frame, and the last two terms are due to the change of the primed unit vectors. Let us denote this more clearly by rewriting Eq. (4.65) as

image

where imagespace is the velocity in the space frame image, and image image the velocity in the rotating frame image. We have also used Eq. (4.64). We can write the second term in Eq. (4.66) as a vector product by introducing image. This leads to a more compact form

image

or equivalently and in a more familiar form,

image

In deriving Eq. (4.67), we have used the position vector as an example and restricted the angular velocity in the z direction. It is actually valid for an arbitrary vector and angular velocity. The more general rule is

image

Equation (4.69) should be read this way: the derivative of a vector in the space frame is equal to the derivative of the (same) vector in the rotating frame plus the cross product of the angular velocity and the vector. This is a very useful rule.

For instance, suppose we wish to calculate acceleration from Eq. (4.68). We have

image

Applying Eq. (4.69) to each of the two terms on the right hand side, we have

image

We have used image and image. Substituting them into Eq. (4.70) and using the fact that image is the acceleration in the rotating frame, we obtain the relationship for image and image as

image

Let image be the net force on a particle of mass m. The equation of motion in the space frame (inertial) is image. Expanded in the rotating frame (noninertial), it becomes

image

Besides the actual force, this equation has two additional force-like terms. The velocity-dependent term, image, is the Coriolis effect, and the other term, image, is the centrifugal force.

4.B Rotation matrices

Sometimes it is necessary to transform the coordinates from the rotating frame to the space frame. This can be done using (x, y) = image and Eq. (4.63). The results may be expressed conveniently in the form of a rotation matrix as

image

The inverse transformation is

image

These rotation matrices work on any vectors, not just position vectors.

Denoting the rotation matrix by A, we can write Eq. (4.74) as

image

Note that we are careful with the notation image rather than image. The reason is that the transformation has dual interpretations. Here, we are following the interpretation that the operator A transforms the components of the vector in the space frame (unprimed) into the components of the same vector in the rotating frame (primed). In other words, A is interpreted to act on the coordinate system, the vector itself is unchanged, and only the components are transformed from the unprimed frame to the primed frame which is rotated counterclockwise by an angle θ.

The second interpretation is that the operator A acts on the vector image, transforming it into a new vector image, both in the same reference frame. The new vector represents a clockwise rotation of the original vector by an angle θ. We would represent this operation as image. Both interpretations involve identical mathematical operations. In the current context, we follow the first interpretation for convenience, i.e., the operator A relates the components of the same vector between rotated coordinates.

In three dimensions, the rotation matrices about the x, y, and z axes follow straightforwardly from Eq. (4.74),

image

The inverse transformation can be obtained by changing the sign of the angle θ → −θ, because a rotation by an angle θ is exactly canceled by a reverse rotation by −θ, resulting in no change (the identity transformation). If image represents the inverse transformation, we can write image, and image, i = x, y, or z.

Successive rotations can be represented by a product of rotation matrices. For example, a rotation of α about the x-axis followed by a second rotation of β about the z-axis can be written as

image

The order is important for finite rotations, and the final matrix is built from right to left in the order of rotations. The inverse matrix is image image.

4.C Radial velocity transformation

Our goal is to transform the velocity in the orbital plane from the center of mass frame to the space-fixed frame where observation is made. As Figure 4.3 shows, the relative position in the orbital plane is

image

Using Eq. (4.13), the velocity components can be obtained as,

image

With the help of Eqs. (4.6) and (4.12), being careful to replace m by reduced mass μ, and using the exact form of Kepler's third law (4.18), we can reduce the orbital (relative) velocity to

image

where, as before, T is the period, a the semimajor axis, and e the eccentricity.

Let image and image denote the velocities of the planet and the star in the center of mass, respectively. Then image. Solving for image, we have

image

It is identical to Eq. (4.33) except for the primed notation which will be convenient for the transformation below. Substituting Eq. (4.80) into (4.81), we obtain the wobbling velocity of the star in the center of mass frame

image

Next, we need to transform the wobbling velocity from the center of mass frame (primed) to the space-fixed frame (unprimed). This can be done conveniently by a rotation matrix. As Figure 4.10 illustrates, the orbit orientation is the result of two successive rotations. Imagine the aphelion (x′-axis) and the normal (the image vector, or z′-axis) of the orbital plane are initially aligned with X and Z, respectively. The final orientation of the orbit can be obtained as: a first rotation by an angle i about the x′-axis, and a second rotation by an angle ω about the z′-axis. The rotation matrix follows from Eq. (4.77), A = Az(ω)Ax(i). Recall that A will transform a vector from unprimed frame (space) to the primed frame (center of mass). What we need is the inverse transformation from the center of mass frame to the space frame, i.e., image. Using the rotation matrices (4.76), we have the inverse transformation

image

Transforming the velocity vector in Eq. (4.82) by A−1, we obtain the velocity of the star in the space-fixed frame

image

This is the desired result. We pick up a Z component in the process because the orbit is tilted due to the inclination angle. The inclination angle i = 90° corresponds to the edge-on view, and i = 0° the face-on view.

We can make two extensions to the result. First, if the center of mass is moving with velocity image, we must add it to image. Second, if the star has multiple planets, and if planet-planet interaction is negligible,16 then the total wobbling velocity is a vector sum of contributions from all the planets. For example, for the Z component v*z of a star with N planets, we have from Eq. (4.84)

image

where MT = M + Σj mj is the total mass, and C = VCM,z is the velocity of the center of mass along Z. Equation (4.85) can be used to fit the Doppler velocity profile to obtain the orbital parameters.

4.D Program listings and descriptions

Program listing 4.3: Precession of Mercury (mercury.py)

import ode, numpy as np # get ODE solvers, numpy   2 import visual as vp # get VPython modules for animation import matplotlib.pyplot as plt # get matplotlib plot functions   4 def mercury(id, r, v, t): # eqns of motion for mercury   6 if (id == 0): return v # velocity, dr/dt s = vp.mag(r)   8 return −GM*r*(1.0 + lamb/(s*s))/(s*s*s) # acceleration, dv/dt 10 def set_scene(r): # r = init position of planet # draw scene, mercury, sun, info box, RungeLenz vector 12 scene = vp.display(title =’Precession of Mercury’, center=(.1*0,0), background=(.2,.5,1)) 14 planet= vp.sphere(pos=r, color =(.9,.6,.4), make_trail=True, radius=0.05, material=vp.materials.diffuse) 16 sun = vp.sphere(pos=(0,0), color=vp.color.yellow, radius=0.02, material=vp.materials.emissive) 18 sunlight = vp. local_light (pos=(0,0), color=vp.color.yellow) info = vp.label(pos=(.3, −.4), text=’Angle’) # angle info 20 RLvec = vp.arrow(pos=(0,0), axis=(−1,0,0), length = 0.25) return planet, info, RLvec 22 def go(animate = True): # default: True 24 r, v = np.array([0.4667, 0.0]), np.array ([0.0, 8.198]) # init r, v t, h, ta, angle = 0.0, 0.002, [], [] 26 w = 1.0/vp.mag(r) # W0 = Ω(r) 28 if (animate): planet, info, RLvec = set_scene(r) while t<100: # run for 100 years 30 L = vp.cross(r, v) # image A = vp.cross(v, L) − GM*r/vp.mag(r) # scaled RL vec, Eq. (4.86) 32 ta.append(t) angle.append(np.arctan(A.y/A.x)*180*3600/np.pi) # arcseconds 34 if (animate): vp.rate(100) 36 planet.pos = r # move planet RLvec.axis, RLvec.length = A, .25 # update RL vec 38 info.text=’Angle“: %8.2f’ %(angle[−1]) # angle info r, v, t, w = ode.leapfrog_tt(mercury, r, v, t, w, h) 40 plt.figure () # make plot 42 plt.plot(ta, angle) plt.xlabel(’Time (year)’), plt.ylabel(’Precession (arcsec)’) 44 plt.show() 46 GM = 4*np.pi*np.pi # G*Msun # lamb=relativistic correction, global, used inmercury() 48 lamb = input(’Please enter lambda, eg: 0.01, or 1.1E-8 :> ’) go(animate = True) # set to False to speed up calc. for plots

The equations of motion due to the relativistic correction (4.19) are computed by mercury(). It uses vector concepts and is nearly identical to earth() in Program 4.1, with the only difference in the correction factor 1 + λ/r2. Also, the animation scene is contained in a standalone function set_scene().

The first block in the main program go() initializes the position and velocity for Mercury according to Table 4.1, as well as W0. If animate is true, the simulation will set up the Mercury-Sun system by calling set_scene() which draws the scene, including an arrow representing the Runge-Lenz vector plus a text box (label) that will display the angle of precession. In each iteration of the main loop, the scaled angular momentum and Runge-Lenz vectors are computed as

image

By this scaling, mass drops out. The angle of precession is found by arctan(Ay/Ax) and converted into arcseconds from radians. We use full vector operations provided by VPython for image and image. Note that the components of a VPython vector such as image can be accessed by index or subscript, e.g., A[0] is the same as A.x.

Next, animation is effected as necessary. This involves changing the Mercury position and updating the direction of the Runge-Lenz vector. The current precession angle (angle[-1]) is converted to a float string17 (line 38) and displayed in the text box. Lastly, the integrator leapfrog_tt() advances the system forward by one step h, in transformed time s. Upon exiting the main loop, the results are displayed in a graph.

Program listing 4.4: Radial velocity data modeling (rvfit.py)

import numpy as np # get numpy   2 import matplotlib.pyplot as plt # get plot functions from scipy.optimize import leastsq # least square fit   4 def rv(V, e, omega, C, theta): # radial velocity   6 return −V*(np.cos(omega + theta) − e*np.cos(omega)) + C   8 def nearest(a, b): # find indices of neareast differences diff = np.subtract.outer(a, b) # find diff : a=[], b=[] or scalar 10 return np.argmin(np.abs(diff), 0) # nearest index 12 def time_theta(e, tshift, fit = True): # calc time and theta psi = np.linspace (0., 2*np.pi, 200) # psi grid 14 t = (psi+e*np.sin(psi))/(2*np.pi) + tshift # Kepler eqn over, under = t>1.0, t<=1.0 # truth arrays 16 t = np.concatenate((t[over]−1, t[under])) # wrap around theta = np.arccos((e+np.cos(psi))/(1+e*np.cos(psi))) # calc theta 18 theta[psi>np.pi] = 2*np.pi−theta[psi>np.pi] # remap to [0,2*pi] theta = np.concatenate((theta[over], theta[under])) # wrap around 20 idx = nearest(t, time) # index of data points return (t[idx], theta[idx]) if fit else (t, theta) 22 def error(p, v, tshift): # error function for leastsq 24 t, theta = time_theta(p[e], tshift) return v − rv(p[V], p[e], p[omega], p[C], theta) 26 T, tshift = 62.23, 0.38 # T=period (day), expt. with time shift 28 time, vel, err = [], [], [] with open(’hd3651.txt’, ’r’) as file: # read HD 3651 dataset 30 for line in file : if line.strip () and line.strip ()[0]!= ’#’: # not blank/comment 32 t, v, er = eval(line) # comma separated fields time.append(t), vel.append(v), err.append(er) 34 time, vel = np.array(time)/T, np.array(vel) # scaled time 36 p = [10., 0.5, 1., 1.] # initial guess: [V, e, omega, C] V, e, omega, C = range(4) # para labels [03] for easy ref 38 p, flag = leastsq(error, p, args=(vel, tshift)) # Go fit 40 t, theta = time_theta(p[e], tshift, 0) # calc fitted results vfit = rv(p[V], p[e], p[omega], p[C], theta) 42 plt.figure () 44 plt.errorbar(time, vel, err, fmt=’o’) # data and fit plt.plot(t, vfit, lw=2) 46 plt.xlabel(’$t/T$’), plt.ylabel(’Radial velocity (m/s)’) plt.text (0.10, −30, ’HD 3651’) 48 plt.ylim(−40, 30), plt.show() # set ylim

The purpose of this program is to model radial velocity (RV) datasets. Starting with a set of parameters, the overall strategy is: compute the radial velocity over a time grid, match it with the nearest observation points, find the error at these points, and input the error to a least square fitting routine which repeats the process until it hopefully converges to an optimal set of parameters.

The main program starts (line 27) by setting the period T and a time shift tshift (change the value to see its effects, see below). The period is not treated as a free parameter, and the time shift is chosen manually. We do so to reduce the parameter space, which is still considerable (four, see Eq. (4.34)).

The next block reads in the RV dataset from a file. The file is opened with with…as (line 29), a handy Python construct that automatically cleans up after operations within the block (e.g., closing the file in this case). For each line in the file, after being stripped of white space, if it is not blank (zero length) or a comment (“#” as the first character), eval() is called to parse the data fields assumed to contain three comma-separated values, namely time, velocity, and error bar, all added to the respective lists. After processing the file, the time and velocity lists are converted to ndarrays, time and vel respectively, for vector operations throughout. Time is also scaled so it is between 0 and 1.

As the initial guess, the parameters [V, e, ω, C] from Eq. (4.34) are assigned to a list and indexed for easy reference (e.g., p[e] instead of p[1] to avoid confusion). We are ready now to enter leastsq, a least square routine from SciPy, which requires a user-supplied function computing the difference between the model and the data, an initial guess, plus optional parameters (such as velocity and time shift). We name this function error().

Upon entering error(), the first function called is time_theta() which accepts as arguments the eccentricity, time shift, and a boolean variable (default true) indicating fitting or evaluation. The logic of this function is a bit more subtle than usual (and it may take a little digging to understand it), but its purpose is clear: to match a pre-generated time grid with the nearest data points for error computation later. We use the NumPy function, linspace(start, end, num), to generate a 1D grid over ψ. It returns an array of num evenly spaced points between [start, end] inclusively ([0, 2π] in this case). Using Kepler's equation (4.39), the time grid t is created from array psi in element-wise operations. Here, it is necessary to shift time by a trial amount tshift because the starting time in the exoplanet orbit is unknown. To reduce the fitting complexity, we keep this parameter manually adjusted as stated earlier (see Project P4.6).

Once shifted, some points will be over the maximum time 1, so they need to be wrapped around. This is done in line 16 via np.concatenate to combine the two halves of array t. The first half of the original array is found by t[over]. The condition over = t>1.0 yields a NumPy truth array whose elements are true if the elements of t are greater than 1 (hence we subtract 1 before wrapping) and false otherwise. This truth array is then used to take only true elements with advanced indexing (see Section 1.D). Similarly, the second half is found by t[under] with under = t<=1.0.

Likewise, the theta (θ) grid is created from ψ via Eq. (4.40). Because arccos is multivalued, θ thus computed will be in the range [0, π] for 0 ≤ ψ < π, and in [π, 0] for πψ < 2π. Since both θ and ψ should vary over the same range [0, 2π] (see Eq. (4.40)), we need to remap the second half of θ correctly. We do this in the same way as for t above, replacing the respective condition with psi>np.pi, and remapping the second half to [π, 2π] by subtracting itself from 2π. Finally, the θ values are wrapped around like time t above, so they are synchronized with each other.

Now, we need to match time t nearest to data points time so as to compute the difference at approximately the same (orbital) time. For this task, we define nearest(a,b) which accepts a as a 1D array and b as either a 1D array or a scalar, and returns the indices of the elements of a that are nearest to the elements of b. For example,

In [2]:   nearest ([1., 2., 3., 4.], [1.2, 2.7])
Out[2]:  array([0, 2])

The pair of numbers in b are closest to the first and the third elements of a, respectively, so the returned index array is [0, 2].

The function nearest() uses the NumPy outer method, which turns most functions to work in an outer-product manner (see Program 8.4 for the outer function). Here (line 9), the np.subtract function modified by the outer method computes the difference between every possible pair of elements in t and time in such a way that a 2D array is formed such that diff[m,n]=t[m]-time[n]. On the next line we locate the indices of the nearest data points using np.argmin which returns the indices of the minimum absolute differences along axis 0 (down a column). This basically amounts to a table lookup. On return from nearest(), the variable idx now contains the indices of t closest to the data points time. Lastly, depending on the fitting flag in the inline if-else statement being true or false, only the indexed or all values of time and θ are returned. The false condition should be used after a successful fit to evaluate the full results.

Back to the error() function, we can now calculate the difference between the velocity data and the model with the function rv() according to Eq. (4.34) using the fit parameters. The difference, an array of length equal to the number of data points, is passed to leastsq for further optimization.

Assuming a successful fit, we calculate the results of our model using the fitted parameters. The data and the fit are plotted, with error bars and smooth curves, respectively (see Figure 4.11). The y-axis limit is set manually (line 48).

The combination of the table-lookup strategy and the least square routine leastsq seems to be stable, and should work well for moderately elliptic orbits. It can become inadequate if the eccentricity is high. In such cases, it may be better to solve Kepler's equation (4.39) to obtain ψ at each data point exactly.

Program listing 4.5: Three-body motion (3body.py)

import ode, rootfinder as rtf # ode, root solvers   2 import visual as vp, numpy as np # VPython, numpy   4 def threebody(id, r, v, t): # Eqns of motion for 3body if (id==0): return v # return velocity array   6 else: # calc acceleration r12, r13, r23 = r[0]−r[1], r[0]−r[2], r[1]−r[2]   8 s12, s13, s23 = vp.mag(r12), vp.mag(r13), vp.mag(r23) a = [−m2*r12/s12**3 − m3*r13/s13**3, # image, Eq. (4.42) 10 m1*r12/s12**3 − m3*r23/s23**3, m1*r13/s13**3 + m2*r23/s23**3] 12 return np.array(a) # return accel array 14 def quintic(x): # Eulers quintic equation, Eq. (4.47) return −m1−m2 + x*(−3*m1−2*m2 + x*(−3*m1−m2 16 + x*(m2+3*m3 + x*(2*m2+3*m3 + x*(m2+m3))))) 18 def dquintic(x): # derivative return −3*m1−2*m2 + x*(2*(−3*m1−m2) + x*(3*(m2+3*m3) 20 + x*(4*(2*m2+3*m3) + x*5*(m2+m3)))) 22 def init_cond(scale): # collinear initial condition r, v = np.zeros ((3,2)), np.zeros ((3,2)) # y = [image], same for v 24 x = rtf.newton(quintic, dquintic, 1.,2. e−16) # solve for λ a = (m2+m3−m1*(1+x+x)/((x*(1+x))**2))**(1./3.) 26 r[1,0] = (m1/(x*x)−m3)/(a*a) # nonzero x only 28 r[0,0] = r[1,0]−x*a r[2,0] = −(m1*r[0,0] + m2*r[1,0])/m3 # CoM at 0 30 v[0,1], v[1,1] = scale*r [0,0], scale*r[1,0] # nonzero Vy only v[2,1] = −(m1*v[0,1] + m2*v[1,1])/m3 # CoM at rest 32 return r, v 34 def set_scene(R, r): # create bodies, velocity arrows vp.display(title =’Three-body motion’, background=(1,1,1)) 36 body, vel = [], [] # bodies, vel arrows c = [(1,0,0), (0,1,0), (0,0,1), (0,0,0)] # RGB colors 38 for i in range(3): body.append(vp.sphere(pos=r[i],radius=R,color=c[i],make_trail=1)) 40 vel.append(vp.arrow(pos=body[i].pos,shaftwidth=R/2,color=c[i])) line, com = vp.curve(color=c[3]), vp.sphere(pos=(0,0), radius=R/4.) 42 return body, vel, line 44 def run_3body(scale): t, h, ic, cycle, R = 0.0, 0.001, 0, 20, 0.1 # anim cycle, R=obj size 46 r, v = init_cond(scale) body, vel, line = set_scene(R, r) # create objects 48 while True: vp.rate(1000) 50 r, v = ode.leapfrog(threebody, r, v, t, h) ic = ic + 1 52 if (ic % cycle == 0): # animate once percyclefor i in range(3): # move bodies, draw vel, path, lines 54 body[i]. pos = r[i] # bodies vel [i].pos, vel [i].axis = body[i].pos, v[i] 56 vel [i].length = R*(1+2*vp.mag(v[i])) # scale vel vector line.pos = [body[i].pos for i in [0,1,2]] # lines 58 m1, m2, m3 = 1., 2., 3. # masses, global 60 run_3body(scale = input(’enter scale, eg 0.7 :> ’))

The heart of the program is threebody() which returns the equations of motion of the coplanar three-body problem, Eqs. (4.41) and (4.42). It uses the same vector concept as in earth() of Program 4.1. There are three bodies, so r and v are 3 × 2 arrays (line 23) holding two-component position and velocity vectors, respectively, of the three bodies. For instance, the position vectors are stored as r = [[x1, y1], [x2, y2], [x3, y3]], so r[0] = [x1, y1] gives the position vector of body 1, and r[2, 1] = y3 gives the y-component of body 3. This simplifies the calculation of acceleration, which again takes the algebraically written form of Eq. (4.42), and at the same time satisfies the requirement of the leapfrog integrator. We have also used Newton's third law with image.

The next two functions, quintic() and dquintic() return the quintic equation (4.47) and its derivative. They are used for finding the root λ by Newton's method, which is particularly suited for our purpose here because it stably converges to the only root faster than the bisection method, and does not require an initial bracket.

The initial condition is calculated in init_cond(). After initializing the position and velocity vectors as 3 × 2 NumPy arrays described above, it goes on to find λ, as well as a. Because the three bodies are initially on the horizontal axis rotating about the center of mass, all vertical positions and horizontal velocities are zero. The nonzero components are calculated from Eqs. (4.49) and (4.50). The parameter ω is omitted and defaults to 1 without loss of generality. We introduce a scale factor, scale, which basically controls the energy and the shape of the ellipse. When scale=1, the orbits are circular. Too small, the ellipses are very elongated; and too large, the motion becomes unbound. A useful range is between 0.5 and 1.3. Note that the y velocity component of body 3, v[2,1], is set more accurately assuming the center of mass at rest.

The main function run_3body() takes the input scale, and obtains the initial condition. It calls set_scene() which creates the three bodies, velocity vectors as arrows, all appended to the respective lists, and the line connecting the bodies. In the main loop, leapfrog() is used to integrate the motion. Rather than animating the motion after each step during which the bodies move only slightly, the scene is updated every cycle number of steps, controlled by the counter ic whenever ic modulus cycle is zero. Animation is updated by changing the current positions of the bodies (line 54), as well as the position, direction, and the length (proportional to speed) of the velocity arrows. The lines connecting the bodies are redrawn by setting the points in the curve to the bodies’ positions (line 57). Lastly, the masses, m1 : m2 : m3 = 1 : 2 : 3, are set as global variables because they are used in several functions.

Program listing 4.6: Plotting the effective potential (r3body_veff.py)

 import numpy as np                                                 # get numpy functions
  2 import matplotlib.pyplot as plt                               # get matplotlib plot functions
 from mpl_toolkits.mplot3d import Axes3D           # for surface plots
  4
 def potential(x, y):       # returns effective potential, without 4piˆ2
  6       r1 = np.sqrt((x+a)*(x+a)+y*y)         # use np.sqrt for array operations
       r2 = np.sqrt((x−b)*(x−b)+y*y)
  8       V = −(1.0−a)/r1 − a/r2 − 0.5*(x*x+y*y)
       return np.maximum(V, −4.0)          # low cutoff value
10
def makeplot():
12      n, s = 201, 5                                       # grid points and stride
      x = np.linspace(−1.5, 1.5, n)             # same x,y grids
14      x, y = np.meshgrid(x, x)                    # make meshgrid, ie, 1D −> 2D

16      V = potential(x, y)                            # compute V,grad(V)
      Fy, Fx = np.gradient(−V)                 # swap Fx, Fy since V[i,j]=V[x,y]
18      big = Fx*Fx + Fy*Fy > 0.003          # truth array for A[i, j] >.003
      Fx[big], Fy[big] = 0, 0                    # cut off large values
20
      fig = plt.figure ()        # add surface plot with strides and color map
22      axis=fig.add_subplot(111, projection=’3d’)   # add subplot
      axis.plot_surface (x, y, V, rstride=3, cstride=3,
24                                   linewidth=0, cmap=plt.cm.spectral)
      axis.set_xlabel (’x’), axis.set_ylabel (’y’), axis.set_zlabel (’V’)
26
       plt.figure ()                      # draw contours and arrows

28      plt.subplot(111, aspect=’equal’)         # square picture
       plt.contour(x, y, V, 26)                            # 26 contour lines
30      plt.xticks ([],[]), plt.yticks ([],[])            # omit ticks

32      # draw arrows on strided grid to space them out, via array slicing
       plt.quiver(x [:: s ,:: s], y [:: s ,:: s], Fx[:: s ,:: s], Fy[:: s ,:: s],
34                       width=0.005, minshaft=2, minlength=0)                 # arrow shape
       txt = [’$L_1$’, ’$L_2$’, ’$L_3$’, ’$L_4$’, ’$L_5$’]   # Lag. pts label
36      loc = [(−1.1, −.07),(.5, −.07),(1.2, −.07),(.3,.8),(.3, −1)]               # label pos
       for i in range(len(txt)):
38             plt.text(loc [i][0], loc [i][1], txt[i], fontsize=16)

40      plt.show()

42 alpha = 0.121       # globals
  a, b = alpha, 1.0−alpha
44 makeplot()

This program computes and plots the scalar potential and vector force fields (Figure 4.17). The function potential() evaluates the effective potential (4.57). It might seem to take on only scalar input x and y, but in fact it works equally well on array input. This is because only NumPy universal functions sqrt and maximum are used (Section 1.D). Therefore, potential() is a ufunc, and it is more efficient to generate the potential on a grid on the fly.

The next routine makeplot() makes the plots. First we use np.linspace to generate a 1D grid as in Program 4.4. The function meshgrid() transforms two 1D-arrays into two 2D-arrays (or mesh). If X,Y=meshgrid(x,y), then X consists of repeating rows of x and Y repeating columns of y. Therefore, a grid point (x[i], y[j]) would be given by (X[j,i], Y[j,i]) after the transformation. For example, let x=[1, 2, 3, 4] and y=[7, 8, 9], then

image

If we choose i=1, j=2, the grid point is (x[1], y[2])=(2,9), which is the same as (X[2,1], Y[2,1]).

The actual statement x, y=meshgrid(x, x) (line 14) means that we have a square grid, stored in 2D arrays. With array inputs to potential(x, y), the potential is calculated at every grid point and returned in an array with the same shape as the input arrays automatically. In effect, each statement in potential() does implicit looping over two-nested loops. All this magic occurs because potential() is a universal function.

Having obtained the potential on the grid, we compute its gradient (line 17) using the NumPy gradient function, which returns the x and y components. Note that we have to swap the Fy and Fx components since x runs across columns and y across rows, which are the second and first dimensions, respectively, in matrix notation.18

Just as we set a low cutoff value for the potential (line 9) to avoid singularities when plotting, we also set a high cutoff value for the gradient to suppresses very big arrows in plotting the force vectors. Line 18 builds a truth array (boolean) big whose elements are true if the magnitude exceeds the specified value, and false otherwise. We then invoke advanced indexing, using the boolean array as the index (see Section 1.D), to set to zero the elements of the gradient corresponding to true elements in big (line 19).

With both the potential and force fields properly prepared, we proceed to plot them with Matplotlib. The first figure (line 21) adds a subplot with 3d projection, and calls plot_surface() from the Axes3D package to make the surface plot of the potential. The rstride and cstride parameters use fewer data points by skipping rows and columns, making the plot easier to manipulate and figure saves smaller. The line width linewidth (or lw) is set to zero to suppress the wire mesh. In the second figure (line 27), a contour plot of equal aspect ratio is produced with contour(). In addition, a force vector field is overlaid on the contours with the quiver() function. Again, points are skipped via slicing so the arrows are not too crowded. The paired ’$’ characters in the text labels (line 35) typesets the text in image math mode. The block (lines 21 to 34) can be used as a basic template for plotting any data.

Program listing 4.7: Restricted three-body (r3body.py)

  import ode, numpy as np       # get ODE solvers, numpy
  2 import visual as vp               # get VPython modules for animation

  4 def r3body(y, t):                   # equations of motion for restricted 3body
        r, v = y[0], y[1]
  6       r1, r2 = r − [−a,0], r − [b,0]              # rel pos vectors
        acc = −GM*(b*r1/vp.mag(r1)**3 + a*r2/vp.mag(r2)**3)    # Eq. (4.55)
  8       acc += omega**2*r + 2*omega*np.array([v[1], −v[0]])    # Coriolis term
        return np.array([v, acc])
10
def set_scene(r):         # r = position of test body
12      vp.display(title =’Restricted 3body’, background=(1,1,1))
       body = vp.sphere(pos=r, color=(0,0,1), radius=0.03, make_trail=1)
14      sun = vp.sphere(pos=(−a,0), color=(1,0,0), radius=0.1)
       jupiter = vp.sphere(pos=(b, 0), color=(0,1,0), radius=0.05)
16      circle = vp.ring(pos=(0,0), color=(0,0,0), thickness=0.005,
                                 axis=(0,0,1), radius=1)        # unit circle
18      return body

20 def restricted_3body(y):                     # y = [r, v] expected
        testbody = set_scene(y[0])
22       t, h = 0.0, 0.001
        while True:
24            vp.rate(2000)
             y = ode.RK4(r3body, y, t, h)
26            testbody.pos = y[0]

28 GM, omega = 4*np.pi**2, 2*np.pi                # G(M1+M2), omega, RTB units
  alpha = 0.0009542                                        # SunJupiter system
30 a, b = alpha, 1.0−alpha
  r, v = [0.509046,0.883346], [0.162719, −0.0937906]       # init pos, vel
32 restricted_3body(np.array([r, v]))

The program simulates restricted three-body motion in the Sun-Jupiter system. It is very similar to Program 4.5. But it uses the RK4 method rather than the leapfrog integrator because the motion involves a velocity-dependent force (4.55). Accordingly, r3body() has the same structure as baseball() in Program 3.8. It takes the input y containing the position and velocity vectors in an ndarray, and returns the velocity and acceleration vectors. The Coriolis term in Eq. (4.55) is simplified to image image, because image and image. This is used in line 8.

Most of the VPython objects are the same as in Program 4.5. We use vp.ring() to represent the unit circle.

1In the calculation of s3, instead of the power operator s**3, multiplications (s*s*s) are used. It is faster this way (up to power ~ 5), and equally readable.

2Such keyboard polling is included in the VPython module (VPM) library (Program S:6.4). The library also defines several classes of objects for use in later chapters, such as the slinky and mesh surfaces.

3Another common choice is θ0 = 0. In that case, rmin and rmax would be swapped.

4Though Pluto was reclassified as a minor planet recently, it does not affect our treatment below.

5For readers interested in technical details, see Sec. 3.6 of Ref. [40].

6A more quantitative explanation of the direction of precession is given in Ref. [61].

7This is a special case of power scaling laws, y = cxα, where x is the scaled variable, α the exponent (or power), and c a constant (usually unimportant). If x″ = λx, then y′ = λαy.

8The latest estimate based on the Kepler mission is that one fifth of Sun-like stars in our galaxy has an Earth-like planet, totaling to tens of billions habitable exoplanets.

9As of this writing, 1022 exoplanets have been confirmed, 548 of which were discovered with the RV method [66].

10This is not to be confused with the radial velocity image in Eq. (4.8) which represents the orbital velocity of the planet directed radially.

11Physics is not only interesting but also colorful sometimes, judging by some terms used.

12We do this in scattering studies of atomic reactions. See Section S:12.5.

13There are variations about the labeling of L1, L2 and L3. We sequentially label them from left to right, agreeing with the convention in Ref. [40].

14This should not be confused with the ability of a central potential to support closed orbits discussed in Section 4.2.5. The forces involved here are velocity dependent and not central, and the orbits are not closed in the space-fixed coordinates.

15Pluto and Neptune have different inclination angles. We ignore that difference here and assume they move in the same plane.

16This amounts to the independent particle approximation. It is a good approximation, particularly if we are primarily interested in the wobbling motion of the star.

17The float-to-string conversion works as ’format% (expressions). Here, format is a string containing the C-style format specifier %W.PT where W is the field length, P the precision (decimal places), T the number type. All except % and the number type are optional. In the present case, ’%8.2f’ specifies a float of length 8 and 2 decimal places.

18The same problem arises in electrostatic potentials on a grid, see Program 7.2.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset