STEMviz
Physics · Analytical Mechanics and Thermodynamics

Constraints, Generalised Coordinates and Virtual Work

A holonomic constraint f({r⃗i},t)=0f(\{\vec r_i\},t)=0 removes one degree of freedom, leaving n=3N−kn=3N-k independent generalised coordinates qjq_j; a virtual displacement δr⃗i=∑j(∂r⃗i/∂qj) δqj\delta\vec r_i=\sum_j(\partial\vec r_i/\partial q_j)\,\delta q_j is taken at frozen time, ideal constraint forces do no virtual work, and D'Alembert's principle ∑i(F⃗i(a)−p⃗˙i)⋅δr⃗i=0\sum_i(\vec F_i^{(a)}-\dot{\vec p}_i)\cdot\delta\vec r_i=0 eliminates the reactions.

Constraints, Generalised Coordinates and Virtual Work

Newtonian mechanics describes a system of NN particles by 3N3N Cartesian coordinates and 3N3N equations mir⃗¨i=F⃗im_i\ddot{\vec{r}}_i = \vec{F}_i. For any system more complicated than a few free masses this is the wrong bookkeeping: the particles of a rigid body, the bead threaded on a wire, the pendulum bob on its rod are not free to move independently, and the forces that keep them on their tracks — the rod tension, the wire's normal force, the internal forces of the rigid body — are unknowns we rarely care about. Analytical mechanics, in the tradition of Lagrange and developed in Goldstein's Chapter 1, rebuilds the subject around the independent ways a system can move and eliminates the forces of constraint from the outset.

This chapter assembles the vocabulary for that programme. A constraint is a restriction on the configurations or velocities a system may take; generalised coordinates are a minimal set of independent parameters that fix the configuration; a virtual displacement is an imagined, instantaneous, constraint-respecting change of configuration; and the principle of virtual work states that the forces of constraint do no work under such a displacement. Put together, these ideas turn a constrained 3N3N-dimensional problem into an unconstrained nn-dimensional one, where nn is the number of degrees of freedom.

How to read this chapter. The single most important line is that the forces of constraint drop out of the virtual-work equation. Everything in Block B — Lagrange's equations, Hamilton's equations, Noether's theorem — is built on that fact. Keep a running list of the systems worked here (bead on wire, plane pendulum, Atwood machine, rolling disc) because the next two chapters solve them again with the machinery this chapter motivates.

1. Configuration Space and Degrees of Freedom

The instantaneous state of NN point particles is a single point in a 3N3N-dimensional configuration space with coordinates (x1,y1,z1,…,xN,yN,zN)(x_1,y_1,z_1,\dots,x_N,y_N,z_N), which we abbreviate as {r⃗i}\{\vec{r}_i\}, i=1,…,Ni = 1,\dots,N. As the system evolves, this point traces a curve.

If the particles are subject to kk independent equations of constraint, the accessible configurations form a surface of dimension

n=3N−kn = 3N - k

inside configuration space. This number nn is the number of degrees of freedom: the number of coordinates that can be varied independently without leaving the constraint surface. A single particle free in space has n=3n = 3; confined to a surface, n=2n = 2; threaded on a wire, n=1n = 1. A rigid body of many atoms has n=6n = 6 — three to place its centre of mass, three to orient it — because the enormous number of interatomic-distance constraints collapses the count.

2. Holonomic and Non-Holonomic Constraints

A constraint is holonomic if it can be written as an equation relating only the coordinates and possibly the time,

fα(r⃗1,…,r⃗N,t)=0,α=1,…,kf_\alpha(\vec{r}_1,\dots,\vec{r}_N,t) = 0, \qquad \alpha = 1,\dots,k

Each such equation removes one degree of freedom and lets one coordinate be solved for in terms of the others. The distance constraint of a rigid body, ∣r⃗i−r⃗j∣=cij|\vec{r}_i - \vec{r}_j| = c_{ij}; the rod of a pendulum, x2+y2=ℓ2x^2 + y^2 = \ell^2; a bead on a prescribed curve — all are holonomic. If fαf_\alpha contains tt explicitly the constraint is rheonomic (moving, e.g. a bead on a wire that is being rotated at a fixed rate); if not, it is scleronomic (fixed).

A constraint that cannot be integrated to a relation among the coordinates alone is non-holonomic. The standard example is a vertical disc of radius aa rolling without slipping on a plane: the rolling condition ties the velocity of the contact point to the angular velocity,

x˙=aϕ˙cos⁡θ,y˙=aϕ˙sin⁡θ,\dot{x} = a\dot{\phi}\cos\theta, \qquad \dot{y} = a\dot{\phi}\sin\theta,

and because θ\theta (the heading) changes as the disc rolls, these differential relations have no integrating factor — there is no f(x,y,θ,ϕ)=0f(x,y,\theta,\phi) = 0. Inequality constraints (a molecule confined to a box, ∣r⃗∣≤R|\vec{r}| \le R) are also non-holonomic. This chapter and the next two treat holonomic systems; non-holonomic systems need Lagrange multipliers, introduced in Chapter 3.

3. Generalised Coordinates

For a holonomic system with n=3N−kn = 3N - k degrees of freedom, choose nn independent parameters q1,…,qnq_1,\dots,q_n — the generalised coordinates — that label the points of the constraint surface. They need not have dimensions of length: an angle, an arc length, a normalised amplitude all qualify. The Cartesian positions are then known functions

r⃗i=r⃗i(q1,…,qn,t),i=1,…,N,\vec{r}_i = \vec{r}_i(q_1,\dots,q_n,t), \qquad i = 1,\dots,N,

with explicit tt-dependence exactly when the constraints are rheonomic. Differentiating by the chain rule gives the velocities

r⃗˙i=∑j=1n∂r⃗i∂qj q˙j+∂r⃗i∂t\dot{\vec{r}}_i = \sum_{j=1}^{n} \frac{\partial \vec{r}_i}{\partial q_j}\,\dot{q}_j + \frac{\partial \vec{r}_i}{\partial t}

The partial derivatives ∂r⃗i/∂qj\partial\vec{r}_i/\partial q_j are the tangent vectors to the constraint surface; the term ∂r⃗i/∂t\partial\vec{r}_i/\partial t is the velocity the particle would have if all the qjq_j were frozen and only the constraint's own time-dependence acted. Two identities that follow immediately and are used in every derivation of Lagrange's equations:

∂r⃗˙i∂q˙j=∂r⃗i∂qj("cancellation of dots"),ddt ⁣(∂r⃗i∂qj)=∂r⃗˙i∂qj("commuting d/dt and ∂/∂qj")\frac{\partial \dot{\vec{r}}_i}{\partial \dot{q}_j} = \frac{\partial \vec{r}_i}{\partial q_j} \qquad\text{("cancellation of dots")}, \qquad\qquad \frac{d}{dt}\!\left(\frac{\partial \vec{r}_i}{\partial q_j}\right) = \frac{\partial \dot{\vec{r}}_i}{\partial q_j} \qquad\text{("commuting } d/dt \text{ and } \partial/\partial q_j\text{")}

Worked example — plane pendulum. A bob of mass mm hangs from a rigid massless rod of length ℓ\ell pivoted at the origin, swinging in the xyxy-plane (yy down). The constraint x2+y2=ℓ2x^2 + y^2 = \ell^2 is one holonomic equation, so n=2−1=1n = 2 - 1 = 1. Take q=θq = \theta, the angle from the downward vertical: x=ℓsin⁡θx = \ell\sin\theta, y=ℓcos⁡θy = \ell\cos\theta. Then x˙=ℓcos⁡θ θ˙\dot{x} = \ell\cos\theta\,\dot\theta, y˙=−ℓsin⁡θ θ˙\dot{y} = -\ell\sin\theta\,\dot\theta, and the speed is ∣r⃗˙∣=ℓ∣θ˙∣|\dot{\vec r}| = \ell|\dot\theta|, a single-variable description with the rod tension nowhere in sight.

4. Virtual Displacements

A virtual displacement δr⃗i\delta\vec{r}_i is an infinitesimal change of the configuration that (i) is imagined to happen at a fixed instant of time, δt=0\delta t = 0, and (ii) is consistent with the constraints as they exist at that instant. It is written with δ\delta rather than dd to mark that it is not an actual displacement occurring over a time dtdt but a comparison between two nearby allowed configurations.

In terms of generalised coordinates, because the qjq_j are independent and unconstrained, an arbitrary virtual displacement is

δr⃗i=∑j=1n∂r⃗i∂qj δqj\delta\vec{r}_i = \sum_{j=1}^{n} \frac{\partial \vec{r}_i}{\partial q_j}\,\delta q_j

with the δqj\delta q_j completely free. Note what is absent: there is no ∂r⃗i/∂t δt\partial\vec{r}_i/\partial t\,\delta t term, precisely because δt=0\delta t = 0. This is the one place where virtual and real displacements differ for a rheonomic system, and it is the reason the formalism handles moving constraints cleanly.

Worked example — bead on a rotating wire. A straight wire in the horizontal plane is forced to rotate about the origin at constant angular rate ω\omega, and a bead slides on it. Constraints: z=0z = 0 and azimuth=ωt\text{azimuth} = \omega t. Generalised coordinate: q=sq = s, the distance along the wire, with r⃗=(scos⁡ωt, ssin⁡ωt, 0)\vec{r} = (s\cos\omega t,\ s\sin\omega t,\ 0). The real displacement in time dtdt is dr⃗=(s˙cos⁡ωt−sωsin⁡ωt, s˙sin⁡ωt+sωcos⁡ωt, 0) dtd\vec{r} = (\dot{s}\cos\omega t - s\omega\sin\omega t,\ \dot s\sin\omega t + s\omega\cos\omega t,\ 0)\,dt, which has a component along the wire's motion. The virtual displacement is δr⃗=(cos⁡ωt, sin⁡ωt, 0) δs\delta\vec{r} = (\cos\omega t,\ \sin\omega t,\ 0)\,\delta s — purely along the wire as it is oriented now. The difference is the frozen-time rule at work.

5. Forces of Constraint and the Principle of Virtual Work

Split the total force on particle ii into an applied part F⃗i(a)\vec{F}_i^{(a)} (gravity, springs, driving) and a constraint part f⃗i\vec{f}_i (the wire's normal force, the rod tension, the floor's reaction). The defining property of an ideal constraint is that it does no work under any virtual displacement:

∑i=1Nf⃗i⋅δr⃗i=0\sum_{i=1}^{N} \vec{f}_i \cdot \delta\vec{r}_i = 0

This holds because ideal constraint forces are perpendicular to the constraint surface while virtual displacements lie in it: the normal force on a bead is ⊥\perp the wire; the tension in a rigid rod does equal and opposite work on its two ends; the static friction at a rolling contact acts at a point with zero velocity. (Sliding friction is not ideal and must be carried as an applied force.)

For a system in equilibrium every F⃗i(a)+f⃗i=0⃗\vec{F}_i^{(a)} + \vec{f}_i = \vec{0}, so ∑i(F⃗i(a)+f⃗i)⋅δr⃗i=0\sum_i (\vec{F}_i^{(a)} + \vec{f}_i)\cdot\delta\vec{r}_i = 0, and the constraint term vanishes by the line above. This leaves the principle of virtual work:

∑i=1NF⃗i(a)⋅δr⃗i=0for every virtual displacement, at equilibrium.\sum_{i=1}^{N} \vec{F}_i^{(a)} \cdot \delta\vec{r}_i = 0 \quad\text{for every virtual displacement, at equilibrium.}

The unknown reaction forces have been eliminated; only the applied forces appear.

Worked example — ladder against a wall. A uniform ladder of weight WW leans at angle θ\theta with its foot on a rough floor and its top on a smooth wall. Let the applied "force" be gravity acting at the centre of mass, height 12Lsin⁡θ\tfrac{1}{2}L\sin\theta. A virtual increase δθ\delta\theta raises the centre of mass by δh=12Lcos⁡θ δθ\delta h = \tfrac{1}{2}L\cos\theta\,\delta\theta, so gravity does virtual work −W δh-W\,\delta h. If the only applied force is gravity this cannot vanish for arbitrary δθ\delta\theta — confirming the ladder is not in equilibrium without floor friction, which is the applied horizontal force needed to make the total virtual work zero.

6. Generalised Forces

Substitute δr⃗i=∑j(∂r⃗i/∂qj) δqj\delta\vec{r}_i = \sum_j (\partial\vec{r}_i/\partial q_j)\,\delta q_j into the virtual work of the applied forces:

δW=∑iF⃗i(a)⋅δr⃗i=∑j=1n(∑iF⃗i(a)⋅∂r⃗i∂qj)δqj≡∑j=1nQj δqj\delta W = \sum_{i} \vec{F}_i^{(a)}\cdot\delta\vec{r}_i = \sum_{j=1}^{n} \left( \sum_{i} \vec{F}_i^{(a)}\cdot\frac{\partial\vec{r}_i}{\partial q_j} \right) \delta q_j \equiv \sum_{j=1}^{n} Q_j\,\delta q_j

The coefficient

Qj=∑i=1NF⃗i(a)⋅∂r⃗i∂qjQ_j = \sum_{i=1}^{N} \vec{F}_i^{(a)} \cdot \frac{\partial \vec{r}_i}{\partial q_j}

is the generalised force conjugate to qjq_j. Its units are whatever makes Qj δqjQ_j\,\delta q_j an energy: if qjq_j is a length, QjQ_j is a force; if qjq_j is an angle, QjQ_j is a torque. Because the δqj\delta q_j are independent, the principle of virtual work becomes simply Qj=0Q_j = 0 for all jj at equilibrium.

When the applied forces are conservative, F⃗i(a)=−∇iV\vec{F}_i^{(a)} = -\nabla_i V, the generalised force is minus a gradient in qq-space:

Qj=−∑i∇iV⋅∂r⃗i∂qj=−∂V∂qjQ_j = -\sum_i \nabla_i V \cdot \frac{\partial\vec{r}_i}{\partial q_j} = -\frac{\partial V}{\partial q_j}

so equilibrium is exactly a stationary point of the potential, ∂V/∂qj=0\partial V/\partial q_j = 0 — the familiar statement, here recovered from a much more general principle.

Worked example — generalised force on the pendulum. With q=θq = \theta and gravity F⃗(a)=mg y^\vec{F}^{(a)} = mg\,\hat{y} (taking yy downward), ∂r⃗/∂θ=(ℓcos⁡θ, −ℓsin⁡θ)\partial\vec{r}/\partial\theta = (\ell\cos\theta,\,-\ell\sin\theta), so Qθ=mg⋅(−ℓsin⁡θ)=−mgℓsin⁡θQ_\theta = mg\cdot(-\ell\sin\theta) = -mg\ell\sin\theta. This is the gravitational torque about the pivot, and it equals −∂V/∂θ-\partial V/\partial\theta with V=−mgℓcos⁡θV = -mg\ell\cos\theta.

7. D'Alembert's Principle in Embryo

Equilibrium is a special case. To reach dynamics, rewrite Newton's law as F⃗i(a)+f⃗i−p⃗˙i=0⃗\vec{F}_i^{(a)} + \vec{f}_i - \dot{\vec{p}}_i = \vec{0} and read the term −p⃗˙i-\dot{\vec{p}}_i as an inertial force, so that every instant looks like a statics problem. Dotting with δr⃗i\delta\vec{r}_i, summing, and again dropping the constraint term ∑if⃗i⋅δr⃗i=0\sum_i \vec{f}_i\cdot\delta\vec{r}_i = 0:

∑i=1N(F⃗i(a)−p⃗˙i)⋅δr⃗i=0\sum_{i=1}^{N} \left( \vec{F}_i^{(a)} - \dot{\vec{p}}_i \right) \cdot \delta\vec{r}_i = 0

This is D'Alembert's principle. It is the exact dynamical statement in which the forces of constraint have been eliminated, valid for scleronomic and rheonomic holonomic systems alike. The whole of the next chapter is the algebra of pushing this equation through the substitution δr⃗i=∑j(∂r⃗i/∂qj) δqj\delta\vec{r}_i = \sum_j(\partial\vec{r}_i/\partial q_j)\,\delta q_j and using the two dot-cancellation identities of Section 3 to arrive at Lagrange's equations.

8. Counting Degrees of Freedom in Practice

  • Two beads on a rigid rod, rod free in a plane: each bead free in the plane is 22, total 44; the fixed-separation constraint removes 11; n=3n = 3 (rod's centre position x,yx,y and orientation ϕ\phi).
  • Double plane pendulum: two bobs, 44 Cartesian coordinates, two rod-length constraints, n=2n = 2 — use (θ1,θ2)(\theta_1,\theta_2).
  • Rigid body, free: 3N3N atomic coordinates minus 3N−63N - 6 independent distance constraints, n=6n = 6.
  • Disc rolling without slipping on a line (in its plane): centre height fixed (11 constraint) and x˙=aϕ˙\dot{x} = a\dot\phi integrable to x=aϕ+constx = a\phi + \text{const} (11 more), so here the rolling constraint is holonomic and n=1n = 1. The genuinely non-holonomic case needs the disc free to steer on a plane.

The lesson: count Cartesian coordinates, subtract the number of independent holonomic constraints, and check whether any velocity constraint is secretly integrable before calling a system non-holonomic.

9. Recovering the Constraint Forces

Eliminating the reactions is a feature, but sometimes the reaction is the answer — will the rod snap, will the bead fly off the loop? Two routes recover it. First, having solved the reduced problem for qj(t)q_j(t), substitute back into Newton's second law for one particle and read off the constraint force as the difference f⃗i=p⃗˙i−F⃗i(a)\vec{f}_i = \dot{\vec{p}}_i - \vec{F}_i^{(a)}. Second, keep the constraint as an equation f(q⃗,t)=0f(\vec q,t) = 0 adjoined with a Lagrange multiplier λ\lambda; the multiplier turns out to be proportional to the magnitude of the constraint force. Chapter 3 develops the multiplier method; for now note only that the information is not lost, merely set aside.

Worked example — tension in the pendulum rod. Once θ(t)\theta(t) is known, resolve Newton's law along the rod: T−mgcos⁡θ=mℓθ˙2T - mg\cos\theta = m\ell\dot\theta^2 (centripetal), so T=mgcos⁡θ+mℓθ˙2T = mg\cos\theta + m\ell\dot\theta^2. Energy conservation from release at θ0\theta_0 gives ℓθ˙2=2g(cos⁡θ−cos⁡θ0)\ell\dot\theta^2 = 2g(\cos\theta - \cos\theta_0), hence T=mg(3cos⁡θ−2cos⁡θ0)T = mg(3\cos\theta - 2\cos\theta_0). The reduced formalism gave θ(t)\theta(t); one line of Newton then gave the reaction.

Common Pitfalls

  • Treating a virtual displacement as a real one. δr⃗i\delta\vec{r}_i is taken at frozen time: no ∂r⃗i/∂t\partial\vec{r}_i/\partial t term. For a rheonomic system the real path leaves the instantaneous constraint surface; the virtual displacement never does.
  • Counting dependent constraints. Only independent constraint equations reduce nn. Four masses in a plane joined by all six pairwise rods give 8−6=28-6=2, but a planar rigid body has n=3n=3: exactly one rod is redundant, so only five constraints are independent.
  • Calling an integrable velocity constraint non-holonomic. x˙=aϕ˙\dot{x} = a\dot\phi integrates to x−aϕ=constx - a\phi = \text{const} and is holonomic. Test for an integrating factor before invoking multipliers.
  • Including ideal constraint forces in QjQ_j. The generalised force is built from applied forces only; the reactions are exactly what the formalism removes.
  • Forgetting that sliding friction is not ideal. Kinetic friction does negative work on real and virtual displacements; carry it as an applied force with QjfricQ_j^{\text{fric}}.
  • Wrong units for QjQ_j. If qjq_j is an angle, its conjugate generalised force is a torque, not a force. Always check that Qj δqjQ_j\,\delta q_j has dimensions of energy.

Summary

  • The configuration of NN particles is a point in 3N3N-dimensional configuration space; kk independent holonomic constraints confine it to a surface of dimension n=3N−kn = 3N - k, the number of degrees of freedom.
  • Holonomic constraints are equations fα({r⃗i},t)=0f_\alpha(\{\vec r_i\},t) = 0; each removes one freedom. Non-holonomic constraints (non-integrable velocity relations, inequalities) do not and need multipliers.
  • Generalised coordinates q1,…,qnq_1,\dots,q_n parametrise the constraint surface; r⃗i=r⃗i(q⃗,t)\vec{r}_i = \vec{r}_i(\vec q,t) gives r⃗˙i=∑j(∂r⃗i/∂qj)q˙j+∂r⃗i/∂t\dot{\vec r}_i = \sum_j (\partial\vec r_i/\partial q_j)\dot q_j + \partial\vec r_i/\partial t and the identities ∂r⃗˙i/∂q˙j=∂r⃗i/∂qj\partial\dot{\vec r}_i/\partial\dot q_j = \partial\vec r_i/\partial q_j.
  • A virtual displacement δr⃗i=∑j(∂r⃗i/∂qj) δqj\delta\vec r_i = \sum_j (\partial\vec r_i/\partial q_j)\,\delta q_j is taken at δt=0\delta t = 0 and respects the instantaneous constraints.
  • Ideal constraints do no virtual work: ∑if⃗i⋅δr⃗i=0\sum_i \vec f_i\cdot\delta\vec r_i = 0. Hence the principle of virtual work ∑iF⃗i(a)⋅δr⃗i=0\sum_i \vec F_i^{(a)}\cdot\delta\vec r_i = 0 at equilibrium, and the generalised force Qj=∑iF⃗i(a)⋅∂r⃗i/∂qj=−∂V/∂qjQ_j = \sum_i \vec F_i^{(a)}\cdot\partial\vec r_i/\partial q_j = -\partial V/\partial q_j for conservative forces.
  • D'Alembert's principle ∑i(F⃗i(a)−p⃗˙i)⋅δr⃗i=0\sum_i (\vec F_i^{(a)} - \dot{\vec p}_i)\cdot\delta\vec r_i = 0 is the dynamical generalisation and the starting point for Lagrange's equations.