1.9 Abstraction of Path Functions, 2

Structure and Interpretation of Classical Mechanics

.

Let \displaystyle{\bar \Gamma} be a function such that

\displaystyle{\begin{aligned}  f &= \bar \Gamma (\bar f) \\  \end{aligned}}

So, to get a value of \displaystyle{\begin{aligned} f \end{aligned}}, we input a local tuple:

\displaystyle{\begin{aligned}  f (t, q(t), v(t), \cdots, q^{(n)}(t))   &= f (t, q, v, \cdots, q^{(n)})(t) \\   &= f(\Gamma[q])(t) \\   &= f \circ \Gamma[q](t) \\   &= \bar f [q](t) \\   \bar \Gamma (\bar f) (t, q(t), v(t), \cdots, q^{(n)}(t))   &= \bar f [q](t) \\   \end{aligned}}

(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-path takes 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)))))))

\displaystyle{\begin{aligned}   q(t) &= q_0 + v_0 (t-t_0) + \frac{1}{2} a_0 (t-t_0)^2 + ... +\frac{1}{n!} q^{(n)}_0 (t-t_0)^n \\   &= q_0 + v_0 (dt) + \frac{1}{2} a_0 (dt)^2 + ... +\frac{1}{n!} q^{(n)}_0 (dt)^n \\  \end{aligned}}

.

Note that for the function in the program, \displaystyle{\bar \Gamma (\bar f)}, the input is actually not \displaystyle{(t, q, v, \cdots, q^{(n)})} but \displaystyle{(t, q(t), v(t), \cdots, q^{(n)}(t))}.

\displaystyle{\begin{aligned}  \bar \Gamma (\bar f) (t, q(t), v(t), \cdots) &= \bar f[O(t, q, v, \cdots)](t) \\   \end{aligned}}

.

(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