Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

We’ve seen the Lagrangian formulation of mechanics, and we have seen how to use it to derive the equations of motion for a system. We will cover a few common examples of Lagrangian mechanics and point out some of the subtleties that arise in each case.

Example: The Atwood Machine

The Atwood machine consists of two masses, MM and mm, connected by a massless string that passes over a massless pulley. The system is subject to gravity alone. The figure below shows the system along with a choice of coordinates y1y_1 and y2y_2 for the two masses.

Atwood Machine

These coordinates are measured from the center of the pulley and positive y1y_1 and y2y_2 are taken to be upward. Let’s try to use the Lagrangian formalism to find the equations of motion for this system.

V=+Mgy1+mgy2V = + Mgy_1 + mgy_2
T=12My˙12+12my˙22T = \dfrac{1}{2}M\dot{y}_1^2 + \dfrac{1}{2}m\dot{y}_2^2

Equation of Constraint

But notice that y1y_1 and y2y_2 are no independent coordinates. If we unravel the string that is over the pulley, we find that (assume length of string is ll):

y1+πR+y2=ly_1 + \pi R + y_2 = l

where RR is the radius of the pulley. That is shown in the figure below.

Unraveled String

The equation above is called an equation of constraint. It relates the coordinates y1y_1 and y2y_2 to each other. We can use this equation to eliminate one of the coordinates. Let’s eliminate y2y_2:

l=y1+πR+y2→y1=(l−πR)−y2l = y_1 + \pi R + y_2 \rightarrow y_1 = (l - \pi R) - y_2

This constraint has implications for velocities,

dy1dt=ddt((l−πR)−y2)=−dy2dt\dfrac{dy_1}{dt} = \dfrac{d}{dt}\left((l-\pi R) - y_2\right) = -\dfrac{dy_2}{dt}
y˙1=−y˙2.\dot{y}_1 = -\dot{y}_2.

This is likely what we could have expected, that the two masses move in opposite directions at the same speed.

Constructing the Lagrangian

Let’s use this constraint to reduce the number of coordinates in the Lagrangian.

L(y1,y2,y˙1,y˙2)→L(y1,y˙1)\mathcal{L}(y_1, y_2, \dot{y}_1, \dot{y}_2) \rightarrow \mathcal{L}(y_1, \dot{y}_1)

We can do this by substituting y2y_2 in terms of y1y_1 into the energy equations:

T(y1,y˙1)=12My˙12+12my˙22=12(M+m)y˙12=T(y˙1)T(y_1, \dot{y}_1) = \dfrac{1}{2}M\dot{y}_1^2 + \dfrac{1}{2}m\dot{y}_2^2 = \dfrac{1}{2}(M+m)\dot{y}_1^2 = T(\dot{y}_1)
V(y1,y2)=+Mgy1+mgy2V(y_1, y_2) = +Mgy_1 + mgy_2
V(y1,y2)=Mgy1+mg((l−πR)−y1)V(y_1, y_2) = Mgy_1 + mg((l-\pi R) - y_1)
V(y1,y2)=(M−m)gy1+mg(l−πR)V(y_1, y_2) = (M-m)g y_1 + mg(l-\pi R)
V(y1,y2)=(M−m)gy1+U0V(y_1, y_2) = (M-m)g y_1 + U_0

where U0=mg(l−πR)U_0 = mg(l-\pi R) is a constant and will not affect the equations of motion.

L(y1,y˙1)=T(y˙1)−V(y1)=12(M+m)y˙12−(M−m)gy1\mathcal{L}(y_1, \dot{y}_1) = T(\dot{y}_1) - V(y_1) = \dfrac{1}{2}(M+m)\dot{y}_1^2 - (M-m)g y_1
∂L∂y1=−(M−m)g\dfrac{\partial \mathcal{L}}{\partial y_1} = -(M-m)g
∂L∂y˙1=(M+m)y˙1\dfrac{\partial \mathcal{L}}{\partial \dot{y}_1} = (M+m)\dot{y}_1

These derivatives give the following equation of motion:

−(M−m)g−ddt((M+m)y˙1)=0-(M-m) g - \dfrac{d}{dt}\left((M+m)\dot{y}_1\right) = 0

Generalized Force

Notice that the first term in the above equation is the force on the mass MM in the Newtonian picture: the weight of MM minus the weight of mm. That makes sense because the Lagrangian formalism is supposed to reproduce Newton’s laws, and the spatial derivative of the Lagrangian produces a generalized force.

∂L∂qi=−∂V∂qi=Fi\dfrac{\partial \mathcal{L}}{\partial q_i} = -\dfrac{\partial V}{\partial q_i} = F_i

The kinetic term has no spatial dependence, so it does not contribute to the generalized force.

Generalized Momentum

The second term in the above equation is the time derivative of the momentum of the system using y1y_1 as the coordinate:

(M+m)y˙1=My˙1−my˙2=py1(M+m)\dot{y}_1 = M\dot{y}_1 - m\dot{y}_2 = p_{y_1}

Again, that is a sensible result because the Lagrangian formalism is supposed to reproduce Newton’s laws, and the generalized force is related to the time derivative of the generalized momentum.

ddt(∂L∂q˙i)=ddt(∂T∂q˙i)=dpqidt\dfrac{d}{dt}\left(\dfrac{\partial \mathcal{L}}{\partial \dot{q}_i}\right) = \dfrac{d}{dt}\left(\dfrac{\partial T}{\partial \dot{q}_i}\right) = \dfrac{dp_{q_i}}{dt}

Equation of Motion

The equation of motion can be written as

(M+m)y¨1=−(M−m)g(M+m)\ddot{y}_1 = -(M-m)g
y¨1=−(M−m)(M+m)g.\ddot{y}_1 = -\dfrac{(M-m)}{(M+m)}g.

With M>mM > m, this acceleration is downward as the larger mass MM accelerates down. With y˙1=−y˙2\dot{y}_1 = -\dot{y}_2, we know

y¨2=−y¨1\ddot{y}_2 = -\ddot{y}_1

, so that:

y¨2=(M−m)(M+m)g\ddot{y}_2 = \dfrac{(M-m)}{(M+m)}g

Again, with M>mM > m, this acceleration is upward as the smaller mass mm accelerates up.

Example: Atwood Machine with Rotating Pulley

In the previous example, we didn’t take into account the energy needed to rotate the pulley. Let’s do that now. Because the rope cannot slip, any small rotation RdϕR d\phi of the pulley gives a change dy1dy_1 in the position of mass MM. This is the no slip constraint.

If the pulley has a mass MpM_p and radius RR, then we must introduce it’s kinetic energy:

Tpulley=12Iω2T_{pulley} = \dfrac{1}{2} I \omega^2

where II is the moment of inertia of the pulley and ω\omega is the angular velocity of the pulley, ω=ϕ˙\omega = \dot{\phi}. This angular velocity is related to the linear velocities of the masses.

I=12MpR2I = \dfrac{1}{2}M_p R^2
Tpulley=12(12MpR2)ϕ˙2T_{pulley} = \dfrac{1}{2} \left(\dfrac{1}{2}M_p R^2\right) \dot{\phi}^2
Tpulley=14MpR2ϕ˙2T_{pulley} = \dfrac{1}{4}M_p R^2 \dot{\phi}^2

We now map this additional kinetic energy into the problem.

T(y˙1,ϕ˙)=12(M+m)y˙12+14MpR2ϕ˙2T(\dot{y}_1, \dot{\phi}) = \dfrac{1}{2}(M+m)\dot{y}_1^2 + \dfrac{1}{4}M_p R^2 \dot{\phi}^2

But the constraint is such that,

dy1=Rdϕ→y1=Rϕ+Rϕ0⏟const.dy_1 = Rd\phi \rightarrow y_1 = R\phi +\underbrace{R\phi_0}_{\textrm{const.}}
y˙1=Rϕ˙\dot{y}_1 = R\dot{\phi}

We work these back into TT, VV, and L\mathcal{L}.

T(ϕ˙)=12(M+m)y˙12+14MpR2ϕ˙2T(\dot{\phi}) = \dfrac{1}{2}(M+m)\dot{y}_1^2 + \dfrac{1}{4}M_p R^2 \dot{\phi}^2
T(ϕ˙)=12(M+m+12Mp)R2ϕ˙2T(\dot{\phi}) = \dfrac{1}{2}(M+m+\frac{1}{2}M_p)R^2 \dot{\phi}^2
V(ϕ)=(M−m)gy1+U0V(\phi) = (M-m)gy_1 + U_0
V(ϕ)=(M−m)g(Rϕ+Rϕ0)+U0V(\phi) = (M-m)g(R\phi + R\phi_0) + U_0
V(ϕ)=(M−m)gRϕ+U~0V(\phi) = (M-m)gR\phi + \tilde{U}_0

where U~0=(M−m)gRϕ0+U0\tilde{U}_0 = (M-m)gR\phi_0 + U_0 is another constant that will not affect the equations of motion.

L(ϕ,ϕ˙)=T(ϕ˙)−V(ϕ)\mathcal{L}(\phi, \dot{\phi}) = T(\dot{\phi}) - V(\phi)
L(ϕ,ϕ˙)=12(M+m+12Mp)R2ϕ˙2−(M−m)gRϕ\mathcal{L}(\phi, \dot{\phi}) = \dfrac{1}{2}(M+m+\frac{1}{2}M_p)R^2 \dot{\phi}^2 - (M-m)gR\phi

Torque and Angular Momentum

Our generalized coordinate is ϕ\phi and our generalized velocity is ϕ˙\dot{\phi}. We apply the Euler-Lagrange equation. We obtain the generalized force:

∂L∂ϕ=−(M−m)gR=Fϕ\dfrac{\partial \mathcal{L}}{\partial \phi} = -(M-m)gR = F_{\phi}

Notice that in this case, the generalized force is not the same as the force on mass MM in the Newtonian picture. It’s a torque around the pulley.

We can find the generalized momentum in a similar way:

∂L∂ϕ˙=(M+m+12Mp)R2ϕ˙=pϕ\dfrac{\partial \mathcal{L}}{\partial \dot{\phi}} = (M+m+\frac{1}{2}M_p)R^2\dot{\phi} = p_{\phi}

This equals the generalized momentum associated with the pulley angle. The hanging masses move vertically, not tangentially around the pulley, so their contributions should be computed from their actual vertical position vectors and velocities rather than from Rr^R\hat r and Rϕ˙ϕ^R\dot\phi\hat\phi.

L⃗total=L⃗disk+L⃗M+L⃗m\vec{L}_{total} = \vec{L}_{disk} + \vec{L}_{M} + \vec{L}_{m}
L⃗disk=Idiskω=12MpR2ϕ˙ (out of the page)\vec{L}_{disk} = I_{disk}\omega = \dfrac{1}{2}M_p R^2 \dot{\phi}\,\text{(out of the page)}
L⃗M=Mr⃗M×v⃗M(computed using the actual vertical position and velocity)\vec{L}_{M} = M\vec{r}_{M}\times \vec{v}_{M}\quad\text{(computed using the actual vertical position and velocity)}
L⃗m=mr⃗m×v⃗m(computed using the actual vertical position and velocity)\vec{L}_{m} = m\vec{r}_{m}\times \vec{v}_{m}\quad\text{(computed using the actual vertical position and velocity)}

Add them up:

L⃗total=(12Mp+M+m)R2ϕ˙ (out of the page)\vec{L}_{total} = \left(\dfrac{1}{2}M_p + M + m\right)R^2 \dot{\phi}\,\text{(out of the page)}

Or the magnitude:

Ltotal=(12Mp+M+m)R2ϕ˙L_{total} = \left(\dfrac{1}{2}M_p + M + m\right)R^2 \dot{\phi}
pϕ=Ltotalp_{\phi} = L_{total}

Equation of Motion

We return to the differential equation of motion:

−(M−m)gR−ddt((M+m+12Mp)R2ϕ˙)=0-(M-m)gR - \dfrac{d}{dt}\left((M+m+\frac{1}{2}M_p)R^2\dot{\phi}\right)=0

−(M−m)gR−(M+m+12Mp)R2ϕ¨=0-(M-m)gR - (M+m+\frac{1}{2}M_p)R^2\ddot{\phi} = 0

which produces the following equation of motion:

ϕ¨=−gR(M−m)(M+m+12Mp)\ddot{\phi} = -\dfrac{g}{R}\dfrac{(M-m)}{(M+m+\frac{1}{2}M_p)}

which is a constant acceleration.

Comparing this to the massless-pulley result y¨1=−(M−m)(M+m)g\ddot{y}_1 = -\frac{(M-m)}{(M+m)}g from before, we see the pulley’s moment of inertia acts like extra inertia in the denominator, slowing the whole system down. The plot below shows the distance the heavier mass MM has descended after time tt for a few choices of pulley mass MpM_p.

Source
<Figure size 700x500 with 1 Axes>

Example: Bead in a Parabolic Bowl

A bead of mass mm is constrained to move along a parabolic bowl. There is a gravitational force acting on the bead. The bowl is symmetric about the zz-axis and the bead is constrained to move along the surface without friction or rolling. The bowl is described by the equation:

z=12c(x2+y2)z = \dfrac{1}{2}c(x^2 + y^2)

where cc is a constant that describes the curvature of the bowl. The figure below shows the system.

Bead in a Parabolic Bowl

In this case the system is better solved in cylindrical coordinates. The coordinates are (r,ϕ,z)(r, \phi, z), where rr is the distance from the zz-axis, ϕ\phi is the angle around the zz-axis, and zz is the height above the xyxy-plane as shown above.

With ⟨ρ,ϕ,z⟩\langle \rho, \phi, z\rangle as the coordinates, equation for the constraint is:

z=12c(x2+y2)=12cρ2.z = \dfrac{1}{2}c(x^2 + y^2) = \dfrac{1}{2}c\rho^2.

Note that cc has units.

[z]=m[ρ2]=m2[c]=1m[z] = m \quad [\rho^2] = m^2 \quad [c] = \dfrac{1}{m}

The speed in cylindrical coordinates can be derived from the expressions in Cartesian coordinates, but we quote the result here:

v2=ρ˙2+ρ2ϕ˙2+z˙2.v^2 = \dot{\rho}^2 + \rho^2\dot{\phi}^2 + \dot{z}^2.

Constructing the Lagrangian

We write the kinetic and potential energy of the bead in terms of the coordinates (r,ϕ,z)(r, \phi, z).

T=12m(ρ˙2+ρ2ϕ˙2+z˙2)T = \dfrac{1}{2}m\left(\dot{\rho}^2 + \rho^2\dot{\phi}^2 + \dot{z}^2\right)
V=mgzV = mgz

In principle, the Lagrangian can depend on all three coordinates and all three velocities.

L(ρ,ρ˙,ϕ,ϕ˙,z,z˙,t)=T−V\mathcal{L}(\rho, \dot{\rho}, \phi, \dot{\phi}, z, \dot{z}, t) = T - V

There is no explicit time dependence, so we can ignore tt. When the Lagrangian has no explicit time dependence, we should expect the energy to be conserved. This form of Lagrangian analysis does not account for dissipation.

L(ρ,ρ˙,ϕ,ϕ˙,z,z˙)\mathcal{L}(\rho, \dot{\rho}, \phi, \dot{\phi}, z, \dot{z})

Moreover, with the symmetry of the problem, we can expect no ϕ\phi dependence. That is the gravitational potential energy only depends on zz and not on ϕ\phi. This is a consequence of the symmetry of the problem and indicates that ϕ\phi is a cyclic coordinate. We thus expect angular momentum to be conserved about the zz-axis.

L(ρ,ρ˙,ϕ˙,z,z˙)\mathcal{L}(\rho, \dot{\rho}, \dot{\phi}, z, \dot{z})

Lastly, the constraint equation gives us zz in terms of ρ\rho:

z=12cρ2z = \dfrac{1}{2}c\rho^2

And thus we can find the time derivative of zz:

z˙=cρρ˙.\dot{z} = c\rho\dot{\rho}.

So the Lagrangian can be simplified three variables:

L(ρ,ρ˙,ϕ˙)=T−V\mathcal{L}(\rho, \dot{\rho}, \dot{\phi}) = T - V
L(ρ,ρ˙,ϕ˙)=12m((1+c2ρ2)ρ˙2+ρ2ϕ˙2)−mg12cρ2\mathcal{L}(\rho, \dot{\rho}, \dot{\phi}) = \dfrac{1}{2}m\left((1+c^2\rho^2)\dot{\rho}^2 + \rho^2\dot{\phi}^2\right) - mg\dfrac{1}{2}c\rho^2

Equations of Motion

We can now apply the Euler-Lagrange equations to find the equations of motion. We will do this for each coordinate. Let’s start with ϕ\phi because there is only one term in the Lagrangian that depends on ϕ˙\dot{\phi}.

∂L∂ϕ⏟0−ddt(∂L∂ϕ˙)=0\underbrace{\dfrac{\partial \mathcal{L}}{\partial \phi}}_0 - \dfrac{d}{dt}\left(\dfrac{\partial \mathcal{L}}{\partial \dot{\phi}}\right) = 0
ddt(∂L∂ϕ˙)=ddt(mρ2ϕ˙)⏟Lz=0\dfrac{d}{dt}\left(\dfrac{\partial \mathcal{L}}{\partial \dot{\phi}}\right) = \dfrac{d}{dt}\underbrace{\left(m\rho^2\dot{\phi}\right)}_{L_z} = 0

This equation of motion indicates that the angular momentum about the zz-axis is conserved, as we expected from the symmetry of the problem.

For the coordinate ρ\rho, we have:

∂L∂ρ−ddt(∂L∂ρ˙)=0\dfrac{\partial \mathcal{L}}{\partial \rho} - \dfrac{d}{dt}\left(\dfrac{\partial \mathcal{L}}{\partial \dot{\rho}}\right) = 0
∂L∂ρ=mρϕ˙2+mc2ρρ˙2−mgcρ\dfrac{\partial \mathcal{L}}{\partial \rho} = m\rho\dot{\phi}^2 + mc^2\rho\dot{\rho}^2 - mgc\rho
∂L∂ρ˙=m(1+c2ρ2)ρ˙\dfrac{\partial \mathcal{L}}{\partial \dot{\rho}} = m(1+c^2\rho^2)\dot{\rho}
ddt(∂L∂ρ˙)=m(1+c2ρ2)ρ¨+2mc2ρρ˙2\dfrac{d}{dt}\left(\dfrac{\partial \mathcal{L}}{\partial \dot{\rho}}\right) = m(1+c^2\rho^2)\ddot{\rho} + 2mc^2\rho\dot{\rho}^2

We can now write the equation of motion:

mρϕ˙2+mc2ρρ˙2−mgcρ−m(1+c2ρ2)ρ¨−2mc2ρρ˙2=0m\rho\dot{\phi}^2 + mc^2\rho\dot{\rho}^2 - mgc\rho - m(1+c^2\rho^2)\ddot{\rho} - 2mc^2\rho\dot{\rho}^2 = 0

We can clean this up a little bit:

ρ¨(1+c2ρ2)+c2ρρ˙2=ρϕ˙2−gcρ\ddot{\rho}(1+c^2\rho^2) + c^2\rho\dot{\rho}^2 = \rho\dot{\phi}^2 - gc\rho
ρ¨(1+c2ρ2)+c2ρρ˙2−ρϕ˙2+gcρ=0\ddot{\rho}(1+c^2\rho^2) + c^2\rho\dot{\rho}^2 - \rho\dot{\phi}^2 + gc\rho = 0

We try to write both equations in terms of their accelerations. We have:

ρ¨=−c2ρρ˙2−ρϕ˙2+gcρ1+c2ρ2\ddot{\rho} = -\dfrac{c^2\rho\dot{\rho}^2 - \rho\dot{\phi}^2 + gc\rho}{1+c^2\rho^2}
ϕ¨=−2ρρ˙ϕ˙ρ2\ddot{\phi} = - \dfrac{2\rho\dot{\rho}\dot{\phi}}{\rho^2}

For which we can develop a solution anywhere away from the origin (ρ≠0\rho \neq 0).

Preparing for Numerical Solution

We need to write these equations in a form that is ready for numerical solution. We can do this by writing the equations in terms of the first derivatives. Let ω=ϕ˙\omega = \dot{\phi} and v=ρ˙v = \dot{\rho}. We get 4 1st order equations:

ρ˙=v\dot{\rho} = v
ϕ˙=ω\dot{\phi} = \omega
v˙=−c2ρv2−ρω2+gcρ1+c2ρ2\dot{v} = -\dfrac{c^2\rho v^2 - \rho\omega^2 + gc\rho}{1+c^2\rho^2}
ω˙=−2vωρ\dot{\omega} = - \dfrac{2 v\omega}{\rho}

Let’s integrate these equations numerically, launching the bead at ρ0=1\rho_0=1 with ρ˙0=0\dot\rho_0=0 and a nonzero angular velocity ϕ˙0=1.2\dot\phi_0=1.2. We plot ρ(t)\rho(t) to see the radial oscillation, and reconstruct the 3D path (x,y,z)(x,y,z) to see the bead trace out its orbit on the bowl.

Source
<Figure size 1100x500 with 2 Axes>

The bead’s radius oscillates steadily between a minimum and maximum value rather than settling down, because there is nothing to dissipate energy in this frictionless system, while conservation of Lz=mρ2ϕ˙L_z = m\rho^2\dot\phi forces ϕ˙\dot\phi to speed up whenever ρ\rho shrinks, tracing out the looping path on the bowl’s surface shown at right.