Constraints and generalized coordinates
Lagrangian and Hamiltonian formulations · Physics
Study notes
Example: Simple Pendulum Step 1: Identify constraint The ball is attached to a fixed point by a massless string of length L. The constraint equation is x² + y² = L². Step 2: Choose generalized coordinate Use the angle θ that the string makes with the vertical. This is the only independent coordinate. Step 3: Express positions x = L sinθ, y = -L cosθ. Step 4: Compute kinetic energy T Velocity components: vx = L θ̇ cosθ, vy = L θ̇ sinθ. Speed squared: v² = v_x² + v_y² = L² θ̇². So T = ½ m L² θ̇². Step 5: Compute potential energy V V = m g y = -m g L cosθ. Step 6: Form Lagrangian L = T - V L = ½ m L² θ̇² + m g L cosθ. Step 7: Apply Lagrange’s equation ∂L/∂θ = -m g L sinθ, ∂L/∂θ̇ = m L² θ̇, d/dt(∂L/∂θ̇) = m L² θ̈. Plug into Lagrange: m L² θ̈ + m g L sinθ = 0. Step 8: Simplify θ̈ + (g/L) sinθ = 0. This is the equation of motion for a simple pendulum. Step 9: Small-angle approximation (optional) For small θ, sinθ ≈ θ, giving θ̈ + (g/L) θ = 0, a simple harmonic oscillator.