# Hamiltonian systems

Post-publication activity

Curator: James Meiss

A dynamical system of $$2n\ ,$$ first order, ordinary differential equations $\tag{1} \dot z=J\nabla H(z,t),\quad J= \left( {\begin{array}{*{20}c} 0 & I \\{ - I} & 0 \\ \end{array}} \right) \;,$

is an $$n$$ degree-of-freedom (d.o.f.) Hamiltonian system (when it is nonautonomous it has $$n + 1/2$$ d.o.f.). Here $$H$$ is the ''Hamiltonian'', a smooth scalar function of the extended phase space variables $$z$$ and time $$t\ ,$$ the $$2n \times 2n$$ matrix $$J$$ is the Poisson matrix and $$I$$ is the $$n\times n$$ identity matrix. The equations naturally split into two sets of $$n$$ equations for canonically conjugate variables, $$z = (q,p)\ ,$$ i.e. $\tag{2} \dot q=\partial H/\partial p,\quad \dot p=-\partial H/\partial q \;.$

Here the $$n$$ coordinates $$q$$ represent the configuration variables of the system (e.g. positions of the component parts) and their canonically conjugate momenta $$p$$ represent the impetus gained by movement.

Hamiltonian systems are universally used as models for virtually all of physics.

## Formulation

In 1834 William Rowan Hamilton showed that Newton's equations $$F = ma$$ for a set of particles in a conservative force field $$F = -\nabla V$$ with "potential energy" $$V$$ could be derived from a single function that he called the "characteristic function", $\tag{3} H(q,p) = \sum_{i=1}^n \frac{|p_i|^2}{2m_i} + V(q_1,q_2,\ldots,q_n) \;.$

Here $$q_i$$ is the position of the $$i^{th}$$ particle whose mass is $$m_i\ ,$$ and $$p_i$$ is its canonical momentum $$p_i = m_i \dot{q}_i\ .$$ The equations of motion are obtained by (2), which can in turn be converted to Newton's second order form by differentiating the equation $$\dot{q}_i = {p_i}/{m_i}\ .$$

At first it seems that Hamilton's formulation gives only a convenient restatement of Newton's system---the convenience perhaps most evident in that the scalar function $$H(q,p)$$ encodes all of the information of the $$2n$$ first order dynamical equations. However, a Hamiltonian formulation gives much more than just this simplification. Indeed, if we allow more general functions $$H(q,p,t)$$ and a more general relationship between the canonical momenta and the velocities $$\dot{q}$$ then virtually all of the models of classical physics have a Hamiltonian formulation, including electromagnetic forces, which are not derivable from a (scalar) potential. Moreover, waves in inviscid fluids such as surface water waves or magnetohydrodynamic waves also have a Hamiltonian (PDE) formulation. Quantum mechanics is formally obtained from classical mechanics by replacing the canonical momentum in the Hamiltonian by a differential operator.

Hamiltonian structure provides strong constraints on the flow. Most simply, when $$H$$ does not depend upon time (autonomous) then its value is constant along trajectories: the energy $$E = H(q,p)$$ is constant, see Energy Conservation. Similarly if the Hamiltonian is independent of one of the configuration variables (the variable is ignorable), then (2) implies that the corresponding canonical momentum is an invariant. This gives a simple explanation for the relation between symmetries (for example rotational symmetry) and invariants (for example angular momentum)---see Noether's Theorem.

One of the stronger constraints imposed by Hamiltonian structure relates to stability: it is impossible for a trajectory to be asymptotically stable in a Hamiltonian system. Even more structure applies: for each eigenvalue $$\lambda$$ of an equilibrium there is a corresponding opposite eigenvalue $$-\lambda\ .$$ For example an equilibrium of a one degree-of-freedom system must either be a center (two imaginary eigenvalues, $$\pm i\omega$$ or a saddle (two real eigenvalues, $$\pm\lambda$$) or have a double zero eigenvalue.

Another geometric implication is that knowledge of $$n$$ invariants is enough to fully characterize a solution of the $$2n$$ equations for an $$n$$ degree-of-freedom system, i.e., the Hamiltonian is integrable. This follows from Liouville's Integrability Theorem. Moreover, if the orbits of such a system are bounded, then almost all of them must lie on $$n$$-dimensional tori. Kolmogorov, Arnold and Moser proved that a sufficiently smooth, nearly-integrable Hamiltonian system still has many such invariant tori (see KAM theory). This strong structural stability of Hamiltonian dynamics was unexpected even in the middle of the $$20^{th}$$ century when physicists began the first computer simulations of dynamical systems (see Fermi Pasta Ulam problem).

## Examples

For many mechanical systems, the Hamiltonian takes the form $$H(q,p) = T(q,p) + V(q)\ ,$$ where $$T(q,p)$$ is the kinetic energy, and $$V(q)$$ is the potential energy of the system. Such systems are called natural Hamiltonian systems. The simplest case is when the kinetic energy is of the form in (3) for a set of particles with kinetic momenta $$p_i \in \mathbb{R}^3$$ and masses $$m_i\ .$$ More generally, when the extent of the bodies is taken into account the kinetic energy can depend upon the configuration of the system, but it is typically a quadratic function of the momenta, so that $$T(q,p) = \frac12 p^T M(q)^{-1} p \ ,$$ where the $$n \times n$$ mass matrix $$M(q)$$ represents the shape as well as the inertia of the system, and the vector $$p \in \mathbb{R}^n$$ includes both linear momenta and angular momenta.

### Springs

A harmonic spring has potential energy of the form $$\frac{k}{2}x^2\ ,$$ where $$k$$ is the spring's force coefficient (the force per unit length of extension) or the spring constant, and $$x$$ is the length of the spring relative to its unstressed, natural length. Thus a point particle of mass $$m$$ connected to a harmonic spring with natural length $$L$$ that is attached to a fixed support at the origin and allowed to move in one dimension has a Hamiltonian of the form $$H(q,p) = \frac{1}{2m} p^2 + \frac{k}{2}(q-L)^2$$ and thus its equations of motion are $\dot{q} = p/m \;, \quad \dot{p} = -k(q-L) \;.$ If the spring is hanging vertically in a constant gravitational field, then the new equations are obtained by simply adding the gravitational potential energy $$m g q$$ to $$H\ .$$

A set of point masses that are coupled by springs has potential energy given by the sum of the potential energies of each spring in the system. For example suppose that there are two masses connected to three springs as shown in (Figure 1). The Hamiltonian is $H(q,p) = \frac{1}{m_1} p_1^2 + \frac{1}{m_2} p_2^2 + \frac{k_1}{2}q_1^2 + \frac{k_2}{2} (q_2-q_1)^2 + \frac{k_3}{2}(L-q_2)^2 \;.$

One advantage of the Hamiltonian formulation of mechanics is that the equations for arbitrarily complicated arrays of springs and masses can be obtained by simply finding the expression for the total energy of the system (However, it is often easier to do this using the Lagrangian formulation of mechanics which does not require knowing the form of the canonical momenta in advance).

### Pendulum

The ideal, planar pendulum is a particle of mass $$m$$ in a constant gravitational field, that is attached to a rigid, massless rod of length $$L\ ,$$ as shown in (Figure 2). The canonical momentum of this system is the angular momentum $$p = mL^2 \dot{\theta}$$ and the potential energy is the gravitational energy $$-mgL \cos \theta\ ,$$ where $$\theta$$ is the angle from the vertical. The Hamiltonian is $\tag{4} H(\theta,p) = \frac{p^2}{2mL^2} - mgL \cos\theta \;.$

This gives the equations of motion $\dot{\theta} = \frac{p}{mL^2} \;,\quad \dot{p} = -mgL \sin \theta \;.$ While these equations are simple, their explicit solution requires elliptic functions. However, the trajectories of the pendulum are easy to visualize since the energy is conserved, see (Figure 3). When the energy is below $$mgL$$ the angle cannot exceed $$\pi$$ and the pendulum oscillates. Since the energy is conserved, the orbit must be periodic. For energies larger than $$mgL\ ,$$ the pendulum rotates, and the angle either monotonically grows with time (if the angular momentum is positive) or decreases (negative $$p$$). The critical level set is the separatrix; the two orbits on this level set asymptotically approach the equilibrium $$(\pm\pi,0)$$ as $$t \to \pm \infty\ .$$ These are called homoclinic orbits.

### N-body problem

A set of point masses interacting by Newton's gravitational force is also a Hamiltonian system of the natural form (3) with potential energy $V(q_1,\ldots q_n) = - \sum_{i<j} \frac{Gm_im_j}{||q_i-q_j||}$ where $$q_i \in \mathbb{R}^3$$ is the position of the $$i^{th}$$ body. In addition to the conserved energy $$H = E$$ this system has additional conserved quantities. Since $$H$$ is a function only of the difference between particle positions, the total momentum $\tag{5} P = \sum_{i=1}^n p_i$

is conserved. Since $$H$$ is a function only of the distance between the bodies, the total angular momentum is also conserved $L = \sum_{i=1}^n q_i \times p_i$

For the case of two bodies, the Hamiltonian has six degrees of freedom (the three components of the position and momentum for each body), however, the conservation of total momentum means that if we choose coordinates moving with the center of mass $Q = \frac{1}{M} \sum_{i=1}^n {m_i q_i}$ where $$M = \sum m_i$$ is the total mass, then the Hamiltonian is independent of $$Q\ ,$$ so that its conjugate momentum (5) is constant. Thus the system is reduced to three degrees of freedom, depending only upon the inter-particle vector $$q = q_1-q_2\ ,$$ and its conjugate momentum, $$p = \mu \dot{q}\ ,$$ where $$\mu = \frac{m_1m_2}{M}$$ is the reduced mass. In these coordinates the Hamiltonian becomes $\tag{6} H(q,Q,p,P) = \frac{P^2}{2M} + \frac{p^2}{2\mu} - \frac{Gm_1m_2}{||q||}$

The total angular momentum splits as well $$L = Q\times P + q \times p\ .$$ Since $$P$$ is constant, and $$\dot{Q} = MP\ ,$$ the first term is itself individually conserved, so $$l = q \times p$$ is also constant, a fact that can also be seen from (6) directly.

The dynamics of three or more bodies can be extremely complex.

### Electromagnetic Forces

A nonrelativistic charged particle in an electromagnetic field has the equations of motion $m \ddot{q} = e E(q,t) + \frac{e}{c}\dot{q} \times B(q,t)$ where $$E$$ is the electric field, and $$B$$ is the magnetic field and we use Gaussian (cgs) units. This system is Hamiltonian, with $\tag{7} H(q,p,t) = \frac{1}{2m} \left (p - \frac{e}{c} A \right)^2 + e \phi ,$

where the scalar and vector potentials $$\phi$$ and $$A$$ are defined through $E = \nabla \phi + \frac{\partial A}{\partial t} , \quad B = \nabla \times A .$

The momentum occurring in (7) is not the kinetic momentum $$m \dot{q}\ ,$$ but rather a canonical momentum defined by $$p = m \dot{q} + \frac{e}{c}A\ .$$ For systems that also have a Lagrangian formulation, the canonical momentum is defined by $p = \frac{\partial L(q,\dot{q})}{\partial \dot{q}} \;.$

Note that the first term in the Hamiltonian (7) is simply the kinetic energy as usual, and the last term is the electrical potential energy.

## Geometric Structure

Much of the elegance of the Hamiltonian formulation stems from its geometric structure. Hamiltonian phase space is an even dimensional space with a natural splitting into two sets of coordinates, the configuration variables $$q$$ and the momenta $$p\ .$$ For most physical systems the momenta are similar to velocities, which are tangent vectors to trajectories, but the difference--emphasized in the electromagnetic example--is that they are cotangent vectors, as we will explain further below. In this case the Hamiltonian phase space is the cotangent bundle of the configuration space.

More abstractly, the phase space of a Hamiltonian system is an even dimensional manifold $$M$$ that is endowed with a nondegenerate two-form, $$\omega\ .$$ This two-form allows us to define a pairing between vectors and covectors. Given a Hamiltonian function $$H: M \to \mathbb{R}\ ,$$ the Hamiltonian vector field $$\dot{z} = X(z)$$ is defined by $\tag{8} i_X \omega \equiv \omega(X,\cdot) = dH .$

This is just a coordinate-free version of (1). Indeed, a famous theorem of Darboux implies that near each point in $$M$$ there exists a set of canonical variables $$z = (q,p)\ ,$$ such that $\omega = dq \wedge dp \;,$ where $$\wedge$$ is the "wedge product". In terms of these coordinates, $$\omega(v,w) = v^T J w\ ,$$ where $$J$$ is the Poisson matrix (1), and the equations (8) become $J^{T} X = \nabla H ,$ which is a restatement of (1).

### Conservation of Energy

If a Hamiltonian does not depend explicitly on time, then its value, the energy, is constant. Indeed differentiating along a trajectory gives $\frac{dH}{dt} = \frac{\partial H}{\partial q} \frac{dq}{dt} + \frac{\partial H}{\partial p} \frac{dp}{dt} = 0 ,$ by (2). Thus $$H(q(t),p(t)) = H(q(0),p(0)) = E\ .$$

While Hamiltonian systems are often referred to as conservative systems, these two types of dynamical systems should not be confounded. In the autonomous case, a Hamiltonian system conserves energy, however, it is easy to construct nonHamiltonian systems that also conserve an energy-like quantity. Moreover, in the nonautonomous case, the Hamiltonian depends explicitly on time $$H(q,p,t)$$ and there is no conserved energy.

### Liouville's Theorem

One direct consequence of the form (2) is that the divergence of a Hamiltonian vector field is zero $\nabla \cdot X = \nabla \cdot J \nabla H = \sum_{i,j} J_{ij} \frac{\partial H}{\partial z_i \partial z_j} = 0 .$ since $$J$$ is antisymmetric and the Hessian matrix $$D^2H$$ is symmetric. This immediately implies that the volume of any bundle of trajectories is preserved. That is, suppose $$A$$ is a set of initial conditions with volume $V(A) = \int_A dz .$ If $$z$$ evolves to $$\varphi_t(z)\ ,$$ the flow of the vector field, then the new volume $\int_{\varphi_t(A)} dz = \int_A \delta(\varphi_t(z)-y) dy ,$ is the same as the original volume $$V(A)\ .$$

This is known as Liouville's theorem. It is valid for any divergence free vector field, $$\nabla \cdot X = 0\ .$$

Note that Hamiltonian flow is volume preserving even when it is nonautonomous.

### Poincaré's Invariant

In addition to preserving volume, Hamiltonian systems also preserve a loop action, or Poincaré invariant. Given any loop $$L$$ in the extended phase space $$(q,p,t)\ ,$$ let $\tag{9} A(L) = \oint_L p dq - H(q,p,t)dt .$

Then under a Hamiltonian flow the loop action is preserved $A(\varphi_t(L)) = A(L) .$ Even more generally, suppose $$T$$ is the two dimensional tube obtained from the flow of $$L\ :$$ $$T = \{ \varphi_t(L): t \in \mathbb{R}\}$$ and $$L'$$ is any loop on $$T$$ that is homotopic to $$L\ .$$ Then $$A(L') = A(L)\ .$$

This fact is used, for example, in the construction of a Poincaré section for Hamiltonian systems.

### Symplectic Maps

A map $$f: M \to M$$ is symplectic if it preserves the symplectic form $$\omega\ .$$ Geometrically, we say that $$f^*\omega = \omega\ ,$$ which becomes in components $\tag{10} Df^T J Df = J$

where $$Df$$ is the $$2n \times 2n$$ Jacobian matrix $Df(q,p) = \begin{pmatrix} \frac{\partial f_q}{\partial q} & \frac{\partial f_q}{\partial p} \\ \frac{\partial f_p}{\partial q} & \frac{\partial f_p}{\partial p} \end{pmatrix} \;.$ The preservation of the loop action (9) implies that the time-$$T$$ map of any Hamiltonian flow is symplectic. This follows from Stokes's theorem and the fact that for a loop at a fixed value of time, the loop action reduces to $$\oint_L p dq \ .$$ Note that this holds even if the Hamiltonian depends explicitly on time $$H(q,p,t) \ .$$

Another way in which symplectic maps arise is for Poincaré sections of autonomous Hamiltonian flows on an energy surface. For example if the surface $$Q = \{(q,p): q_n = 0, \dot{q}_n > 0, H(q,p) = E\}$$ is selected, then the resulting return map to $$Q$$ is symplectic with the form $$\omega|_Q = \sum_{i=1}^{n-1} dq_i \wedge dp_i\ .$$ This is especially useful for the visualization of the motion of a two-degree-of-freedom system, since the resulting map is two-dimensional.

The set of linear mappings that obey (10) is called the symplectic group; it is a Lie group. Any quadratic Hamiltonian $H(z) = \frac12 z^T K z \;,$ where $$K$$ is a (constant) symmetric matrix, has a linear flow that is generated by the exponential $$\Phi(t) = e^{tJK}\ .$$ Each of the matrices in the curve $$\Phi(t)$$ is symplectic. Indeed, the collection $$\{JK: K^T = K\}$$ forms the Lie Algebra of the symplectic group.

## Integrable Systems

A dynamical system is integrable when it can be solved in some way. One (rather restrictive) way in which this can happen is if the flow of the vector field can be constructed analytically. However, since this can almost never be done (in terms of elementary functions), this is not an especially useful class of systems.

However, there is a class of Hamiltonian systems, action-angle systems, whose solutions can be obtained analytically, and there is a well-accepted definition of integrability for Hamiltonian dynamics due to Liouville in which each integrable Hamiltonian is (locally) equivalent to these action-angle systems.

### Action-Angle Variables

A Hamiltonian system is written in action-angle form if there is a set of canonical variables $$(\theta, I)$$ where $$\theta \in \mathbb{T}^n$$ and $$I \in \mathbb{R}^n$$ and such that $$H$$ depends only upon the actions$H(I)\ .$

In this case the equations of motion (1) become simple indeed: $\tag{11} \dot{\theta} = \nabla H(I) = \Omega(I) \;, \quad \dot{I} = 0$

These equations can be easily solved, giving $(\theta(t), I(t)) = (\theta_o + \Omega(I_o) t , I_o)$ Thus the angles move along the invariant torus $$I = I_o$$ with a fixed frequency vector $$\Omega\ .$$

For example, the simple harmonic oscillator Hamiltonian $H(q,p) = \frac12 (p^2 + q^2)$ can be written in action angle form by setting $$(q,p) = (\sqrt{2I} \sin \theta, \sqrt{2I} \cos \theta)\ .$$ The new variables are canonical since $$dq \wedge dp = d\theta \wedge dI$$ (i.e., the transformation is canonical). In the new coordinates the Hamiltonian becomes $$H(\theta, I) = I\ .$$ Thus it is in action-angle form with $$\Omega = 1\ .$$ A more general, anharmonic oscillator, with a natural Hamiltonian of the form (3) with a potential energy $$V(q)$$ with a unique minimum at $$q = 0$$ has a Hamiltonian that depends in a nonlinear way upon the action, but which nevertheless can be reduced to action-angle form.

Hamiltonian systems with two or more degrees of freedom cannot always be reduced to action-angle form, giving rise to chaotic motion.

### Liouville Integrability

Liouville and Arnold showed that the motion in a larger class of Hamiltonian systems is as simple as that of (11).

Suppose that an $$n$$ degree-of-freedom Hamiltonian system (2) has a set of $$n$$ invariants $$F_i$$ that are almost everywhere independent (their gradients span an $$n$$-dimensional space except on sets of zero measure) and that are in involution, that is, their Poisson brackets vanish: $\{F_i, F_j\} \equiv \omega(\nabla F_i, \nabla F_j ) = 0 \;.$ Then if a regular level set of the invariants $$L_c = \{ F_i(q,p) = c_i: i = 1,\ldots n \}$$ is compact it must be a torus . Moreover, there is a neighborhood of $$L_c$$ in which there exist action-angle coordinates such that the equations of motion reduce to (11). See (Arnold, 1978).

For example, every one degree-of-freedom, autonomous Hamiltonian system is Liouville integrable. However, the action-angle coordinates may not be globally defined. In the case of the pendulum (4), there are action-variables away from the separatrix.

Generically the dynamics on an invariant torus are quasiperiodic.

## KAM Theory

Andrey Kolmogorov discovered a general method for the study of perturbed, integrable Hamiltonian systems. The method lead to theorems by Vladimir Arnold for analytic Hamiltonian systems (Arnold, 1963) and by Jurgen Moser for smooth enough area-preserving mappings (Moser 1962), and the ideas have become known as KAM theory.

Roughly speaking, KAM theory implies that a Hamiltonian system of the form $H(\theta,I) = H_0(I) + \epsilon H_1(\theta,I) \;,$ which is integrable at $$\epsilon = 0\ ,$$ still has a large set of invariant tori if $$\epsilon$$ is small enough (a set whose measure approaches the total measure as $$\epsilon \to 0$$). In order that KAM theory apply, the Hamiltonian must be sufficiently smooth, and (for the simplest version of the theorem) the unperturbed Hamiltonian must satisfy a nondegeneracy or twist condition, that $$D^2H_0(I)$$ is nonsingular.

For more details see Kolmogorov-Arnold-Moser Theory.

## Hamiltonian Chaos Figure 4: Poincaré section at $$t = 2\pi k$$ of the two-wave Hamiltonian (12) for $$a = 4\ ,$$ $$b = 6$$ and $$\epsilon = 0.1\ .$$ Resonant island chains with rotation numbers $$0/1, 1/2, 2/3, 4/5$$ and $$1/1$$ are shown.

Though many invariant tori of an integrable system typically persist upon a perturbation, tori that commensurate or nearly commensurate are typically destroyed. Chaotic dynamics often occurs in the neighborhood of these destroyed tori.

An invariant torus is characterized by its frequency vector $$\Omega\ .$$ It is commensurate if there exists an integer vector $$m \in \Z^n$$ such that $m \cdot \Omega = 0$ Commensurate tori of an integrable system are generically destroyed by any perturbation.

For example, consider the 1.5 degree-of-freedom system $\tag{12} H(q,p) = \frac12 p^2 + \epsilon( a cos(2 \pi q) + b cos(2\pi (q-t))$

that represents the motion of (for example) a charge particle in the field of two electrostatic waves. Here the phase space can be taken to be $$\mathbb{T}^2 \times \mathbb{R}$$ since $$H$$ is a periodic function of $$q$$ and $$t$$ For $$\epsilon = 0\ ,$$ the momentum is constant and the orbits lie on two-dimensional tori with the frequency vector $$\Omega = (p,1)^T\ .$$ Consequently every torus with a rational value of $$p$$ is commensurate--indeed such orbits are periodic in this case.

KAM theory implies that if $$p$$ is "sufficiently" irrational, then the torus is preserved for $$|\epsilon| \ll 1\ .$$ However commensurate tori and nearby irrational tori are destroyed. For small $$\epsilon$$ the destroyed tori are replaced by chains of islands formed from a pair of periodic orbits, one a saddle and the other elliptic (see Stability of Hamiltonian Flows). Surrounding the elliptic orbit are a family of two-dimensional tori with a new topology (not homotopic to $$p = constant\ ,$$ see (Figure 4). Moreover, the stable and unstable manifolds of the saddle typically intersect transversely, giving rise to a Smale horseshoe and chaotic motion (albeit chaos that is limited to a narrow layer about the separatrix. As $$\epsilon$$ grows these chaotic layers also grow, and they can envelope larger regions of phase space, see (Figure 5).