7.5 Virtual Work & Lagrange's Equation
Key Takeaways
- Virtual work and Lagrange's equation are both named explicitly in the Engineering Mechanics bullet of the CIL Mechanical Paper-II syllabus.
- The principle of virtual work states that a system in equilibrium does zero net virtual work under any small virtual displacement consistent with its constraints.
- Constraint and reaction forces do no virtual work, which is why the method solves a mechanism without ever computing a pin reaction.
- Lagrange's equation derives the equations of motion from the difference between kinetic and potential energy, using generalised coordinates equal in number to the degrees of freedom.
Why Energy Methods Exist
The free-body approach requires one equilibrium equation per body and produces unknown pin reactions that must be carried through the algebra even when nobody wants them. For a mechanism with several links, that is a great deal of work to find one applied force.
Virtual work removes the reactions entirely. Its central observation is that constraint forces — pin reactions, smooth-surface normals, and the internal forces in rigid links — act perpendicular to the motion they permit, or in equal and opposite pairs, and therefore do no work. If work is the only quantity you write down, they never enter the equations.
Virtual Displacement
A virtual displacement $\delta r$ is an infinitesimal, imaginary change in configuration that is:
- consistent with the constraints — the system must still hold together and respect its supports;
- instantaneous — time is frozen, so it is not a real motion;
- arbitrary in magnitude within those limits.
The symbol $\delta$ rather than $d$ marks it as virtual rather than actual.
The Principle of Virtual Work
A system of connected rigid bodies is in equilibrium if and only if the total virtual work done by all active forces during any admissible virtual displacement is zero.
For a system with couples applied, the corresponding term is $\sum M_j,\delta\theta_j$.
Active forces are the applied loads, spring forces and weights. Reactive forces are the support and constraint forces, and they are excluded because they do no virtual work.
Method
- Choose a single independent coordinate that describes the configuration — usually an angle.
- Express the position of every point where an active force acts in terms of that coordinate.
- Differentiate to obtain each virtual displacement in terms of $\delta\theta$.
- Write $\delta W = 0$, cancel $\delta\theta$, and solve.
Worked Example: A Toggle Mechanism
Two links, each of length $L$, are pinned to form a symmetric toggle. The upper pin carries a vertical downward load $P$, and a horizontal force $Q$ is applied at the lower roller. Each link makes an angle $\theta$ with the horizontal.
Taking the fixed pin as origin, the height of the load point is $y = L\sin\theta$ and the horizontal position of the roller is $x = 2L\cos\theta$.
Virtual displacements:
Virtual work, with $P$ acting downward against increasing $y$ and $Q$ acting in the direction of decreasing $x$:
Cancelling $L,\delta\theta$:
As $\theta \to 0$ the required $Q$ grows without bound — which is exactly the mechanical advantage a toggle clamp or a stone crusher exploits. No pin reaction was ever computed.
Potential Energy and Stability
When all active forces are conservative, virtual work can be written as the change in total potential energy $V$, and equilibrium requires
The second derivative then classifies the equilibrium, exactly as in the single-variable calculus of Section 1:
| Condition | Equilibrium |
|---|---|
| $d^2V/d\theta^2 > 0$ | Stable — potential energy is a minimum |
| $d^2V/d\theta^2 < 0$ | Unstable — potential energy is a maximum |
| $d^2V/d\theta^2 = 0$ | Neutral |
A ball at the bottom of a bowl is stable; the same ball balanced on a dome is unstable.
Generalised Coordinates and Degrees of Freedom
A generalised coordinate $q_i$ is any independent quantity that helps fix the configuration of a system. The number required equals the number of degrees of freedom. For a simple pendulum, one angle suffices; for a double pendulum, two.
Generalised coordinates need not be lengths — an angle, an area or a charge can serve, provided the set is independent and complete.
Lagrange's Equation
Define the Lagrangian as the difference between kinetic and potential energy:
For each generalised coordinate $q_i$, the equation of motion is
where $\dot q_i$ is the generalised velocity and $Q_i$ is the generalised non-conservative force — damping, friction, or an applied driving force. When all forces are conservative, $Q_i = 0$.
Equivalently, in terms of $T$ and $V$ separately:
Why it is worth the trouble
| Newton-Euler | Lagrangian |
|---|---|
| Vector equations; direction matters | Scalar energies; no vector resolution |
| Constraint forces appear and must be eliminated | Constraint forces never appear |
| One free-body diagram per body | One Lagrangian for the whole system |
| Coordinate choice is awkward for rotating systems | Any convenient generalised coordinate works |
Worked Example: Simple Pendulum
A bob of mass $m$ hangs on a massless rod of length $l$, with $\theta$ measured from the downward vertical.
Kinetic energy. The bob's speed is $l\dot\theta$, so
Potential energy, taking the pivot as datum:
Lagrangian: $L = \tfrac{1}{2}ml^2\dot\theta^2 + mgl\cos\theta$.
Now apply the equation:
Substituting:
For small oscillations, $\sin\theta \approx \theta$ — the truncated Taylor series from Section 1 — giving simple harmonic motion with
Notice that the rod tension never appeared. That is the whole point of the method.
Worked Example: Mass-Spring System
For a mass $m$ on a spring of stiffness $k$ with displacement $x$:
recovering the familiar undamped vibration equation with $\omega_n = \sqrt{k/m}$. Adding a viscous damper contributes a generalised force $Q = -c\dot x$, producing $m\ddot x + c\dot x + kx = 0$ — the same equation treated at length in the Vibrations chapter.
In the principle of virtual work, constraint and reaction forces are excluded from the work equation because they:
The Lagrangian of a mechanical system is defined as:
Applying Lagrange's equation to a simple pendulum of length l yields the equation of motion in which the angular acceleration equals:
A conservative system is in equilibrium at a configuration where the second derivative of total potential energy with respect to the coordinate is positive. The equilibrium is: