Euler-Lagrange Dynamics
March 22, 2026 · View on GitHub
Overview & Motivation
The Euler-Lagrange equations provide a systematic way to derive the equations of motion for mechanical systems from energy principles. Instead of tracking forces on each body (as in Newton's method), they express dynamics in terms of generalized coordinates and the system's kinetic and potential energy.
For a robotic manipulator or any articulated mechanism with degrees of freedom, the Euler-Lagrange formulation yields a compact matrix equation:
Where:
- — generalized coordinates (joint angles/positions)
- — generalized velocities and accelerations
- — mass (inertia) matrix, symmetric positive definite
- — Coriolis and centrifugal terms
- — gravitational terms
- — generalized forces/torques (inputs)
This formulation supports two fundamental computations:
- Forward dynamics: given torques , compute accelerations
- Inverse dynamics: given desired accelerations , compute required torques
Mathematical Theory
Prerequisites
The Lagrangian of a system is defined as:
where is kinetic energy and is potential energy.
Core Definitions
The Euler-Lagrange equation for coordinate is:
For a rigid-body system, kinetic energy takes the form:
Applying the Euler-Lagrange equation to this quadratic form yields the standard manipulator equation:
Mass Matrix
The mass matrix is always symmetric () and positive definite ( for ). These properties guarantee:
- The forward dynamics linear system always has a unique solution
- Physical kinetic energy is always non-negative
Coriolis Matrix
The Coriolis matrix captures velocity-dependent forces using Christoffel symbols of the first kind:
A key property: is skew-symmetric, which is important for passivity-based control.
Gravity Vector
where is the total potential energy of the system.
Complexity Analysis
| Operation | Time | Space | Notes |
|---|---|---|---|
| Forward dynamics | Dominated by solve via Gaussian elimination | ||
| Inverse dynamics | Matrix-vector multiplication | ||
| Model evaluation | Model-dependent | Computing , , |
For systems with DOF (typical robotic manipulators), the cost of Gaussian elimination is negligible. For larger systems, consider the Recursive Newton-Euler Algorithm (RNEA) which achieves inverse dynamics.
Step-by-Step Walkthrough
Example: Simple Pendulum (1-DOF)
A point mass on a rigid rod of length :
System parameters: , ,
Model matrices:
- (single DOF → no Coriolis)
Forward dynamics at , , :
Inverse dynamics for holding position ():
Example: Two-Link Planar Arm (2-DOF)
For a 2-DOF arm with equal links (, ):
At rest (, ):
- ,
- → gravity terms vanish when links hang vertically
- Forward dynamics with produces (equilibrium)
Pitfalls & Edge Cases
- Singular mass matrix: Should not happen for physically valid systems, but numerical conditioning degrades near kinematic singularities (e.g., fully extended arm). The Gaussian elimination solver uses partial pivoting to help.
- Fixed-point arithmetic: Dynamics values (torques, accelerations) typically exceed the range of Q15/Q31 formats. Use
floatunless inputs are carefully scaled. - Coriolis computation: The choice of Coriolis parameterization (Christoffel vs. factored form) affects the skew-symmetry property of . The interface returns the product directly, leaving the parameterization choice to the user.
- Energy consistency: For simulation, ensure the model matrices satisfy the skew-symmetry property; otherwise, energy may not be conserved in numerical integration.
- Units: Be explicit about whether angles are in radians (standard) and torques in N·m.
Variants & Generalizations
| Variant | Trade-off | Use Case |
|---|---|---|
| Euler-Lagrange (this) | forward, closed-form, intuitive | Small systems (), control design, analysis |
| Newton-Euler | Body-by-body force balance | Single rigid bodies, intuitive for simple systems |
| Recursive Newton-Euler (RNEA) | inverse dynamics | Large kinematic chains, real-time control |
| Articulated Body Algorithm (ABA) | forward dynamics | Large chains, simulation |
| Hamiltonian formulation | Phase-space, symplectic integration | Long-horizon simulation, energy preservation |
Applications
- Robot control: Computed torque control, gravity compensation, impedance control
- Simulation: Forward dynamics integration for physics simulation
- System identification: Estimate dynamic parameters from measured motion
- Trajectory optimization: Inverse dynamics as constraints in optimization
- Vibration analysis: Linearized dynamics around equilibrium points
Connections to Other Algorithms
- Gaussian Elimination (GaussianElimination.md): Used internally to solve in forward dynamics
- LQR Controller (Lqr.md): Euler-Lagrange dynamics can be linearized to produce the state-space matrices needed for LQR design
- Kalman Filter (../filters/active/): State estimation for partially observed dynamical systems derived from Euler-Lagrange models
- DARE (DiscreteAlgebraicRiccatiEquation.md): Discretized Euler-Lagrange systems feed into DARE for optimal control gain computation
References & Further Reading
- Siciliano, B., Sciavicco, L., Villani, L., & Oriolo, G. (2009). Robotics: Modelling, Planning and Control. Springer. Chapters 7–8.
- Spong, M. W., Hutchinson, S., & Vidyasagar, M. (2020). Robot Modeling and Control (2nd ed.). Wiley. Chapter 6.
- Murray, R. M., Li, Z., & Sastry, S. S. (1994). A Mathematical Introduction to Robotic Manipulation. CRC Press.
- Featherstone, R. (2008). Rigid Body Dynamics Algorithms. Springer. (For RNEA and ABA extensions.)