Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. (define (Lagrange-eq L q)
  2. (- (D (compose ((partial 2) L) (Gamma q)))
  3. (compose ((partial 1) L) (Gamma q))))
  4.  
  5. (define (V x y)
  6. (+ (/ (+ (square x) (square y)) 2)
  7. (* (square x) y)
  8. (- (/ (cube y) 3))))
  9.  
  10. (define ((L m) local)
  11. (let ((vx (ref (velocity local) 0))
  12. (vy (ref (velocity local) 1))
  13. ( x (ref (coordinate local) 0))
  14. ( y (ref (coordinate local) 1)))
  15. (- (/ (* m (+ (square vx) (square vy))) 2)
  16. (V x y))))
  17.  
  18. (define (q t)
  19. (up
  20. ((literal-function 'x) t)
  21. ((literal-function 'y) t)))
  22.  
  23. (print-expression
  24. ((Lagrange-eq (L 'm) q) 't))
  25. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement