Ex Implementation of $\delta$

Structure and Interpretation of Classical Mechanics


b. Use your delta procedure to verify the properties of \displaystyle{\delta} listed in exercise 1.7 for simple functions such as implemented by the procedure f:

(define (f q)
    (literal-function ’F
          (-> (UP Real (UP* Real) (UP* Real)) Real))
    (Gamma q)))

This implements an n-degree-of-freedom path-dependent function that depends on the local tuple of the path at each moment. You can define a literal two-dimensional path by

(define q (literal-function ’q (-> Real (UP Real Real))))

You should compute both sides of the equalities and subtract the results. The answer should be zero.


(define (((delta eta) f) q)
  (define (g epsilon)
    (f (+ q (* epsilon eta))))
    ((D g) 0))

(define (f q)
  (compose (literal-function 'f (-> (UP Real Real Real) Real))
           (Gamma q)))

(define eta (literal-function 'eta))

(define q (literal-function 'q))

(print-expression ((((delta eta) f) q) 't))

— Patrick Eli Catach


(print-expression ((((delta eta) f) q) 't))
(+ (* ((D eta) t) (((partial 2) f) (up t (q t) ((D q) t)))) 
   (* (eta t) (((partial 1) f) (up t (q t) ((D q) t)))))
(show-expression ((((delta eta) f) q) 't))


— Me@2020-04-11 12:01:04 PM



2020.04.11 Saturday (c) All rights reserved by ACHK