Exercise 1.18: Bead on a triaxial surface

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

A bead of mass inline_formula not implemented moves without friction on a triaxial ellipsoidal surface. In rectangular coordinates the surface satisfies

formula not implemented

for some constants inline_formula not implemented, inline_formula not implemented, and inline_formula not implemented. Identify suitable generalized coordinates, formulate a Lagrangian, and find Lagrange's equations.

The transformation to elliptical coordinates is very similar to the spherical coordinate transformation, but with a fixed inline_formula not implemented, inline_formula not implemented and inline_formula not implemented coefficient for each rectangular dimension, and no more radial degree of freedom:

(defn elliptical->rect [a b c]
  (fn [[_ [theta phi]]]
    (up (* a (sin theta) (cos phi))
        (* b (sin theta) (sin phi))
        (* c (cos theta)))))

Next, the Lagrangian:

(defn L-free-particle [m]
  (fn [[_ _ v]]
    (* (/ 1 2) m (square v))))
(defn L-central-triaxial [m a b c]
  (compose (L-free-particle m)
           (F->C (elliptical->rect a b c))))

Final Lagrangian:

(let [local (up 't
                (up 'theta 'phi)
                (up 'thetadot 'phidot))]
  ((L-central-triaxial 'm 'a 'b 'c) local))

I'm sure there's some simplification in there for us. But why?

Lagrange equations of motion:

(let [L (L-central-triaxial 'm 'a 'b 'c)
      theta (literal-function 'theta)
      phi (literal-function 'phi)]
  (((Lagrange-equations L) (up theta phi))
   't))

This is fairly horrifying. This really demands animation, as I bet it looks cool, but it's not comprehensible in this form.

Runtimes (1)