Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Physics from energy alone
Lagrange found a different way into mechanics. Instead of adding up forces and their directions, you write down just two numbers for any arrangement of the system: its energy of motion (kinetic, T) and its stored energy (potential, V). One recipe turns T − V into the equations of motion. It works for pendulums, robot arms and planets alike, in whatever coordinates are most convenient (angles, lengths, anything).
Robot-arm dynamics, legged-robot models, spacecraft with flexible appendages and multibody simulators are almost always derived with Lagrangian methods. Model-based controllers (computed torque, MPC) and physics-informed networks (Lagrangian neural networks) are built directly on L = T − V.
- 1. The Lagrangian is…
- 2. How many coordinates describe a double pendulum's configuration?
- 3. The double pendulum at large angles is…
Level 1: Beginner
★★☆☆☆ Basic⏱ 25 minSecondary-school mathematics: arithmetic and elementary algebra.Generalized coordinates
The degrees of freedom are the minimum number of independent numbers needed to describe a configuration: 1 for a pendulum (θ), 2 for a double pendulum or a 2-link arm, 6 for a free rigid body in space. Generalized coordinates are any such set. Constraints (rigid rods, rolling) are built into the choice of coordinates, so their forces never appear.
The Lagrangian and the Euler–Lagrange equation
where are generalized forces that aren’t in V (motor torques, friction). For a pendulum, gives . The generalized momentum is ; for the pendulum it’s , an angular momentum.
- 1. Degrees of freedom of a free rigid body in space:
- 2. For a pendulum, ∂L/∂θ̇ equals…
- 3. Constraint forces (like rod tension) in the Lagrangian method…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.Stationary action
Among all paths q(t) with fixed endpoints, the physical one makes the action stationary. Setting the first variation to zero gives exactly the Euler–Lagrange equation (the calculus of variations, a3-5-9). This is Hamilton’s principle.
Robot manipulators
For an n-joint arm, and V = V(q). The Euler–Lagrange equations become the manipulator equation
M is the configuration-dependent mass matrix, C holds the Coriolis and centrifugal terms, G(q) = ∂V/∂q is gravity, and τ the joint torques. Given a desired trajectory, inverse dynamics computes τ. Forward dynamics solves for q̈ from τ.
Symmetries and conservation
If L doesn’t depend on a coordinate (it’s cyclic), then is conserved. For a central force, φ is cyclic, so is conserved (Kepler’s second law). If L has no explicit time dependence, energy is conserved. Noether’s theorem makes the general link: every continuous symmetry gives a conservation law.
- 1. In the manipulator equation, G(q) represents…
- 2. A coordinate absent from L gives…
- 3. Hamilton's principle says the true path makes the action…
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Euler–Lagrange reproduces Newton
For a particle with , we get and . So . ∎
Cyclic coordinates
If , the Euler–Lagrange equation reads . ∎ If the radius halves under a central force, the angular rate quadruples.
Expanding the derivative
(for L without explicit t). This is the H q̈ + J q̇ form used in the code. For mechanical systems, is positive definite, so q̈ is always solvable.
Atwood machine, the Lagrangian way
With one coordinate x (rope length is fixed): , so . No tension appears. ∎
- 1. For mechanical systems, ∂²L/∂q̇² is…
- 2. Atwood with 1 kg and 3 kg via Lagrange: acceleration…
- 3. Euler–Lagrange for L = ½m ẋ² − V(x) gives…
Level 4: Expert
★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.Inverse dynamics of a two-link arm
A planar arm moves in a vertical plane: link 1 is 2 kg × 0.5 m, link 2 is 1.5 kg × 0.4 m, both uniform. A minimum-jerk motion (zero velocity and acceleration at both ends) takes it from (−0.5, 0.3) rad to (0.8, 1.2) rad. Joint torques come from the Euler–Lagrange equations applied to L alone, via numerical derivatives.
- Holding still: the torques are (13.646, 2.884) N·m, exactly the gravity torques. Gravity compensation is just G(q).
- Move time: a 1 s move needs peak torques (21.99, 5.08) N·m. Doing it in 0.5 s needs (45.39, 11.48) N·m. The dynamic (non-gravity) part grows exactly ×4.00, the 1/T² law. That’s why fast robots need big motors and light arms.
- Energy balance: integrated motor work, 17.94 J, equals the change in total energy, confirming the computed torques.
Computed-torque control feeds exactly this τ forward and corrects errors with feedback (Lynch and Park, 2017).
Lagrangian mechanics in AI, robotics and aerospace
- Robot dynamics and control: the manipulator equation, computed-torque control, and passivity-based control exploiting the energy structure.
- Learning: Lagrangian neural networks (Cranmer et al., 2020) and DeLaN (Lutter, Ritter and Peters, 2019) learn L from data, so the learned models conserve energy and generalize better.
- Spacecraft: flexible-appendage and fuel-slosh models; multibody dynamics of deployables.
- Simulation: variational integrators that discretize the action itself and inherit its conservation laws.
References
- H. Goldstein, C. Poole, J. Safko (2002). Classical Mechanics, 3rd ed. Addison-Wesley.
- K. Lynch, F. Park (2017). Modern Robotics. Cambridge.
- M. Cranmer, S. Greydanus, S. Hoyer, P. Battaglia, D. Spergel, S. Ho (2020). “Lagrangian neural networks.” ICLR Workshop on Integration of Deep Neural Models and Differential Equations.
- M. Lutter, C. Ritter, J. Peters (2019). “Deep Lagrangian networks: using physics as model prior for deep learning.” ICLR.
- J. Marsden, M. West (2001). “Discrete mechanics and variational integrators.” Acta Numerica, 10.