Domain B — Analytical & Lagrangian Dynamics

Generalized coordinates, constraints, and the foundations of Lagrangian / Hamiltonian methods.

← Back to Advanced Domains (A–E)

Domain B.3 — Lagrangian Dynamics

A conceptual bridge from d’Alembert’s principle to the Euler–Lagrange equations, and to the matrix forms used in multibody dynamics, robotics, and spacecraft modelling.

1. Why Lagrangian Dynamics? (Motivation)

At the end of Domain B.2 we obtained d’Alembert’s principle: for a system of $N$ particles the difference between applied and inertial forces does no virtual work along admissible virtual displacements:

\[ \sum_{i=1}^{N} \bigl(\mathbf{f}_i - m_i \ddot{\mathbf{R}}_i\bigr)\cdot \delta \mathbf{R}_i = 0 . \]

This automatically eliminates constraint forces, but everything is expressed in terms of particle positions $\mathbf{R}_i$, virtual displacements $\delta\mathbf{R}_i$, and partial velocities. For real mechanisms or spacecraft this becomes algebraically heavy.

Lagrange’s key idea is to stop working directly with forces and instead work with energies. We introduce generalized coordinates $\mathbf{q} = (q_1,\dots,q_n)$ that completely describe the configuration. Then:

All conservative mechanics is wrapped into a single scalar function

\[ L(\mathbf{q}, \dot{\mathbf{q}}, t) \equiv T(\mathbf{q}, \dot{\mathbf{q}}, t) - V(\mathbf{q}, t), \]

called the Lagrangian. From this one scalar we can recover the full set of equations of motion.

2. From d’Alembert to Generalized Equations of Motion

From B.2 we already know how to project Newton’s law onto generalized coordinates. For each coordinate $q_j$,

\[ \sum_{i=1}^{N} m_i \ddot{\mathbf{R}}_i \cdot \frac{\partial \mathbf{R}_i}{\partial q_j} = \sum_{i=1}^{N} \mathbf{f}_i \cdot \frac{\partial \mathbf{R}_i}{\partial q_j} \equiv Q_j , \]

where $Q_j$ is the generalized force associated with $q_j$. The left-hand side is a generalized “inertial force” and can be expressed purely in terms of the kinetic energy. Using the chain rule and

\[ T = \frac{1}{2}\sum_{i=1}^{N} m_i \dot{\mathbf{R}}_i\cdot\dot{\mathbf{R}}_i , \]

one can show the key identity

\[ \sum_{i=1}^{N} m_i \ddot{\mathbf{R}}_i \cdot \frac{\partial \mathbf{R}_i}{\partial q_j} = \frac{d}{dt}\!\left(\frac{\partial T}{\partial \dot{q}_j}\right) - \frac{\partial T}{\partial q_j}. \]

Substituting this into the generalized form of d’Alembert’s principle gives

\[ \frac{d}{dt}\!\left(\frac{\partial T}{\partial \dot{q}_j}\right) - \frac{\partial T}{\partial q_j} = Q_j, \qquad j = 1,\dots,n. \]

So the dynamics of the system can be obtained by differentiating the kinetic energy with respect to the generalized coordinates and their time rates, and equating this to the generalized forces.

3. Lagrangian and the Euler–Lagrange Equation

For conservative forces, the generalized forces arise from a scalar potential $V(\mathbf{q}, t)$. In that case

\[ Q_j^{(\text{cons})} = -\frac{\partial V}{\partial q_j}. \]

Define the Lagrangian

\[ L(\mathbf{q}, \dot{\mathbf{q}}, t) = T(\mathbf{q}, \dot{\mathbf{q}}, t) - V(\mathbf{q}, t). \]

Then

\[ \frac{\partial L}{\partial \dot{q}_j} = \frac{\partial T}{\partial \dot{q}_j}, \qquad \frac{\partial L}{\partial q_j} = \frac{\partial T}{\partial q_j} - \frac{\partial V}{\partial q_j}. \]

Substituting these into the generalized kinetic-energy equation and using $Q_j = -\partial V/\partial q_j$ yields the Euler–Lagrange equations:

\[ \frac{d}{dt}\!\left(\frac{\partial L}{\partial \dot{q}_j}\right) - \frac{\partial L}{\partial q_j} = 0, \qquad j = 1,\dots,n. \]

For a conservative mechanical system, these are fully equivalent to Newton’s laws, but written entirely in terms of generalized coordinates and energies.

4. Including Non-Conservative Forces

Real systems almost always include forces that cannot be represented by a potential function, such as friction, aerodynamic drag, actuator torques, and externally applied disturbances.

Let $\mathbf{f}_{\text{nc},i}$ denote the non-conservative force on the $i$-th particle. Its contribution to the generalized force associated with $q_j$ is

\[ Q_{\text{nc},j} = \sum_{i=1}^{N} \mathbf{f}_{\text{nc},i}\cdot \frac{\partial \mathbf{R}_i}{\partial q_j}. \]

The total generalized force is then

\[ Q_j = -\frac{\partial V}{\partial q_j} + Q_{\text{nc},j}. \]

The Euler–Lagrange equations generalize to

\[ \frac{d}{dt}\!\left(\frac{\partial L}{\partial \dot{q}_j}\right) - \frac{\partial L}{\partial q_j} = Q_{\text{nc},j}, \qquad j = 1,\dots,n. \]

Interpretation:

5. Quadratic Kinetic Energy and the Mass Matrix

For most mechanical systems the kinetic energy is quadratic in the generalized speeds $\dot{\mathbf{q}}$:

\[ T(\mathbf{q}, \dot{\mathbf{q}}, t) = \frac{1}{2}\,\dot{\mathbf{q}}^{T} \mathbf{M}(\mathbf{q}, t)\,\dot{\mathbf{q}} + T_1(\mathbf{q}, t, \dot{\mathbf{q}}) + T_0(\mathbf{q}, t), \]

where $\mathbf{M}(\mathbf{q}, t)$ is the symmetric positive-definite mass matrix, $T_1$ is at most linear in $\dot{\mathbf{q}}$ (often zero in inertial frames), and $T_0$ is independent of $\dot{\mathbf{q}}$.

In many common cases we can ignore $T_1$ and $T_0$ and simply write

\[ T = \frac{1}{2}\,\dot{\mathbf{q}}^{T} \mathbf{M}(\mathbf{q})\,\dot{\mathbf{q}}. \]

The mass-matrix entries are

\[ M_{ij}(\mathbf{q}) = \frac{\partial^2 T}{\partial \dot{q}_i\,\partial \dot{q}_j}. \]

Using this structure, the Euler–Lagrange equations can be rearranged into the familiar matrix form

\[ \mathbf{M}(\mathbf{q})\,\ddot{\mathbf{q}} + \mathbf{C}(\mathbf{q}, \dot{\mathbf{q}})\,\dot{\mathbf{q}} + \nabla_{\mathbf{q}} V(\mathbf{q}) = \mathbf{Q}_{\text{nc}}(\mathbf{q}, \dot{\mathbf{q}}, t), \]

where:

This is the form you will see in robotics, spacecraft attitude dynamics, and multibody simulation libraries.

6. Special Structures: Quasi & Cyclic Coordinates

6.1 Quasi-Coordinates and Velocity-Based Descriptions

Sometimes it is more natural to describe motion using generalized velocities such as body-fixed angular velocities instead of the coordinate rates $\dot{\mathbf{q}}$. Suppose the generalized speeds are related to some alternative velocity variables $\boldsymbol{\omega}$ by

\[ \dot{\mathbf{q}} = \mathbf{D}(\mathbf{q})\,\boldsymbol{\omega}. \]

One can construct a kinetic energy $T(\mathbf{q}, \boldsymbol{\omega})$ and derive modified Lagrange equations in which derivatives are taken with respect to $\boldsymbol{\omega}$ instead of $\dot{\mathbf{q}}$. The resulting equations (Boltzmann–Hamel or quasi-coordinate equations) are particularly convenient for rigid-body dynamics where angular velocities are more natural than Euler-angle rates.

6.2 Cyclic (Ignorable) Coordinates and Routh Reduction

A generalized coordinate $q_k$ is cyclic (or ignorable) if it does not appear explicitly in the Lagrangian:

\[ \frac{\partial L}{\partial q_k} = 0. \]

The Euler–Lagrange equation then reduces to

\[ \frac{d}{dt}\!\left(\frac{\partial L}{\partial \dot{q}_k}\right) = 0, \]

so its conjugate momentum $p_k \equiv \partial L/\partial \dot{q}_k$ is constant. Cyclic coordinates therefore correspond to conserved quantities (linear momentum, angular momentum, etc.), and spotting them early can dramatically simplify a problem.

Routh’s procedure goes one step further: for systems with some cyclic and some non-cyclic coordinates, it constructs a reduced Lagrangian (the Routhian) that depends only on the non-cyclic coordinates, with the conserved momenta treated as constants. The resulting equations of motion have lower dimension and are often much easier to handle.

7. Summary Box — Lagrangian Dynamics at a Glance

This single recipe covers everything from a simple pendulum to a multibody spacecraft with flexible appendages. Domain B.4 will build on this by shifting from $L = T - V$ to the Hamiltonian $H = T + V$, leading to canonical state-space formulations and phase-space geometry.

Next in Domain B

Domain B.4 — Extended Hamilton’s Principle for Hybrid Systems →

← Domain B.2 — d’Alembert’s Principle

← Back to Domain B overview