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
For a robotic manipulator or any articulated mechanism with
Where:
-
$q \in \mathbb{R}^n$ — generalized coordinates (joint angles/positions) -
$\dot{q}, \ddot{q}$ — generalized velocities and accelerations -
$M(q) \in \mathbb{R}^{n \times n}$ — mass (inertia) matrix, symmetric positive definite -
$C(q, \dot{q})\dot{q} \in \mathbb{R}^n$ — Coriolis and centrifugal terms -
$g(q) \in \mathbb{R}^n$ — gravitational terms -
$\tau \in \mathbb{R}^n$ — generalized forces/torques (inputs)
This formulation supports two fundamental computations:
-
Forward dynamics: given torques
$\tau$ , compute accelerations$\ddot{q} = M^{-1}(\tau - C\dot{q} - g)$ -
Inverse dynamics: given desired accelerations
$\ddot{q}$ , compute required torques$\tau = M\ddot{q} + C\dot{q} + g$
The Lagrangian of a system is defined as:
where
The Euler-Lagrange equation for coordinate
For a rigid-body system, kinetic energy takes the form:
Applying the Euler-Lagrange equation to this quadratic form yields the standard manipulator equation:
The mass matrix is always symmetric (
- The forward dynamics linear system
$M\ddot{q} = f$ always has a unique solution - Physical kinetic energy is always non-negative
The Coriolis matrix captures velocity-dependent forces using Christoffel symbols of the first kind:
A key property:
where
| Operation | Time | Space | Notes |
|---|---|---|---|
| Forward dynamics | Dominated by |
||
| Inverse dynamics | Matrix-vector multiplication |
||
| Model evaluation | Model-dependent | Computing |
For systems with
A point mass
System parameters:
Model matrices:
$M(q) = ml^2 = 1.0$ -
$C(q, \dot{q})\dot{q} = 0$ (single DOF → no Coriolis) $g(q) = mgl\sin(q) = 9.81\sin(q)$
Forward dynamics at
Inverse dynamics for holding position (
For a 2-DOF arm with equal links (
At rest (
-
$\sin(q_1) = 0$ ,$\sin(q_1 + q_2) = 0$ -
$g = [0, 0]^T$ → gravity terms vanish when links hang vertically - Forward dynamics with
$\tau = 0$ produces$\ddot{q} = [0, 0]^T$ (equilibrium)
- 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
$[-1, 1)$ range of Q15/Q31 formats. Usefloatunless inputs are carefully scaled. -
Coriolis computation: The choice of Coriolis parameterization (Christoffel vs. factored form) affects the skew-symmetry property of
$\dot{M} - 2C$ . The interface returns the product$C(q,\dot{q})\dot{q}$ 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.
| Variant | Trade-off | Use Case |
|---|---|---|
| Euler-Lagrange (this) |
|
Small systems ( |
| Newton-Euler | Body-by-body force balance | Single rigid bodies, intuitive for simple systems |
| Recursive Newton-Euler (RNEA) |
|
Large kinematic chains, real-time control |
| Articulated Body Algorithm (ABA) |
|
Large chains, simulation |
| Hamiltonian formulation | Phase-space, symplectic integration | Long-horizon simulation, energy preservation |
- 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
-
Gaussian Elimination (GaussianElimination.md): Used internally to solve
$M\ddot{q} = f$ in forward dynamics -
LQR Controller (Lqr.md): Euler-Lagrange dynamics can be linearized to produce the
$(A, B)$ 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
- 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.)