Ex 1.21 The dumbbell, 2.2.2

[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))))

(let ((L (L-free-constrained 'm_0 'm_1 'l)))
  (show-expression
   ((compose L (Gamma q-rect)) 't)))

\displaystyle{  \frac{1}{2} m_0 \left( \dot x_0^2 + \dot y_0^2 \right)  + \frac{1}{2} m_1 \left( \dot x_1^2 + \dot y_1^2 \right)  + \frac{F}{2 l} \left( l^2 - y_1^2 + 2 y_0 y_1 - x_1^2 + 2 x_0 x_1 - y_0^2 - x_0^2 \right)  }

\displaystyle{  = \frac{1}{2} m_0 \left( \dot x_0^2 + \dot y_0^2 \right)  + \frac{1}{2} m_1 \left( \dot x_1^2 + \dot y_1^2 \right)  - \frac{F}{2 l} \left[ (y_1 - y_0)^2 + (x_1 - x_0)^2 - l^2 \right]  }


(define ((local_ 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)))
    local))

(show-expression
 ((compose (local_ 'm_0 'm_1 'l) (Gamma q-rect)) 't))


(define ((p0_ 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)))
    p0))
 
(show-expression
 ((compose (p0_ 'm_0 'm_1 'l) (Gamma q-rect)) 't))


(define ((p1_ 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)))
    p1))
 
(show-expression
 ((compose (p1_ 'm_0 'm_1 'l) (Gamma q-rect)) 't))

[guess]

— based on /sicmutils/sicm-exercises

— Me@2021-04-27 05:03:59 PM

.

.

2021.05.11 Tuesday (c) All rights reserved by ACHK