Friday, July 7, 2017

(B11) - Dynamics Part 3







$
\let\ss\scriptstyle
\let\sss\scriptscriptstyle
\newcommand{\vshift}[2]{\raise#1ex\hbox{${#2}$}}
\newcommand{\bs}[1]{\boldsymbol{#1}}
\newcommand{\+}{\hspace{1mu}}
\newcommand{\dt}[1]{\overset{\sss \bullet}{#1}}
\newcommand{\ddt}[1]{\overset{\sss \bullet \bullet}{#1}}
\newcommand{\pt}[1]{\overset{\vshift{-.5}{\ss \circ}}{#1}}
\newcommand{\ppt}[1]{\overset{\vshift{-.5}{\ss \circ}}{#1}}
\newcommand{\pow}[1]{\raise{.8ex}{\ss{#1}}}
\newcommand{\uminus}{\vshift{.17}{\bs{\ss{-}}}}

\renewcommand{\i}{\+\pow{(i)}}
\renewcommand{\ii}{^{(i)}}
\renewcommand{\p}{\partial}
\renewcommand{\d}{{\vshift{-.4}{\!\+\+\+\ss\delta\+}}}
\renewcommand{\a}{\alpha}
\renewcommand{\b}{{\vshift{-.4}{\!\+\+\+\ss\beta\+}}}
\renewcommand{\g}{\gamma}
\renewcommand{\ba}{\bar{\a}}
\renewcommand{\bb}{\bar{\b}}
\renewcommand{\bg}{\bar{\g}}
\renewcommand{\R}{\bs{R}}
\renewcommand{\V}{\bs{V}}
\renewcommand{\A}{\bs{A}}
\renewcommand{\P}{\bs{P}}
\renewcommand{\F}{\bs{F}}
\renewcommand{\Q}{Q_{\a\b}}
\renewcommand{\L}{\mathcal{L}}
\renewcommand{\H}{\mathcal{H}}
\renewcommand{\dR}{\dt{\R}}
\renewcommand{\ddR}{\ddt{\R}}

\newcommand{\sdt}[1]{\lower{.5ex}{\ss \dt{#1}}}
\newcommand{\dXdq}[2]{\p_{#1} {#2}}
\newcommand{\dXdp}[2]{\p^{#1} {#2}}
\newcommand{\dXdqt}[2]{\p \sdt{#1} {#2}}
\newcommand{\dRdq}{\dXdq{\a}{\R}}
\newcommand{\dVdq}{\dXdq{\a}{\V}}
\newcommand{\dLdq}{\dXdq{\a}{L}}
\newcommand{\dLdqt}{\dXdqt{\a\+}{L}}
\newcommand{\dHdq}{\dXdq{\a}{H}}
\newcommand{\dHdp}{\dXdp{\a\!}{H}}
\newcommand{\qdot}[1]{\dt{q} \pow{#1}}
\newcommand{\lagrangify}[1]{\dt{ \left[ \+ \dXdqt{\a}{#1} \+ \right]} \, - \, \dXdq{\a}{#1}}

$

Primer

This blurb is a direct continuation of the previous [dynamics 2]. The notation and all definitions carry over. Here we expand Lagrange's and Hamilton's equations using tensor notation. We explore Lagrange's equations given a general Lagrangian $L(q,\dt{q},t)  = T - U$. For Hamilton's equations we restrict ourselves to potential functions that are linear in the velocities, ie. $\p \sdt{\a}\sdt{\b} U = 0$.

In the previous post we carried around $t$ explicitly. In this post however, we will treat $t$ as another coordinate $t \equiv q^0$. Note that $\qdot{0} = 1$ and $\ddt{q}\pow{0} = 0$. The main advantage will be that we no longer have to carry around terms with partial time derivatives $\circ$, since they will be implicit in Einstein summations involving $\p_\a$. We can also write the functional dependencies $\R(q), L(q,\qdot{}), H(q,\qdot{}),$ etc. more succinctly. The only thing special about $t$ is that it is not of a spatial dimension. So Lagrange's equations
$$
\lagrangify{L} \; = \; F_\a
$$which were a result of a virtual spatial displacement $\delta \R$, do not apply to the time-index (even though $F_0$ is perfectly well defined). In Hamilton's equations we have a little bit more freedom. There is nothing stopping us from defining the momentum conjugate to time: $p_0 = \dXdqt{0\+}{L} = 0$. Since $p_0$ vanishes, the value of the Hamiltonian
$$
H = \qdot{\a} \+ p_\a \, - \, L
$$remains unchanged when we introduce the time-index. However, the momenta half of Hamilton's equations, which followed from Lagrange's equations, still do not apply to the time-index. We need modify Hamilton's equations to
$$
\begin{array}{rcl}
    \dt{q}\pow{\+\a} &=& \dHdp \\
    \dt{p}_\a &=&
        \left\{ \begin{array}{ll}
            \, 0 & \a = 0 \\
            \, F_\a \, - \, \dHdq \qquad & \text{otherwise}
        \end{array} \right.
\end{array}
$$where the coordinate equation $\qdot{\+0} = \dXdp{\+0\!}{H} = 1$ is valid by virtue of the Legendre transform. This is an ugly modification though, so instead we will use the convention that whenever we write down the equations of motion, the free-index does not run over $0$. Whenever I feel there is a possible confusion about the time-index I will point it out. Otherwise try to keep its meaning in the back of your mind -- everything will follow through nicely so long as you remember that
$$
\begin{array}{ccc}
q^0 = t, & \qdot{\+0} = 1, \\
p_0 = 0, & \dt{p}_0 = 0
\end{array}
$$

Definitions

Here is where the funky notation really shines. We can think of $\R(q)$ as a statement that each particle lives in the $\eta+1$-dimensional space of $q$'s. We can define the typical tensor quantities for each particle by amounting $\R\i$ to the vector field of position. The covariant basis for each particle is then
$$
\bs{q}\ii_{\+\a} \; = \; \dRdq\ii
$$ Naturally, the covariant metric tensor of each particle becomes
$$
q\ii_{\+\a\b} \; = \; \bs{q}\ii_{\+\a} \cdot \bs{q}\ii_{\+\b}
$$ Note that since $\R\i$ might not depend on all the coordinates, some of the basis vectors might vanish $\bs{q}\ii_{\+\a} = \bs{0}$. In such a case $q\ii_{\+\a\b}$ becomes singular and the contravariant-particle quantities are ill-defined. We get around this issue by considering the system as a whole. We define the covariant metric tensor of the system as the mass-weighted sum of the particle metric tensors
$$
Q_{\a\b} = \sum m\i \, q\ii_{\a\b}
$$ There is no problem defining the contravariant-system quantities since $Q_{\a\b}$ will always be invertible (otherwise the system is non-holonomic). Indeed the contravariant metric tensor of the system is defined as such inverse $Q^{\a\g}Q_{\g\b} = \delta^\a_\b$. We can also define the system-Christoffel symbols
$$
\Gamma^\g_{\a\b} \;\; = \;\; \tfrac{1}{2} \+ Q^{\g\d} \+ \left( \dXdq{\a}{Q_{\b\d}} \; + \;
    \dXdq{\b}{Q_{\a\d}} \; - \; \dXdq{\d}{Q_{\a\b}} \right)
$$


Tensor Lagrange

We will start with Lagrange's equations in their full generality. Let us define the Lagrangian operator $\L$ that acts on a function
$$
\L_\a[X] \;\; = \;\; \dt{ [ \+ \dXdqt{\a}{X} \+ ] } \, - \, \dXdq{\a}{X}
$$ Note that the operator is obviously linear. Because I like the way it sounds, I will use the term "Lagrangify"  to represent an application of $\L$. Indeed, Lagrangifying the Lagrangian yields Lagrange's equations. Try saying that five times fast.
$$
\L_\a[L] \; = \; \L_\a[T-U] \; = \; \L_\a[T] \, - \, \L_\a[U] \; = \; F_\a
$$
This will be useful for carrying the potential $U$ around. While we treat $U$ as somewhat arbitrary, the kinetic energy $T$ has a concrete form in terms of the particle velocities $\V = \qdot{\a} \+ \bs{q}_{\+\a}$.
$$
T \;\; = \;\; \sum \tfrac{1}{2} m \V \cdot \V  \;\; = \;\; \tfrac{1}{2} \+  \qdot{\a} \+ \qdot{\b} \, \Q
$$ Lagrangifying $T$ is a fairly straightforward application of the chain rule. Since the potential is just an arbitrary function $U(q, \dt{q})$, we can also Lagrangify it in one shot
$$
\begin{array}{rcl}
\L_\g[T] &=& \ddt{q} \pow{\a} \, Q_{\a\g}  \; + \;
         \qdot{\a} \+ \qdot{\+\b} \+
            \+ \left( Q_{\g\d} \+\+ \Gamma^{\d}_{\a\b} \right) \\
\L_\g[U] &=& \ddt{q} \, \p \sdt{\a} \sdt{\g} \+ U  \; + \;
         \qdot{\a} \,  \p_\a \sdt{\g} \+ U \; - \; \dXdq{\g\+}{U}
\end{array}
$$
Note that the second term in $\L_\g[T]$ follows by symmetry. Subtracting the second equation from the first brings us to Lagrange's equations $\L_\g[L] = F_\g$
$$
    \ddt{q} \pow{\a} \+ \left( Q_{\a\g} - \p \sdt{\a} \sdt{\g} \+ U \right)  \; + \;
    \qdot{\a} \+ \qdot{\b} \+ \left( Q_{\g\d} \+\+ \Gamma^{\d}_{\a\b} \right)
    \; - \; \qdot{\a} \+ \left( \p_\a \sdt{\g} \+ U \right)  \; + \; \dXdq{\g\+}{U} \;\; = \;\; F_\g
$$ To decouple the coordinate accelerations we need to invert $\left( Q_{\a\g} - \p \sdt{\a} \sdt{\g} \+ U \right)$, which is typically only feasible numerically. Let's consider the special case where $U=0$. For most applications (video games in particular), this is not unduly hampering since we can always move $U$ to the RHS by subtracting $\nabla U$ from $\F$. If we then multiply both sides by the contravariant metric tensor we end up with decoupled equations of motions that are quite analagous to the ones we found for a single particle. Indeed, $Q^{\g\d}\L_\d[L]$ yields
$$
\ddt{q} \pow{\g}  \; + \; \qdot{\a} \+ \qdot{\b} \, \Gamma^{\+\g}_{\a\b} \;\; = \;\; F^\g
$$

Tensor Hamilton

The conjugate momenta take a simple tensor form
$$
p_\a \; = \; \dLdqt \; = \; \qdot{\b} \Q - \dXdqt{\a}{U}
$$ To find the Hamiltonian as a function of $q$ and $p$, we invert the expression above to find the velocities as a function $\qdot{}(q,p)$ and plug the result into $H = \qdot{\a} p_\a - L$. The problem is that for a general $U(q,\qdot{})$, the second term on the RHS $\dXdqt{\a}{U}$ will be a function of $\qdot{}$ and an explicit inversion will typically be impossible. We really want $\dXdqt{\a}{U}$ to be a function of $q$ alone. We can ensure this by restricting the potential $U$ to be linear in the velocities. That is, $\p \sdt{\a} \sdt{\b} \+ U = 0$ or rather the potential takes the form
$$
U(q,\qdot{}) \;\; = \;\; \qdot{\a} \+ W_\a  \, + \, \Lambda
$$ for some arbitrary functions $W_\a(q)$ and $\Lambda(q)$ of $q$ alone. Classically, the letter $V$ is used in place of $\Lambda$, but there is no reason to overload letters (instead we flip the V upside down). An example of such a potential occurs in the consideration of electromagnetic forces. The inversion of the momenta yields the first half of Hamilton's equations: $ \qdot{\a} = Q^{\a\b} P_\b$ where
$$
P_\b  \;\; = \;\;  p_\b + W_\b
$$ Now we simply plug $\qdot{}$ into the three terms $\qdot{\a}p_\a - T + U$ to get an expression for the Hamiltonian $H(q,p)$.
$$
H \;\; = \;\; \tfrac{1}{2} \+ P_\a P_\b \+ Q^{\a\b} \, + \, \Lambda
$$
Taking the coordinate derivatives of $H$ leads us to Hamilton's equations: $\qdot{\a} = \dHdp$ and $\dt{p}_\a = F_\a - \dHdq$, which are the set of $2 \eta$ velocity-decoupled first-order equations
$$
\begin{array}{rcl}
\qdot{\a} &=& Q^{\a\b} P_\b \\
\dt{p}_\a &=& F_\a \; - \; \dXdq{\a}{\Lambda} \; - \;  P_\g \+ Q^{\g\b} \+ \dXdq{\a}{W_{\!\b}} \; - \;  \tfrac{1}{2} \+ P_\g P_\b \+ \dXdq{\a} Q^{\g\b}
\end{array}
$$
Note that the first term on the RHS $\L[U] = \uminus \dXdq{\a}{\Lambda}$. By the force-potential equivalence, we can always set $U=0$ and $L=T$. The second and third terms then get swallowed by $F_\a$ and we end up with an expression that is very similar to Lagrange's set of decoupled equations. Both are quite convenient for computation.
$$
 \dt{p}_\a \;\; = \;\; F_\a \; - \;  \tfrac{1}{2} \+ p_\g \+ p_\b \+ \dXdq{\a} Q^{\g\b}
$$


1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete