# 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

.

.

# 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

.

.

# The Principle of Stationary Action

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

.

The Principle of Stationary Action $\displaystyle{\delta_\eta S[q] (t_1, t_2) = 0}$ $\delta_\eta S[q] (t_1, t_2) = \int_{t_1}^{t_2} \delta_\eta L \circ \Gamma[q]$

— Structure and Interpretation of Classical Mechanics

.

.

2019.05.13 Monday 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

.

.

# 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

.

.

# 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

.

.

# 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

.

.

# 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 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

SICM, 3.2 | SICP, 2.2

（安：你上星期也有提及過，那本電腦界的神作。）

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

— Me@2014.06.03

# 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)

.

.

 “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.

.

.

.

2010.03.04 Thursday ACHK

# SICM, 3.2

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

— Me@2012.12.25

# 尋找時間的定義

SICM, 3 | SICP, 2

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