interior-product.scm 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. (define (interior-product X)
  21. ;;; FBE move after define
  22. ;; (assert (vector-field? X) "X not a vector field: interior-product")
  23. (define (ix alpha)
  24. (assert (form-field? alpha) "alpha not a form field: interior-product")
  25. (let ((p (get-rank alpha)))
  26. ;;; FBE move after define
  27. ;; (assert (> p 0) "Rank of form not greater than zero: interior-product")
  28. (define (the-product . args)
  29. (assert (= (length args) (- p 1))
  30. "Wrong number of arguments to interior product")
  31. (apply alpha (cons X args)))
  32. (assert (> p 0) "Rank of form not greater than zero: interior-product")
  33. (procedure->nform-field the-product
  34. (- p 1)
  35. `((interior-product ,(diffop-name X))
  36. ,(diffop-name alpha)))))
  37. (assert (vector-field? X) "X not a vector field: interior-product")
  38. ix)
  39. #|
  40. ;;; Claim L_x omega = i_x d omega + d i_x omega (Cartan Homotopy Formula)
  41. (install-coordinates R3-rect (up 'x 'y 'z))
  42. (define R3-rect-point ((R3-rect '->point) (up 'x0 'y0 'z0)))
  43. (define X (literal-vector-field 'X R3-rect))
  44. (define Y (literal-vector-field 'Y R3-rect))
  45. (define Z (literal-vector-field 'Z R3-rect))
  46. (define W (literal-vector-field 'W R3-rect))
  47. (define alpha
  48. (compose (literal-function 'alpha (-> (UP Real Real Real) Real))
  49. (R3-rect '->coords)))
  50. (define beta
  51. (compose (literal-function 'beta (-> (UP Real Real Real) Real))
  52. (R3-rect '->coords)))
  53. (define gamma
  54. (compose (literal-function 'gamma (-> (UP Real Real Real) Real))
  55. (R3-rect '->coords)))
  56. (define omega
  57. (+ (* alpha (wedge dx dy))
  58. (* beta (wedge dy dz))
  59. (* gamma (wedge dz dx))))
  60. (define ((L1 X) omega)
  61. (+ ((interior-product X) (d omega))
  62. (d ((interior-product X) omega))))
  63. (pec ((- (((Lie-derivative X) omega) Y Z)
  64. (((L1 X) omega) Y Z))
  65. ((R3-rect '->point) (up 'x0 'y0 'z0))))
  66. #| Result:
  67. 0
  68. |#
  69. (pec (let ((omega (literal-1form-field 'omega R3-rect)))
  70. ((- (((Lie-derivative X) omega) Y)
  71. (((L1 X) omega) Y))
  72. ((R3-rect '->point) (up 'x0 'y0 'z0)))))
  73. #| Result:
  74. 0
  75. |#
  76. (pec (let ((omega (* alpha (wedge dx dy dz))))
  77. ((- (((Lie-derivative X) omega) Y Z W)
  78. (((L1 X) omega) Y Z W))
  79. ((R3-rect '->point) (up 'x0 'y0 'z0)))))
  80. #| Result:
  81. 0
  82. |#
  83. |#