13.4.4 Hamiltonian Mechanics

The Lagrangian formulation of mechanics is the most convenient for determining a state transition equation for a collection of bodies. Once the kinetic and potential energies are determined, the remaining efforts are straightforward computation of derivatives and algebraic manipulation. Hamiltonian mechanics provides an alternative formulation that is closely related to the Lagrangian. Instead of expressing second-order differential constraints on an $ n$-dimensional C-space, it expresses first-order constraints on a $ 2n$-dimensional phase space. This idea should be familiar from Section 13.2. The new phase space considered here is an example of a symplectic manifold, which has many important properties, such as being orientable and having an even number of dimensions [39]. The standard phase vector is defined as $ x = (q,{\dot q})$; however, instead of $ {\dot q}$, $ n$ variables will be introduced and denoted as $ p$. Thus, a transformation exists between $ (q,{\dot q})$ and $ (p,q)$. The $ p$ variables are related to the configuration variables through a special function over the phase space called the Hamiltonian. Although the Hamiltonian formulation usually does not help in the determination of $ {\dot x}=
f(x,u)$, it is covered here because its generalization to optimal control problems is quite powerful. This generalization is called Pontryagin's minimum principle and is covered in Section 15.2.3. In the context of mechanics, it provides a general expression of energy conservation laws, which aids in proving many theoretical results [39,397].

The relationship between $ (q,{\dot q})$ and $ (p,q)$ can be obtained by using the Legendre transformation [39,397]. Consider a real-valued function $ f$ of two variables, $ x,y \in {\mathbb{R}}$. Its total differential [508] is

$\displaystyle df = u \;dx + v \;dy ,$ (13.185)

in which

$\displaystyle u = \frac{\partial f}{\partial x} \hspace*{0.25truein}$    and $\displaystyle \hspace*{0.25truein} v = \frac{\partial f}{\partial y} .$ (13.186)

Consider constructing a total differential that depends on $ du$ and $ dy$, instead of $ dx$ and $ dy$. Let $ g$ be a function of $ u$ and $ y$ defined as

$\displaystyle g(u,y) = ux - f .$ (13.187)

The total differential of $ g$ is

$\displaystyle dg = x \; du + u \; dx - df .$ (13.188)

Using (13.185) to express $ df$, this simplifies to

$\displaystyle dg = x \; du - v \; dy.$ (13.189)

The $ x$ and $ v$ variables are now interpreted as

$\displaystyle x = \frac{\partial g}{\partial u} \hspace*{1.0truein} v = -\frac{\partial g}{\partial y} ,$ (13.190)

which appear to be a kind of inversion of (13.186). This idea will be extended to vector form to arrive the Hamiltonian formulation.

Assume that the dynamics do not depend on the particular time (the extension to time-varying dynamics is not difficult; see [39,397]). Let $ L(q,{\dot q})$ be the Lagrangian function defined (13.129). Let $ p \in {\mathbb{R}}^n$ represent a generalized momentum vector (or adjoint variables), which serves the same purpose as $ u$ in (13.185). Each $ p_i$ is defined as

$\displaystyle p_i = \frac{\partial L}{\partial{\dot q}_i}.$ (13.191)

In some literature, $ p$ is instead denoted as $ \lambda$ because it can also be interpreted as a vector of Lagrange multipliers. The Hamiltonian function is defined as

$\displaystyle H(p,q) = p \cdot {\dot q}- L(q,{\dot q}) = \sum_{i=1}^n p_i {\dot q}_i - L(q,{\dot q})$ (13.192)

and can be interpreted as the total energy of a conservative system [397]. This is a vector-based extension of (13.187) in which $ L$ and $ H$ replace $ f$ and $ g$, respectively. Also, $ p$ and $ q$ are the vector versions of $ u$ and $ x$, respectively.

Considered as a function of $ p$ and $ q$ only, the total differential of $ H$ is

$\displaystyle dH = \sum_{i=1}^n \frac{\partial H}{\partial p_i} dp_i + \sum_{i=1}^n \frac{\partial H}{\partial q_i} dq_i .$ (13.193)

Using (13.192), $ dH$ can be expressed as

$\displaystyle dH = \sum_{i=1}^n {\dot q}_i \;dp_i + \sum_{i=1}^n p_i \;d{\dot q...
...al{\dot q}_i} d{\dot q}_i - \sum_{i=1}^n \frac{\partial L}{\partial q_i} dq_i .$ (13.194)

The $ d{\dot q}_i$ terms all cancel by using (13.191), to obtain

$\displaystyle dH = \sum_{i=1}^n {\dot q}_i \;dp_i - \sum_{i=1}^n \frac{\partial L}{\partial q_i} dq_i .$ (13.195)

Using (13.118),

$\displaystyle {\dot p}= \frac{\partial L}{\partial q_i} .$ (13.196)

This implies that

$\displaystyle dH = \sum_{i=1}^n {\dot q}_i \;dp_i - \sum_{i=1}^n {\dot p}_i \;dq_i .$ (13.197)

Equating (13.197) and (13.193) yields $ 2n$ equations called Hamilton's equations:

$\displaystyle {\dot q}_i = \frac{\partial H}{\partial p_i} \hspace*{1.0truein} {\dot p}_i = \frac{\partial H}{\partial q_i} ,$ (13.198)

for each $ i$ from $ 1$ to $ n$. These equations are analogous to (13.190).

Hamilton's equations are equivalent to the Euler-Lagrange equation. Extremals in both cases yield equivalent differential constraints. The difference is that the Lagrangian formulation uses $ (q,{\dot q})$ and the Hamiltonian uses $ (p,q)$. The Hamiltonian results in first-order partial differential equations. It was assumed here that the dynamics are time-invariant and the motions occur in a conservative field. In this case, $ dH = 0$, which corresponds to conservation of total energy. In the time-varying case, the additional equation $ \partial H/\partial t = -\partial L/\partial t$ appears along with Hamilton's equations. As stated previously, Hamilton's equations are primarily of interest in establishing basic results in theoretical mechanics, as opposed to determining the motions of particular systems. For example, the Hamiltonian is used to establish Louisville's theorem, which states that phase flows preserve volume, implying that a Hamiltonian system cannot be asymptotically stable [39]. Asymptotic stability is covered in Section 15.1.1. Pontryagin's minimum principle, an extension of Hamilton's equations to optimal control theory, is covered in 15.2.3.

Steven M LaValle 2012-04-20