REZZE.NET

SICM Exercise 1.12

Solution to exercise 1.12 of Structure and Interpretation of Classical Mechanics by Gerald Jay Sussman and Jack Wisdom.

Lagrange’s Equations

🛈 Note

Compute Lagrange’s equations for the Lagrangians in exercise 1.9 using the Lagrange-equations procedure. Additionally, use the computer to perform each of the steps in the Lagrange-equations procedure and show the intermediate results. Relate these steps to the ones you showed in the hand derivation of exercise 1.9.

(define ((Lagrange-equations Lagrangian) q)
  (let* ((part1 (compose ((partial 1) Lagrangian) (Gamma q)))
         (part2 (compose ((partial 2) Lagrangian) (Gamma q)))
         (Dpart2 (D part2)))
    (up part1 part2 Dpart2 (- Dpart2 part1))))

(define ((L-planar-polar m g l) local)
  (let ((theta (coordinate local))
        (thetadot (velocity local)))
    (+ (* 1/2 m (square l) (square thetadot))
       (* m g l (cos theta)))))

(show-expression
 (((Lagrange-equations (L-planar-polar 'm 'g 'l))
   (literal-function 'theta))
 't))

(define (2d-potential x y)
  (+ (/ (+ (square x) (square y)) 2)
     (* (square x) y)
     (- (/ (cube y) 3))))

(define ((L-particle m V) local)
  (let* ((q (coordinate local))
         (qdot (velocity local))
         (x (ref q 0)) (y (ref q 1))
         (vx (ref qdot 0)) (vy (ref qdot 1)))
    (- (* 1/2 m (+ (square vx) (square vy)))
       (V x y))))

(show-expression
 (((Lagrange-equations (L-particle 'm 2d-potential))
   (up (literal-function 'x)
       (literal-function 'y)))
  't))

(define ((L-sphere m R) local)
  (let* ((q (coordinate local))
         (qdot (velocity local))
         (theta (ref q 0))
         (phi (ref q 1))
         (alpha (ref qdot 0))
         (beta (ref qdot 1)))
    (* 1/2 m (square R) (+ (square alpha)
                           (square (* beta (sin theta)))))))

(show-expression
 (((Lagrange-equations (L-sphere 'm 'R))
   (up (literal-function 'theta)
       (literal-function 'phi)))
  't))

The solution processes are identical to the hand derivations in task 1.9.

Tags:
Authors: