Reduction to one body, energy and angular-momentum integrals, the Laplace–Runge–Lenz vector and the orbit equation (Binet), verified against the JPL Horizons state vector of Mars at J2000.
⏱ 180 minvector ODEsfirst integralscross productconic sectionschange of variable u = 1/ranalysis of numerical cancellationrevision
By the end you will be able to:
Reduce the gravitational two-body problem to a one-body problem with parameter μ = G(m₁ + m₂).
Prove the conservation of the specific angular momentum h, the specific energy ε and the Laplace–Runge–Lenz vector A.
Derive the orbit equation r = p/(1 + e cos ν) from A and, alternatively, from Binet's equation.
Classify orbits by the sign of ε and relate a, e, p, h and ε to one another (vis-viva, Kepler's third law).
Compute h, ε, A and the geometric elements of a real orbit from a JPL Horizons state vector and analyze the propagation of errors.
1. Motivation
Two point masses attracting each other according to Newton’s law form the only gravitational problem that can be solved
exactly. All of the celestial mechanics that follows (perturbations, three bodies, space maneuvers) is built
on it: every planet, comet or probe is described, instant by instant, as if it followed the two-body orbit
that best fits its state. In this lesson we prove that this orbit is a conic, identify the quantities that are
conserved, and check everything against the real state vector of Mars published by JPL.
2. Reduction to one body
Let two masses m1, m2 have inertial positions R1, R2, and let G be the gravitational constant.
Newton’s equations are
Adding them, the center of massRcm=(m1R1+m2R2)/(m1+m2) satisfies R¨cm=0:
it moves in a straight line at constant velocity (six constants of integration). Subtracting the equations
divided by their respective masses, the relative vectorr=R2−R1 obeys
r¨=−r3μr,μ≡G(m1+m2),r=∥r∥
which is the motion of a particle in a fixed central field with gravitational parameterμ (m³/s²).
The energy and angular momentum of the system in the center-of-mass frame are written with the reduced massm∗=m1m2/(m1+m2): E=21m∗v2−Gm1m2/r and L=m∗r×v, with v=r˙.
Dividing by m∗ we obtain the specific quantities (per unit reduced mass) that we will use from here on:
ε=2v2−rμ,h=r×v.
For a planet orbiting the Sun, μ=GM⊙(1+mp/M⊙). JPL reflects this in its “Keplerian GM”:
for Mars, μ=1.32712482870×1011 km³/s², which is GM⊙=1.32712440041×1011 plus
GMMars=4.2828×104 km³/s² (DE441).
3. First integrals
3.1 Angular momentum: the motion is planar
dtdh=r˙×v+r×r¨=v×v−r3μr×r=0.
Since r⊥h at every instant, the orbit lies in the plane perpendicular to h.
In polar coordinates (r,ν) of that plane, v=r˙r^+rν˙ν^ and
h=r2ν˙,dtdA=21r2ν˙=21h=const,
which is Kepler’s second law (the law of areas).
3.2 Energy
dtd(2v2)=v⋅r¨=−r3μr⋅v=−r3μrr˙=dtd(rμ),
using r⋅v=rr˙. Hence ε=v2/2−μ/r is constant.
3.3 The Laplace–Runge–Lenz vector
Proposition. The vector A=v×h−μrr is conserved.
Proof. Since h is constant, dtd(v×h)=r¨×h. With the identity
a×(b×c)=b(a⋅c)−c(a⋅b):
On the other hand, dtdrr=rv−r2r˙r=rv−r3(r⋅v)r.
Both expressions coincide, so A˙=r¨×h−μdtd(r/r)=0. ■
Two immediate properties:
A⋅h=0 (both terms are perpendicular to h): Alies in the orbital plane.
A2=μ2+2εh2. Indeed, v⊥h gives ∥v×h∥2=v2h2, and
(v×h)⋅r=h⋅(r×v)=h2, so
A2=v2h2−2μh2/r+μ2=μ2+2h2(2v2−rμ).
Let us count constants: h (3), ε (1) and A (3) give 7, but the two relations above reduce
the number of independent integrals to 5. The sixth constant that fixes the solution is the time of
periapsis passage τ, which will appear in Kepler’s equation (lesson 1). The vector A was found by Laplace in
1799 and rediscovered several times (Goldstein 1975); in quantum mechanics it is responsible for the “accidental”
degeneracy of the hydrogen atom.
4. The orbit equation
We take the dot product of A with r:
A⋅r=(v×h)⋅r−μr=h2−μr.
If ν is the angle between A and r (the true anomaly), A⋅r=Arcosν and, rearranging,
r=1+ecosνp,p≡μh2,e≡μA
This is the polar equation of a conic with one focus at the origin, with semi-latus rectump and eccentricitye;
the vector A points toward periapsis (ν=0, minimum r). This is Kepler’s first law, generalized to all
conics. Dividing A2=μ2+2εh2 by μ2:
For the ellipse, p=a(1−e2) with a the semi-major axis, and from the previous relation h2=μa(1−e2) one obtains
ε=−2aμ,v2=μ(r2−a1)(vis-viva equation).
The extreme values of r are rp=a(1−e) (periapsis) and ra=a(1+e) (apoapsis). Finally, the area of the ellipse,
πab with b=a1−e2, is swept at the rate h/2, so the period is T=2πab/h and, substituting h:
T=2πμa3(Kepler’s third law),n≡T2π=a3μ(mean motion).
5. Binet’s equation
There is an alternative route, without A, which moreover works for any central force. With u=1/r and h=r2ν˙:
The radial component of r¨=−μr/r3 in polar coordinates is r¨−rν˙2=−μ/r2, that is,
−h2u2u′′−h2u3=−μu2. Dividing by −h2u2:
dν2d2u+u=h2μ
This is the equation of a harmonic oscillator driven by a constant; its general solution is
u=μ/h2+Ccos(ν−ν0), which with ν0=0 and C=μe/h2 reproduces exactly r=p/(1+ecosν).
For an arbitrary central force per unit mass f(r) the equation is u′′+u=−f(1/u)/(h2u2); the fact that
only forces ∝r and ∝r−2 give closed orbits for all initial conditions is Bertrand’s
theorem (1873), and a perturbation ∝r−3 produces a precession of the periapsis (Problem 4), which is the
mechanism behind the relativistic advance of Mercury’s perihelion.
6. Verification with a real body: Mars at J2000
JPL Horizons (DE441 ephemerides, Park et al. 2021) gives for Mars, with respect to the center of the Sun, in the
J2000 ecliptic plane and at the epoch JD 2451545.0 TDB (2000-Jan-01 12:00):
x
y
z
r (km)
2.080481406×108
−2.007052628×106
−5.156288959×106
v (km/s)
1.162672404
26.29606455
0.5222970230
with μ=1.3271248287×1011 km³/s². We compute (in km, s; the values are rounded to 6 significant figures):
Quantity
Formula
Value
r
∥r∥
2.08122×108 km
v
∥v∥
26.3269 km/s
h
r×v
(1.34542×108,−1.14658×108,5.47318×109) km²/s
h
5.47603×109 km²/s
ε
v2/2−μ/r
−291.114 km²/s²
a
−μ/(2ε)
2.27939×108 km =1.52368 au
p
h2/μ
2.25954×108 km
A/μ
v×h/μ−r/r
(0.0852778,−0.0377765,−0.00288768)
e
A/μ
0.0933151
T
2πa3/μ
686.97 d
Horizons publishes, for the same epoch, a=2.279391329739×108 km and e=0.09331510146: our calculation
agrees in every figure shown (the test elementos.test.ts checks it to 10−9 relative). Two
further checks: the inclination of the orbital plane with respect to the ecliptic is arccos(hz/h)=1.84988° (Horizons:
1.849876°), and p/r=1.08568=1+ecosν with ν=23.333°, which is exactly the true anomaly given by
Horizons. The orbit equation works to ten figures on a real planet: the residual is explained by the
perturbations of the other planets, which slowly change these osculating elements (lesson 4).
7. Numerical analysis
Cancellation in e.A/μ is the difference of two vectors of magnitude close to 1
(∥v×h∥/μ≈1+ecosν and ∥r/r∥=1). If the orbit is nearly circular, the subtraction
loses digits: the relative error in e is of order ϵmach/e, with ϵmach≈2.2×10−16 in double
precision. For Mars (e≈0.09) one digit is lost; for an orbit with e∼10−6 six are lost.
The alternative e2=1+2εh2/μ2 does not help (it is also a subtraction, 1−(1−e2)). The robust approach is to compute
directly the small components ecosν=p/r−1 and esinν=(r⋅v)h/(μr), which are obtained
without subtracting large, nearly equal quantities (Problem 6).
Sensitivity of a to the velocity. From a=μr/(2μ−rv2),
aδa=∣ε∣v2vδv(for Mars, v2/∣ε∣=2.38).
The factor v2/∣ε∣=2(2a/r−1) grows without bound as the orbit approaches the parabola (ε→0): the orbit
determination of a nearly parabolic comet from a few observations is intrinsically ill-conditioned in a and in T
(δT/T=23δa/a), even though p and e are obtained well.
Diagnostics for integrators. Since h, ε and A are exactly constant, their drift in a
numerical integration measures the error of the method. In RK4, the direction of A rotates slowly (numerical precession
of the periapsis) and ε drifts secularly ∝th4; a symplectic integrator (leapfrog) keeps ε
bounded but also makes A precess (see metodos-numericos/01). The simulator displays the energy at every
instant.
8. Simulator
Period T = 1.000 years · t = 0.000 years · r = 0.000 au · v = 0.00 km/s
Questions for analysis:
With e=0.9, compare the speed at periapsis and at apoapsis with the vis-viva equation: it must satisfy vp/va=(1+e)/(1−e)=19.
Keep a fixed and increase e: the period does not change (third law) even though the trajectory is very different.
Notice that the velocity vector never points toward the focus except at the apsides, where it is perpendicular to r.
Problems
(Proof) Show that v×h=μ[(1+ecosν)r^−esinνν^] in the polar basis
(r^,ν^) of the orbital plane, and deduce again that A=μep^, where p^ is the direction of periapsis.
Show solution
In the plane, v=r˙r^+(h/r)ν^ and h=hz^ with r^×z^=−ν^,
ν^×z^=r^. Hence v×h=−hr˙ν^+(h2/r)r^. Differentiating r=p/(1+ecosν):
r˙=(pesinν/(1+ecosν)2)ν˙=(μ/h)esinν, and h2/r=μ(1+ecosν). Thus
v×h=μ[(1+ecosν)r^−esinνν^] and
A=v×h−μr^=μe(cosνr^−sinνν^)=μep^, since from r^=cosνp^+sinνq^ and
ν^=−sinνp^+cosνq^ it follows that cosνr^−sinνν^=p^, the fixed unit vector toward ν=0.
(Proof) Derive the vis-viva equation v2=μ(2/r−1/a) for the ellipse and write its hyperbolic version. What is v as r→∞ on the hyperbola?
Show solution
ε=v2/2−μ/r and ε=−μ/(2a) give v2=μ(2/r−1/a). On the hyperbola e>1, p=a(1−e2) requires a<0;
with ah=−a>0: v2=μ(2/r+1/ah) and v∞=μ/ah=2ε, the hyperbolic excess velocity, which is central to lesson 6.
(Hodograph) Show that the tip of the velocity vector traces a circle of radius μ/h centered at (0,μe/h) in the perifocal frame (x axis toward periapsis).
Show solution
From v×h=A+μr^ and h⊥v: taking the cross product with h on the left,
h×(v×h)=vh2, so v=h×A/h2+(μ/h2)h×r^. The first term is
constant, of magnitude μe/h and perpendicular to A (it points along perifocal +y); the second has constant magnitude μ/h and rotates with r^.
In components, v=(μ/h)(−sinν,e+cosν), which confirms the center (0,μe/h) and radius μ/h.
(Binet and precession) For the force per unit mass f(r)=−μ/r2−δ/r3 with δ≪h2, solve Binet’s equation and show that the periapsis advances by Δϖ≈πδ/h2 per revolution.
Show solution
u′′+u=μ/h2+(δ/h2)u⇒u′′+κ2u=μ/h2 with κ2=1−δ/h2. Solution: u=μ/(h2κ2)+Ccos(κν).
Periapsis recurs when κν=2π, that is, every Δν=2π/κ≈2π(1+δ/(2h2)): an advance of
Δϖ=2π/κ−2π≈πδ/h2. In general relativity the effective term is δ=3μh2/c2 (Schwarzschild
lesson), which gives 6πμ/(c2p) per orbit: 42.98′′ per century for Mercury.
(Hyperbola) A body arrives from infinity with excess velocity v∞ and passes at minimum distance rp from the center. Show that e=1+rpv∞2/μ and that the asymptotes make an angle with the axis such that the total deflection angle is δ=2arcsin(1/e).
Show solution
At periapsis vp2=v∞2+2μ/rp (vis-viva with ε=v∞2/2) and h=rpvp. With p=h2/μ=rp(1+e):
rp2(v∞2+2μ/rp)/μ=rp(1+e)⇒e=1+rpv∞2/μ. The asymptotes correspond to r→∞, i.e.
1+ecosν∞=0, cosν∞=−1/e. The angle between the two asymptotes and the direction of arrival is δ=2ν∞−π,
and sin(δ/2)=−cosν∞=1/e.
(Computational) Horizons gives for Earth (Sun center, ecliptic J2000, JD 2451545.0 TDB):
r=(−2.649903368×107,1.446972968×108,−6.111494260×102) km,
v=(−29.79426007,−5.469294940,1.817836785×10−4) km/s, μ=1.3271283864×1011 km³/s².
Write a program that computes h, ε, a, e, the inclination i=arccos(hz/h) and ν (use the robust formulas of section 7)
and compare it with Horizons: a=1.496650146×108 km, e=0.01711862907, i=4.181×10−4 degrees, ν=358.5689°.
Why is a not exactly 1 au, nor i exactly 0?
Show solution
import numpy as npmu = 1.3271283864171489e11r = np.array([-2.649903367743050e7, 1.446972967925493e8, -6.111494259536266e2])v = np.array([-29.79426007043741, -5.469294939770602, 1.817836785027449e-4])rn, vn = np.linalg.norm(r), np.linalg.norm(v)h = np.cross(r, v); hn = np.linalg.norm(h)eps = vn**2/2 - mu/rn; a = -mu/(2*eps); p = hn**2/muecos = p/rn - 1; esin = np.dot(r, v)*hn/(mu*rn) # no cancellatione = np.hypot(ecos, esin); nu = np.degrees(np.arctan2(esin, ecos)) % 360i = np.degrees(np.arccos(h[2]/hn))print(a, e, i, nu) # 1.4966501455e8 0.017118629 4.181e-4 358.5689
One obtains a=1.49665×108 km, e=0.0171186, i=4.18×10−4°, ν=358.569°. The vector is that of the center of
the Earth, not of the Earth–Moon barycenter: the Earth oscillates around that barycenter (about 4 670 km from its center) with
the lunar period, which displaces the osculating orbit with respect to the mean one (1 au, in the ecliptic). These are
perturbations, the subject of lesson 4.
(Virial) Show that in an elliptical orbit the time averages satisfy ⟨1/r⟩t=1/a and ⟨v2⟩t=μ/a, that is, 2⟨T⟩=−⟨V⟩.
Show solution
With the eccentric anomaly E (lesson 1), r=a(1−ecosE) and ndt=(1−ecosE)dE=(r/a)dE. Then
⟨1/r⟩=T1∫0Trdt=2π1∫02πadE=a1. From vis-viva,
⟨v2⟩=2μ⟨1/r⟩−μ/a=μ/a. With T=v2/2 and V=−μ/r per unit mass: 2⟨T⟩=μ/a=−⟨V⟩.
Self-assessment
✦ Self-assessment
Answer all the questions to check.
Further reading
Murray & Dermott (1999), Solar System Dynamics, ch. 2: the two-body problem in the notation used here (§2.3–2.5).
Danby (1988), Fundamentals of Celestial Mechanics, ch. 6: classical treatment with the three anomalies and the hodograph.
Curtis (2020), Orbital Mechanics for Engineering Students, ch. 2: engineering approach, with the numerical examples 2.x in km and km/s.
Vallado (2013), Fundamentals of Astrodynamics and Applications, ch. 1 and §2.2: constants, integrals and degenerate cases.
Goldstein, Poole & Safko (2002), Classical Mechanics, §3.7–3.9: Bertrand’s theorem and the Laplace–Runge–Lenz vector; Goldstein (1975), DOI 10.1119/1.9745, on the history of the vector.
Park et al. (2021), DE440/DE441, DOI 10.3847/1538-3881/abd414: the ephemerides from which the Horizons vectors are taken.
🍎 Teacher guide
Time
2 classes of 90 min
Learning outcome
By the end, the student reduces the two-body problem to a one-body problem, proves the conservation of h, ε and A, derives the orbit equation by two routes (the vector A and Binet's equation) and verifies the results on a real state vector, quantifying the propagation of errors.
Evidence of learning
Submission of computational problem 6 (code + comparison with Horizons + explanation of the discrepancies) and of one of proofs 1–5 written up rigorously.
Materials
Python 3 with NumPy (or a spreadsheet with cross product)
Access to JPL Horizons (ssd.jpl.nasa.gov/horizons) to download vectors of other bodies
Simulator "Keplerian orbit"
Suggested sequence
Class 1. Start from the two Newtonian equations and arrive at r¨=−μr/r3 on the board (15 min). Conservation of h and ε with their geometric consequences (20 min). Complete proof of A˙=0 and of the orbit equation; discuss the count of integrals (40 min). Closing: classification by the sign of ε and vis-viva (15 min).
Class 2. Binet’s equation and Bertrand’s theorem as motivation for precession (25 min). Workshop with the Mars vector: each pair computes one row of the table in section 6 and the results are compared with Horizons (35 min). Cancellation and sensitivity analysis with numerical examples in the simulator (20 min). Assign problem 6 and one proof.
Common mistakes
Using μ = GM of the central body while forgetting the mass of the secondary: for Mars the effect is 3×10⁻⁷ relative, but in a binary star system it is of order 1. Show the "Keplerian GM" of Horizons.
Confusing the angle ν (true anomaly, measured from A) with the polar angle measured from an arbitrary axis. Insist that A defines the origin of ν.
Believing that the conservation of h is enough to obtain the ellipse. Make clear that h only gives the plane and the law of areas; the shape comes from A (or from Binet, which requires the 1/r² law).
Treating a and T as well determined in nearly parabolic orbits: ask for the factor v²/|ε| for a comet with e = 0.9999.
Key terms in this lesson (12)
Glossary terms that appear in the text. Each one links to its full entry.
Two-body problemWorking out how two bodies move when they attract only each other, like the Sun and a planet. It has an exact solution: Kepler's ellipses. With three bodies there is no longer a closed formula.
Orbital velocityThe speed at which a body travels along its orbit. The Space Station goes around Earth at 7.7 km/s; Earth goes around the Sun at almost 30 km/s.
OrbitThe path one body follows around another because of gravity: the Moon around Earth, Earth around the Sun. Almost all are ellipses, slightly flattened ovals.
HorizonThe line where the sky seems to touch the land or the sea. A celestial object "rises" when it crosses the horizon going up and "sets" when it crosses it going down.
Kepler's lawsThree rules about how the planets move: (1) they follow ellipses with the Sun at one focus, (2) they move faster when they are closer to the Sun and (3) distant planets take much longer to go around.
PerihelionThe point of the orbit closest to the Sun; there the planet moves fastest. Earth passes through it in early January. For the Moon around Earth it is called perigee.
Semi-major axisHalf the length of the ellipse: the planet's "average" distance from the Sun. It is the number that rules Kepler's third law: the larger it is, the slower the planet.
Kepler's equationThe equation that says where on its ellipse a planet is on a given date. It cannot be solved with algebra: it has to be solved by successive approximations, as astronomy programs do.
PerturbationAny small "nudge" that pulls an orbit away from a perfect ellipse: the attraction of other planets, Earth's flattening, air drag. That is how Neptune was discovered, through the perturbations of Uranus.
PrecessionEarth's axis wobbles very slowly, like a spinning top, and takes about 26 000 years to complete one turn. That is why the star marking north changes over the millennia.
EccentricityA number between 0 and 1 that says how flattened an orbit is: 0 is a perfect circle, and the closer to 1, the more elongated. Earth's is 0.017, almost a circle; Halley's comet's, 0.97.
Orbital elementsThe six numbers that fully describe an orbit: its size, its shape, how it is tilted and oriented, and where the body is at a given moment.