Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 23

Hamiltonian Mechanics: Problem Solving

Recommended resources

Hello! Welcome to the next lesson in our study of analytical mechanics.

In our last session, we formally derived the Hamiltonian formalism from the Lagrangian using the Legendre transformation. We established that the Hamiltonian is a function on phase space, and that the system's evolution is governed by the beautifully symmetric Hamilton's canonical equations:

Today, we move from derivation to application. Our goal is to use this powerful framework to solve mechanics problems. We will formalize a step-by-step "recipe" for Hamiltonian analysis and apply it to several systems of increasing complexity. While for some simple problems this method might seem more elaborate than the Lagrangian approach, mastering it is crucial. The Hamiltonian perspective provides profound insights into the geometry of dynamics and is the foundation for quantum mechanics and statistical mechanics.

1. The "Why" and "How" of Hamiltonian Mechanics

Before we dive into problem-solving, it's worth taking a moment to appreciate the conceptual shift that Hamiltonian mechanics represents. It's more than just a new set of equations; it's a new way of thinking about dynamics.

Classical Mechanics, Lecture 16: Hamiltonian Mechanics. Phase Space.

This video provides an excellent high-level perspective on why the Hamiltonian formulation is considered so elegant and fundamental, and it outlines the general process we will be following.

Watch from 01:45 to 20:54. The first part (until 07:29) discusses the conceptual place of Hamiltonian mechanics as the gateway to quantum mechanics. The second part (from 07:29) lays out the precise recipe for constructing the Hamiltonian and its equations, which we will use throughout this lesson. Pay close attention to the warning about completely eliminating the generalized velocities (q̇) in favor of the momenta (p).


2. The Hamiltonian Recipe: A Step-by-Step Guide

As summarized in the video, solving a problem using the Hamiltonian formalism follows a clear, systematic procedure. This process ensures we correctly move from the configuration space of the Lagrangian () to the phase space of the Hamiltonian ().

For a system with generalized coordinates, the steps are:

  1. Write the Lagrangian: Calculate the kinetic energy and potential energy , and form the Lagrangian .
  2. Find the Canonical Momenta: For each coordinate , calculate its conjugate momentum using the definition:
  3. Invert for Velocities: Algebraically solve the equations from Step 2 to express each generalized velocity as a function of the coordinates and momenta, . This is a critical step.
  4. Construct the Hamiltonian: Write the formal definition of the Hamiltonian:

    Then, substitute the expressions for from Step 3 into this equation to get the final Hamiltonian . No terms should remain.
  5. Write Hamilton's Equations: For each of the degrees of freedom, write down the two first-order canonical equations:

    This will give you a system of first-order ordinary differential equations.
  6. Solve the Equations: Solve this system of ODEs to find the motion of the system, and . Often, this involves combining a pair of equations to eliminate and recover a single second-order equation for , which is typically equivalent to the Euler-Lagrange equation.

This procedure is summarized well in the following resource, which you can use as a reference.

The Hamiltonian method

This document formally lists the steps for solving problems with the Hamiltonian method. It's a useful text to solidify the procedure we just outlined.

Read the section titled '15.2.4 Solving Hamilton’s equations'. It lists the six steps very clearly. Note the author's comment that for simple systems, this method isn't necessarily more efficient, but its value lies in its broader applications in physics.


3. Worked Examples

Let's apply this recipe to a few physical systems.

Example 1: The Simple Pendulum

Consider a simple pendulum of mass and length . The generalized coordinate is the angle .

  1. Lagrangian: The kinetic energy is and the potential energy is (taking at the bottom).

  2. Canonical Momentum:

  3. Invert for Velocity:

  4. Construct Hamiltonian:


    Notice that and the potential energy in the Hamiltonian is . In this case, , the total energy.

  5. Hamilton's Equations:

  6. Solve: The first equation simply confirms our expression for . We can differentiate it with respect to time to get . Substituting the second equation into this gives:

    This is the familiar equation of motion for a pendulum.

The video you watched earlier contains a walkthrough of this exact problem. You can review it if any step was unclear.

Classical Mechanics, Lecture 16: Hamiltonian Mechanics. Phase Space.

For a guided walkthrough of the pendulum example, you can review this segment.

Watch from 54:19 to 59:14. The lecturer applies the 'Hamiltonian crank' to the pendulum, following the same steps we just did.

Test your understanding!

Consider a block of mass sliding frictionlessly down an incline of angle . Let be the displacement along the incline.

  1. Write the Lagrangian .
  2. Follow the Hamiltonian recipe to find the Hamiltonian and the two Hamilton's equations.
  3. Combine the equations to find the familiar second-order equation for .
Show answer
  1. Lagrangian: The kinetic energy is . The potential energy, taking at the top of the ramp, is .
  2. Hamiltonian Recipe:
    • Momentum:
    • Invert:
    • Hamiltonian:
    • Hamilton's Equations:

  3. Solve: Differentiate the first equation: . Substitute the second equation into this:

    This is precisely the constant acceleration we expect from . You can watch another clear derivation of this problem in the video "Block on an Incline" from Dot Physics (LINK) between 13:36 and 18:45.

Example 2: Bead on a Parabolic Wire

Let's tackle a more complex case where the canonical momentum isn't simply . Consider a bead of mass sliding on a frictionless parabolic wire in a vertical plane, given by .

  1. Lagrangian:
    The velocity squared is . Since , we have .

    The Lagrangian is .

  2. Canonical Momentum:

    Notice here that depends on both and .

The rest of the derivation involves some algebra.

Classical Mechanics, Lecture 16: Hamiltonian Mechanics. Phase Space.

Let's watch the derivation for this more complex system. This example highlights how the formalism handles cases where the relationship between velocity and momentum is not trivial.

Watch from 59:14 to 1:06:29. Follow the application of the recipe to this problem. Note how the final Hamiltonian and the resulting equations of motion look significantly more complex than the Lagrangian, but are derived systematically.

Advanced Example: The Double Pendulum

To satisfy your interest in high-level problems, consider the double pendulum. Its Lagrangian (for two equal masses and lengths ) is already quite complex:

Following the Hamiltonian recipe from here involves significant algebraic manipulation. The resulting Hamiltonian is:

From this , one would then derive the four Hamilton's equations for . While we won't perform the derivation here, it's a perfect example of the formalism's power to handle even very complex systems systematically. If you wish to see the full, rigorous derivation, the resource below provides it.

EP 222: Classical Mechanics Tutorial Sheet 7: Solution

This tutorial solution works through the full derivation for the double pendulum. It's a great example of the level of algebraic rigor required for competitive-level problems.

Review Problem 1. You don't need to check every line of algebra, but follow the logic of how the momenta p₁ and p₂ are found, how they are used to eliminate θ̇₁ and θ̇₂, and the final form of H. The document labels the algebra as 'tedious', which is an understatement!


4. The Geometric Picture: Motion as a Flow in Phase Space

What is the ultimate payoff for this more abstract formalism? One major benefit is a new, powerful geometric interpretation of dynamics. Hamilton's equations treat coordinates () and momenta () on an equal footing. The -dimensional space spanned by all the and is called phase space.

The state of a system at any instant is represented by a single point in phase space. As time evolves, this point traces out a trajectory. Hamilton's equations, and , define a unique velocity vector at every point in phase space. This vector field defines a "flow," and the system's evolution is simply following this flow.

Phase Space of a Nonlinear Pendulum
This image shows the phase space for a pendulum. The horizontal axis is position (q = θ) and the vertical is momentum (p = pθ). The lines are trajectories the system can follow. The closed loops near the center represent oscillations, while the wavy lines at the top and bottom represent continuous rotations. The Hamiltonian's value is constant along each trajectory (since energy is conserved). Hamilton's equations define the vector field that tells the system which way to 'flow' at every point.

This geometric view is incredibly powerful. The structure of the phase space portrait tells you everything about the possible motions of the system without solving the equations for every initial condition.

Classical Mechanics, Lecture 16: Hamiltonian Mechanics. Phase Space.

To understand this concept of 'Hamiltonian flow' more deeply, let's return to our main video resource.

Watch the segment from 25:23 to 38:51. The key idea is that the time-evolution vector $(\dot{q}, \dot{p})$ is related to the gradient of the Hamiltonian function, but rotated. This forces the system to move along contours of constant Hamiltonian, which corresponds to conservation of energy.


Conclusion

In this lesson, we established a robust methodology for analyzing mechanical systems within the Hamiltonian framework. We saw how this "recipe" can be applied to simple and complex problems alike, always yielding a set of first-order differential equations that govern the system's evolution in phase space.

Key Takeaways:

  • Solving problems with Hamiltonian mechanics follows a six-step recipe: L → p → → H → Hamilton's Equations → Solve.
  • The crucial step is to express the Hamiltonian strictly as a function of coordinates , momenta , and time , eliminating all generalized velocities .
  • The result is a set of first-order ODEs, in contrast to the second-order ODEs of the Lagrangian method.
  • Conceptually, Hamiltonian dynamics is best viewed as a flow on phase space, where the Hamiltonian function itself generates the evolution of the system's state.

Preview of the Next Lesson:
We've just had a glimpse of the power of the phase space picture. In our next lesson, we will delve deeper into this concept. We will learn how to construct and interpret phase space diagrams for simple Hamiltonian systems, allowing us to understand the qualitative nature of a system's motion—identifying oscillations, rotations, and points of equilibrium—purely by analyzing the geometry of its phase space.