MechanicsLagrangian Mechanics2 of 6
Lagrangian Mechanics · 2

Constraints and Generalized Coordinates

To find how a bead on a wire or a pendulum on a rod moves without solving for unknown normal forces and tensions, we replace x,y,z\Pos{x}, \Pos{y}, \Pos{z} with coordinates that only trace out the allowed path.

1

Constraints, Degrees of Freedom, and Generalized Coordinates

We want to find the minimum number of independent coordinates needed to give every particle's position in a constrained system.

Constraints, Degrees of Freedom, and Generalized Coordinates

Each independent constraint equation ties coordinates together and removes one independent choice from the system. For NN particles moving in 3D space with kk independent constraint equations, the number of degrees of freedom is

n⏟degrees offreedom\displaystyle \underbrace{n}_{\substack{\text{degrees of}\\\text{freedom}}} =3N⏟particlesin 3D−k⏟independentconstraints\displaystyle = 3\underbrace{N}_{\substack{\text{particles}\\\text{in 3D}}} - \underbrace{k}_{\substack{\text{independent}\\\text{constraints}}}

If the motion stays in a 2D plane, each particle starts with 22 coordinates instead of 33, so n=2N−kn = 2N - k. Once we know nn, we choose nn independent generalized coordinates q1\Pos{q_1}, q2\Pos{q_2}, …\dots, qn\Pos{q_n} (such as an angle θ\Pos{\theta} or an arc length s\Pos{s}) that describe the allowed positions directly.

Turning the single dial θ\Pos{\theta} to any value automatically places (x,y)(\Pos{x}, \Pos{y}) on the circle x2+y2=L2\Pos{x^2} + \Pos{y^2} = L^2 without ever stretching the rod, so the rod's tension disappears from the coordinate description.

Turn one angle dial to see how it sets both the x and y positions on the circle while keeping the rod length fixed.
2

Holonomic and Non-Holonomic Constraints

Before we cross out a coordinate for every rule in a problem, we need to check whether the constraint actually keeps the system on a smaller surface of allowed positions.

Holonomic and Non-Holonomic Constraints
LL
θ\htmlClass{lc-blue}{\theta}
θ\htmlClass{lc-blue}{\theta}
x2+y2−L2=0\htmlClass{lc-blue}{x^2} + \htmlClass{lc-blue}{y^2} - L^2 = 0

When a constraint equation is given in terms of velocities (x˙,y˙,θ˙\Vel{\dot{x}}, \Vel{\dot{y}}, \Vel{\dot{\theta}}), we check whether it is just the time derivative ddtf=0\frac{d}{dt}f = 0 of a position equation f=0f = 0, or a velocity rule that cannot be integrated.

Text solution
Integrable velocity constraint (holonomic)Rewrite xx˙+yy˙=0\Pos{x}\Vel{\dot{x}} + \Pos{y}\Vel{\dot{y}} = 0 as a single time derivative using the chain rule in reverse, then integrate with respect to time to get back the position constraint.
xdxdt+ydydt=ddt(12x2+12y2)=0  ⟹  x2+y2−L2=0\displaystyle \begin{aligned} \Pos{x}\Vel{\frac{dx}{dt}} + \Pos{y}\Vel{\frac{dy}{dt}} &= \frac{d}{dt}\left(\frac{1}{2}\Pos{x^2} + \frac{1}{2}\Pos{y^2}\right) \\ &= 0 \\ &\implies \Pos{x^2} + \Pos{y^2} - L^2 = 0 \end{aligned}
Match coefficients for the non-slipping carIf the car's velocity constraint −x˙sin⁡θ+y˙cos⁡θ=0-\Vel{\dot{x}}\sin\theta + \Vel{\dot{y}}\cos\theta = 0 came from differentiating a position function ddtf(x,y,θ)\frac{d}{dt}f(\Pos{x}, \Pos{y}, \Pos{\theta}) == ∂f∂xx˙+∂f∂yy˙+∂f∂θθ˙\frac{\partial f}{\partial x}\Vel{\dot{x}} + \frac{\partial f}{\partial y}\Vel{\dot{y}} + \frac{\partial f}{\partial \theta}\Vel{\dot{\theta}} == 00, its partial derivatives would have to match term by term.
∂f∂x\displaystyle \frac{\partial f}{\partial x} =−sin⁡θ,∂f∂y\displaystyle = -\sin\theta, \qquad \frac{\partial f}{\partial y} =cos⁡θ,∂f∂θ\displaystyle = \cos\theta, \qquad \frac{\partial f}{\partial \theta} =0\displaystyle = 0
Check mixed partial derivatives (non-holonomic)Differentiate ∂f∂x\frac{\partial f}{\partial x} with respect to θ\Pos{\theta} and compare it against ∂∂x(∂f∂θ)\frac{\partial}{\partial x}\left(\frac{\partial f}{\partial \theta}\right) to see if a smooth function f(x,y,θ)f(\Pos{x}, \Pos{y}, \Pos{\theta}) can exist.
∂∂θ(∂f∂x)\displaystyle \frac{\partial}{\partial \theta}\left(\frac{\partial f}{\partial x}\right) =−cos⁡θ≠∂∂x(∂f∂θ)\displaystyle = -\cos\theta \neq \frac{\partial}{\partial x}\left(\frac{\partial f}{\partial \theta}\right) =0\displaystyle = 0

Because the mixed partial derivatives do not match, the car's rule as written is not ddtf=0\frac{d}{dt}f = 0 for any ff. That check alone isn't the whole test, because a velocity rule can become a time derivative after we multiply it by a function: yx˙−xy˙=0\Pos{y}\Vel{\dot{x}} - \Pos{x}\Vel{\dot{y}} = 0 fails the mixed-partial check, but divided by y2\Pos{y^2} it is ddt(xy)=0\frac{d}{dt}\left(\frac{\Pos{x}}{\Pos{y}}\right) = 0. For the car, multiplying by any function gg would need ∂f∂x=−gsin⁡θ\frac{\partial f}{\partial x} = -g\sin\theta, ∂f∂y=gcos⁡θ\frac{\partial f}{\partial y} = g\cos\theta and ∂f∂θ=0\frac{\partial f}{\partial \theta} = 0. The last makes the first two independent of θ\Pos{\theta}, yet their ratio is −tan⁡θ-\tan\theta. So the car's rule does not come from any position equation f(x,y,θ)=constf(\Pos{x}, \Pos{y}, \Pos{\theta}) = \text{const}, and all 33 coordinates (x,y,θ)(\Pos{x}, \Pos{y}, \Pos{\theta}) are still needed to give the car's position and heading in the lot.

For a ball rolling without slipping on a flat table, bringing the ball back to the exact same (x,y)(\Pos{x}, \Pos{y}) spot along different closed paths leaves the chalk dot at different 3D orientations, showing that the rolling constraint cannot fix orientation as a function of (x,y)(\Pos{x}, \Pos{y}).

When you roll a ball back to its starting spot without slipping, the way it faces at the end depends on the path you took.
3

Energy in Generalized Coordinates: Cart and Pendulum

We now want to write a system's kinetic energy T\Kin{T} and potential energy V\Pot{V} in terms of its generalized coordinates qi\Pos{q_i} and generalized velocities q˙i\Vel{\dot{q}_i}. Because physical speed comes from the Cartesian velocities in T\Kin{T} == 12m(x˙2+y˙2+z˙2)\frac{1}{2}m(\Vel{\dot{x}^2} + \Vel{\dot{y}^2} + \Vel{\dot{z}^2}), we cannot simply plug q˙\Vel{\dot{q}} in for v\Vel{v}; we first write the Cartesian positions (x,y)(\Pos{x}, \Pos{y}) as functions of our dials qi\Pos{q_i} and take their time derivatives.

00
MM
X\htmlClass{lc-blue}{X}
LL
mm
θ\htmlClass{lc-blue}{\theta}
Lsin⁡θ\htmlClass{lc-blue}{L\sin\theta}
Lcos⁡θ\htmlClass{lc-blue}{L\cos\theta}
Energy in Generalized Coordinates: Cart and Pendulum
MM
LL
mm
T=  ?V=  ?\begin{aligned} \htmlClass{lc-pink}{T} &= \;? \\ \htmlClass{lc-blue}{V} &= \;? \end{aligned}
Text solution
Choose generalized coordinatesTwo independent dials describe the system in the plane: the cart's horizontal position q1=X\Pos{q_1} = \Pos{X} and the pendulum's angle from the vertical q2=θ\Pos{q_2} = \Pos{\theta}.
q1\displaystyle \Pos{q_1} =X,q2\displaystyle = \Pos{X}, \qquad \Pos{q_2} =θ\displaystyle = \Pos{\theta}
Write Cartesian positions in terms of X\Pos{X} and θ\Pos{\theta}Use the right triangle of the rod to write the positions of the cart and the bob so that (x−X)2+y2=L2(\Pos{x} - \Pos{X})^2 + \Pos{y^2} = L^2 holds automatically.
xcart=X,ycart=0\displaystyle \begin{aligned} \Pos{x_{\text{cart}}} &= \Pos{X}, \\ \Pos{y_{\text{cart}}} &= 0 \end{aligned}
x=X+Lsin⁡θ,y=−Lcos⁡θ\displaystyle \begin{aligned} \Pos{x} &= \Pos{X} + \Pos{L\sin\theta}, \\ \Pos{y} &= -\Pos{L\cos\theta} \end{aligned}
Differentiate with respect to timeUse the chain rule to find the bob's horizontal and vertical velocity components as both X\Pos{X} and θ\Pos{\theta} change with time.
x˙=X˙+Lcos⁡θ θ˙,y˙=Lsin⁡θ θ˙\displaystyle \begin{aligned} \Vel{\dot{x}} &= \Vel{\dot{X}} + L\cos\theta\,\Vel{\dot{\theta}}, \\ \Vel{\dot{y}} &= L\sin\theta\,\Vel{\dot{\theta}} \end{aligned}
Square and add the bob's velocity componentsExpand x˙2+y˙2\Vel{\dot{x}^2} + \Vel{\dot{y}^2} and factor out L2θ˙2L^2\Vel{\dot{\theta}^2} to simplify with cos⁡2θ+sin⁡2θ=1\cos^2\theta + \sin^2\theta = 1.
x˙2+y˙2=(X˙+Lcos⁡θ θ˙)2+(Lsin⁡θ θ˙)2=X˙2+2LX˙θ˙cos⁡θ+L2θ˙2(cos⁡2θ+sin⁡2θ)=X˙2+2LX˙θ˙cos⁡θ+L2θ˙2\displaystyle \begin{aligned} \Vel{\dot{x}^2} + \Vel{\dot{y}^2} &= (\Vel{\dot{X}} + L\cos\theta\,\Vel{\dot{\theta}})^2 \\ &\quad + (L\sin\theta\,\Vel{\dot{\theta}})^2 \\ &= \Vel{\dot{X}^2} + 2L\Vel{\dot{X}\dot{\theta}}\cos\theta \\ &\quad + L^2\Vel{\dot{\theta}^2}(\cos^2\theta + \sin^2\theta) \\ &= \Vel{\dot{X}^2} + 2L\Vel{\dot{X}\dot{\theta}}\cos\theta \\ &\quad + L^2\Vel{\dot{\theta}^2} \end{aligned}
Assemble T\Kin{T} and V\Pot{V}Add the kinetic energies of the cart and bob, and write the gravitational potential energy from the bob's vertical height y\Pos{y}.
T(X,θ,X˙,θ˙)=12MX˙2+12m(X˙2+2LX˙θ˙cos⁡θ+L2θ˙2)\displaystyle \begin{aligned} \Kin{T}(\Pos{X}, \Pos{\theta}, \Vel{\dot{X}}, \Vel{\dot{\theta}}) &= \frac{1}{2}M\Vel{\dot{X}^2} \\ &\quad + \frac{1}{2}m\Big(\Vel{\dot{X}^2} \\ &\qquad + 2L\Vel{\dot{X}\dot{\theta}}\cos\theta \\ &\qquad + L^2\Vel{\dot{\theta}^2}\Big) \end{aligned}
V(θ)\displaystyle \Pot{V}(\Pos{\theta}) =mgy\displaystyle = mg\Pos{y} =−mgLcos⁡θ\displaystyle = -mg\Pos{L\cos\theta}

So the energies depend only on the two unconstrained dials (X,θ)(\Pos{X}, \Pos{\theta}) and their rates (X˙,θ˙)(\Vel{\dot{X}}, \Vel{\dot{\theta}}), with the cross term 2LX˙θ˙cos⁡θ2L\Vel{\dot{X}\dot{\theta}}\cos\theta showing how the sliding cart and swinging rod combine in the bob's horizontal speed.

4

Moving Constraints: The Driven Pendulum

Now suppose a motor shakes the pivot horizontally on a fixed schedule xpivot(t)=Acos⁡(ωt)\Track{x_{\text{pivot}}(t)} = \Track{A\cos(\omega t)}, making the constraint time-dependent (rheonomic). We want to find the bob's kinetic energy T(θ,θ˙,t)\Kin{T}(\Pos{\theta}, \Vel{\dot{\theta}}, t) and potential energy V(θ)\Pot{V}(\Pos{\theta}) when the pivot motion is driven by the motor rather than free to slide.

Moving Constraints: The Driven Pendulum
xpivot(t)=Acos⁡(ωt)\htmlClass{lc-blue}{x_{\text{pivot}}(t) = A\cos(\omega t)}
θ\htmlClass{lc-blue}{\theta}
T=  ?\htmlClass{lc-pink}{T} = \;?

Whenever a position equation x(q1,…,qn,t)\Pos{x}(\Pos{q_1}, \dots, \Pos{q_n}, t) contains time tt explicitly, the chain rule adds the velocity of the moving constraint itself to the velocity coming from the dials:

x˙=∂x∂q1q˙1+⋯+∂x∂qnq˙n⏟from turning the dials qi+∂x∂t⏟from the movingconstraint\displaystyle \begin{aligned}\Vel{\dot{x}} &= \underbrace{\frac{\partial x}{\partial q_1}\Vel{\dot{q}_1} + \dots + \frac{\partial x}{\partial q_n}\Vel{\dot{q}_n}}_{\text{from turning the dials } \Pos{q_i}} + \underbrace{\Track{\frac{\partial x}{\partial t}}}_{\substack{\text{from the moving}\\\text{constraint}}}\end{aligned}
Text solution
Write Cartesian positions in terms of θ\Pos{\theta} and ttBecause the motor holds the pivot at Acos⁡(ωt)\Track{A\cos(\omega t)}, only q1=θ\Pos{q_1} = \Pos{\theta} remains as a generalized coordinate, and tt enters x\Pos{x} explicitly.
x(θ,t)=Acos⁡(ωt)+Lsin⁡θ,y(θ,t)=−Lcos⁡θ\displaystyle \begin{aligned} \Pos{x}(\Pos{\theta}, t) &= \Track{A\cos(\omega t)} + \Pos{L\sin\theta}, \\ \Pos{y}(\Pos{\theta}, t) &= -\Pos{L\cos\theta} \end{aligned}
Take the total time derivativeAdd the swing term ∂x∂θθ˙\frac{\partial x}{\partial \theta}\Vel{\dot{\theta}} and the explicit motor velocity ∂x∂t\Track{\frac{\partial x}{\partial t}} to get x˙\Vel{\dot{x}}.
x˙=∂x∂θθ˙+∂x∂t=Lcos⁡θ θ˙−Aωsin⁡(ωt),y˙=Lsin⁡θ θ˙\displaystyle \begin{aligned} \Vel{\dot{x}} &= \frac{\partial x}{\partial \theta}\Vel{\dot{\theta}} + \Track{\frac{\partial x}{\partial t}} \\ &= L\cos\theta\,\Vel{\dot{\theta}} - \Track{A\omega\sin(\omega t)}, \\ \Vel{\dot{y}} &= L\sin\theta\,\Vel{\dot{\theta}} \end{aligned}
Square and add the velocity componentsExpand x˙2+y˙2\Vel{\dot{x}^2} + \Vel{\dot{y}^2} and combine the θ˙2\Vel{\dot{\theta}^2} terms using cos⁡2θ+sin⁡2θ=1\cos^2\theta + \sin^2\theta = 1.
x˙2+y˙2=(Lcos⁡θ θ˙−Aωsin⁡(ωt))2+(Lsin⁡θ θ˙)2=L2θ˙2(cos⁡2θ+sin⁡2θ)−2ALωsin⁡(ωt)cos⁡θ θ˙+A2ω2sin⁡2(ωt)=L2θ˙2−2ALωsin⁡(ωt)cos⁡θ θ˙+A2ω2sin⁡2(ωt)\displaystyle \begin{aligned} \Vel{\dot{x}^2} + \Vel{\dot{y}^2} &= \Big(L\cos\theta\,\Vel{\dot{\theta}} \\ &\qquad - \Track{A\omega\sin(\omega t)}\Big)^2 \\ &\quad + (L\sin\theta\,\Vel{\dot{\theta}})^2 \\ &= L^2\Vel{\dot{\theta}^2}(\cos^2\theta + \sin^2\theta) \\ &\quad - 2\Track{A}L\Track{\omega\sin(\omega t)}\cos\theta\,\Vel{\dot{\theta}} \\ &\quad + \Track{A^2\omega^2\sin^2(\omega t)} \\ &= L^2\Vel{\dot{\theta}^2} \\ &\quad - 2\Track{A}L\Track{\omega\sin(\omega t)}\cos\theta\,\Vel{\dot{\theta}} \\ &\quad + \Track{A^2\omega^2\sin^2(\omega t)} \end{aligned}
Assemble T\Kin{T} and V\Pot{V}Substitute x˙2+y˙2\Vel{\dot{x}^2} + \Vel{\dot{y}^2} into 12mv2\frac{1}{2}m\Vel{v^2} and y\Pos{y} into mgymg\Pos{y}.
T(θ,θ˙,t)=12m(L2θ˙2−2ALωsin⁡(ωt)cos⁡θ θ˙+A2ω2sin⁡2(ωt))\displaystyle \begin{aligned} \Kin{T}(\Pos{\theta}, \Vel{\dot{\theta}}, t) &= \frac{1}{2}m\Big(L^2\Vel{\dot{\theta}^2} \\ &\quad - 2\Track{A}L\Track{\omega\sin(\omega t)}\cos\theta\,\Vel{\dot{\theta}} \\ &\quad + \Track{A^2\omega^2\sin^2(\omega t)}\Big) \end{aligned}
V(θ)\displaystyle \Pot{V}(\Pos{\theta}) =−mgLcos⁡θ\displaystyle = -mg\Pos{L\cos\theta}

In the free-cart T\Kin{T}, every term was a product of two velocities. Because of the ∂x∂t\Track{\frac{\partial x}{\partial t}} term from the moving pivot, T(θ,θ˙,t)\Kin{T}(\Pos{\theta}, \Vel{\dot{\theta}}, t) now includes a term with a single factor of θ˙\Vel{\dot{\theta}} and a term A2ω2sin⁡2(ωt)\Track{A^2\omega^2\sin^2(\omega t)} with no velocity at all, which depends purely on time.

The bob's velocity combines its swing velocity ∂r∂θθ˙\tfrac{\partial \mathbf{r}}{\partial \theta}\Vel{\dot{\theta}} and the pivot's velocity ∂r∂t\Track{\tfrac{\partial \mathbf{r}}{\partial t}}, so the bob gets kinetic energy from the motor even when θ˙=0\Vel{\dot{\theta}} = 0.

On a moving track, the bob’s velocity is the sum of its swing around the pivot and the pivot’s own motion, so the bob keeps moving even when its angle is held still.
5

Virtual Work and the Four-Step Recipe

Why do normal forces and rod tensions drop out when we use q1,…,qn\Pos{q_1}, \dots, \Pos{q_n}? A virtual displacement δr\Step{\delta\mathbf{r}} is a tiny nudge of the coordinates by δqi\Step{\delta q_i} along the allowed surface with time held frozen (δt=0\delta t = 0).

Virtual Work and the Four-Step Recipe

At a frozen instant δt=0\delta t = 0, even a moving wire or pivot stands still, so nudging qi\Pos{q_i} moves the particle purely tangent to the constraint surface while an ideal normal force N\Force{\mathbf{N}} or tension pushes purely perpendicular to it:

δW=N⏟perpendicular toallowed surface⋅δr⏟tangent to allowedsurface at δt=0=0\displaystyle \begin{aligned}\Work{\delta W} &= \underbrace{\Force{\mathbf{N}}}_{\substack{\text{perpendicular to}\\\text{allowed surface}}} \cdot \underbrace{\Step{\delta\mathbf{r}}}_{\substack{\text{tangent to allowed}\\\text{surface at } \delta t = 0}} = 0\end{aligned}

Key concepts

To set up any constrained system for energy-based mechanics, start by deciding which rules actually eliminate coordinates. A constraint reduces the degrees of freedom (n=3N−kn = 3N - k in 3D, or 2N−k2N - k in 2D) only if it is holonomic: an equation of positions and time f(r1,…,t)=0f(\Pos{\mathbf{r}_1}, \dots, t) = 0, or a velocity constraint that integrates into one, such as xx˙+yy˙\Pos{x}\Vel{\dot{x}} + \Pos{y}\Vel{\dot{y}} == ddt(12x2+12y2)\frac{d}{dt}\left(\frac{1}{2}\Pos{x^2} + \frac{1}{2}\Pos{y^2}\right) == 00. Do not eliminate a coordinate when a velocity rule cannot be written as ddtf=0\frac{d}{dt}f = 0, even after multiplying it by a function (like a car's no-sideslip condition −x˙sin⁡θ+y˙cos⁡θ=0-\Vel{\dot{x}}\sin\theta + \Vel{\dot{y}}\cos\theta = 0 or a ball rolling on a table) or when the rule is an inequality like r≤R\Pos{r} \le R; those are non-holonomic and still need every coordinate to give the position. Likewise, if a motor drives a pivot or wire on a known schedule like xpivot(t)=Acos⁡(ωt)\Track{x_{\text{pivot}}(t)} = \Track{A\cos(\omega t)}, do not give a generalized coordinate to the motor: the constraint is rheonomic (time-dependent, rather than scleronomic, which is independent of time), so tt goes directly into the position equations.

Once you have picked nn independent dials q1,…,qn\Pos{q_1}, \dots, \Pos{q_n}, never plug q˙i\Vel{\dot{q}_i} straight into 12mq˙2\frac{1}{2}m\Vel{\dot{q}^2} for kinetic energy. For an angle θ\Pos{\theta}, 12mθ˙2\frac{1}{2}m\Vel{\dot{\theta}^2} does not even have units of energy! Always go through Cartesian coordinates in four steps:

Key concept

Count n=3N−kn = 3N - k and choose nn independent generalized coordinates q1,…,qn\Pos{q_1}, \dots, \Pos{q_n}.

Key concept

Write the Cartesian positions x,y,z\Pos{x}, \Pos{y}, \Pos{z} of each mass in terms of qi\Pos{q_i} (and tt if the constraint moves), such as x(θ,t)\Pos{x}(\Pos{\theta}, t) == Acos⁡(ωt)+Lsin⁡θ\Track{A\cos(\omega t)} + \Pos{L\sin\theta} and y(θ)=−Lcos⁡θ\Pos{y}(\Pos{\theta}) = -\Pos{L\cos\theta}.

Key concept

Differentiate with respect to time using the chain rule, including the explicit moving-constraint term ∂x∂t\Track{\frac{\partial x}{\partial t}} whenever tt appears in the position equation:

x˙\displaystyle \Vel{\dot{x}} =∂x∂q1q˙1+⋯+∂x∂qnq˙n+∂x∂t\displaystyle = \frac{\partial x}{\partial q_1}\Vel{\dot{q}_1} + \dots + \frac{\partial x}{\partial q_n}\Vel{\dot{q}_n} + \Track{\frac{\partial x}{\partial t}}

Key concept

Substitute the Cartesian velocities and heights into T\Kin{T} == 12m(x˙2+y˙2+z˙2)\frac{1}{2}m(\Vel{\dot{x}^2} + \Vel{\dot{y}^2} + \Vel{\dot{z}^2}) and V=mgy\Pot{V} = mg\Pos{y}. Because a virtual displacement δr=∑i∂r∂qiδqi\Step{\delta\mathbf{r}} = \sum_i \frac{\partial \mathbf{r}}{\partial q_i}\Step{\delta q_i} taken at frozen time (δt=0\delta t = 0) points purely along the constraint surface at that instant, ideal normal forces and tensions are perpendicular to δr\Step{\delta\mathbf{r}} and do zero virtual work (δW=N⋅δr=0\Work{\delta W} = \Force{\mathbf{N}} \cdot \Step{\delta\mathbf{r}} = 0).

6

Practice

1

Three particles move in 3D space, joined to one another by three rigid rods of fixed lengths L12L_{12}, L23L_{23}, and L31L_{31} so that they form a rigid triangle. Write the constraint equations for the system, use n=3N−kn = 3N - k to find the number of degrees of freedom, and explain what those degrees of freedom represent physically.

Start with the total number of coordinates for N=3N = 3 particles in 3D space, and write one Pythagorean distance equation for each of the three rods.

Let the positions of the three particles be (x1,y1,z1)(\Pos{x_1}, \Pos{y_1}, \Pos{z_1}), (x2,y2,z2)(\Pos{x_2}, \Pos{y_2}, \Pos{z_2}), and (x3,y3,z3)(\Pos{x_3}, \Pos{y_3}, \Pos{z_3}). The three rigid rods give k=3k = 3 independent distance constraints:
(x1−x2)2+(y1−y2)2+(z1−z2)2−L122\displaystyle (\Pos{x_1} - \Pos{x_2})^2 + (\Pos{y_1} - \Pos{y_2})^2 + (\Pos{z_1} - \Pos{z_2})^2 - L_{12}^2 =0\displaystyle = 0
(x2−x3)2+(y2−y3)2+(z2−z3)2−L232\displaystyle (\Pos{x_2} - \Pos{x_3})^2 + (\Pos{y_2} - \Pos{y_3})^2 + (\Pos{z_2} - \Pos{z_3})^2 - L_{23}^2 =0\displaystyle = 0
(x3−x1)2+(y3−y1)2+(z3−z1)2−L312\displaystyle (\Pos{x_3} - \Pos{x_1})^2 + (\Pos{y_3} - \Pos{y_1})^2 + (\Pos{z_3} - \Pos{z_1})^2 - L_{31}^2 =0\displaystyle = 0
With N=3N = 3 particles moving in 3D space and k=3k = 3 independent constraint equations, the number of degrees of freedom is
n\displaystyle n =3N−k\displaystyle = 3N - k =3(3)−3\displaystyle = 3(3) - 3 =6.\displaystyle = 6.
(Watch out: Because a triangle is flat, it is tempting to use the 2D formula 2N−k=2(3)−3=32N - k = 2(3) - 3 = 3, which only counts motion if the triangle were trapped inside a fixed 2D plane. Here the particles move in 3D space, so they start with 3N=93N = 9 coordinates.)
Physically, 33 degrees of freedom give the (x,y,z)(\Pos{x}, \Pos{y}, \Pos{z}) position of the triangle's center in 3D space, and the remaining 33 degrees of freedom are angles that give the 3D orientation of the rigid triangle.
2

A bead of mass mm slides without friction along a rigid, stationary wire bent into the parabola y=ax2\Pos{y} = \Pos{ax^2} in a vertical (x,y)(\Pos{x}, \Pos{y}) plane, where aa is a constant and gravity gg points in the −y-y direction. How many degrees of freedom does the bead have? Using the horizontal position q=x\Pos{q} = \Pos{x} as the generalized coordinate, write the Cartesian position and velocity equations and find the kinetic energy T(q,q˙)\Kin{T}(\Pos{q}, \Vel{\dot{q}}) and potential energy V(q)\Pot{V}(\Pos{q}).

Write both x\Pos{x} and y\Pos{y} in terms of q\Pos{q}, then use the chain rule to differentiate y=aq2\Pos{y} = \Pos{aq^2} with respect to time tt before substituting into T=12m(x˙2+y˙2)\Kin{T} = \frac{1}{2}m(\Vel{\dot{x}^2} + \Vel{\dot{y}^2}).

The bead moves in a 2D plane (22 coordinates) with 11 holonomic constraint equation, y−ax2=0\Pos{y} - \Pos{ax^2} = 0, so it has
n\displaystyle n =2−1\displaystyle = 2 - 1 =1 degree of freedom.\displaystyle = 1\text{ degree of freedom.}
Choosing q=x\Pos{q} = \Pos{x} as the generalized coordinate gives the position equations:
x\displaystyle \Pos{x} =q,y\displaystyle = \Pos{q}, \qquad \Pos{y} =aq2.\displaystyle = \Pos{aq^2}.
Taking the time derivative of each coordinate using the chain rule gives the Cartesian velocities:
x˙\displaystyle \Vel{\dot{x}} =q˙,y˙\displaystyle = \Vel{\dot{q}}, \qquad \Vel{\dot{y}} =ddt(aq2)\displaystyle = \frac{d}{dt}(\Pos{aq^2}) =2aqq˙.\displaystyle = 2aq\Vel{\dot{q}}.
(Watch out: Two common slips here are forgetting y˙\Vel{\dot{y}} altogether, which gives T=12mq˙2\Kin{T} = \frac{1}{2}m\Vel{\dot{q}^2}, or differentiating aq2\Pos{aq^2} with respect to q\Pos{q} instead of tt and writing y˙=2aq\Vel{\dot{y}} = 2aq without the chain-rule factor q˙\Vel{\dot{q}}, which gives 12m(q˙2+4a2q2)\frac{1}{2}m(\Vel{\dot{q}^2} + 4a^2 q^2) and doesn't even have units of energy.)
Substituting x˙\Vel{\dot{x}} and y˙\Vel{\dot{y}} into the kinetic energy T=12m(x˙2+y˙2)\Kin{T} = \frac{1}{2}m(\Vel{\dot{x}^2} + \Vel{\dot{y}^2}) gives
T(q,q˙)\displaystyle \Kin{T}(\Pos{q}, \Vel{\dot{q}}) =12m(q˙2+(2aqq˙)2)\displaystyle = \frac{1}{2}m\left(\Vel{\dot{q}^2} + (2aq\Vel{\dot{q}})^2\right) =12m(1+4a2q2)q˙2.\displaystyle = \frac{1}{2}m(1 + 4a^2 q^2)\Vel{\dot{q}^2}.
The gravitational potential energy V=mgy\Pot{V} = mg\Pos{y} is
V(q)\displaystyle \Pot{V}(\Pos{q}) =mgaq2.\displaystyle = mg\Pos{aq^2}.
3

Consider two velocity constraints: (a) A particle moving in a 2D plane whose velocity components obey yx˙+xy˙=0\Pos{y}\Vel{\dot{x}} + \Pos{x}\Vel{\dot{y}} = 0. (b) A particle moving in 3D space whose velocity components obey zx˙+y˙=0\Pos{z}\Vel{\dot{x}} + \Vel{\dot{y}} = 0. Determine whether each constraint is holonomic or non-holonomic by testing whether it can be written in the form ddtf=0\frac{d}{dt}f = 0 for a position function ff, and state how many coordinates are needed to give the particle's position in each case.

Match the coefficients of x˙,y˙,z˙\Vel{\dot{x}}, \Vel{\dot{y}}, \Vel{\dot{z}} against the chain-rule expansion ∂f∂xx˙+∂f∂yy˙+∂f∂zz˙=0\frac{\partial f}{\partial x}\Vel{\dot{x}} + \frac{\partial f}{\partial y}\Vel{\dot{y}} + \frac{\partial f}{\partial z}\Vel{\dot{z}} = 0, and check whether the mixed partial derivatives of ff agree.

(a) (Watch out: Don't assume a constraint is non-holonomic just because it is written with velocity dots x˙\Vel{\dot{x}} and y˙\Vel{\dot{y}}; always check whether it integrates first.) By the product rule (chain rule in reverse), the left-hand side of yx˙+xy˙=0\Pos{y}\Vel{\dot{x}} + \Pos{x}\Vel{\dot{y}} = 0 is an exact time derivative:
ydxdt+xdydt\displaystyle \Pos{y}\Vel{\frac{dx}{dt}} + \Pos{x}\Vel{\frac{dy}{dt}} =ddt(xy)\displaystyle = \frac{d}{dt}(\Pos{xy}) =0.\displaystyle = 0.
Integrating with respect to time gives the position constraint xy−C=0\Pos{xy} - C = 0, where CC is a constant. Because it integrates to an equation of positions alone, the constraint is holonomic. It keeps the particle on a 1D hyperbola in the 2D plane, reducing the required coordinates from 22 down to 11 generalized coordinate.
(b) Suppose there were a position function f(x,y,z)f(\Pos{x}, \Pos{y}, \Pos{z}) such that ddtf(x,y,z)=0\frac{d}{dt}f(\Pos{x}, \Pos{y}, \Pos{z}) = 0 gave zx˙+y˙=0\Pos{z}\Vel{\dot{x}} + \Vel{\dot{y}} = 0. Expanding by the chain rule gives
∂f∂xx˙+∂f∂yy˙+∂f∂zz˙\displaystyle \frac{\partial f}{\partial x}\Vel{\dot{x}} + \frac{\partial f}{\partial y}\Vel{\dot{y}} + \frac{\partial f}{\partial z}\Vel{\dot{z}} =0.\displaystyle = 0.
Matching coefficients with zx˙+y˙=0\Pos{z}\Vel{\dot{x}} + \Vel{\dot{y}} = 0 requires
∂f∂x\displaystyle \frac{\partial f}{\partial x} =z,∂f∂y\displaystyle = \Pos{z}, \qquad \frac{\partial f}{\partial y} =1,∂f∂z\displaystyle = 1, \qquad \frac{\partial f}{\partial z} =0.\displaystyle = 0.
(Watch out: Do not treat z\Pos{z} as a constant and integrate zx˙+y˙=0\Pos{z}\Vel{\dot{x}} + \Vel{\dot{y}} = 0 to zx+y=C\Pos{zx} + \Pos{y} = C; differentiating zx+y\Pos{zx} + \Pos{y} gives zx˙+xz˙+y˙=0\Pos{z}\Vel{\dot{x}} + \Pos{x}\Vel{\dot{z}} + \Vel{\dot{y}} = 0, which has an extra xz˙\Pos{x}\Vel{\dot{z}} term that is not zero.) Checking the mixed partial derivatives with respect to x\Pos{x} and z\Pos{z} shows a mismatch:
∂∂z(∂f∂x)\displaystyle \frac{\partial}{\partial z}\left(\frac{\partial f}{\partial x}\right) =1≠∂∂x(∂f∂z)\displaystyle = 1 \neq \frac{\partial}{\partial x}\left(\frac{\partial f}{\partial z}\right) =0.\displaystyle = 0.
So zx˙+y˙\Pos{z}\Vel{\dot{x}} + \Vel{\dot{y}} is not itself ddtf\frac{d}{dt}f. Multiplying the constraint by a function gg first doesn't help: we would need ∂f∂x=gz\frac{\partial f}{\partial x} = g\Pos{z}, ∂f∂y=g\frac{\partial f}{\partial y} = g and ∂f∂z=0\frac{\partial f}{\partial z} = 0. The last makes ff, and so g=∂f∂yg = \frac{\partial f}{\partial y}, independent of z\Pos{z}, and then ∂f∂x=gz\frac{\partial f}{\partial x} = g\Pos{z} depends on z\Pos{z} unless g=0g = 0. Therefore, the constraint does not come from any position equation f(x,y,z)=constf(\Pos{x}, \Pos{y}, \Pos{z}) = \text{const}. The constraint is non-holonomic, cannot eliminate a coordinate, and all 33 coordinates are still needed to give the particle's position.
4

A straight frictionless wire lies in a vertical (x,y)(\Pos{x}, \Pos{y}) plane. A motor rotates the wire counterclockwise about the origin at a constant angular speed ω\omega, so that the wire makes an angle θ(t)=ωt\theta(t) = \omega t with the +x+x axis. A bead of mass mm slides along the wire at a signed distance r\Pos{r} from the origin, with gravity gg pointing in the −y-y direction. Is the wire constraint scleronomic or rheonomic? Using q=r\Pos{q} = \Pos{r} as the single generalized coordinate, find the Cartesian velocities x˙\Vel{\dot{x}} and y˙\Vel{\dot{y}} and the energies T(r,r˙,t)\Kin{T}(\Pos{r}, \Vel{\dot{r}}, t) and V(r,t)\Pot{V}(\Pos{r}, t).

Write x(r,t)\Pos{x}(\Pos{r}, t) and y(r,t)\Pos{y}(\Pos{r}, t) using trigonometry for the angle ωt\omega t, and include both ∂∂rr˙\frac{\partial}{\partial r}\Vel{\dot{r}} and ∂∂t\frac{\partial}{\partial t} when computing x˙\Vel{\dot{x}} and y˙\Vel{\dot{y}}.

Because the angle of the wire θ(t)=ωt\Track{\theta(t)} = \Track{\omega t} changes as a given function of time tt, the constraint equation explicitly contains tt and is rheonomic (and holonomic, leaving 11 degree of freedom, q=r\Pos{q} = \Pos{r}).
The Cartesian coordinates of the bead in terms of r\Pos{r} and tt are
x(r,t)=rcos⁡(ωt),y(r,t)=rsin⁡(ωt).\displaystyle \begin{aligned} \Pos{x}(\Pos{r}, t) &= \Pos{r\cos(\omega t)}, \\ \Pos{y}(\Pos{r}, t) &= \Pos{r\sin(\omega t)}. \end{aligned}
Using x˙=∂x∂rr˙+∂x∂t\Vel{\dot{x}} = \frac{\partial x}{\partial r}\Vel{\dot{r}} + \Track{\frac{\partial x}{\partial t}} and y˙=∂y∂rr˙+∂y∂t\Vel{\dot{y}} = \frac{\partial y}{\partial r}\Vel{\dot{r}} + \Track{\frac{\partial y}{\partial t}}, the velocity components are
x˙\displaystyle \Vel{\dot{x}} =r˙cos⁡(ωt)−rωsin⁡(ωt),\displaystyle = \Vel{\dot{r}}\cos(\omega t) - \Track{r\omega\sin(\omega t)},
y˙\displaystyle \Vel{\dot{y}} =r˙sin⁡(ωt)+rωcos⁡(ωt).\displaystyle = \Vel{\dot{r}}\sin(\omega t) + \Track{r\omega\cos(\omega t)}.
(Watch out: Leaving out the explicit time derivatives ∂x∂t\Track{\frac{\partial x}{\partial t}} and ∂y∂t\Track{\frac{\partial y}{\partial t}} drops the −rωsin⁡(ωt)-\Track{r\omega\sin(\omega t)} and +rωcos⁡(ωt)+\Track{r\omega\cos(\omega t)} terms, which misses the tangential speed rω\Track{r\omega} from the rotating wire and leads to the wrong kinetic energy 12mr˙2\frac{1}{2}m\Vel{\dot{r}^2}.)
Squaring both velocity expressions and adding them gives
x˙2+y˙2=r˙2(cos⁡2(ωt)+sin⁡2(ωt))+r2ω2(sin⁡2(ωt)+cos⁡2(ωt))=r˙2+r2ω2,\displaystyle \begin{aligned} &\Vel{\dot{x}^2} + \Vel{\dot{y}^2} \\ &\quad = \Vel{\dot{r}^2}\left(\cos^2(\omega t) + \sin^2(\omega t)\right) \\ &\qquad + \Track{r^2\omega^2}\left(\sin^2(\omega t) + \cos^2(\omega t)\right) \\ &\quad = \Vel{\dot{r}^2} + \Track{r^2\omega^2}, \end{aligned}
since the cross terms −2rωr˙cos⁡(ωt)sin⁡(ωt)-2\Track{r\omega}\Vel{\dot{r}}\cos(\omega t)\sin(\omega t) and +2rωr˙sin⁡(ωt)cos⁡(ωt)+2\Track{r\omega}\Vel{\dot{r}}\sin(\omega t)\cos(\omega t) cancel and cos⁡2(ωt)+sin⁡2(ωt)=1\cos^2(\omega t) + \sin^2(\omega t) = 1. Thus the kinetic and potential energies are
T(r,r˙)=12m(r˙2+r2ω2),V(r,t)=mgy=mgrsin⁡(ωt).\displaystyle \begin{aligned} \Kin{T}(\Pos{r}, \Vel{\dot{r}}) &= \frac{1}{2}m(\Vel{\dot{r}^2} + \Track{r^2\omega^2}), \\ \Pot{V}(\Pos{r}, t) &= mg\Pos{y} = mg\Pos{r\sin(\omega t)}. \end{aligned}
5

For the motor-driven pendulum, the bob's position is x(θ,t)\Pos{x}(\Pos{\theta}, t) == Acos⁡(ωt)+Lsin⁡θ\Track{A\cos(\omega t)} + \Pos{L\sin\theta} and y(θ,t)=−Lcos⁡θ\Pos{y}(\Pos{\theta}, t) = -\Pos{L\cos\theta}, and the rod tension FT\Force{\mathbf{F}_T} always points along the rod toward the moving pivot. Find the components of a virtual displacement δr=(δx,δy)\Step{\delta\mathbf{r}} = (\Step{\delta x}, \Step{\delta y}) produced by a small nudge δθ\Step{\delta\theta}, show mathematically that the tension does zero virtual work (δW=FT⋅δr=0\Work{\delta W} = \Force{\mathbf{F}_T} \cdot \Step{\delta\mathbf{r}} = 0), and explain why δr\Step{\delta\mathbf{r}} must be taken at frozen time (δt=0\delta t = 0) for this cancellation to hold.

Hold time frozen (δt=0\delta t = 0) to find δx=∂x∂θδθ\Step{\delta x} = \frac{\partial x}{\partial \theta}\Step{\delta\theta} and δy=∂y∂θδθ\Step{\delta y} = \frac{\partial y}{\partial \theta}\Step{\delta\theta}, then take the dot product with the tension vector FT\Force{\mathbf{F}_T} == (−FTsin⁡θ, FTcos⁡θ)(-\Force{F_T}\sin\theta,\, \Force{F_T}\cos\theta).

A virtual displacement freezes time (δt=0\delta t = 0) and nudges only the generalized coordinate θ\Pos{\theta} by δθ\Step{\delta\theta}:
δx=∂x∂θδθ=Lcos⁡θ δθ,δy=∂y∂θδθ=Lsin⁡θ δθ.\displaystyle \begin{aligned} \Step{\delta x} &= \frac{\partial x}{\partial \theta}\Step{\delta\theta} = L\cos\theta\,\Step{\delta\theta}, \\ \Step{\delta y} &= \frac{\partial y}{\partial \theta}\Step{\delta\theta} = L\sin\theta\,\Step{\delta\theta}. \end{aligned}
(Watch out: Do not use the actual displacement dx\Step{dx} == Lcos⁡θ dθ−Aωsin⁡(ωt) dtL\cos\theta\,\Step{d\theta} - \Track{A\omega\sin(\omega t)}\,dt with dt≠0dt \neq 0; including the motor step −Aωsin⁡(ωt) dt-\Track{A\omega\sin(\omega t)}\,dt leaves a non-zero work term FTAωsin⁡θsin⁡(ωt) dt\Work{F_T A\omega\sin\theta\sin(\omega t)\,dt} because the moving tension does real work on the bob over time dtdt.)
The vector from the moving pivot (Acos⁡(ωt),0)(\Track{A\cos(\omega t)}, 0) to the bob is (Lsin⁡θ,−Lcos⁡θ)(\Pos{L\sin\theta}, -\Pos{L\cos\theta}), so the rod tension FT\Force{\mathbf{F}_T} pointing back toward the pivot has components
FT\displaystyle \Force{\mathbf{F}_T} =(−FTsin⁡θ, FTcos⁡θ).\displaystyle = (-\Force{F_T}\sin\theta,\, \Force{F_T}\cos\theta).
Taking the dot product of FT\Force{\mathbf{F}_T} with δr=(Lcos⁡θ δθ, Lsin⁡θ δθ)\Step{\delta\mathbf{r}} = (L\cos\theta\,\Step{\delta\theta},\, L\sin\theta\,\Step{\delta\theta}) gives the virtual work:
δW=FT⋅δr=(−FTsin⁡θ)(Lcos⁡θ δθ)+(FTcos⁡θ)(Lsin⁡θ δθ)=0.\displaystyle \begin{aligned} \Work{\delta W} &= \Force{\mathbf{F}_T} \cdot \Step{\delta\mathbf{r}} \\ &= (-\Force{F_T}\sin\theta)(L\cos\theta\,\Step{\delta\theta}) \\ &\quad + (\Force{F_T}\cos\theta)(L\sin\theta\,\Step{\delta\theta}) \\ &= 0. \end{aligned}
Freezing time (δt=0\delta t = 0) is needed because at a single instant the allowed circle is standing still, so δr\Step{\delta\mathbf{r}} points purely tangent to the circle while FT\Force{\mathbf{F}_T} points purely radially along the rod. Over a real time step dt≠0dt \neq 0, the actual displacement dr=δr+∂r∂tdt\Step{d\mathbf{r}} = \Step{\delta\mathbf{r}} + \Track{\frac{\partial \mathbf{r}}{\partial t}}dt includes the horizontal pivot motion (−Aωsin⁡(ωt) dt,0)(-\Track{A\omega\sin(\omega t)}\,dt, 0), which is not perpendicular to the rod.