Lesson 1.2 · 1. Foundations

Lagrangian Mechanics

Now that we have the Euler-Lagrange equation, let's see why it's so powerful. The key insight: choose coordinates that match your problem, and the physics follows automatically.

Generalized Coordinates

Cartesian Coordinates

Cartesian coordinates are the standard $(x, y, z)$ grid system. Think of a room: $x$ measures how far left or right you are, $y$ how far forward or back, and $z$ how high up. Every point in space gets a unique $(x, y, z)$ address, like measuring your position by distance from each wall.

In Newtonian mechanics, we work with Cartesian coordinates $(x, y, z)$ and must carefully handle constraints with forces. The Lagrangian approach is different:

Generalized coordinates are any set of independent variables $q_1, q_2, \ldots, q_n$ that completely specify the configuration of a system.

The word "generalized" means: use whatever coordinates are natural for your problem. They don't need to be positions: they can be angles, distances along curves, or any parameters that uniquely describe the state.

Degrees of Freedom

The number of generalized coordinates equals the degrees of freedom: the number of independent ways the system can move. A particle in 3D has 3 degrees of freedom. A pendulum constrained to swing in a plane has 1.

Some everyday examples: a train on a track has 1 degree of freedom (its position along the track). A drone flying in the air has 3 degrees of freedom (it can move in $x$, $y$, and $z$). A door on a hinge has 1 degree of freedom (the angle of the door).

Example: The Simple Pendulum

A mass $m$ hangs from a string of length $\ell$, swinging in a vertical plane.

θ m
The simple pendulum. One degree of freedom: the angle θ.

Interactive: Simple Pendulum

Length 150px

Click anywhere to set the pendulum angle. Adjust the length with the slider.

Cartesian approach: The mass has coordinates $(x, y)$ with constraint $x^2 + y^2 = \ell^2$. We'd need to handle the tension force.

Lagrangian approach: Use the angle $\theta$ as our single generalized coordinate. The constraint is automatically satisfied.

Position in terms of $\theta$:

$$ x = \ell \sin\theta, \quad y = -\ell \cos\theta $$

Velocity:

$$ \dot{x} = \ell \dot{\theta} \cos\theta, \quad \dot{y} = \ell \dot{\theta} \sin\theta $$

Quick Reminder: Kinetic and Potential Energy

As we saw in Lesson 1: kinetic energy $T$ is the energy of motion, and potential energy $V$ describes conservative interactions. For many non-relativistic mechanical systems in Cartesian coordinates, the Lagrangian is $L = T - V$. More general systems can contain velocity-dependent interactions or use a different, but dynamically equivalent, Lagrangian.

Kinetic energy:

$$ T = \frac{1}{2}m(\dot{x}^2 + \dot{y}^2) = \frac{1}{2}m\ell^2\dot{\theta}^2 $$

Potential energy (taking $y=0$ at the pivot):

$$ V = mgy = -mg\ell\cos\theta $$

The Lagrangian:

$$ L = T - V = \frac{1}{2}m\ell^2\dot{\theta}^2 + mg\ell\cos\theta $$

Now apply Euler-Lagrange: $\frac{d}{dt}\frac{\partial L}{\partial \dot{\theta}} - \frac{\partial L}{\partial \theta} = 0$

Step 1: Compute derivatives

$\frac{\partial L}{\partial \dot{\theta}} = m\ell^2\dot{\theta}$

$\frac{\partial L}{\partial \theta} = -mg\ell\sin\theta$

Step 2: Time derivative

$\frac{d}{dt}\frac{\partial L}{\partial \dot{\theta}} = m\ell^2\ddot{\theta}$

Step 3: Euler-Lagrange equation

$m\ell^2\ddot{\theta} + mg\ell\sin\theta = 0$

Simplifying:

$$ \ddot{\theta} + \frac{g}{\ell}\sin\theta = 0 $$

This is the pendulum equation. Notice: we never mentioned tension. The constraint is built into our choice of coordinate.

Small Angle Approximation

For small oscillations, $\sin\theta \approx \theta$, giving $\ddot{\theta} + \frac{g}{\ell}\theta = 0$, simple harmonic motion with period $T = 2\pi\sqrt{\ell/g}$.

Constraints

What is a Constraint?

A constraint is a restriction on how a system can move. For example, a bead threaded on a wire can only slide along the wire, not fly off into space. A pendulum bob must stay at the end of its string. Constraints limit the possible positions, reducing the number of degrees of freedom.

Constraints reduce the degrees of freedom. There are two types:

Holonomic vs. Non-Holonomic at a Glance

Holonomic = the constraint restricts position only (e.g., "the bead must stay on the wire"). Non-holonomic = the constraint also involves velocity (e.g., "the wheel rolls without slipping").

Holonomic Constraints

Expressible as equations relating coordinates (possibly with time):

$$ f(q_1, q_2, \ldots, q_n, t) = 0 $$

Examples:

  • Pendulum: $x^2 + y^2 = \ell^2$
  • Particle on a sphere: $x^2 + y^2 + z^2 = R^2$
  • Bead on a rotating hoop (time-dependent constraint)

For many regular holonomic constraints, we can choose independent generalized coordinates locally and eliminate redundant variables. When that elimination is difficult or only local, Lagrange multipliers are still useful.

Non-Holonomic Constraints

Involve velocities and cannot be integrated to position constraints:

$$ f(q_1, \ldots, q_n, \dot{q}_1, \ldots, \dot{q}_n, t) = 0 $$

Example: A ball rolling without slipping. The no-slip condition relates velocity to angular velocity but can't be reduced to a position constraint.

Non-holonomic constraints require more care (Lagrange multipliers), but many important systems are holonomic.

Example: Double Pendulum

Two masses connected by rigid rods, a classic chaotic system.

θ₁ θ₂ ℓ₁ ℓ₂ m₁ m₂
The double pendulum. Two degrees of freedom: θ₁ and θ₂.

Two generalized coordinates: $\theta_1$ and $\theta_2$.

Positions:

$$ x_1 = \ell_1 \sin\theta_1, \quad y_1 = -\ell_1 \cos\theta_1 $$
$$ x_2 = \ell_1 \sin\theta_1 + \ell_2 \sin\theta_2, \quad y_2 = -\ell_1 \cos\theta_1 - \ell_2 \cos\theta_2 $$

The Lagrangian (after computing $T$ and $V$):

$$ L = \frac{1}{2}(m_1 + m_2)\ell_1^2\dot{\theta}_1^2 + \frac{1}{2}m_2\ell_2^2\dot{\theta}_2^2 + m_2\ell_1\ell_2\dot{\theta}_1\dot{\theta}_2\cos(\theta_1 - \theta_2) $$ $$ + (m_1 + m_2)g\ell_1\cos\theta_1 + m_2 g\ell_2\cos\theta_2 $$

The equations of motion are coupled and nonlinear. This is why the double pendulum exhibits chaos for large amplitudes.

What is Phase Space?

Phase space is a mathematical space where each point represents both the position AND the velocity of the system at one instant. For the double pendulum, the phase space is 4-dimensional: 2 position coordinates ($\theta_1$, $\theta_2$) and 2 velocity coordinates ($\dot{\theta}_1$, $\dot{\theta}_2$). Every possible state of the system is a single point in this 4D space, and as the system evolves, that point traces a path.

Why is the double pendulum chaotic?

Chaos requires: (1) nonlinearity, (2) at least 3 dimensions in phase space. The double pendulum has 4D phase space $(\theta_1, \theta_2, \dot{\theta}_1, \dot{\theta}_2)$ and the $\cos(\theta_1 - \theta_2)$ coupling is nonlinear. Tiny differences in initial conditions lead to vastly different trajectories.

Interactive: Double Pendulum

Click anywhere to randomize. Watch the chaotic trajectory emerge.

The Recipe

For any mechanical system:

  1. Identify degrees of freedom: how many independent ways can it move?
  2. Choose generalized coordinates: pick coordinates that naturally describe the motion
  3. Write $T$ and $V$: express kinetic and potential energy in terms of $q_i$ and $\dot{q}_i$
  4. Form $L = T - V$
  5. Apply Euler-Lagrange: one equation per coordinate

Why This Works

The Lagrangian formulation automatically:

  • Handles constraints (built into coordinate choice)
  • Works in any coordinate system
  • Reveals conserved quantities (next lesson)
  • Generalizes to fields, relativity, and quantum mechanics

Multiple Coordinates

With $n$ generalized coordinates $q_1, \ldots, q_n$, we get $n$ Euler-Lagrange equations:

$$ \frac{d}{dt}\frac{\partial L}{\partial \dot{q}_i} - \frac{\partial L}{\partial q_i} = 0 \quad \text{for } i = 1, \ldots, n $$

These form a system of coupled differential equations describing the motion.

Exercises

  1. Atwood machine: Two masses $m_1$ and $m_2$ connected by a string over a pulley. Choose a single generalized coordinate and derive the equation of motion.
  2. Bead on a wire: A bead slides frictionlessly on a parabolic wire $y = ax^2$ in a gravitational field. Find the Lagrangian and equation of motion.
  3. Spherical pendulum: A pendulum free to swing in any direction (not confined to a plane). How many degrees of freedom? Write the Lagrangian.
Key Takeaways
  • Generalized coordinates are any independent variables describing configuration
  • Degrees of freedom = number of independent coordinates needed
  • Constraints reduce degrees of freedom and are built into coordinate choice
  • The Lagrangian method: write $L = T - V$ in generalized coordinates, apply Euler-Lagrange
  • Constraint forces (like tension) never appear; they're handled automatically