# Ex 1.15 Central force motion

Structure and Interpretation of Classical Mechanics

.

Find Lagrangians for central force motion in three dimensions in rectangular coordinates and in spherical coordinates. First, find the Lagrangians analytically, then check the results with the computer by generalizing the programs that we have presented.

~~~

The Lagrangians in rectangular coordinates:

\displaystyle{ \begin{aligned} &L (t; x, y, x; v_x, v_y, v_z) \\ &= \frac{1}{2} m \left( v_x^2 + v_y^2 + v_z^2 \right) - U \left( \sqrt{x^2 + y^2 + z^2} \right) \\ \end{aligned}}

The Lagrangians in spherical coordinates:

\displaystyle{ \begin{aligned} &L (t; r, \theta, \phi; \dot r, \dot \theta, \dot \phi) \\ &= \frac{1}{2} m r^2 \dot \phi^2 (\sin \theta)^2 + \frac{1}{2} m \dot \theta^2 r^2 + \frac{1}{2} m \dot r^2 - U (r) \\ &= \frac{1}{2} m \left( \dot r^2 + r^2 \dot \theta^2 + r^2 (\sin^2 \theta) \dot \phi^2 \right) - U (r) \\ \end{aligned}}

.


(define ((F->C F) local)
(->local (time local)
(F local)
(+ (((partial 0) F) local)
(* (((partial 1) F) local)
(velocity local)))))

(define (p->r local)
(let ((polar-tuple (coordinate local)))
(let ((r (ref polar-tuple 0))
(theta (ref polar-tuple 1))
(phi (ref polar-tuple 2)))
(let ((x (* r (sin theta) (cos phi)))
(y (* r (sin theta) (sin phi)))
(z (* r (cos theta))))
(up x y z)))))

(define ((L-central-rectangular m U) local)
(let ((q (coordinate local))
(v (velocity local)))
(- (* 1/2 m (square v))
(U (sqrt (square q))))))

(define (L-central-polar m U)
(compose (L-central-rectangular m U) (F->C p->r)))

(show-expression
((L-central-polar 'm (literal-function 'U))
(->local 't
(up 'r 'theta 'phi)