Section 5.2 Hamiltonian Systems
Objectives

To understand that a Hamiltonian system is a system of the form
\begin{align*} \frac{dx}{dt} & = \frac{\partial H}{\partial y} (x, y)\\ \frac{dy}{dt} & = \frac{\partial H}{\partial x}(x, y), \end{align*}where \(H : {\mathbb R}^2 \rightarrow {\mathbb R}^2\) is a smooth function. In particular, \(H\) is called a Hamiltonian function for the system.

To understand that if
\begin{align*} \frac{dx}{dt} & = \frac{\partial H}{\partial y} (x, y)\\ \frac{dy}{dt} & = \frac{\partial H}{\partial x}(x, y), \end{align*}is a Hamiltonian system, then \(H\) is constant along any solution curve. In particular, the solution curves of a Hamiltonian system are the level sets of \(H\text{.}\)
To understand how to compute \(H\) for a Hamiltonian system
To understand that a Hamiltonian system has no spiral sinks or sources.
An undamped harmonic oscillator, \(m y'' + k y = 0\text{,}\) can be written as the system
Now suppose that \((y(t), v(t))\) is a solution curve in the \(yv\)plane. We will calculate the slope of the solution curve, \(dv/dy\text{.}\) Using the fact from calculus that the derivative of an inverse function is
we have
In general for the system
we have
Using separation of variables to solve the equation
we obtain the solution
where \(C\) is a constant. The first term of (5.2.1) is the kinetic energy function of the harmonic oscillator
while the second term is the potential energy function
For this reason, we call the function
the total energy function of the harmonic oscillator. EquationÂ (5.2.1) tells us that energy is conserved. That is, the sum of the potential energy and the kinetic energy is constant.
Subsection 5.2.1 The Nonlinear Pendulum
While pendulums have long been used in clocks to keep time, they have also been used to measure gravity as well as used in early seismometers to measure the effect of earthquakes. One of the more interesting uses of a pendulum has been to measure the rotation of the earth. In 1851, the French physicist, LĂ©on Foucault, used a pendulum (FigureÂ 5.2.1) to demonstrate that the earth actually rotated on its axis. The fact that the earth rotates had been known for a long time, but Foucault's experiment gave the first simple proof of this phenomena.
Let us consider a pendulum made of a light rod of length \(L\) called the arm of the pendulum with a mass \(m\) on the end of the rod called the bob (FigureÂ 5.2.2). We will ignore the mass of the arm in our system. The position of the bob is given by \(\theta(t)\text{,}\) which we will measure in a counterclockwise direction. We will assume that \(\theta(0)\) is when the bob is in the vertical position.
There are two forces acting on the pendulumâ€”gravity and friction. The position of the bob at time \(t\) is
and the velocity of the bob is \(L (d \theta / dt)\text{,}\) the length of the velocity vector (FigureÂ 5.2.3). The component of the acceleration that points along the direction of motion of the bob is
We can take the force due to friction to be proportional to the velocity,
where \(b \geq 0\text{.}\) Thus, Newton's second law tells us that
or
As a system, we can model the pendulum as
If there is no damping for our pendulum, we say that we have an ideal pendulum. In this case,
Since
we know that the energy function for the pendulum is
Of course, \(E(\theta, v)\) is constant on the ideal pendulum.
Subsection 5.2.2 Hamiltonian Systems
The ideal pendulum and the undamped harmonic oscillator are examples of Hamiltonian systems. More specifically, a Hamiltonian system is a system of the form
where \(H : {\mathbb R}^2 \rightarrow {\mathbb R}\) is a smooth function.
Example 5.2.4.
The system
is Hamiltonian since for \(H(x, y) = x^3  2xy  y^3\)
Example 5.2.5.
In the case of the harmonic oscillator and ideal pendulum, \(H\) is just the energy function. For the harmonic oscillator, the Hamiltonian function is
In this case,
A change of variables (\(y = my\)) tells us that this system is equivalent to the system
For the ideal pendulum
where
The following theorem tells the importance of Hamiltonian systems. That is, the solution curves of the system are simply the level sets of the Hamiltonian function.
Theorem 5.2.6.
Let
be a Hamiltonian system, where \(H : {\mathbb R}^2 \rightarrow {\mathbb R}\text{.}\) Then \(H\) is constant along any solution curve.
Proof.
Let \((x(t), y(t))\) be a solution curve for the system. Using the chain rule
TheoremÂ 5.2.6 tells us how to draw the solution curves in the phase plane without solving the system. Assuming that the Hamiltonian function \(H\) is not constant on any open set in \({\mathbb R}^2\text{,}\) we simply need to plot the level curves, \(H(x, y) = C\text{.}\) The solutions of the system live on these level sets, and all we need to do is find the direction of the solution curve. However, this is quite easy since we know the vector field of the system. Furthermore, the equilibrium points of the Hamiltonian system occur at the critical points of \(H\) (where the partials of \(H\) vanish). For example, we can see the solution curves of
in FigureÂ 5.2.7.
Subsection 5.2.3 The Ideal Pendulum Revisited
The ideal pendulum
is Hamiltonian, since the total energy function
is the Hamiltonian function for the system. If we set \(g/L = 1\text{,}\) then the solution curves of the system are just the level curves of (5.2.2). In FigureÂ 5.2.8, the closed ellipses correspond to the normal motion of a pendulum, while cosine curves correspond to a pendulum that always rotates in the same direction. The curves that join the equilibrium points correspond to the pendulum that rotates exactly to the top of the arc and then rotates back in the other direction.
Hamiltonian systems are rather rare. Given a system, we need a test to see if it is indeed Hamiltonian. For the system
we wish to find a function \(H(x, y)\) such that
If such a function exists, then
Thus,
if our system is Hamiltonian.
Example 5.2.9.
We already know that the system
is Hamiltonian. Indeed,
The condition that
is also sufficient for
to be a Hamiltonian system. That is, we can construct a Hamiltonian function if \(\partial f/ \partial x =  \partial g/ \partial y\text{.}\) If
then
Differentiating \(H\) with respect to \(x\text{,}\) tells us that
Now we can determine \(\phi(x)\) by solving the firstorder differential equation
We summarize our results in the following theorem.
Theorem 5.2.10.
Let
where \(f\) and \(g\) are continuously differentiable.
If the system is Hamiltonian, then
\begin{equation} \frac{\partial f}{\partial x} =  \frac{\partial g}{\partial y}.\tag{5.2.3} \end{equation}If equationÂ (5.2.3) is true on a rectangle \(R\text{,}\) then the system is Hamiltonian on \(R\) and
\begin{equation*} H(x, y) = \int f(x, y) \, dy + \phi(x), \end{equation*}where\begin{equation*} \phi'(x) = \frac{\partial}{\partial x}\left( \int f(x, y) \, dy \right)  g(x, y). \end{equation*}
Example 5.2.11.
As an example, we will show how we constructed the Hamiltonian function given in ExampleÂ 5.2.4 for the system
First,
Consequently,
and \(\phi(x) = x^3 + C\text{,}\) where \(C\) is any constant. If we choose \(C = 0\text{,}\) our Hamiltonian function is
Example 5.2.12.
As a second example, suppose
Since
our system is Hamiltonian. To find a Hamiltonian, we compute
Thus,
and \(\phi(x) = x^2 + C\text{.}\) Letting \(C = 0\text{,}\) our Hamiltonian function is
Solution curves for this system are given in FigureÂ 5.2.13.
Activity 5.2.1. Hamiltonian Systems.
For each of the systems,
Show that the system is Hamiltonian.
Find a Hamiltonian function \(H(x, y)\) for the system.
Plot the level sets of \(H(x, y)\text{.}\)
Plot the phase portrait of the system, describing any equilibrium solutions.^{â€‰1â€‰}
(a)
(b)
Subsection 5.2.4 Equilibrium Solutions of Hamiltonian Systems
The system that we studied in ExampleÂ 5.2.4,
has equilibrium solutions at \((0,0)\) and \((2/3, 2/3)\text{.}\) Referring to the phase portrait for the system (FigureÂ 5.2.7), we might guess that \((0,0)\) is a saddle, and \((2/3, 2/3)\) is either a center or a spiral sink. Since solution curves must follow contours for the Hamiltonian function \(H(x, y) = x^3  2xy  y^3\text{,}\) spiral sinks do not make sense.
Let us examine the possible types of equilibrium solutions for a Hamiltonian system. Suppose that \((x_0, y_0)\) is an equilibrium solution for the system
In order to determine the nature of the equilibrium solution, we will compute the Jacobian matrix of the system at \((x_0, y_0)\text{,}\)
If we let
then \(J\) becomes
The characteristic polynomial of this matrix is
Therefore, our matrix has eigenvalues
and we have the following possibilities.
If \(\alpha^2 + \beta \gamma \gt 0\text{,}\) we have two real eigenvalues of opposite signs. Therefore, our equilibrium solution is a saddle.
If \(\alpha^2 + \beta \gamma = 0\text{,}\) the only eigenvalue is zero.
If \(\alpha^2 + \beta \gamma \lt 0\text{,}\) we have two purely imaginary eigenvalues.
In particular, a Hamiltonian system has no spiral sinks or sources.
Returning to ExampleÂ 5.2.4, the Jacobian matrix is
For the equilibrium solution \((0,0)\text{,}\) we have eigenvalues \(\lambda = \pm 2\text{,}\) which tells us that the origin is a nodal saddle. The Jacobian matrix corresponding to \((x_0, y_0) = (2/3, 2/3)\) is
Since \(J\) has eigenvalues \(\lambda = \pm 2 \sqrt{5} \, i\text{.}\) Therefore, solution curves near \((2/3, 2/3)\) should look like closed orbits.
Subsection 5.2.5 Important Lessons
A pendulum can be modeled by the equation
\begin{equation*} \frac{d^2 \theta}{dt^2} + \frac{b}{m} \frac{d \theta}{dt}  \frac{g}{L} \sin \theta = 0. \end{equation*}or the system\begin{align*} \frac{d \theta}{dt} & = v\\ \frac{dv}{dt} & =  \frac{b}{m} v  \frac{g}{L} \sin \theta. \end{align*}A Hamiltonian system is a system of the form
\begin{align*} \frac{dx}{dt} & = \frac{\partial H}{\partial y} (x, y)\\ \frac{dy}{dt} & = \frac{\partial H}{\partial x}(x, y), \end{align*}where \(H : {\mathbb R}^2 \rightarrow {\mathbb R}^2\) is a smooth function.If
\begin{align*} \frac{dx}{dt} & = \frac{\partial H}{\partial y} (x, y)\\ \frac{dy}{dt} & = \frac{\partial H}{\partial x}(x, y), \end{align*}is a Hamiltonian system, then \(H\) is constant along any solution curve. In particular, the solution curves of a Hamiltonian system are the level sets of \(H\text{.}\)If the system
\begin{align*} \frac{dx}{dt} & = f(x, y)\\ \frac{dy}{dt} & = g(x, y), \end{align*}is Hamiltonian, then\begin{equation*} \frac{\partial f}{\partial x} =  \frac{\partial g}{\partial y}. \end{equation*}If \(f_x =  g_y\) is true on a rectangle \(R\text{,}\) then the system
\begin{align*} \frac{dx}{dt} & = f(x, y)\\ \frac{dy}{dt} & = g(x, y), \end{align*}is Hamiltonian on \(R\) and\begin{equation*} H(x, y) = \int f(x, y) \, dy + \phi(x), \end{equation*}where\begin{equation*} \phi'(x) = \frac{\partial}{\partial x}\left( \int f(x, y) \, dy \right)  g(x, y). \end{equation*}A Hamiltonian system has no spiral sinks or sources.
Reading Questions 5.2.6 Reading Questions
1.
Explain in your own words what a Hamiltonian system is.
2.
What types of equilibrium solutions are possible in a Hamiltonian system?
Exercises 5.2.7 Exercises
Hamiltonian Systems.
For each of the systems in Exercise GroupÂ 5.2.7.1â€“4,
Show that the system is Hamiltonian.
Find a Hamiltonian function \(H(x, y)\) for the system.
Plot the level sets of \(H(x, y)\text{.}\)
Plot the phase portrait of the system, describing any equilibrium solutions.
1.
2.
3.
4.
5.
Consider an ideal pendulum with bob mass \(m\) and arm length \(l\) given by
What is the linearization of the ideal pendulum system at the equilibrium point \((0, 0)\text{?}\)
Using \(g = 9.8\) m/s\(^2\text{,}\) how should \(l\) and \(m\) be chosen so that small swings of the pendulum have period 1 second?
For the linearization of the ideal pendulum at \((0, 0)\text{,}\) the period of oscillation is independent of the amplitude. Does the same statement hold for the ideal pendulum itself? Is the period of oscillation the same no matter how high the pendulum swings? If not, will the period be shorter or longer for high swings?
An ideal pendulum clockâ€” a clock containing an ideal pendulum that â€śticksâ€ť once for each swing of the pendulum armâ€” keeps perfect time when the pendulum makes very high swings. Will the clock rum fast or slow if the amplitude of the swings is very small?
If the arm length of the ideal pendulum is doubled from \(l\) to \(2l\text{,}\) what is the effect on the period of small amplitude swinging solutions?
What is the rate of change of the period of small amplitude swings as \(l\) varies?
Will an ideal pendulum clock that keeps perfect time on earth run fast or slow on the moon?
6.
Describe the phase portrait for
when \(a \lt 0\text{.}\)
7.
Consider the autonomous system
Show that this system is a Hamiltonian system.
Find a Hamiltonian function for this system.