Noether.scm 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #| -*-Scheme-*-
  2. Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
  3. 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
  4. 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Massachusetts
  5. Institute of Technology
  6. This file is part of MIT/GNU Scheme.
  7. MIT/GNU Scheme is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or (at
  10. your option) any later version.
  11. MIT/GNU Scheme is distributed in the hope that it will be useful, but
  12. WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with MIT/GNU Scheme; if not, write to the Free Software
  17. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
  18. USA.
  19. |#
  20. ;;; Noether Theorem Support
  21. ;;; F-tilde is a parametric coordinate transformation that given
  22. ;;; parameters takes a state and returns transformed coordinates.
  23. ;;; F-tilde may take an arbitrary number of real-valued parameters.
  24. ;;; F-tilde applied to zeros is the coordinate selector: It takes a
  25. ;;; state and returns the coordinates. The hypothesis of Noether's
  26. ;;; theorem is that the Lagrangian is invariant under the
  27. ;;; transformation for all values of the parameters.
  28. ;;; (D (lambda parms (compose L (F->C (apply F-tilde parms))))) = 0
  29. (define (Noether-integral L F-tilde)
  30. (let ((zero-parameters (make-list (car (arity F-tilde)) 0)))
  31. (* ((partial 2) L) (apply (D F-tilde) zero-parameters))))
  32. #|
  33. (define ((L-central-rectangular m V) local)
  34. (let ((q (coordinate local))
  35. (v (velocity local)))
  36. (- (* 1/2 m (square v))
  37. (V (sqrt (square q))))))
  38. (define (F-tilde theta phi psi)
  39. (compose (Rx theta)
  40. (Ry phi)
  41. (Rz psi)
  42. coordinate))
  43. (pe ((Noether-integral
  44. (L-central-rectangular 'm (literal-function 'Vr))
  45. F-tilde)
  46. (up 't
  47. (up 'x 'y 'z)
  48. (up 'vx 'vy 'vz))))
  49. (down (+ (* -1 m vy z) (* m vz y))
  50. (+ (* m vx z) (* -1 m vz x))
  51. (+ (* -1 m vx y) (* m vy x)))
  52. |#