Unit 2: Lagrangian Formalism
- 1. Generalized Coordinates and Velocities
- 2. Principle of Virtual Work
- 3. D’Alembert’s Principle
- 4. Lagrange’s Equations from D’Alembert’s Principle
- 5. Hamilton’s Principle and Lagrange’s Equations
- 6. Deduction of Hamilton’s Principle from D’Alembert’s Principle
- 7. Applications of Euler-Lagrange Equations
1. Generalized Coordinates and Velocities
1.1 Generalized Coordinates
In classical mechanics, describing the motion of a system of N particles using standard Cartesian coordinates (xi, yi, zi) often becomes mathematically cumbersome due to the presence of geometrical constraints. To simplify analysis, we introduce generalized coordinates.
Definition: Generalized coordinates are defined as the minimum number of independent variables required to completely specify the physical state and configuration of a dynamical system at any given instant in time.
If a system consisting of N particles is subjected to k independent constraint equations, the number of degrees of freedom (n) is calculated as:
Degrees of Freedom (n) = 3N - k
The set of generalized coordinates is conventionally denoted by:
q1, q2, q3, ..., qn
The position vector ri of the i-th particle can be expressed as a function of the generalized coordinates and explicit time t:
ri = ri(q1, q2, ..., qn, t)
1.2 Generalized Velocities
The time derivative of a generalized coordinate is known as a generalized velocity.
Generalized Velocity: q̇j = dqj / dt (for j = 1, 2, ..., n)
By differentiating the position vector ri with respect to time using the chain rule, the velocity vi of the i-th particle is given by:
vi = dri / dt = ∑j=1n (∂ri / ∂qj) q̇j + ∂ri / ∂t
1.3 Comparison: Cartesian vs. Generalized Coordinates
| Feature | Cartesian Coordinates | Generalized Coordinates |
|---|---|---|
| Dimension/Units | Always length (meters) | Can be length, angle, energy, or dimensionless quantity |
| Independence | Coordinates are coupled when constraints exist | Mutually independent of each other |
| Number of variables | 3N variables for N particles | n = 3N - k variables (reduces dimension) |
| Constraint Handling | Constraint forces must be calculated explicitly | Constraint forces are eliminated from equations |
2. Principle of Virtual Work
2.1 Concept of Virtual Displacement
A virtual displacement, denoted by δri, is an infinitesimal, imaginary change in the system's position vector occurring at a fixed instant of time (dt = 0). It must be consistent with the forces and constraints imposed on the system, but does not involve any actual passage of time.
| Property | Real Displacement (dri) | Virtual Displacement (δri) |
|---|---|---|
| Time Interval | Occurs during a finite or differential time interval dt ≠ 0 | Occurs instantaneously at dt = 0 |
| Constraint Variation | May depend on time-varying constraints | Constraints are frozen at time t |
| Mathematical Notation | dri = ∑j (∂ri / ∂qj) dqj + (∂ri / ∂t) dt | δri = ∑j (∂ri / ∂qj) δqj |
2.2 Principle Statement
Consider a mechanical system in static equilibrium. The total force Fi acting on particle i consists of the applied force Fi(a) and the force of constraint fi:
Fi = Fi(a) + fi
For equilibrium, the total net force on each particle is zero: Fi = 0. The total virtual work done by these forces during a virtual displacement δri is:
δW = ∑i Fi · δri = ∑i Fi(a) · δri + ∑i fi · δri = 0
For systems with rigid or smooth constraints (such as ideal constraints like rigid rods, smooth surfaces, or inextensible strings), the constraint forces do zero total virtual work:
∑i fi · δri = 0
Principle of Virtual Work Statement: The virtual work done by applied, non-constraint forces for a system of connected rigid particles in static equilibrium is zero for any arbitrary virtual displacement compatible with the constraints:
δW = ∑i Fi(a) · δri = 0
3. D’Alembert’s Principle
3.1 Concept and Formulation
D’Alembert’s principle extends the Principle of Virtual Work from static equilibrium to dynamic systems by introducing the concept of reverse effective force (inertial force).
According to Newton's second law for particle i:
Fi = ṗi or Fi - ṗi = 0
where pi = mivi is the linear momentum, and ṗi is its time derivative (miai). We can view this as a condition of dynamic equilibrium under effective force (Fi - ṗi).
3.2 Mathematical Statement
Taking the dot product of the dynamic equilibrium equation with a virtual displacement δri and summing over all particles:
∑i (Fi - ṗi) · δri = 0
Substituting Fi = Fi(a) + fi:
∑i (Fi(a) - ṗi) · δri + ∑i fi · δri = 0
Since the virtual work done by constraint forces vanishes for holonomic systems (∑i fi · δri = 0), we obtain D’Alembert’s Principle:
D’Alembert’s Principle:
∑i (Fi(a) - ṗi) · δri = 0
Key Insight: D’Alembert’s principle successfully eliminates the unknown forces of constraint from the governing dynamic equations of motion.
4. Lagrange’s Equations from D’Alembert’s Principle
To derive Lagrange’s equations, we transform D’Alembert’s principle from Cartesian coordinates (ri) into independent generalized coordinates (qj).
Step 1: Transform Virtual Displacement
The virtual displacement δri in terms of generalized coordinates is:
δri = ∑j=1n (∂ri / ∂qj) δqj
Step 2: Transform Applied Work Term
Substituting δri into the applied force term gives:
∑i Fi(a) · δri = ∑i Fi(a) · [ ∑j (∂ri / ∂qj) δqj ] = ∑j [ ∑i Fi(a) · (∂ri / ∂qj) ] δqj
We define the Generalized Force Qj corresponding to coordinate qj as:
Qj = ∑i Fi(a) · (∂ri / ∂qj)
Thus, the virtual work term becomes: ∑j Qj δqj
Step 3: Transform Inertial Term
The inertial force term is ∑i ṗi · δri = ∑i mi r̈i · δri. Rewriting using generalized coordinates:
∑i mi r̈i · δri = ∑j [ ∑i mi r̈i · (∂ri / ∂qj) ] δqj
Consider the identity using product rule of differentiation:
mi r̈i · (∂ri / ∂qj) = (d / dt) [ mi ṙi · (∂ri / ∂qj) ] - mi ṙi · (d / dt)(∂ri / ∂qj)
Using the kinematic identities:
- ∂ri / ∂qj = ∂ṙi / ∂q̇j (Cancellation of dots property)
- (d / dt)(∂ri / ∂qj) = ∂ṙi / ∂qj (Interchange of derivatives)
Substituting these identities back into the relation:
∑i mi r̈i · (∂ri / ∂qj) = (d / dt) [ ∂ / ∂q̇j ( ∑i (1/2) mi vi2 ) ] - ∂ / ∂qj ( ∑i (1/2) mi vi2 )
Recognizing the total kinetic energy T = ∑i (1/2) mi vi2, the inertial term simplifies to:
(d / dt)(∂T / ∂q̇j) - ∂T / ∂qj
Step 4: Combine Terms into D’Alembert’s Principle
Substituting both the generalized force and kinetic energy terms into D’Alembert's principle:
∑j=1n [ (d / dt)(∂T / ∂q̇j) - ∂T / ∂qj - Qj ] δqj = 0
Since generalized coordinates qj are completely independent, each term in the brackets must individually equal zero:
(d / dt)(∂T / ∂q̇j) - ∂T / ∂qj = Qj (for j = 1, 2, ..., n)
Step 5: Conservative Systems and Lagrangian Form
If the forces are conservative, the force can be derived from a scalar potential function V(qj):
Fi(a) = -∇i V ⇒ Qj = -∂V / ∂qj
Since potential energy V depends only on coordinates qj (and not velocities q̇j), ∂V / ∂q̇j = 0. We can rewrite the equation as:
(d / dt) [ ∂(T - V) / ∂q̇j ] - ∂(T - V) / ∂qj = 0
Defining the Lagrangian Function L = T - V:
Euler-Lagrange Equations of Motion:
(d / dt)(∂L / ∂q̇j) - ∂L / ∂qj = 0 (for j = 1, 2, ..., n)
5. Hamilton’s Principle and Lagrange’s Equations
5.1 Statement of Hamilton’s Principle
Hamilton’s Principle (also known as the Principle of Least Action) provides an integral formulation of classical mechanics.
Hamilton’s Principle: The actual motion of a conservative dynamical system from time t1 to time t2 takes a path such that the line integral of the Lagrangian function L (called the Action Integral I) is stationary (has an extremum value) compared to all nearby neighboring paths with identical boundary values at t1 and t2.
δI = δ ∫t1t2 L(qj, q̇j, t) dt = 0
Boundary conditions require zero variation at endpoints: δqj(t1) = 0 and δqj(t2) = 0.
5.2 Derivation of Lagrange’s Equations from Hamilton’s Principle
Using calculus of variations, compute the variation of the action integral I:
δI = ∫t1t2 δL(qj, q̇j, t) dt = 0
Expand δL using the chain rule:
δL = ∑j=1n [ (∂L / ∂qj) δqj + (∂L / ∂q̇j) δq̇j ]
Substitute δL into the action variation:
δI = ∫t1t2 ∑j=1n [ (∂L / ∂qj) δqj + (∂L / ∂q̇j) (d/dt)(δqj) ] dt = 0
Integrate the second term by parts:
∫t1t2 (∂L / ∂q̇j) (d/dt)(δqj) dt = [ (∂L / ∂q̇j) δqj ]t1t2 - ∫t1t2 (d / dt)(∂L / ∂q̇j) δqj dt
Applying endpoint boundary conditions δqj(t1) = δqj(t2) = 0, the boundary evaluation term vanishes:
[ (∂L / ∂q̇j) δqj ]t1t2 = 0
Combining the remaining integrated terms gives:
δI = ∫t1t2 ∑j=1n [ (∂L / ∂qj) - (d / dt)(∂L / ∂q̇j) ] δqj dt = 0
Because variations δqj are arbitrary and independent within the time interval (t1, t2), the integrand must vanish identically for each j:
(d / dt)(∂L / ∂q̇j) - ∂L / ∂qj = 0
6. Deduction of Hamilton’s Principle from D’Alembert’s Principle
Hamilton’s Principle can be derived directly from D’Alembert’s Principle by integrating over a finite time interval [t1, t2].
Derivation Steps:
1. Start with D’Alembert’s Principle in differential form:
∑i (mi r̈i - Fi(a)) · δri = 0
2. Integrate this relation over time from t1 to t2:
∫t1t2 ∑i mi r̈i · δri dt - ∫t1t2 ∑i Fi(a) · δri dt = 0 --- (Equation A)
3. Analyze the first term using integration by parts:
∫t1t2 mi r̈i · δri dt = [ mi ṙi · δri ]t1t2 - ∫t1t2 mi ṙi · (d/dt)(δri) dt
Since virtual displacements vanish at endpoint times t1 and t2 (δri(t1) = δri(t2) = 0), the boundary term is zero. Using (d/dt)(δri) = δṙi:
∫t1t2 ∑i mi r̈i · δri dt = - ∫t1t2 ∑i mi ṙi · δṙi dt = - ∫t1t2 δ [ ∑i (1/2) mi ṙi2 ] dt = - ∫t1t2 δT dt
4. Analyze the second term for conservative forces:
∫t1t2 ∑i Fi(a) · δri dt = ∫t1t2 δW dt = - ∫t1t2 δV dt
5. Substitute these back into Equation A:
- ∫t1t2 δT dt - ( - ∫t1t2 δV dt ) = 0 ⇒ ∫t1t2 (δT - δV) dt = 0
Factoring out the variational operator δ:
δ ∫t1t2 (T - V) dt = 0 ⇒ δ ∫t1t2 L dt = 0
This completes the formal deduction of Hamilton’s Principle from D’Alembert’s Principle.
7. Applications of Euler-Lagrange Equations
7.1 One-Dimensional Simple Harmonic Oscillator
Consider a particle of mass m attached to a spring with spring constant k, moving along the x-axis.
- Generalized coordinate: q = x
- Generalized velocity: q̇ = ẋ
- Kinetic Energy: T = (1/2) m ẋ2
- Potential Energy: V = (1/2) k x2
Formulating the Lagrangian:
L = T - V = (1/2) m ẋ2 - (1/2) k x2
Partial Derivatives:
∂L / ∂ẋ = m ẋ
(d / dt)(∂L / ∂ẋ) = m ẍ
∂L / ∂x = -k x
Applying Euler-Lagrange Equation:
(d / dt)(∂L / ∂ẋ) - ∂L / ∂x = 0 ⇒ m ẍ - (-k x) = 0 ⇒ m ẍ + k x = 0
Dividing by m yields the standard equation of motion for a SHO:
ẍ + ω2 x = 0 (where ω = √(k / m))
7.2 Simple Pendulum
Consider a point mass m suspended by a massless, inextensible string of length l under gravity g.
- Generalized coordinate: q = θ (angular displacement from vertical)
- Position coordinates: x = l sin θ, y = l cos θ (taking fixed support point as origin, downward y)
- Velocity: v2 = ẋ2 + ẏ2 = (l θ̇ cos θ)2 + (-l θ̇ sin θ)2 = l2 θ̇2
- Kinetic Energy: T = (1/2) m l2 θ̇2
- Potential Energy: V = -m g l cos θ (referencing origin)
Formulating the Lagrangian:
L = T - V = (1/2) m l2 θ̇2 + m g l cos θ
Partial Derivatives:
∂L / ∂θ̇ = m l2 θ̇
(d / dt)(∂L / ∂θ̇) = m l2 θ̈
∂L / ∂θ = -m g l sin θ
Applying Euler-Lagrange Equation:
m l2 θ̈ - (-m g l sin θ) = 0 ⇒ m l2 θ̈ + m g l sin θ = 0
Simplifying by dividing by m l2:
θ̈ + (g / l) sin θ = 0
Small-angle approximation (sin θ ≈ θ): θ̈ + (g / l) θ = 0, giving angular frequency ω = √(g / l).
7.3 Compound Pendulum
A compound pendulum is any rigid body of mass m oscillating about a horizontal axis passing through a pivot point O under gravity.
- Generalized coordinate: q = θ (angle of deflection of line connecting pivot to center of mass)
- Distance: h = distance from pivot O to Center of Mass (CM)
- Moment of Inertia: I = moment of inertia about pivot axis O
- Kinetic Energy: T = (1/2) I θ̇2
- Potential Energy: V = -m g h cos θ (taking pivot O as zero reference level)
Formulating the Lagrangian:
L = T - V = (1/2) I θ̇2 + m g h cos θ
Partial Derivatives:
∂L / ∂θ̇ = I θ̇
(d / dt)(∂L / ∂θ̇) = I θ̈
∂L / ∂θ = -m g h sin θ
Applying Euler-Lagrange Equation:
I θ̈ - (-m g h sin θ) = 0 ⇒ I θ̈ + m g h sin θ = 0
Dividing by I:
θ̈ + (m g h / I) sin θ = 0
For small oscillations (sin θ ≈ θ): θ̈ + (m g h / I) θ = 0.
The time period is T = 2π √(I / (m g h)) = 2π √(Leq / g), where equivalent length Leq = I / (m h).
7.4 Free-Falling Body in Uniform Gravity
Consider a body of mass m falling vertically under a uniform gravitational acceleration g.
- Generalized coordinate: q = y (vertical displacement measured positive upwards)
- Kinetic Energy: T = (1/2) m ẏ2
- Potential Energy: V = m g y
Formulating the Lagrangian:
L = T - V = (1/2) m ẏ2 - m g y
Partial Derivatives:
∂L / ∂ẏ = m ẏ
(d / dt)(∂L / ∂ẏ) = m ÿ
∂L / ∂y = -m g
Applying Euler-Lagrange Equation:
(d / dt)(∂L / ∂ẏ) - ∂L / ∂y = 0 ⇒ m ÿ - (-m g) = 0 ⇒ m ÿ + m g = 0
Simplifying gives the classical acceleration equation:
ÿ = -g
7.5 Summary of System Lagrangians & Equations of Motion
| System | Generalized Coordinate (q) | Lagrangian (L = T - V) | Equation of Motion |
|---|---|---|---|
| 1D Harmonic Oscillator | x | (1/2) m ẋ2 - (1/2) k x2 | m ẍ + k x = 0 |
| Simple Pendulum | θ | (1/2) m l2 θ̇2 + m g l cos θ | θ̈ + (g / l) sin θ = 0 |
| Compound Pendulum | θ | (1/2) I θ̇2 + m g h cos θ | I θ̈ + m g h sin θ = 0 |
| Free-Falling Body | y (upwards) | (1/2) m ẏ2 - m g y | ÿ = -g |