1. Constructing the Hamiltonian
Start from a Lagrangian $L(\mathbf{q}, \dot{\mathbf{q}}, t)$ and define the conjugate momenta
\[ p_i = \frac{\partial L}{\partial \dot{q}_i}, \qquad i = 1,\dots,n. \]
Under the usual regularity condition (the map $\dot{\mathbf{q}} \mapsto \mathbf{p}$ can be inverted), we define the Hamiltonian
\[ H(\mathbf{q}, \mathbf{p}, t) = \sum_{i=1}^{n} p_i \dot{q}_i - L(\mathbf{q}, \dot{\mathbf{q}}, t), \]
where $\dot{\mathbf{q}}$ on the right-hand side is expressed in terms of $(\mathbf{q},\mathbf{p},t)$.
For a natural mechanical system (kinetic energy quadratic in $\dot{\mathbf{q}}$, potential depending only on $\mathbf{q}$),
\[ H = T + V, \]
so the Hamiltonian coincides with the total mechanical energy.
2. Hamilton’s Canonical Equations
Varying the action in Hamiltonian form, or transforming the Euler–Lagrange equations, yields the canonical equations of motion:
\[ \dot{q}_i = \frac{\partial H}{\partial p_i}, \qquad \dot{p}_i = -\frac{\partial H}{\partial q_i} + Q_{\text{nc},i}, \qquad i = 1,\dots,n, \]
where $Q_{\text{nc},i}$ are generalized nonconservative forces (actuators, drag, etc.).
In compact vector–matrix form, define the state vector $\mathbf{x} = (\mathbf{q},\mathbf{p})^T$ and the symplectic matrix
\[ [J] = \begin{bmatrix} 0 & I \\ -I & 0 \end{bmatrix}. \]
Then Hamilton’s equations can be written as
\[ \dot{\mathbf{x}} = [J]^{-1} \frac{\partial H}{\partial \mathbf{x}} + \begin{bmatrix} 0 \\ \mathbf{Q}_{\text{nc}} \end{bmatrix}, \qquad \mathbf{Q}_{\text{nc}} = (Q_{\text{nc},1},\dots,Q_{\text{nc},n})^T. \]
The constant matrix $[J]$ encodes the symplectic geometry of phase space.
3. Poisson Brackets — Compact Form of Hamilton’s Equations
For any smooth phase-space function $F(\mathbf{q},\mathbf{p},t)$, its time derivative along the motion is
\[ \dot{F} = (F,H) + \frac{\partial F}{\partial t} + \left[\frac{\partial F}{\partial \mathbf{p}}\right]^T \mathbf{Q}_{\text{nc}}, \]
where the Poisson bracket of $F$ and $G$ is defined as
\[ (F,G) = \sum_{i=1}^{n} \left( \frac{\partial F}{\partial q_i} \frac{\partial G}{\partial p_i} - \frac{\partial F}{\partial p_i} \frac{\partial G}{\partial q_i} \right). \]
Hamilton’s canonical equations themselves can be written compactly as
\[ \dot{q}_i = (q_i,H), \qquad \dot{p}_i = (p_i,H) + Q_{\text{nc},i}. \]
A function $F$ is conserved (first integral) if
- $\partial F/\partial t = 0$,
- $(F,H) = 0$,
- $\displaystyle \left[\frac{\partial F}{\partial \mathbf{p}}\right]^T \mathbf{Q}_{\text{nc}} = 0 $ (no explicit work from nonconservative forces along $F$).
4. Canonical Transformations
A transformation of phase-space variables
\[ (\mathbf{q},\mathbf{p}) \longrightarrow (\mathbf{Q},\mathbf{P}) \]
is called canonical if the new variables again satisfy Hamilton’s equations with respect to some (possibly new) Hamiltonian $H^\ast(\mathbf{Q},\mathbf{P},t)$. Geometrically, this means the transformation preserves the symplectic structure of phase space.
4.1 Symplectic (Jacobian) Criterion
Let the transformation be smooth and invertible:
\[ \mathbf{Q} = f(\mathbf{q},\mathbf{p},t), \qquad \mathbf{P} = g(\mathbf{q},\mathbf{p},t). \]
Its Jacobian matrix is
\[ [M] = \begin{bmatrix} \dfrac{\partial \mathbf{Q}}{\partial \mathbf{q}} & \dfrac{\partial \mathbf{Q}}{\partial \mathbf{p}} \\ \dfrac{\partial \mathbf{P}}{\partial \mathbf{q}} & \dfrac{\partial \mathbf{P}}{\partial \mathbf{p}} \end{bmatrix}. \]
The transformation is canonical if and only if
\[ [M]\,[J]\,[M]^T = [J], \]
i.e. $[M]$ is a symplectic matrix. This condition implies:
- preservation of phase-space volume (Liouville’s theorem),
- preservation of Poisson brackets: $(Q_i,P_j)=\delta_{ij}$, $(Q_i,Q_j)=0$, $(P_i,P_j)=0$.
5. Perfect Differential Criterion (Powerful Test)
An alternative and often simpler test is based on the phase-space 1-form $\sum (q_i\,dp_i - p_i\,dq_i)$. A transformation is canonical if there exists a scalar function $W$ such that
\[ \sum_{i=1}^{n} \left(q_i\,dp_i - p_i\,dq_i\right) - \sum_{i=1}^{n} \left(Q_i\,dP_i - P_i\,dQ_i\right) = dW. \]
If the left-hand side is an exact differential $dW$, the transformation is canonical. This “perfect differential” test is usually much easier to apply by hand than checking $[M][J][M]^T = [J]$ directly.
6. Generating Functions
Many canonical transformations can be constructed from a single scalar generating function $W$, involving a mix of old and new variables. Four standard types are:
| Type | Generating Function | Depends on | Relations |
|---|---|---|---|
| $W_1$ | $W_1(\mathbf{q}, \mathbf{Q}, t)$ | old $\mathbf{q}$, new $\mathbf{Q}$ | $p_i = \dfrac{\partial W_1}{\partial q_i}, \quad P_i = -\dfrac{\partial W_1}{\partial Q_i}$ |
| $W_2$ | $W_2(\mathbf{q}, \mathbf{P}, t)$ | old $\mathbf{q}$, new $\mathbf{P}$ | $p_i = \dfrac{\partial W_2}{\partial q_i}, \quad Q_i = \dfrac{\partial W_2}{\partial P_i}$ |
| $W_3$ | $W_3(\mathbf{p}, \mathbf{Q}, t)$ | old $\mathbf{p}$, new $\mathbf{Q}$ | $q_i = -\dfrac{\partial W_3}{\partial p_i}, \quad P_i = -\dfrac{\partial W_3}{\partial Q_i}$ |
| $W_4$ | $W_4(\mathbf{p}, \mathbf{P}, t)$ | old $\mathbf{p}$, new $\mathbf{P}$ | $q_i = -\dfrac{\partial W_4}{\partial p_i}, \quad Q_i = \dfrac{\partial W_4}{\partial P_i}$ |
Generating functions are central in:
- orbit element transformations,
- Hamilton–Jacobi theory,
- action–angle variables and perturbation methods.
7. Example: Orthogonal Canonical Transformation
Consider the linear transformation
\[ \mathbf{q} = [A]\mathbf{q}^\ast, \qquad \mathbf{p} = [A]\mathbf{p}^\ast, \]
where $[A]$ is an orthogonal matrix:
\[ [A]^T[A] = I. \]
Substituting into the phase-space 1-form gives
\[ \mathbf{q}^T d\mathbf{p} - (\mathbf{q}^\ast)^T d\mathbf{p}^\ast = 0, \]
so the perfect differential criterion is satisfied with $W = 0$. The transformation is canonical. In practice, such orthogonal transformations appear when diagonalizing coupled oscillators into normal modes.
8. Example: Nonlinear Canonical Transformation
For a single degree of freedom, consider the nonlinear change of variables
\[ q_j = 2 a_j \cos p_j^\ast, \qquad p_j = 2 a_j \sin p_j^\ast, \]
where $a_j$ is a constant. Applying the perfect differential test yields the generating function
\[ W = -\frac{1}{2} \sum_j a_j \sin(2 p_j^\ast). \]
Hence the transformation is canonical, and the new Hamiltonian $H^\ast$ is obtained by substituting $(\mathbf{q},\mathbf{p})$ in terms of $(\mathbf{q}^\ast,\mathbf{p}^\ast)$ into the original $H$.
9. Time as a Canonical Coordinate
When the Hamiltonian has explicit time dependence, it is often convenient to extend phase space by treating time as an additional coordinate:
\[ q_{n+1} = t, \qquad p_{n+1} = -H. \]
In the extended $(2n+2)$-dimensional phase space, the Hamiltonian becomes autonomous. This trick is widely used in orbit perturbation theory and in constructing action–angle variables.
10. Summary Box — Hamiltonian Dynamics & Canonical Transformations
Hamiltonian Dynamics
- Define momenta: $p_i = \partial L / \partial \dot{q}_i$.
- Hamiltonian: $H = \displaystyle \sum_i p_i \dot{q}_i - L$.
- Canonical equations: $\dot{q}_i = \partial H / \partial p_i$, $\dot{p}_i = -\partial H / \partial q_i + Q_{\text{nc},i}$.
- Poisson-bracket form: $\dot{F} = (F,H) + \partial F/\partial t + (\partial F/\partial\mathbf{p})^T \mathbf{Q}_{\text{nc}}$.
Canonical Transformations
- Preserve the structure of Hamilton’s equations.
- Symplectic condition on the Jacobian: $[M][J][M]^T = [J]$.
- Perfect differential test: $\sum(q_i\,dp_i - p_i\,dq_i) - \sum(Q_i\,dP_i - P_i\,dQ_i) = dW$.
- Generated by functions $W_1, W_2, W_3, W_4$ of mixed old/new variables.
- Used for simplifying dynamics, finding normal modes, and transforming orbit elements or action–angle coordinates.