Lessons · gravitation

Elliptical orbits: Kepler's laws fall out of the inverse-square law

Regime 2 — calculus does what algebra cannot. The acceleration isn't constant, so the algebra formulas don't apply; calculus is the only road in, and SymPy proves the closed form solves the equation of motion.

Regime 2 · calculus does more Math machine-derived & checked by SymPy 2 modeling assumptions (author-asserted)

A real orbit is not a circle but an ellipse with the planet at one focus (μ=GM=4×1014\mu = GM = 4\times10^{14} m³/s², semi-major axis a=1.6×107a = 1.6\times10^{7} m). The satellite races through its closest point (perihelion) and crawls at its farthest (aphelion). There is no algebra formula for where it is at time tt — so the path is integrated numerically from r¨=μr/r3\ddot{\mathbf r}=-\mu\mathbf r/r^3, and SymPy checks it conserves energy and angular momentum. Slide the eccentricity from a circle to a long ellipse: the shape changes completely, but because every orbit shares the same semi-major axis, they all take the same time to go around — Kepler's third law.

Period T=2πa3/μT = 2\pi\sqrt{a^3/\mu} (same for every ee)
20110 s
Perihelion distance rp=a(1e)r_p = a(1-e)
9600000 m
Aphelion distance ra=a(1+e)r_a = a(1+e)
22400000 m
Speed at perihelion (fastest)
7638 m/s
Speed at aphelion (slowest)
3273 m/s
Solve the central-force ODE numerically
r¨=μr3r,sn+1=sn+h6(k1+2k2+2k3+k4)\ddot{\mathbf r} = -\frac{\mu}{r^3}\,\mathbf r,\qquad \mathbf s_{n+1}=\mathbf s_n+\tfrac{h}{6}(k_1+2k_2+2k_3+k_4)

The same inverse-square law, but now the radius varies, so there is no elementary time-parameterisation (Kepler's equation is transcendental). Step the position and velocity forward with RK4 from perihelion. The producer checks the result conserves energy and angular momentum and that the orbit closes — verification, for a numerical solution.

integrate r¨=μr/r3\ddot{\mathbf r}=-\mu\mathbf r/r^3 by RK4; check energy 12v2μ/r\tfrac12 v^2-\mu/r and angular momentum xy˙yx˙x\dot y-y\dot x are conserved; check the orbit closes; same aa\Rightarrow same TT

  • The specific energy 12v2μ/r=μ/2a\tfrac12 v^2-\mu/r=-\mu/2a is conserved along the orbit (max relative drift 4.7e134.7e-13). [numeric]
  • The angular momentum xy˙yx˙x\dot y-y\dot x is conserved (max relative drift 1.1e141.1e-14) — Kepler's second law: the line to the body sweeps equal areas in equal times. [numeric]
  • After one period the path returns to its start (gap <7.5e12a<7.5e-12\,a) — a closed ellipse (Kepler's first law). [numeric]
  • Every orbit shares the semi-major axis aa, so all have the same period T=2πa3/μT=2\pi\sqrt{a^3/\mu} — Kepler's third law depends on aa, not the shape. [numeric]

Dimensional homogeneity: checked by SymPy (holds).

Common misconception: “A planet moves at constant speed around its orbit, and a more eccentric orbit takes longer to complete.

Neither is true. By Kepler's second law (angular momentum is conserved), the planet sweeps equal areas in equal times — so it moves fastest at perihelion and slowest at aphelion; at e=0.5e=0.5 it is three times faster at its closest point than its farthest. And by Kepler's third law the period depends only on the semi-major axis aa, not the eccentricity: a circle and a long thin ellipse with the same aa take exactly the same time to go around. Slide the eccentricity and watch the shape stretch while the period stays put.

Modeling assumptions — author-asserted, disclosed not discharged
  • Two-body problem: a point (or spherical) planet far more massive than the satellite, whose mass cancels; no other bodies, no drag.
  • All orbits share the semi-major axis aa (so the same period), and stay above the planet's surface (perihelion rp=a(1e)8×106r_p = a(1-e) \ge 8\times10^6 m even at e=0.5e=0.5).

The trajectory, fully annotated

A static rendering (Matplotlib) at the default launch — the path y vs x, with the apex and range marked. The interactive version with launch-angle and speed sliders is in the Graph tab above.

2026-06-26T19:42:17.224616 image/svg+xml Matplotlib v3.11.0, https://matplotlib.org/