Exercise 1.11: Kepler's Third Law

(require '[sicmutils.env :refer :all])

This exercise asks us to derive Kepler's third law by considering a Lagrangian that describes two particles rotating in a circular orbit around their center of mass at some rate.

Here's the Lagrangian for "central force", in polar coordinates. This is rotational kinetic energy, minus some arbitrary potential inline_formula not implemented that depends on the distance inline_formula not implemented between the two particles.

(defn L-central-polar [m V]
  (fn [[_ [r phi] [rdot phidot]]]
    (let [T (* (/ 1 2)
               m
               (+ (square rdot)
                  (square (* r phidot))))]
      (- T (V r)))))

This function defines gravitational potential energy:

(defn gravitational-energy [G m1 m2]
  (fn [r]
    (- (/ (* G m1 m2) r))))

What is the mass inline_formula not implemented in the Lagrangian above? It's the "reduced mass", totally unjustified at this point in the book:

(defn reduced-mass [m1 m2]
  (/ (* m1 m2)
     (+ m1 m2)))

If you want to see why the reduced mass has the form it does, check out this derivation.

The Lagrangian is written in terms of some angle inline_formula not implemented and inline_formula not implemented, the distance between the two particles. inline_formula not implemented defines a circular path:

(defn q [r omega]
  (fn [t]
    (let [phi (* omega t)]
      (up r phi))))

Write the Lagrange equations, given inline_formula not implemented and inline_formula not implemented:

(let [eqfn (Lagrange-equations
            (L-central-polar (reduced-mass 'm_1 'm_2)
                             (gravitational-energy 'G 'm_1 'm_2)))]
  ((eqfn (q 'a 'n)) 't))

These two entries are residuals, equal to zero. Stare at the top residual and you might notice that you can can factor out:

  • the reduced mass, and

  • a factor of inline_formula not implemented

Manually factor these out:

(let [eqfn (Lagrange-equations
            (L-central-polar
             (reduced-mass 'm_1 'm_2)
             (gravitational-energy 'G 'm_1 'm_2)))]
  (* ((eqfn (q 'a 'n)) 't)
     (/ (square 'a)
        (reduced-mass 'm_1 'm_2))))

And, boom, with some cleanup, we see Kepler's third law:

formula not implemented
Runtimes (2)