PHYS-344 · Lesson 5 of 12 · 26 min

Constraint forces, Lagrange multipliers and nonholonomic systems

Lesson 4 made a virtue of ignoring constraint forces: by choosing coordinates that satisfy the constraints automatically, the forces that enforce them never appear. Sometimes, though, the constraint force is exactly what we want to know. An engineer needs the tension in a cable, the load on a bearing or the moment a block starts to slide; a physicist needs to know when a particle leaves a surface. And some constraints, such as rolling without slipping on a plane, cannot be built into coordinates at all. This lesson handles both situations with Lagrange multipliers.

Keeping the constraint as an equation

Instead of eliminating a constraint, keep more coordinates than there are degrees of freedom, and impose the constraint \(f(q, t) = 0\) separately. The virtual displacements \(\delta q_j\) are then not independent: they must satisfy \(\sum_j \frac{\partial f}{\partial q_j}\delta q_j = 0\). D'Alembert's principle still says \(\sum_j \big(\frac{d}{dt}\frac{\partial L}{\partial\dot q_j} - \frac{\partial L}{\partial q_j}\big)\delta q_j = 0\) for all such displacements. Adding \(\lambda\) times the constraint condition, with \(\lambda\) chosen to make one bracket vanish, makes all of them vanish:

\[\frac{d}{dt}\frac{\partial L}{\partial\dot q_j} - \frac{\partial L}{\partial q_j} = \lambda\frac{\partial f}{\partial q_j}, \qquad j = 1, \dots, n.\]

These \(n\) equations together with \(f = 0\) determine the \(n\) coordinates and \(\lambda(t)\). The right-hand side is the generalized constraint force: \(\lambda\,\partial f/\partial q_j\) is the component of the force that enforces the constraint along \(q_j\). With several constraints \(f_a = 0\), there is one multiplier for each, and the right side becomes \(\sum_a\lambda_a\,\partial f_a/\partial q_j\). The method is the same as the multiplier rule for constrained optimization in MATH-372, now applied in the space of paths.

The geometric meaning is clean. The gradient \(\nabla f\) points perpendicular to the constraint surface \(f = 0\), so the constraint force points perpendicular to it, which is exactly the condition for doing no work in displacements along the surface. The multiplier sets its size.

The pendulum, the other way

Treat a pendulum bob in Cartesian coordinates \((x, y)\) with \(L = \tfrac12 m(\dot x^2 + \dot y^2) - mgy\) and constraint \(f = x^2 + y^2 - \ell^2 = 0\). The equations are

\[m\ddot x = 2\lambda x, \qquad m\ddot y = -mg + 2\lambda y.\]

The constraint force is \(2\lambda(x, y)\), along the rod, with magnitude \(2|\lambda|\ell\). To find \(\lambda\), differentiate the constraint twice: \(x\ddot x + y\ddot y + \dot x^2 + \dot y^2 = 0\). Substituting the accelerations gives \(2\lambda\ell^2/m - gy + v^2 = 0\), so \(\lambda = -m(v^2 - gy)/(2\ell^2)\). With \(y = -\ell\cos\theta\) and \(v = \ell\dot\theta\), the tension \(-2\lambda\ell\) is

\[T_{\text{rod}} = m\big(g\cos\theta + \ell\dot\theta^2\big),\]

the familiar result: the rod supports the component of gravity along it and supplies the centripetal force. For a pendulum released from rest at \(\theta_0\), energy gives \(\ell\dot\theta^2 = 2g(\cos\theta - \cos\theta_0)\), so \(T_{\text{rod}} = mg(3\cos\theta - 2\cos\theta_0)\). The program integrates the Cartesian equations with the multiplier and compares.

Leaving a surface

A small bead starts at rest at the top of a smooth hemisphere of radius \(R\), is nudged, and slides down. In polar coordinates \((r, \theta)\) about the center, with \(\theta\) from the top, \(L = \tfrac12 m(\dot r^2 + r^2\dot\theta^2) - mgr\cos\theta\), with constraint \(f = r - R = 0\). The \(r\) equation is

\[m\ddot r - mr\dot\theta^2 + mg\cos\theta = \lambda.\]

While in contact \(r = R\) and \(\ddot r = 0\), so \(\lambda = mg\cos\theta - mR\dot\theta^2\). This is the radial constraint force, the normal force \(N\) pushing outward. Energy conservation gives \(R\dot\theta^2 = 2g(1 - \cos\theta)\), so \(N = mg(3\cos\theta - 2)\). The surface can only push, not pull, so the bead leaves when \(N\) reaches zero, at \(\cos\theta = 2/3\), or 48.19 degrees from the top, after dropping one third of the radius. The multiplier told us both the force and when the inequality constraint stops acting.

Two panels. On the left, a gray hemisphere with a red bead on its surface at 48.2 degrees from the vertical, labeled leaves here, and a dashed red path curving away from the surface beyond it. On the right, the path of a wheel seen from above: from a start point it rolls right along the x axis, turns on the spot, rolls back along a line sloping down to the left, and ends at a red point below and slightly to the right of the start, labeled finish shifted sideways.
Left: the multiplier gives the normal force on the bead, which reaches zero at \(\cos\theta = 2/3\). Right: a wheel that cannot slide sideways reaches a sideways position by rolling and turning; the shift is about \(\varepsilon^2\) for steps of size \(\varepsilon\).

Rolling without slipping

A cylinder of radius \(a\) rolling down an incline of angle \(\alpha\) has two coordinates, the distance \(s\) its center has moved and the angle \(\phi\) it has turned. Rolling without slipping says \(\dot s = a\dot\phi\), which integrates to \(s = a\phi\) plus a constant: the constraint is holonomic, and we can eliminate \(\phi\). With moment of inertia \(I\), \(L = \tfrac12 M\dot s^2 + \tfrac12 I\dot s^2/a^2 + Mgs\sin\alpha\), and \(\ddot s = g\sin\alpha/(1 + I/Ma^2)\): \(\tfrac23 g\sin\alpha\) for a solid cylinder, \(\tfrac12 g\sin\alpha\) for a hoop. Keeping both coordinates and a multiplier instead gives the same acceleration and, in addition, the friction force at the contact, \(\lambda/a = (I/a^2)\ddot s\). That is the force that must be available from static friction; if \(\mu Mg\cos\alpha\) is smaller, the cylinder slips.

Nonholonomic constraints

A wheel rolling on a plane, or a coin, or an ice skate, is different. Take a thin vertical wheel whose contact point is at \((x, y)\) and whose heading is \(\phi\). It can roll forward and it can turn, but it cannot slide sideways, so its velocity must point along its heading:

\[\dot x\sin\phi - \dot y\cos\phi = 0.\]

This is a condition on velocities that cannot be integrated into a relation among \(x\), \(y\) and \(\phi\). Proof: if it could, some function \(g(x, y, \phi) = 0\) would confine the wheel to a two-dimensional surface in its three-dimensional configuration space. But by rolling and turning, the wheel can reach any position with any heading, as anyone who has parallel-parked a car knows. A constraint that restricts velocities without restricting reachable configurations is nonholonomic.

The general form is a constraint linear in velocities, \(\sum_j a_{j}(q)\,\dot q_j = 0\). Nonholonomic constraints cannot be built into coordinates, but they can be handled by multipliers: the equations become \(\frac{d}{dt}\frac{\partial L}{\partial\dot q_j} - \frac{\partial L}{\partial q_j} = \lambda a_{j}\), solved together with the constraint. A caution: one must not substitute a nonholonomic constraint into the Lagrangian before taking derivatives, and the problem cannot be posed as making an action stationary among constrained paths. The correct equations are the d'Alembert form above, which follows the physics of a wheel that grips the ground; making the action stationary among paths that obey the constraint gives a different and physically wrong system, sometimes called vakonomic mechanics.

How a wheel moves sideways

If the wheel cannot slide sideways, how does it ever get sideways? By combining two allowed motions in a loop. Roll forward a distance \(\varepsilon\), turn on the spot by an angle \(\varepsilon\), roll back \(\varepsilon\), turn back \(\varepsilon\). Each step is allowed, but the loop does not close: the wheel ends up displaced sideways by about \(\varepsilon^2\). Mathematically, the two allowed directions of motion, rolling \((\cos\phi, \sin\phi, 0)\) and turning \((0, 0, 1)\), do not commute, and their commutator, called a Lie bracket, is \((\sin\phi, -\cos\phi, 0)\): a sideways motion. The theorem that repeated brackets of allowed motions span every direction, so every configuration is reachable, is due to Wei-Liang Chow in 1939 and Petr Rashevskii in 1938. It underlies the control of robots, cars and spacecraft attitude.

Pendulum tension from a Lagrange multiplier, a bead leaving a hemisphere, and a sideways shift from nonholonomic motion
import math
g = 9.81

# 1. Pendulum in Cartesian coordinates with the constraint x^2 + y^2 = l^2 enforced by a multiplier.
#    m xddot = 2 lam x, m yddot = -m g + 2 lam y; differentiating the constraint twice gives lam.
m, l = 0.5, 1.2
def accel(x, y, vx, vy):
    lam = -m * (vx * vx + vy * vy - g * y) / (2 * l * l)   # from x xddot + y yddot + v^2 = 0
    return 2 * lam * x / m, -g + 2 * lam * y / m, lam
th = math.radians(60); x, y = l * math.sin(th), -l * math.cos(th); vx = vy = 0.0
dt = 1e-5; t = 0.0
print(" angle (deg)   tension from multiplier (N)   m(g cos th + l thdot^2) (N)")
for target in (60, 40, 20, 0):
    while math.degrees(math.atan2(x, -y)) > target + 1e-9:
        ax, ay, lam = accel(x, y, vx, vy)
        vx += ax * dt; vy += ay * dt; x += vx * dt; y += vy * dt
        r = math.hypot(x, y); x, y = x * l / r, y * l / r              # project back onto the circle
        vr = (vx * x + vy * y) / l; vx -= vr * x / l; vy -= vr * y / l
    a = math.atan2(x, -y); thdot2 = (vx * vx + vy * vy) / l ** 2
    lam = accel(x, y, vx, vy)[2]
    print(f"   {math.degrees(a):6.2f}        {-2 * lam * l:10.4f}                  {m * (g * math.cos(a) + l * thdot2):10.4f}")
print(f"tension at the bottom from energy: m g (3 - 2 cos 60) = {m * g * (3 - 2 * math.cos(math.radians(60))):.4f} N")

# 2. A bead sliding from rest at the top of a smooth hemisphere: the normal force N = m g (3 cos th - 2)
#    found from the multiplier vanishes at cos th = 2/3.
th_off = math.acos(2 / 3)
print(f"bead leaves the hemisphere at {math.degrees(th_off):.2f} deg from the top, "
      f"having dropped {1 - 2 / 3:.4f} of the radius")

# 3. Nonholonomic constraint: a wheel that cannot slip sideways can still reach any position and heading.
#    Sequence: roll forward, turn on the spot, roll back, turn back. The net result is a sideways shift.
def drive(state, speed, turn_rate, T, n=2000):
    x, y, ph = state; dt = T / n
    for _ in range(n):
        x += speed * math.cos(ph) * dt; y += speed * math.sin(ph) * dt; ph += turn_rate * dt
    return x, y, ph
for eps in (0.4, 0.2, 0.1):
    st = (0.0, 0.0, 0.0)
    for v, w in ((1.0, 0.0), (0.0, 1.0), (-1.0, 0.0), (0.0, -1.0)):
        st = drive(st, v, w, eps)
    print(f"steps of size {eps:.1f}: sideways shift {st[1]:+.5f} m, forward {st[0]:+.5f} m, "
          f"heading {abs(st[2]):.1e} rad, shift / eps^2 = {st[1] / eps ** 2:+.4f}")
Output
 angle (deg)   tension from multiplier (N)   m(g cos th + l thdot^2) (N)
    60.00            2.4525                      2.4525
    40.00            6.3674                      6.3674
    20.00            8.9226                      8.9226
    -0.00            9.8101                      9.8101
tension at the bottom from energy: m g (3 - 2 cos 60) = 9.8100 N
bead leaves the hemisphere at 48.19 deg from the top, having dropped 0.3333 of the radius
steps of size 0.4: sideways shift -0.15577 m, forward +0.03158 m, heading 7.4e-18 rad, shift / eps^2 = -0.9735
steps of size 0.2: sideways shift -0.03973 m, forward +0.00399 m, heading 3.7e-18 rad, shift / eps^2 = -0.9933
steps of size 0.1: sideways shift -0.00998 m, forward +0.00050 m, heading 1.9e-18 rad, shift / eps^2 = -0.9983

The tension from the multiplier and from \(m(g\cos\theta + \ell\dot\theta^2)\) agree at every printed angle, from 2.45 N at the release point to 9.81 N at the bottom, which matches \(mg(3 - 2\cos60^\circ)\) exactly. The bead leaves the hemisphere at 48.19 degrees. For the wheel, steps of 0.4, 0.2 and 0.1 produce sideways shifts of 0.156, 0.040 and 0.010, so the shift divided by \(\varepsilon^2\) approaches 1 as the steps shrink, while the heading returns to its start to rounding error. A car maneuvers into a parking space this way, with steering and driving playing the roles of turning and rolling.

Worked problem

When does a block on a sphere slip?

A solid ball of radius \(a\) rolls without slipping from rest at the top of a large fixed sphere of radius \(R\). The center of the ball moves on a circle of radius \(R + a\). At what angle does it leave the sphere, assuming it does not slip first?

Show solution
  1. Energy with rolling: \(Mg(R + a)(1 - \cos\theta) = \tfrac12 Mv^2 + \tfrac12 Iv^2/a^2 = \tfrac12\cdot\tfrac75 Mv^2\) for a solid ball.
  2. So \(v^2 = \tfrac{10}{7}g(R + a)(1 - \cos\theta)\).
  3. The radial equation with the normal force as multiplier: \(N = Mg\cos\theta - Mv^2/(R + a) = Mg\big[\cos\theta - \tfrac{10}{7}(1 - \cos\theta)\big]\).
  4. Setting \(N = 0\): \(\tfrac{17}{7}\cos\theta = \tfrac{10}{7}\), so \(\cos\theta = 10/17\).

Answer: \(\theta = \arccos(10/17) = 54.0^\circ\), later than the sliding bead's 48.2 degrees, because some of the energy goes into spin and the ball moves more slowly. In practice friction may fail first, since the required friction force grows as the normal force shrinks.

Worked problem

The force on a bead on a rotating rod

A bead slides without friction on a straight rod that rotates in a horizontal plane at constant \(\omega\). From PHYS-244, \(r = r_0\cosh\omega t\) if released from rest at \(r_0\). Find the force the rod exerts on the bead.

Show solution
  1. Use \(r\) and \(\phi\) with constraint \(f = \phi - \omega t = 0\). \(L = \tfrac12 m(\dot r^2 + r^2\dot\phi^2)\).
  2. The \(\phi\) equation: \(\frac{d}{dt}(mr^2\dot\phi) = \lambda\). With \(\dot\phi = \omega\), \(\lambda = 2mr\dot r\omega\).
  3. \(\lambda\) is a torque about the axis; the force perpendicular to the rod is \(\lambda/r = 2m\omega\dot r\).
  4. With \(\dot r = r_0\omega\sinh\omega t\), the force is \(2m\omega^2 r_0\sinh\omega t\).

Answer: \(F_\perp = 2m\omega\dot r\), the Coriolis term from PHYS-244, here appearing as the force the rod must supply. It grows exponentially, so the motor driving the rod must supply ever more torque.

Common mistakes

  • MistakeSubstituting a nonholonomic constraint into the Lagrangian before deriving the equations.

    InsteadDerive Lagrange's equations with multipliers first, then impose the constraint on the velocities.

  • MistakeTaking the sign of the multiplier as the sign of the force without checking the constraint's form.

    InsteadThe constraint force is \(\lambda\nabla f\); its direction depends on how \(f\) is written.

  • MistakeAssuming a normal force can pull.

    InsteadContact constraints are inequalities; when the multiplier changes sign the constraint is released and the body leaves the surface.

  • MistakeTreating rolling of a cylinder on a line as nonholonomic.

    InsteadIn one dimension \(\dot s = a\dot\phi\) integrates to \(s = a\phi\), a holonomic constraint.

  • MistakeExpecting a wheel that cannot slip sideways to be unable to reach sideways positions.

    InsteadLoops of allowed motions generate the forbidden direction at second order, through the Lie bracket.

Summary and key terms

  • Keeping extra coordinates and imposing \(f = 0\) with a multiplier gives \(\frac{d}{dt}\partial L/\partial\dot q_j - \partial L/\partial q_j = \lambda\,\partial f/\partial q_j\).
  • The multiplier term is the generalized constraint force, normal to the constraint surface.
  • Multipliers give tensions, normal forces and friction requirements, and reveal when contact is lost: a bead leaves a smooth sphere at \(\cos\theta = 2/3\).
  • Nonholonomic constraints restrict velocities without restricting reachable configurations; they are handled with multipliers in d'Alembert form.
  • Non-commuting allowed motions generate the forbidden ones at second order, which is how a car parks.
Lagrange multiplier
An unknown function of time that sets the size of a constraint force.
generalized constraint force
The term λ ∂f/∂q_j that enforces a constraint in Lagrange's equations.
nonholonomic constraint
A constraint on velocities that cannot be integrated to a constraint on coordinates.
rolling without slipping
The contact point of a rolling body has zero velocity relative to the surface.
Lie bracket
The commutator of two vector fields; it measures the net motion of a small loop of the two flows.
inequality constraint
A constraint such as contact with a surface that holds only while the constraint force has the right sign.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. A 2.0 kg pendulum bob on a 1.5 m string is released from 90 degrees. Find the tension at the bottom.

    Show answer

    \(mg(3 - 2\cos90^\circ) = 3mg = 58.9\ \mathrm N\).

  2. At what angle from the top does a bead released from rest leave a smooth sphere of radius 2 m, and how far has it dropped?

    Show answer

    \(\cos\theta = 2/3\), \(\theta = 48.2^\circ\), drop \(R/3 = 0.67\ \mathrm m\), independent of \(R\) in angle.

  3. A hollow cylinder rolls down a 30 degree incline. Find its acceleration and the friction force for \(M = 1\ \mathrm{kg}\).

    Show answer

    \(I = Ma^2\): \(\ddot s = \tfrac12 g\sin30^\circ = 2.45\ \mathrm{m/s^2}\); friction \(= M\ddot s = 2.45\ \mathrm N\).

  4. What minimum coefficient of static friction lets that cylinder roll without slipping?

    Show answer

    \(\mu \ge 2.45/(9.81\cos30^\circ) = 0.29\).

  5. Write the constraint for a wheel that cannot slide sideways and show it is of the form \(\sum a_j\dot q_j = 0\).

    Show answer

    \(\sin\phi\,\dot x - \cos\phi\,\dot y + 0\cdot\dot\phi = 0\), with \(a = (\sin\phi, -\cos\phi, 0)\).

  6. A loop of four steps of size 0.05 is used to shift a wheel sideways. Roughly how far does it move?

    Show answer

    About \(\varepsilon^2 = 0.0025\), or 2.5 mm for steps in meters and radians.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz