Structure and Interpretation of Classical Mechanics
.
c. Make a change of coordinates to a coordinate system with center of mass coordinates ,
, angle
, distance between the particles
, and tension force
. Write the Lagrangian in these coordinates, and write the Lagrange equations.
~~~
[guess]
(define (KE-particle m v) (* 1/2 m (square v))) (define ((L-free-constrained m0 m1 l) local) (let* ((extract (extract-particle 2)) (p0 (extract local 0)) (q0 (coordinate p0)) (qdot0 (velocity p0)) (p1 (extract local 1)) (q1 (coordinate p1)) (qdot1 (velocity p1)) (F (ref (coordinate local) 4))) (- (+ (KE-particle m0 qdot0) (KE-particle m1 qdot1)) (U-constraint q0 q1 F l)))) (define ((extract-particle pieces) local i) (let* ((indices (apply up (iota pieces (* i pieces)))) (extract (lambda (tuple) (vector-map (lambda (i) (ref tuple i)) indices)))) (up (time local) (extract (coordinate local)) (extract (velocity local))))) (define (U-constraint q0 q1 F l) (* (/ F (* 2 l)) (- (square (- q1 q0)) (square l)))) (let ((L (L-free-constrained 'm_0 'm_1 'l)) (q-rect (up (literal-function 'x_0) (literal-function 'y_0) (literal-function 'x_1) (literal-function 'y_1) (literal-function 'F)))) (show-expression ((compose L (Gamma q-rect)) 't)))
(define ((q->r m0 m1) local) (let ((q (coordinate local))) (let ((x_cm (ref q 0)) (y_cm (ref q 1)) (theta (ref q 2)) (c (ref q 3)) (F (ref q 4)) (M (+ m0 m1))) (let ((x0 (- x_cm (* (/ m1 M) c (cos theta)))) (y0 (- y_cm (* (/ m1 M) c (sin theta)))) (x1 (+ x_cm (* (/ m0 M) c (cos theta)))) (y1 (+ y_cm (* (/ m0 M) c (sin theta))))) (up x0 y0 x1 y1 F))))) (let ((q (up (literal-function 'x_cm) (literal-function 'y_cm) (literal-function 'theta) (literal-function 'c) (literal-function 'F)))) (show-expression (q 't)))
(show-expression (up 't (up 'x_cm 'y_cm 'theta 'c 'F) (up 'xdot_cm 'ydot_cm 'thetadot 'cdot 'Fdot)))
(show-expression ((q->r 'm_0 'm_1) (up 't (up 'x_cm 'y_cm 'theta 'c 'F) (up 'xdot_cm 'ydot_cm 'thetadot 'cdot 'Fdot))))
(let ((q (up (literal-function 'x_cm) (literal-function 'y_cm) (literal-function 'theta) (literal-function 'c) (literal-function 'F)))) (show-expression ((q->r 'm_0 'm_1) ((Gamma q) 't))))
(show-expression ((F->C (q->r 'm_0 'm_1)) (up 't (up 'x_cm 'y_cm 'theta 'c 'F) (up 'xdot_cm 'ydot_cm 'thetadot 'cdot 'Fdot))))
(define (L-cm m0 m1 l) (compose (L-free-constrained m0 m1 l) (F->C (q->r m0 m1)))) (show-expression ((L-cm 'm_0 'm_1 'l) (up 't (up 'x_cm 'y_cm 'theta 'c 'F) (up 'xdot_cm 'ydot_cm 'thetadot 'cdot 'Fdot))))
(show-expression (((Lagrange-equations (L-cm 'm_0 'm_1 'l)) (up (literal-function 'x_cm) (literal-function 'y_cm) (literal-function 'theta) (literal-function 'c) (literal-function 'F))) 't))
(show-expression (((Lagrange-equations (L-cm 'm_0 'm_1 'l)) (up (literal-function 'x_cm) (literal-function 'y_cm) (literal-function 'theta) (lambda (t) 'l) (literal-function 'F))) 't))
[guess]
— Me@2021-09-17 06:35:51 AM
.
.
2021.09.18 Saturday (c) All rights reserved by ACHK
You must be logged in to post a comment.