Structure and Interpretation of Classical Mechanics
.
(define (((delta eta) f) q)
(define (g epsilon)
(f (+ q (* epsilon eta))))
((D g) 0))
(define eta (literal-function 'eta))
(define q (literal-function 'q))
— Patrick Eli Catach
.
Code
(define (f q)
(compose (literal-function 'f (-> (UP Real) Real)) q))
and
(define (f q) (compose (literal-function 'f) q))
have the same effect. If you execute
(show-expression ((((delta eta) f) q) 't))
you will get
![\displaystyle{\delta_\eta f[q] = \eta(t) Df(q(t))}](https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B%5Cdelta_%5Ceta+f%5Bq%5D+%3D+%5Ceta%28t%29+Df%28q%28t%29%29%7D&bg=ffffff&fg=333333&s=1&c=20201002)
.
It seems not to make sense, because
is functional. Its input is a path function, not a real number. We cannot differentiate it with respect to its argument, which is a path.
It actually make sense in this special case because now
(define (f q)
(compose (literal-function 'f (-> (UP Real) Real)) q))
In other words,
is a function of one argument only. And variation itself can be expressed in terms of differentiation:
![\displaystyle{ \begin{aligned} g( \epsilon ) &= f[q + \epsilon \eta] \\ \delta_\eta f[q] &= \lim_{\epsilon \to 0} \left( \frac{g(\epsilon) - g(0)}{\epsilon} \right) = D g(0) \\ \end{aligned}}](https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cbegin%7Baligned%7D+g%28+%5Cepsilon+%29+%26%3D+f%5Bq+%2B+%5Cepsilon+%5Ceta%5D+%5C%5C++%5Cdelta_%5Ceta+f%5Bq%5D+%26%3D+%5Clim_%7B%5Cepsilon+%5Cto+0%7D+%5Cleft%28+%5Cfrac%7Bg%28%5Cepsilon%29+-+g%280%29%7D%7B%5Cepsilon%7D+%5Cright%29+%3D+D+g%280%29+%5C%5C+%5Cend%7Baligned%7D%7D&bg=ffffff&fg=333333&s=0&c=20201002)
So
![\displaystyle{ \begin{aligned} &\delta_\eta f[q] \\ &= \left. \frac{d}{d \epsilon} f[q + \epsilon \eta] \right|_{x=a} \\ \end{aligned}}](https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cbegin%7Baligned%7D++%26%5Cdelta_%5Ceta+f%5Bq%5D+%5C%5C+%26%3D+%5Cleft.+%5Cfrac%7Bd%7D%7Bd+%5Cepsilon%7D+f%5Bq+%2B+%5Cepsilon+%5Ceta%5D+%5Cright%7C_%7Bx%3Da%7D++%5C%5C+%5Cend%7Baligned%7D%7D&bg=ffffff&fg=333333&s=1&c=20201002)
No. This explanation is not correct. Even if
is a function of one argument only, it is still a path function. Its input argument is a path, not a number. Different path inputs will give different outputs.
The correct explanation should be the following.
(define (f q) (compose (literal-function 'f) q))
(define eta (literal-function 'eta))
(define q (literal-function 'q))
These lines actually imply that
is just a path-independent function.
![\displaystyle{ \begin{aligned} \delta_\eta f[q] &= \lim_{\epsilon \to 0} \left( \frac{f[q+\epsilon \eta]-f[q]}{\epsilon} \right) \\ \end{aligned}}](https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cbegin%7Baligned%7D+%5Cdelta_%5Ceta+f%5Bq%5D+%26%3D+%5Clim_%7B%5Cepsilon+%5Cto+0%7D+%5Cleft%28+%5Cfrac%7Bf%5Bq%2B%5Cepsilon+%5Ceta%5D-f%5Bq%5D%7D%7B%5Cepsilon%7D+%5Cright%29+%5C%5C+%5Cend%7Baligned%7D%7D&bg=ffffff&fg=333333&s=0&c=20201002)
If the function
is just a path-independent,
![\displaystyle{ \begin{aligned} \delta_\eta f[q] &= \lim_{\epsilon \to 0} \left( \frac{f(q+\epsilon \eta)-f(q)}{\epsilon} \right) \\ \end{aligned}}](https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cbegin%7Baligned%7D+%5Cdelta_%5Ceta+f%5Bq%5D+%26%3D+%5Clim_%7B%5Cepsilon+%5Cto+0%7D+%5Cleft%28+%5Cfrac%7Bf%28q%2B%5Cepsilon+%5Ceta%29-f%28q%29%7D%7B%5Cepsilon%7D+%5Cright%29+%5C%5C+%5Cend%7Baligned%7D%7D&bg=ffffff&fg=333333&s=0&c=20201002)
For the time
that
,
![\displaystyle{ \begin{aligned} \delta_\eta f[q] &= \eta \lim_{\epsilon \to 0} \left( \frac{f(q+\epsilon \eta)-f(q)}{\epsilon \eta} \right) \\ &= \eta(t) D f(q(t)) \\ \end{aligned}}](https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cbegin%7Baligned%7D++%5Cdelta_%5Ceta+f%5Bq%5D++%26%3D+%5Ceta+%5Clim_%7B%5Cepsilon+%5Cto+0%7D+%5Cleft%28+%5Cfrac%7Bf%28q%2B%5Cepsilon+%5Ceta%29-f%28q%29%7D%7B%5Cepsilon+%5Ceta%7D+%5Cright%29+%5C%5C++%26%3D+%5Ceta%28t%29+D+f%28q%28t%29%29+%5C%5C++%5Cend%7Baligned%7D%7D&bg=ffffff&fg=333333&s=0&c=20201002)
So the above lines of code are not correct, because they do not represent a path-dependent function. The correct code (for one-dimensional path
) should be
(define (((delta eta) f) q)
(define (g epsilon)
(f (+ q (* epsilon eta))))
((D g) 0))
(define (f q)
(compose (literal-function 'f
(-> (UP Real (UP* Real) (UP* Real)) Real))
(Gamma q)))
(define q (literal-function 'q (-> Real (UP Real))))
(define eta (literal-function 'eta (-> Real (UP Real))))
(print-expression ((((delta eta) f) q) 't))
(show-expression ((((delta eta) f) q) 't))
The result is
![\displaystyle{ \begin{aligned} &\delta_\eta f[q] \\ &= D \eta(t) \partial_2 f \left( \begin{bmatrix} t \\ q(t) \\ Dq(t) \end{bmatrix} \right) + \eta(t) \partial_1 f \left( \begin{bmatrix} t \\ q(t) \\ Dq(t) \end{bmatrix} \right) \\ \end{aligned}}](https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cbegin%7Baligned%7D++%26%5Cdelta_%5Ceta+f%5Bq%5D+%5C%5C+%26%3D+D+%5Ceta%28t%29+%5Cpartial_2+f+%5Cleft%28+%5Cbegin%7Bbmatrix%7D+t+%5C%5C+q%28t%29+%5C%5C+Dq%28t%29+%5Cend%7Bbmatrix%7D+%5Cright%29+%2B+%5Ceta%28t%29+%5Cpartial_1+f+%5Cleft%28+%5Cbegin%7Bbmatrix%7D+t+%5C%5C+q%28t%29+%5C%5C+Dq%28t%29+%5Cend%7Bbmatrix%7D+%5Cright%29++%5C%5C++%5Cend%7Baligned%7D%7D&bg=ffffff&fg=333333&s=1&c=20201002)
But this has a problem. It seems that
is still not a function with a path as input. It is just a function with 3 real numbers as inputs.
Note that the path-dependent function
is not really a general functional. A general functional can depend on an input function in any ways. For example,
A functional that defines the arc length of a curve:
– The Calculus of Variations
– Brian Keng
The function
is not an ordinary function because its input is not a real number, but a path-function
. In other words, it does not depend on individual values of
at different individual times. Instead, its output depends on the whole path
. However, the function
is not a general functional either.
It is not a general functional in the sense that its input is not a general mathematical function, but a (function that represents a) path
. Also,
depends on
in a specific way:
(define (f q)
(compose (literal-function 'f
(-> (UP Real (UP* Real) (UP* Real)) Real))
(Gamma q)))
![\displaystyle{ \begin{aligned} &f[q] \\ &= f(\Gamma[q]) \\ &= f \left( (t, q(t), Dq(t)) \right) \\ &= f(t, q(t), Dq(t)) \\ \end{aligned}}](https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cbegin%7Baligned%7D++%26f%5Bq%5D+%5C%5C+%26%3D+f%28%5CGamma%5Bq%5D%29+%5C%5C++%26%3D+f+%5Cleft%28+%28t%2C+q%28t%29%2C+Dq%28t%29%29+%5Cright%29+%5C%5C++%26%3D+f%28t%2C+q%28t%29%2C+Dq%28t%29%29+%5C%5C++%5Cend%7Baligned%7D%7D&bg=ffffff&fg=333333&s=0&c=20201002)
So, besides being a (non-general) functional,
, with a path,
, as input,
can also be regarded as an ordinary function that has 3 real number inputs:
,
, and
.
We can vary with respect to a path (the
itself), but we cannot differentiate with respect to a path. We can only differentiate with respect to the values of the path
.
For simplicity, we consider the case that the path
is one-dimensional. Only in the sense that
can also be regarded as an ordinary function that has 3 real number inputs, it can use the chain rule of ordinary differentiation:
![\displaystyle{ \begin{aligned} &\delta_\eta f[q] \\ &= D \eta(t) \partial_2 f \left( \begin{bmatrix} t \\ q(t) \\ Dq(t) \end{bmatrix} \right) + \eta(t) \partial_1 f \left( \begin{bmatrix} t \\ q(t) \\ Dq(t) \end{bmatrix} \right) \\ \end{aligned}}](https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cbegin%7Baligned%7D++%26%5Cdelta_%5Ceta+f%5Bq%5D+%5C%5C+%26%3D+D+%5Ceta%28t%29+%5Cpartial_2+f+%5Cleft%28+%5Cbegin%7Bbmatrix%7D+t+%5C%5C+q%28t%29+%5C%5C+Dq%28t%29+%5Cend%7Bbmatrix%7D+%5Cright%29+%2B+%5Ceta%28t%29+%5Cpartial_1+f+%5Cleft%28+%5Cbegin%7Bbmatrix%7D+t+%5C%5C+q%28t%29+%5C%5C+Dq%28t%29+%5Cend%7Bbmatrix%7D+%5Cright%29++%5C%5C++%5Cend%7Baligned%7D%7D&bg=ffffff&fg=333333&s=1&c=20201002)
— Me@2020-06-20 01:17:39 PM
.
.
2020.06.24 Wednesday (c) All rights reserved by ACHK
You must be logged in to post a comment.