Structure and Interpretation of Classical Mechanics
.
Let be a function such that
So, to get a value of , we input a local tuple:
(define ((Gamma-bar f-bar) path-q-local-tuple) (let* ((tqva path-q-local-tuple) (t (time tqva)) (O-tqva (osculating-path tqva))) ((f-bar O-tqva) t)))
.
The procedure
osculating-pathtakes a number of local components and returns a path with these components; it is implemented as a power series.
In scmutils, you can use the pp function to get the definition of a function. For example, the code
(pp osculating-path)
results
(define ((osculating-path state0) t) (let ((t0 (time state0)) (q0 (coordinate state0)) (k (vector-length state0))) (let ((dt (- t t0))) (let loop ((n 2) (sum q0) (dt^n/n! dt)) (if (fix:= n k) sum (loop (+ n 1) (+ sum (* (vector-ref state0 n) dt^n/n!)) (/ (* dt^n/n! dt) n)))))))
.
Note that for the function in the program, , the input is actually not
but
.
.
(define (F->C F) (define (f-bar q-prime) (define q (compose F (Gamma q-prime))) (Gamma q)) (Gamma-bar f-bar)) (show-expression ((F->C p->r) (->local 't (up 'r 'theta) (up 'rdot 'thetadot))))
— Me@2023-12-19 08:16:40 PM
.
.
2024.06.15 Saturday (c) All rights reserved by ACHK