Varying the action, 2.1

Equation (1.28):

\displaystyle{S[q](t_1, t_2) = \int_{t_1}^{t_2} L \circ \Gamma[q]}

Equation (1.30):

\displaystyle{h[q] = L \circ \Gamma[q]}

\displaystyle{\delta_\eta S[q](t_1, t_2) = \int_{t_1}^{t_2} \delta_\eta h[q]}

.

Let \displaystyle{F} be a path-independent function and \displaystyle{g} be a path-dependent function; then

\displaystyle{\delta_\eta h[q] = \left( DF \circ g[q] \right) \delta_\eta g[q]~~~~~\text{with}~~~~~h[q] = F \circ g[q].~~~~~(1.26)}

\displaystyle{\delta_\eta F \circ g[q] = \left( DF \circ g[q] \right) \delta_\eta g[q]}

.

— 1.5.1 Varying a path

— Structure and Interpretation of Classical Mechanics

.

\displaystyle{ \begin{aligned} &\delta_\eta S[q] (t_1, t_2) \\ &= \int_{t_1}^{t_2} \delta_\eta \left( L \circ \Gamma[q] \right) \\  \end{aligned}}

Assume that \displaystyle{L} is a path-independent function, so that we can use Eq. 1.26:

\displaystyle{ \begin{aligned} &= \int_{t_1}^{t_2} (D L \circ \Gamma[q]) \delta_\eta \Gamma[q] \\  \end{aligned}}

\displaystyle{ \begin{aligned} &= \int_{t_1}^{t_2} (D L \circ \Gamma[q]) (0, \eta(t), D\eta(t)) \\  &= \int_{t_1}^{t_2} (D L \left[ \Gamma[q] \right]) (0, \eta(t), D\eta(t)) \\  \end{aligned}}

Assume that \displaystyle{L} is a path-independent function, so that any value of \displaystyle{L} depends on the value of \displaystyle{\Gamma} at that moment only, instead of depending on the whole path \displaystyle{\Gamma}:

\displaystyle{ \begin{aligned} &= \int_{t_1}^{t_2} (D L (\Gamma[q])) (0, \eta(t), D\eta(t)) \\  &= \int_{t_1}^{t_2} (D L (t, q, v)) (0, \eta(t), D\eta(t)) \\  &= \int_{t_1}^{t_2} [\partial_0 L (t, q, v), \partial_1 L (t, q, v), \partial_2 L (t, q, v)] (0, \eta(t), D\eta(t)) \\  \end{aligned}}

What kind of product is it here? Is it just a dot product? Probably not.

\displaystyle{ \begin{aligned} &= \int_{t_1}^{t_2} [\partial_1 L (t, q, v) \eta(t) + \partial_2 L (t, q, v) D\eta(t)] \\  \end{aligned}}

.

— Me@2019-10-12 03:42:01 PM

.

.

2019.10.13 Sunday (c) All rights reserved by ACHK

Introduction to Differential Equations

llamaz 1 hour ago [-]

I think the calculus of variations might be a better approach to introducing ODEs in first year.

You can show that by generalizing calculus so the values are functions rather than real numbers, then trying to find a max/min using the functional version of \displaystyle{\frac{dy}{dx} = 0}, you end up with an ODE (viz. the Euler-Lagrange equation).

This also motivates Lagrange multipliers which are usually taught around the same time as ODEs. They are similar to the Hamiltonian, which is a synonym for energy and is derived from the Euler-Lagrange equations of a system.

Of course you would brush over most of this mechanics stuff in a single lecture (60 min). But now you’ve motivated ODEs and given the students a reason to solve ODEs with constant coefficients.

— Hacker News

.

.

2019.10.02 Wednesday ACHK

A Tale of Two L’s

Lagrange’s equations are traditionally written in the form

\displaystyle{\frac{\mathrm{d}}{\mathrm{d}t} \left ( \frac {\partial L}{\partial \dot{q}} \right ) = \frac {\partial L}{\partial q}}

or, if we write a separate equation for each component of \displaystyle{q}, as

\displaystyle{\frac{\mathrm{d}}{\mathrm{d}t} \left ( \frac {\partial L}{\partial \dot{q^i}} \right ) = \frac {\partial L}{\partial q^i}}

In this way of writing Lagrange’s equations the notation does not distinguish between \displaystyle{L}, which is a real-valued function of three variables \displaystyle{(t, q, \dot q)}, and \displaystyle{L \circ \Gamma[q]}, which is a real-valued function of one real variable \displaystyle{t}.

— Structure and Interpretation of Classical Mechanics

.

.

2019.09.04 Wednesday ACHK

Literal numbers

All primitive mathematical procedures are extended to be generic over
symbolic arguments. When given symbolic arguments, these procedures
construct a symbolic representation of the required answer. There are
primitive literal numbers. We can make a literal number that is
represented as an expression by the symbol “a” as follows:

(literal-number 'a)        ==>  (*number* (expression a))

The literal number is an object that has the type of a number, but its
representation as an expression is the symbol “a”.

(type (literal-number 'a))          ==>  *number*

(expression (literal-number 'a))    ==>  a

— SCMUTILS Reference Manual

.

.

2019.08.17 Saturday ACHK

Ex 1.7 Properties of $\delta$

Let \displaystyle{F} be a path-independent function and \displaystyle{g} be a path-dependent function; then

\displaystyle{\delta_\eta h[q] = \left( DF \circ g[q] \right) \delta_\eta g[q]~~~~~\text{with}~~~~~h[q] = F \circ g[q].~~~~~(1.26)}

— 1.5.1 Varying a path

— Structure and Interpretation of Classical Mechanics

.

Prove that

\displaystyle{\delta_\eta F \circ g[q] = \left( DF \circ g[q] \right) \delta_\eta g[q]}

~~~

\displaystyle{RHS = \lim_{\Delta t \to 0} \left( \frac{F \circ g[q](t+\Delta t) - F \circ g[q](t)}{\Delta t} \right) \lim_{\epsilon \to 0} \left( \frac{g[q+\epsilon \eta]-g[q]}{\epsilon} \right)}

\displaystyle{ \begin{aligned} LHS &= \delta_\eta F \circ g[q] \\   &=  \lim_{\epsilon \to 0} \left( \frac{F \circ g[q+\epsilon \eta]-F \circ g[q]}{\epsilon} \right) \\    &=  \lim_{\epsilon \to 0} \left( \frac{F \left[ g[q+\epsilon \eta] \right] - F \left[ g[q] \right]}{\epsilon} \right) \\   \end{aligned}}

Since \displaystyle{F} is path-independent,

\displaystyle{ \begin{aligned} LHS   &= \lim_{\epsilon \to 0} \left(  \frac{F \left( g[q+\epsilon \eta ] \right) - F \left( g[q] \right)}{\epsilon} \right) \\   \end{aligned}}

Let \displaystyle{ g[q+\epsilon \eta] = g + \Delta g}.

\displaystyle{ \begin{aligned} LHS   &= \lim_{\epsilon \to 0} \left(  \frac{F \left( g[q] + \Delta g[q]] \right) - F \left( g[q] \right)}{\epsilon} \right) \\   &= \lim_{\epsilon \to 0} \left(  \frac{F \left( g[q] + \Delta g[q]] \right) - F \left( g[q] \right)}{\Delta g[q]}\frac{\Delta g[q]}{\epsilon} \right) \\   \end{aligned}}

When \displaystyle{ \epsilon \to 0}, \displaystyle{ \Delta g \to 0 }.

\displaystyle{ \begin{aligned} LHS   &= \lim_{\substack{\epsilon \to 0 \\ \Delta g \to 0}} \left(  \frac{F \left( g[q] + \Delta g[q]] \right) - F \left( g[q] \right)}{\Delta g[q]}\frac{\Delta g[q]}{\epsilon} \right) \\   &= \lim_{\Delta g \to 0} \left(  \frac{F \left( g[q] + \Delta g[q]] \right) - F \left( g[q] \right)}{\Delta g[q]} \lim_{\epsilon \to 0} \frac{g[q + \epsilon \eta] - g[q]}{\epsilon} \right) \\   &= DF \left( g[q] \right) \delta_\eta g[q] \\   &= RHS \\  \end{aligned}}

— Me@2019-06-24 10:55:28 PM

.

.

2019.06.25 Tuesday (c) All rights reserved by ACHK

Ex 1.8 Implementation of $\delta$

\displaystyle{ \begin{aligned} \delta_\eta f[q] &= \lim_{\epsilon \to 0} \left( \frac{f[q+\epsilon \eta]-f[q]}{\epsilon} \right) \\ \end{aligned}}

The variation may be represented in terms of a derivative.

— Structure and Interpretation of Classical Mechanics

\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}}

.

A lambda expression evaluates to a procedure. The environment in effect when the lambda expression is evaluated is remembered as part of the procedure; it is called the closing environment.

— Structure and Interpretation of Classical Mechanics

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

— Me@2019-05-05 10:47:46 PM

.

.

2019.05.05 Sunday (c) All rights reserved by ACHK

Varying a path

Suppose that we have a function \displaystyle{f[q]} that depends on a path \displaystyle{q}. How does the function vary as the path is varied? Let \displaystyle{q} be a coordinate path and \displaystyle{q + \epsilon \eta} be a varied path, where the function \displaystyle{\eta} is a path-like function that can be added to the path \displaystyle{q}, and the factor \displaystyle{\epsilon} is a scale factor. We define the variation \displaystyle{ \delta_\eta f[q]} of the function \displaystyle{f} on the path \displaystyle{q} by

\displaystyle{\delta_\eta f [q] = \lim_{\epsilon \to 0} \left( \frac{f[q + \epsilon \eta] - f[q]}{\epsilon} \right)}

The variation of \displaystyle{f} is a linear approximation to the change in the function \displaystyle{f} for small variations in the path. The variation of \displaystyle{f} depends on \displaystyle{\eta}.

— 1.5.1 Varying a path

— Structure and Interpretation of Classical Mechanics

.

Exercise 1.7. Properties of \displaystyle{\delta}

The meaning of \displaystyle{\delta_\eta (fg)[q]} is

\displaystyle{\delta_\eta (f[q]g[q])}

— Me@2019-04-27 07:02:38 PM

.

.

2019.04.27 Saturday ACHK

scmutils

In order to run the SICM code, you need to install the scmutils library. Just go to the official page to download the library and follow the official instructions to install it in a Linux operating system.

When you try to run it, your system may give the following error message:

/usr/local/bin/mechanics: line 16: exec: xterm: not found

If so, you should install the program xterm first.

.

Also, in case you like to use Emacs as editor, you can:

Just include the following in your .emacs file:

(defun mechanics ()
  (interactive)
  (run-scheme
    "ROOT/mit-scheme/bin/scheme --library ROOT/mit-scheme/lib"
  ))

Replace ROOT with the directory in which you installed the scmutils software. (Remember to replace it in both places. If it is installed differently on your system, just make sure the string has the form “/path/to/mit-scheme --library /path/to/scmutils-library“.) Restart emacs (or use C-x C-e to evaluate the mechanics defun), and launch the environment with the command M-x mechanics.

— Using GNU Emacs With SCMUtils

— Aaron Maxwell

.

In my Ubuntu 18.04, the paths are:

(defun mechanics()
  (interactive)
  (run-scheme
   "/usr/local/scmutils/mit-scheme/bin/scheme --library 
/usr/local/scmutils/mit-scheme/lib"
  ))

— Me@2019-04-07 02:52:50 PM

.

.

2019.04.07 Sunday (c) All rights reserved by ACHK

Finding trajectories that minimize the action

We have used the variational principle to determine if a given trajectory is realizable. We can also use the variational principle to find trajectories. Given a set of trajectories that are specified by a finite number of parameters, we can search the parameter space looking for the trajectory in the set that best approximates the real trajectory by finding one that minimizes the action. By choosing a good set of approximating functions we can get arbitrarily close to the real trajectory.

— Structure and Interpretation of Classical Mechanics

.

We have used the variational principle to determine if a given trajectory is realizable.

How?

— Me@2019-03-29 04:23:36 PM

.

Check if the action of that given trajectory is stationary or not.

— Me@2019-03-29 04:25:45 PM

.

.

2019.03.29 Friday (c) All rights reserved by ACHK

Computing Actions

Lagrangians in generalized coordinates

The function \displaystyle{S_\chi} takes a coordinate path; the function \displaystyle{\mathcal{S}} takes a configuration path.

\displaystyle{\begin{aligned}  \mathcal{S} [\gamma] (t_1, t_2) &= \int_{t_1}^{t_2} \mathcal{L} \circ \mathcal{T} [\gamma]  \\   S_\chi [q] (t_1, t_2) &= \int_{t_1}^{t_2} L_\chi \circ \Gamma [q]  \\   \end{aligned}}

\displaystyle{\begin{aligned}  \mathcal{S} [\gamma] (t_1, t_2)  &= S_\chi [\chi \circ \gamma] (t_1, t_2) \\  \end{aligned}}

Computing Actions

\displaystyle{\texttt{literal-function}} makes a procedure that represents a function of one argument that has no known properties other than the given symbolic name.

The method of computing the action from the coordinate representation of a Lagrangian and a coordinate path does not depend on the coordinate system.

Exercise 1.4. Lagrangian actions

For a free particle an appropriate Lagrangian is

\displaystyle{\begin{aligned}  L(t,x,v) &= \frac{1}{2} m v^2  \\   \end{aligned}}

Suppose that x is the constant-velocity straight-line path of a free particle, such that x_a = x(t_a) and x_b = x(t_b). Show that the action on the solution path is

\displaystyle{\begin{aligned}  \frac{m}{2} \frac{(x_b - x_a)^2}{t_b - t_a} \\   \end{aligned}}

— Structure and Interpretation of Classical Mechanics

.

\displaystyle{\begin{aligned}  L(t,x,v) &= \frac{1}{2} m v^2  \\   \end{aligned}}

\displaystyle{\begin{aligned}  S_\chi [\gamma] (t_1, t_2) &= \int_{t_1}^{t_2} L_\chi (t, q(t), Dq(t)) dt \\  &= \int_{t_2}^{t_1} \frac{1}{2} m v^2 dt \\  &= \frac{1}{2} m v^2 \int_{t_2}^{t_1} dt \\  &= \frac{1}{2} m v^2 (t_2 - t_1)  \\  &= \frac{1}{2} m (\frac{x_2 - x_1}{t_2 - t_1})^2 (t_2 - t_1)  \\  &= \frac{1}{2} m \frac{(x_2 - x_1)^2}{t_2 - t_1}   \\   \end{aligned}}

— Me@2006-2008

— Me@2019-03-10 11:08:29 PM

.

.

2019.03.10 Sunday (c) All rights reserved by ACHK

Generalized Coordinates

Configuration Spaces

The set of all configurations of the system that can be assumed is called the configuration space of the system.

Generalized Coordinates

  1. In order to be able to talk about specific configurations we need to have a set of parameters that label the configurations. The parameters used to specify the configuration of the system are called the generalized coordinates.

  2. The \displaystyle{n}-dimensional configuration space can be parameterized by choosing a coordinate function \displaystyle{\chi} that maps elements of the configuration space to n-tuples of real numbers.

  3. The motion of the system can be described by a configuration path \displaystyle{\gamma} mapping time to configuration-space points.

  4. Corresponding to the configuration path is a coordinate path \displaystyle{q = \chi \circ \gamma} mapping time to tuples of generalized coordinates.

The function \displaystyle{\Xi \chi} takes the coordinate-free local tuple \displaystyle{( t, \gamma (t), \mathcal{D} \gamma (t), ... )} and gives a coordinate representation as a tuple of the time, the value of the coordinate path function at that time, and the values of as many derivatives of the coordinate path function as are needed.

\displaystyle{ \begin{aligned} \text{generalized coordinate representation} &= \Xi (\text{local tuple})    \\  (t, q(t), Dq(t), ...) &= \Xi_\chi (t, \gamma(t), \mathcal{D} \gamma(t), ...)    \\  \end{aligned} }

\displaystyle{ \begin{aligned}  \text{generalized coordinates} &= q \\   &= \chi \circ \gamma \\   \\  q(t) &= \chi(\gamma(t)) \\   \end{aligned} }

\displaystyle{ \begin{aligned}    t &\to \gamma: \text{configuration path}    \to \chi: \text{generalized coordinates} = q \\     \end{aligned} }

\displaystyle{ \begin{aligned}  (t, q(t), Dq(t), ...) &= \Xi_\chi (t, \gamma(t), \mathcal{D} \gamma(t), ...)     \\  \\  \Gamma[q](t) &= (t, q(t), Dq(t), ...) \\  \Gamma[q] &= \Xi_\chi \circ \mathcal{T}[\gamma] \\   \end{aligned} }

— 1.2 Configuration Spaces

— Structure and Interpretation of Classical Mechanics

— Me@2019-03-01 03:09:25 PM

.

.

2019.03.01 Friday ACHK

Path-distinguishing function, 2

\displaystyle{\gamma(t)} = configuration path function

\displaystyle{\mathcal{F} [\gamma]} = a function of time that measures some local property of the path

……….It may depend upon the value of the function \displaystyle{\gamma} at that time

……….and the value of any derivatives of \displaystyle{\gamma} at that time.

.

We can decompose \mathcal{F} [\gamma] into two parts:

1. a part that measures some property of a local description

and

2. a part that extracts a local description of the path from the path function.

.

— 1.3 The Principle of Stationary Action

— Structure and Interpretation of Classical Mechanics

.

1. The function that measures the local property of the system depends on the particular physical system;

2. the method of construction of a local description of a path from a path is the same for any system.

.

\displaystyle{ \begin{aligned}  \mathcal{F} [\gamma] &= \mathcal{L} \circ \mathcal{T}[\gamma] \\  \mathcal{T} [\gamma] &= (t, \gamma (t), \mathcal{D} \gamma (t), ...)  \end{aligned}}

.

— 1.3 The Principle of Stationary Action

— Structure and Interpretation of Classical Mechanics

— Me@2019-02-22 11:46:50 PM

.

.

2019.02.24 Sunday ACHK

Path-distinguishing function

So we will try to arrange that the path-distinguishing function, constructed as an integral of a local property along the path, assumes a stationary value for any realizable path. Such a path-distinguishing function is traditionally called an action for the system. We use the word “action” to be consistent with common usage. Perhaps it would be clearer to continue to call it “path-distinguishing function,” but then it would be more difficult for others to know what we were talking about.

— 1.3 The Principle of Stationary Action

— Structure and Interpretation of Classical Mechanics

.

.

2019.02.17 Sunday ACHK

SICM

d_2019_02_02__12_27_49_PM_

Structure and Interpretation of Classical Mechanics (SICM) is a classical mechanics textbook written by Gerald Jay Sussman and Jack Wisdom with Meinhard E. Mayer. The first edition was published by MIT Press in 2001, and [the] second edition was released in 2015. The book is used at the Massachusetts Institute of Technology to teach a class in advanced classical mechanics, starting with Lagrange’s equations and proceeding through canonical perturbation theory.

— Wikipedia on Structure and Interpretation of Classical Mechanics

.

.

2019.02.02 Saturday ACHK

長頸豹 3

尋找時間的定義 1.2

SICM, 3.2 | SICP, 2.2

這段改編自 2010 年 4 月 10 日的對話。

涉獵多門知識,即使對於「本行」的發展,也會有意想不到的幫助。

例如,我對「什麼是時間」這個物理問題,有極之大的興趣。我想像,如果我只閱讀和研究物理,可能窮一身的時間,也沒有寸進。

估不到,在大概 2006 年,我從一本電腦界的神作中,得到了靈感,開始對「時間定義」有一點理解。然後在今年(2010),再加上我在大學時代時,長期訓練得來的「語理分析」功力,我破解了,「時間」的大部分意思。

(安:你上星期也有提及過,那本電腦界的神作。)

又例如,如果一個人過身後,仍然以某種形式存在的話,究竟確實是以哪一種,或者怎麼樣的形式來存在呢?

從物理和電腦知識中,我得到了一些關鍵靈感。

「靈感」中的「靈」,其實就是解「靈活」、「靈通」,即是有大量和多類型的資料或消息來源。

— Me@2014.06.03

2014.06.03 Tuesday (c) All rights reserved by ACHK

SICP, 3

Just as every day thoughts are expressed in natural language, and formal deductions are expressed in mathematical language, methodological thoughts are expressed in programming languages. A programming language is a method for communicating methods, not just a means for getting a computer to perform operations – programs are written for people to read as much as they are written for machines to execute.

— Lisp: A language for stratified design

— Harold Abelson, Gerald Jay Sussman

— SICP distilled

— jao 

2013.05.31 Friday ACHK

Hacker 3

.

The Jargon File has had a special role in acculturating hackers since its origins in the early 1970s. Many textbooks and some literary works shaped the academic hacker subculture; among the most influential are:

* Hackers: Heroes of the Computer Revolution, by Steven Levy
* Godel, Escher, Bach, by Douglas Hofstadter
* The Art of Computer Programming (TAOCP), by Donald Knuth
* The Mythical Man-Month, by Brooks
* Compilers: Principles, Techniques, and Tools (“the Dragon Book”), by Aho, Sethi, and Ullman
* Structure and Interpretation of Computer Programs (SICP), by Abelson and Sussman
* The C Programming Language (K&R), by Kernighan and Ritchie
* The Hitchhiker’s Guide to the Galaxy, by Douglas Adams
* The Tao of Programming, by Geoffrey James
* The Illuminatus! Trilogy, by Robert Shea and Robert Anton Wilson
* Principia Discordia, by Greg Hill and Kerry Thornley
* The Soul of a New Machine, by Tracy Kidder
* The Cuckoo’s Egg, by Cliff Stoll
* The Unix System, by Stephen R. Bourne
* Hackers & Painters, by Paul Graham
* The Cathedral and the Bazaar, by Eric S. Raymond
* The essays of Richard M. Stallman (many published in Free Software, Free Society: Select Essays of Richard M. Stallman)

– Wikipedia on Hacker (programmer subculture)

.

.

[10] “Hacker” here means a highly skilled programmer, not a computer criminal. — Me

The basic difference is this: hackers build things, crackers break them. — Eric S. Raymond

In academia, a “hacker” is a person who follows a spirit of playful cleverness and enjoys programming.

– Wikipedia on Hacker (academia)

.

.

.

2010.03.04 Thursday ACHK

SICM, 3.2

這段改編自 2010 年 4 月 3 日的對話。

《SICM》(Structure and Interpretation of Classical Mechanics)中的編程語言,除了 Scheme 的本體外,還會用到作者特製的力學程式庫 Scmutils。而這個程式庫(library)卻只有 Linux 的版本,不能安裝在 Windows 之中。那導致我要特意在我的 Windows 中,先裝一個 virtual machine(虛擬機器),從而在那個虛擬機器之上,再安裝一個 Linux 作業系統。

閱讀《SICM》,除了間接令我,發現「時間」的定義外,還令我第一次接觸「virtual machine」這個概念。兩者各自都是,我個人智力發展的一個里程碑。

— Me@2012.12.25

2012.12.25 Tuesday (c) All rights reserved by ACHK

尋找時間的定義

SICM, 3 | SICP, 2

這段改編自 2010 年 4 月 3 日的對話。

當年,我初看《SICM》(Structure and Interpretation of Classical Mechanics)時,我不太懂做那些練習題目,因為那時,我是只是初學,而尚未能掌握,內裡的編程語言 Scheme programming language。

為了熟習 Scheme,我先行閱讀了《SICM》的姊妹作,《SICP》(Structure and Interpretation of Computer Programs)的頭幾課。

《SICP》跟《SICM》,同樣是超級名著。但是它不易理解。幸好,它官方網站提供了,一些 1986 年的講課錄影。當年(2006),尚未流行使用 YouTube,所以我要花很多時間,下載那些錄影。我還記得,每節課的錄影檔案,有 600MB 那麼大。

雖然那麼費神,但卻換來意外的收穫。《SICP》令我瞭解「時間」的定義。

This image is taken from 《SICP》 and 《SICP》 itself is licensed under a Creative Commons Attribution-Noncommercial 3.0 Unported License.

最令我意想不到的是,那竟然是來自一本電腦書,而不是物理書。

— Me@2012.12.23

2012.12.23 Sunday (c) All rights reserved by ACHK