diff options
Diffstat (limited to 'chapters/0-Prologue.scm')
-rw-r--r-- | chapters/0-Prologue.scm | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/chapters/0-Prologue.scm b/chapters/0-Prologue.scm new file mode 100644 index 0000000..3a5f44d --- /dev/null +++ b/chapters/0-Prologue.scm @@ -0,0 +1,30 @@ + +; mostly typing these up to confirm that they display as expected + +(define ((Gamma w) t) + (up t (w t) ((D w) t))) + +(define ((Lagrange-equations Lagrangian) w) + (- (D (compose ((partial 2) Lagrangian) (Gamma w))) + (compose ((partial 1) Lagrangian) (Gamma w)))) + +(define ((L-harmonic m k) local) + (let ((q (coordinate local)) + (v (velocity local))) + (- (* 1/2 m (square v)) + (* 1/2 k (square q))))) + +(define (proposed-solution t) + (* 'a (cos (+ (* 'omega t) 'phi)))) + +(show-expression + (((Lagrange-equations (L-harmonic 'm 'k)) + proposed-solution) + 't)) +; didn't simplify the way The Book shows it, but is equivalent + +(show-expression + (((Lagrange-equations (L-harmonic 'm 'k)) + (literal-function 'x)) + 't)) + |