Skip to main content

2  DAE

Author
Affiliation

Enrico Bertolazzi

University of Trento, Department of Industrial Engineering

Everything needed to find the index of a DAE, reduce it to an ODE plus invariants, and set up constrained mechanics. Numerical methods (consistent initialization, weighted projection, impact re-initialization, order reduction) are in the companion volume Numerical Methods.

Colors: \color{RoyalBlue}\text{differential equations}, \color{Brown}\text{algebraic equations, constraints, hidden constraints}, \color{OrangeRed}\text{initial and consistency conditions}, \color{Crimson}\text{labels}.

2.1 Linear DAEs

Problem. \color{RoyalBlue}\bm E\dot{\bm x}(t)=\bm A\bm x(t)+\bm f(t),\qquad \bm E,\bm A\in\mathbb R^{n\times n}\ \text{constant} \tag{2.1}

\bm E meaning initial data
\det\bm E\ne0 ODE \dot{\bm x}=\bm E^{-1}\bm A\bm x+\bm E^{-1}\bm f, index 0 (piecewise continuous \bm f: unique solution) all of \bm x(0) free
\bm E=\bm0 algebraic system \bm A\bm x=-\bm f \bm A invertible: \bm x(0) fixed by \bm f(0)
singular, \ne\bm0 genuine DAE, possible hidden constraints depends on the pencil

Regular pencil. (\bm E,\bm A) is regular iff \det(\bm A-\lambda_0\bm E)\ne0 for some \lambda_0\in\mathbb R. A singular pencil loses uniqueness or existence.

Weierstrass form. The pencil is regular iff there are invertible \bm P,\bm Q with (\bm P\bm E\bm Q,\ \bm P\bm A\bm Q)= \left( \begin{bmatrix}{\color{Brown}\bm N}&0\\0&\bm I\end{bmatrix}, \begin{bmatrix}\bm I&0\\0&{\color{RoyalBlue}\bm J}\end{bmatrix} \right)

  • \bm N upper triangular nilpotent (any upper triangular matrix with zero diagonal is nilpotent), \bm N^{\nu}=\bm0, \nu the smallest such integer (the degree): blocks at the eigenvalue 0 of \bm E (eigenvalues at infinity, algebraic part).
  • \bm J in Jordan form: finite generalized eigenvalues (differential part).

Decoupling. With \bm z=\bm Q^{-1}\bm x=(\bm z_1;\bm z_2) and \bm g=\bm P\bm f=(\bm g_1;\bm g_2): \left\{ \begin{aligned} {\color{Brown}\bm N\dot{\bm z}_1}&{\color{Brown}=\bm z_1+\bm g_1(t)} && \text{\color{Crimson}algebraic block}\\[0.5em] {\color{RoyalBlue}\dot{\bm z}_2}&{\color{RoyalBlue}=\bm J\bm z_2+\bm g_2(t)} && \text{\color{Crimson}differential block} \end{aligned} \right. \left\{ \begin{aligned} {\color{RoyalBlue}\bm z_2(t)}&{\color{RoyalBlue}=\mathrm e^{\bm Jt}\bm z_2(0)+\int_0^t\mathrm e^{\bm J(t-\tau)}\bm g_2(\tau)\,\mathrm d\tau} && \text{\color{Crimson}variation of constants}\\[0.5em] {\color{Brown}\bm z_1(t)}&{\color{Brown}=-\sum_{k=0}^{\nu-1}\bm N^k\bm g_1^{(k)}(t)} && \text{\color{Crimson}algebraic solution}\\[0.5em] \bm x(t)&=\bm Q\bm z(t) \end{aligned} \right.

Index. Kronecker index =\nu (the largest nilpotent Jordan block); \bm E invertible means index 0. The highest derivative of \bm g_1 needed is \nu-1.

index nilpotency highest derivative of the forcing
0 no algebraic block not applicable
1 \bm N=\bm0 0
2 \bm N^2=\bm0 1
\nu \bm N^\nu=\bm0 \nu-1

Solvability and consistent initial values. The problem with \bm x(0)=\bm x_0 has a solution if (a) (\bm E,\bm A) is regular; (b) \bm g_2 is locally integrable (piecewise continuous suffices) and \bm g_1 has the derivatives through order \nu-1 (more smoothness for a classical C^1 solution); (c) \bm x_0 is consistent: {\color{OrangeRed}\bm x_0=\bm Q\begin{bmatrix} -\displaystyle\sum_{k=0}^{\nu-1}\bm N^k\bm g_1^{(k)}(0)\\ \bm z_2(0) \end{bmatrix}}\qquad \text{\color{Crimson}algebraic block fixed, differential block free}

Recipe (typical exercise: analyze \bm E\dot{\bm x}=\bm A\bm x+\bm f, find the index, reduce).

  1. \det\bm E\ne0: ODE, index 0, stop.
  2. Test regularity, \det(\bm A-\lambda\bm E)\not\equiv0; otherwise uniqueness or existence is lost.
  3. Bring the pencil to Weierstrass form and read \bm N, \bm J.
  4. Index =\nu, the smallest integer with \bm N^\nu=\bm0.
  5. Solve the differential block by variation of constants and the algebraic block by \bm z_1=-\sum_{k=0}^{\nu-1}\bm N^k\bm g_1^{(k)}; then \bm x=\bm Q\bm z.
  6. Build a consistent \bm x_0 (algebraic block fixed, \bm z_2(0) free) and check that \bm g_1 has \nu-1 derivatives.

Watch out.

  • Sign convention: here \bm E\dot{\bm x}=\bm A\bm x+\bm f (Equation 2.1). The next section (Gauss reduction) uses \bm E\bm x'+\bm A\bm x=\bm f (Equation 2.2), the opposite sign of \bm A; the regularity test there reads \det(\bm A+\lambda_0\bm E)\ne0.
  • Algebraic blocks written as \bm N\dot{\bm z}+\bm z=\bm g (opposite to the decoupled equation above) have solution \bm z=\sum_{k=0}^{\nu-1}(-1)^k\bm N^k\bm g^{(k)}.
  • Singular \bm E does not imply a singular pencil. With a singular pencil the solution is not unique: \bm E=\mathrm{diag}(1,0), \bm A=\begin{bmatrix}0&1\\0&0\end{bmatrix}, \bm f=\bm0 reads \dot x_1=x_2; with \bm x(0)=\bm0 every C^1 function \varphi, \varphi(0)=0, gives a solution x_2=\varphi, x_1=\int_0^t\varphi.
  • For \nu\ge1 an arbitrary \bm x(0) is not consistent: check (c) before claiming a solution.

2.2 Index Reduction for Linear DAEs

Jordan forms are not numerically stable; Gaussian elimination gives the same structure.

Problem (sign of \bm A opposite to the previous section). \color{RoyalBlue}\bm E\bm x'+\bm A\bm x=\bm f(t),\qquad \bm E,\bm A\in\mathbb R^{n\times n} \tag{2.2}

Rank-revealing LU of \bm E, k=\operatorname{rank}\bm E (\bm L unit lower triangular k\times k, \bm U upper triangular k\times k with nonzero diagonal): \begin{aligned} \bm P_L\bm E\bm P_R&= \begin{pmatrix}\bm L&\bm0\\\bm M&\bm I\end{pmatrix} \begin{pmatrix}\bm U&\bm K\\\bm0&\bm0\end{pmatrix}, \\ \bm Q^T&=\begin{pmatrix}\bm L^{-1}&\bm0\\-\bm M\bm L^{-1}&\bm I\end{pmatrix}\bm P_L \ \Rightarrow\ \bm Q^T\bm E=\begin{pmatrix}\bm U&\bm K\\\bm0&\bm0\end{pmatrix}\bm P_R^T \end{aligned} The last n-k rows of \bm Q^T\bm E vanish. Write \bm Q^T=(\bm Q_d^T;\bm Q_a^T), so \bm Q_a^T\bm E=\bm0 (\bm Q_a is a basis of \mathcal N(\bm E^T)). No explicit null-space basis is needed.

Recipe (loop separate, file, differentiate; each pass lowers the index by one).

  1. If \det\bm E\ne0: ODE, index 0, stop.
  2. Factorize \bm E and apply the same \bm Q^T to \bm A and \bm f: \left\{ \begin{aligned} {\color{RoyalBlue}\bm E_d\bm x'+\bm A_d\bm x}&{\color{RoyalBlue}=\bm f_d} && \text{\color{Crimson}differential rows}\\[0.5em] {\color{Brown}\bm A_a\bm x}&{\color{Brown}=\bm f_a(t)} && \text{\color{Crimson}algebraic rows} \end{aligned} \right. with \bm E_d=\bm Q_d^T\bm E, \bm A_d=\bm Q_d^T\bm A, \bm f_d=\bm Q_d^T\bm f, \bm A_a=\bm Q_a^T\bm A, \bm f_a=\bm Q_a^T\bm f.
  3. File the algebraic rows as hidden constraints: \color{OrangeRed}\bm A_a\bm x=\bm f_a must hold for \bm x(0).
  4. Differentiate them, \bm A_a\bm x'=\bm f_a', and stack under the differential rows: \widetilde{\bm E}=\begin{pmatrix}\bm E_d\\{\color{Brown}\bm A_a}\end{pmatrix},\quad \widetilde{\bm A}=\begin{pmatrix}\bm A_d\\\bm0\end{pmatrix},\quad \widetilde{\bm f}=\begin{pmatrix}\bm f_d\\{\color{Brown}\bm f_a'}\end{pmatrix} Return to step 1 with \widetilde{\bm E},\widetilde{\bm A},\widetilde{\bm f}.
  5. When \widetilde{\bm E} is nonsingular: ODE \bm x'=-\widetilde{\bm E}^{-1}\widetilde{\bm A}\bm x+\widetilde{\bm E}^{-1}\widetilde{\bm f}. Index = number of differentiations (step 4); for a regular pencil it equals the nilpotency degree \nu.
  6. The initial condition must satisfy the algebraic equations of every pass (the original ones and the hidden ones): \bm x(0) is only partly free.

Invariants. \bm\Psi(\bm x,t) is an invariant (hidden constraint) of \bm x'=\bm F(\bm x,t) iff along solutions \color{Brown}\frac{\mathrm d}{\mathrm dt}\bm\Psi(\bm x(t),t)=\frac{\partial\bm\Psi}{\partial\bm x}\bm F(\bm x,t)+\frac{\partial\bm\Psi}{\partial t}\equiv\bm0 so its value is fixed by the initial condition. Index reduction never discards algebraic equations: it files them as invariants of the resulting ODE, which has more solutions than the DAE.

Watch out.

  • The rank of \widetilde{\bm E} need not increase after one differentiation: keep the differential rows \bm E_d (as in step 4). Rank progression alone is not an index theorem; the loop gives the Kronecker index only under regularity and rank assumptions.
  • The separation is by type of equation, not by variable: \bm A_a still couples all unknowns.
  • ODEs have invariants too (x^2+y^2 for \dot x=y, \dot y=-x) and numerical methods do not preserve them: explicit Euler gives \|\bm v_{k+1}\|\ge\|\bm v_k\|, implicit Euler \|\bm v_{k+1}\|\le\|\bm v_k\|, for every step size. The remedy is projection, Baumgarte stabilization or a structure-preserving method, not a smaller step.

2.3 The Differential Index

Problem. \color{RoyalBlue}\bm F(\bm x,\bm x',t)=\bm0, \bm x\in\mathbb R^n, with \bm F_{\bm x'} singular (some combinations of equations contain no \bm x').

Derivative array. A system of (q+1)n equations in \bm x',\dots,\bm x^{(q+1)} for fixed (\bm x,t): {\color{RoyalBlue}\bm{\mathcal F}_q(\bm x,\bm x',\dots,\bm x^{(q+1)},t) =\begin{pmatrix}\bm F\\ \frac{\mathrm d}{\mathrm dt}\bm F\\ \vdots\\ \frac{\mathrm d^q}{\mathrm dt^q}\bm F\end{pmatrix}=\bm0}

Differentiation index. The least q\ge0 such that \bm{\mathcal F}_q=\bm0 determines \bm x' locally and uniquely as a function of (\bm x,t), i.e. yields the underlying ODE \bm x'=\bm G(\bm x,t). An explicit ODE has index 0. It presumes constant rank of the Jacobians involved; otherwise the index may be undefined or vary along a trajectory.

Recipe on a given system.

  1. Write the derivatives of all equations row by row, up to order q (row k is the k-th time derivative of each equation).
  2. Increase q until \bm x' is determined for every component of \bm x; eliminate \bm x'',\dots,\bm x^{(q+1)} by substitution and linear combinations.
  3. Classify the rows: used for the ODE (they give \bm x'=\bm G); invariants (relations between \bm x and t only: the original algebraic equations and the hidden ones; they characterize the consistent initial values); discarded (not needed, they hold automatically).
  4. The DAE is equivalent to the underlying ODE together with its invariants, not to the ODE alone.
Index by the derivative array.
system index q invariants underlying ODE
x'=-x 0 none x'=-x
x'=-y,\ 0=x+y-\sin t 1 \color{Brown}x+y-\sin t=0 x'=-y,\ y'=y+\cos t
0=x-\sin t,\ 0=x'+y 2 \color{Brown}x-\sin t=0,\ y+\cos t=0 x'=\cos t,\ y'=\sin t
x'=y,\ 0=x 2 \color{Brown}x=0,\ y=0 x'=y,\ y'=0
x'=y,\ y'=z,\ 0=x 3 \color{Brown}x=0,\ y=0,\ z=0 x'=y,\ y'=z,\ z'=0

Other notions of index (they agree on important regular classes, not in general).

  • Perturbation index: how derivatives of a residual perturbation enter the error estimate; depends on the perturbation model and norms.
  • Tractability index: a sequence of projectors separating differential and algebraic directions.
  • Strangeness index: derivative arrays and rank-revealing transformations; also for time-varying and over- or underdetermined systems.
  • Differentiation vs. Kronecker/nilpotency index: equal for a regular constant-coefficient pencil (ODE has index 0); do not transfer to singular pencils or nonlinear DAEs without a separate theorem.

For a regular constant-coefficient pencil of Kronecker index \nu\ge1:

Index notions for a regular pencil, \nu\ge1 (standard results of the respective theories, not derived here; conventions for \nu=0 differ).
differentiation perturbation tractability strangeness
\nu \nu \nu \nu-1

Watch out. The index is a property of the specified formulation; rewriting \bm F(\bm x,\bm x',t)=\bm0 may change it (see Section 2.4).

2.4 Semi-Explicit Form and Its Classification

Problem (\bm x differential variables, \bm y algebraic variables; write \bm g_{\bm y}=\partial\bm g/\partial\bm y, etc.). {\color{RoyalBlue}\bm x'=\bm f(\bm x,\bm y,t)},\qquad {\color{Brown}\bm 0=\bm g(\bm x,\bm y,t)}

From implicit form. For \bm F(\bm x,\bm x',t)=\bm0: if \bm F_{\bm x'} is nonsingular, the implicit function theorem gives an ODE \bm x'=\bm f(\bm x,t). Otherwise set \bm v=\bm x': {\color{RoyalBlue}\bm x'=\bm v},\qquad {\color{Brown}\bm0=\bm F(\bm x,\bm v,t)}

Implicit function theorem. If \bm g_{\bm y} is nonsingular at \bm g=\bm0, locally \bm y=\bm\phi(\bm x,t) with \bm\phi_{\bm x}=-\bm g_{\bm y}^{-1}\bm g_{\bm x}, \bm\phi_t=-\bm g_{\bm y}^{-1}\bm g_t.

Index tests. Which Jacobian (or product) must be nonsingular:

Index classification of semi-explicit DAEs (\bm z is the algebraic variable of the last row).
index system nonsingular matrix invariants of the reduced ODE
1 \bm x'=\bm f(\bm x,\bm y,t), \ \bm0=\bm g(\bm x,\bm y,t) \bm g_{\bm y} \color{Brown}\bm g=\bm0
2 \bm x'=\bm f(\bm x,\bm y,t), \ \bm0=\bm g(\bm x,t) \bm g_{\bm x}\bm f_{\bm y} \color{Brown}\bm g=\bm0,\ \bm h:=\bm g_{\bm x}\bm f+\bm g_t=\bm0
3 \bm x'=\bm f(\bm x,\bm y,\bm z,t), \ \bm y'=\bm g(\bm x,\bm y,t), \ \bm0=\bm h(\bm y,t) \bm h_{\bm y}\bm g_{\bm x}\bm f_{\bm z} \color{Brown}\bm h=\bm0,\ \bm a:=\bm h_{\bm y}\bm g+\bm h_t=\bm0,\ \dot{\bm a}=\bm0

Recipe (read the index without reducing).

  1. Differentiate the constraint along the flow, substituting \bm x'=\bm f (and \bm y'=\bm g if present).
  2. If the algebraic variable is absent from the result, differentiate again.
  3. Stop at the first of \bm g,\dot{\bm g},\ddot{\bm g},\dots that contains the algebraic variable with a nonsingular Jacobian. Index = (number of differentiations of the constraint) +1.
  4. Index 1: one more differentiation gives \bm y'=-\bm g_{\bm y}^{-1}(\bm g_t+\bm g_{\bm x}\bm f). Index 2: \bm h has \bm h_{\bm y}=\bm g_{\bm x}\bm f_{\bm y}.

Hessenberg form of size r. \left\{ \begin{aligned} {\color{RoyalBlue}\dot{\bm x}_i}&{\color{RoyalBlue}=\bm f_i(\bm x_1,\ldots,\bm x_{i+1},t)},\quad i=1,\ldots,r-1\\ {\color{Brown}\bm0}&{\color{Brown}=\bm g(\bm x_1,t)} \end{aligned} \right. \frac{\partial\bm g}{\partial\bm x_1} \frac{\partial\bm f_1}{\partial\bm x_2} \frac{\partial\bm f_2}{\partial\bm x_3}\cdots \frac{\partial\bm f_{r-1}}{\partial\bm x_r} \ \text{nonsingular}\ \Longrightarrow\ \text{differentiation index}=r r=2 is the index-2 test; r=3 is the index-3 test with \bm x_1=\bm y, \bm x_2=\bm x, \bm x_3=\bm z. Index 1 is the degenerate case \bm0=\bm g(\bm x_1,\bm x_2,t) with \bm g_{\bm x_2} nonsingular.

Constrained mechanics is Hessenberg of size 3 (\bm x_1=\bm q, \bm x_2=\bm v, \bm x_3=\bm\lambda; \bm G=\partial\bm\Phi/\partial\bm q): \left\{ \begin{aligned} {\color{RoyalBlue}\dot{\bm q}}&{\color{RoyalBlue}=\bm v}\\ {\color{RoyalBlue}\bm M(\bm q)\dot{\bm v}}&{\color{RoyalBlue}=\bm F(\bm q,\bm v,t)-\bm G(\bm q)^T\bm\lambda}\\ {\color{Brown}\bm0}&{\color{Brown}=\bm\Phi(\bm q)} \end{aligned} \right. \qquad \bm G\,\bm I\,(-\bm M^{-1}\bm G^T)=-\bm G\bm M^{-1}\bm G^T For \bm M positive definite the chain is nonsingular iff \bm G has full row rank: then the system has index 3. Here \bm\lambda has the opposite sign to Equation 2.4, and \bm G=\bm\Phi_{\bm q} is unrelated to \bm G(\bm x,t) of the general DAE.

Watch out.

  • \bm v=\bm x' is not an index-preserving simplification: it typically raises the index by one.
  • Index 2 has two invariants, each weaker than the previous one: a numerical trajectory can satisfy \bm h=\bm0 to machine precision and still drift from \bm g=\bm0.
  • For consistent initial values at index 1, solve \bm g(\bm x_0,\bm y_0,t_0)=\bm0 for \bm y_0; this fails where \bm g_{\bm y} is singular. At index 2 choose \bm x_0 with \bm g(\bm x_0,t_0)=\bm0 and solve \bm h(\bm x_0,\bm y_0,t_0)=\bm0 for \bm y_0 (implicit function theorem, \bm h_{\bm y}=\bm g_{\bm x}\bm f_{\bm y}).

2.5 General Index Reduction

Problem. Covers every semi-explicit system (\bm E=\mathrm{diag}(\bm I,\bm0)) and the linear DAE \bm E\bm x'+\bm A\bm x=\bm f (Equation 2.2; \bm E constant, \bm G=\bm f-\bm A\bm x). \color{RoyalBlue}\bm E(\bm x,t)\,\dot{\bm x}=\bm G(\bm x,t),\qquad \bm E:\mathbb R^n\times\mathbb R\to\mathbb R^{n\times n} \tag{2.3}

Cases for Equation 2.3.
case consequence
\bm E(\bm x,t) nonsingular ODE \dot{\bm x}=\bm E^{-1}\bm G, index 0 (factorize, do not invert)
\bm E\equiv\bm0 \bm0=\bm G(\bm x,t); if \bm G_{\bm x} is nonsingular, \dot{\bm x}=-\bm G_{\bm x}^{-1}\bm G_t; \bm G=\bm0 is an invariant; \color{OrangeRed}\bm x(0) must solve \bm G(\bm x(0),0)=\bm0
\bm E singular, \ne\bm0 genuine DAE: the rank may depend on (\bm x,t), every statement is local

Row-only rank-revealing factorization (\bm P permutation, \bm L unit lower triangular, \bm M_1 of full row rank k=\operatorname{rank}\bm E): \bm P\bm E=\bm L\begin{pmatrix}\bm M_1\\\bm0\end{pmatrix} \quad\Rightarrow\quad \bm T=\bm L^{-1}\bm P,\qquad \bm T\bm E=\begin{pmatrix}\bm M_1\\\bm0\end{pmatrix} Multiplying the DAE by \bm T keeps the solution set and separates the algebraic rows. Recompute the factorization at every pass; never form \bm L^{-1} (forward substitution). By hand: row operations on the table [\bm E\mid\bm G] (swap, add a multiple of a row, scale) until the zero rows of \bm E appear.

Recipe (nonlinear index reduction).

  1. Matrix form \bm E(\bm x,t)\bm x'=\bm G(\bm x,t). An implicit DAE \bm f(\bm x,\bm x',t)=\bm0 is first written in semi-explicit form with \bm y=\bm x' (Section 2.4).
  2. If \det\bm E\ne0: ODE, index 0, stop.
  3. Separate with \bm Q^T=(\bm Q_d^T;\bm Q_a^T): \bm Q_a a basis of \mathcal N(\bm E^T) (\bm Q_a^T\bm E=\bm0), \bm Q_d completing it so that \bm Q=(\bm Q_d,\bm Q_a) is nonsingular (equivalently the last rows of \bm T give \bm Q_a^T): \left\{ \begin{aligned} {\color{RoyalBlue}\bm E_d\bm x'}&{\color{RoyalBlue}=\bm G_d} && \text{\color{Crimson}differential rows}\\[0.5em] {\color{Brown}\bm0}&{\color{Brown}=\bm G_a(\bm x,t)} && \text{\color{Crimson}algebraic rows (invariant)} \end{aligned} \right. with \bm E_d=\bm Q_d^T\bm E, \bm G_d=\bm Q_d^T\bm G, \bm G_a=\bm Q_a^T\bm G.
  4. Differentiate the algebraic rows, \bm G_a^t+\bm G_a^x\bm x'=\bm0 (superscripts: partial derivatives in t and \bm x): \widetilde{\bm E}\bm x'=\widetilde{\bm G},\qquad \widetilde{\bm E}=\begin{pmatrix}\bm E_d\\{\color{Brown}-\bm G_a^x}\end{pmatrix},\quad \widetilde{\bm G}=\begin{pmatrix}\bm G_d\\{\color{Brown}\bm G_a^t}\end{pmatrix}
  5. Repeat from step 2 until \widetilde{\bm E} is invertible. Index = number of times step 4 was performed. The equations \bm G_a=\bm0 of every pass are kept as invariants.

Watch out.

  • Requires \bm E(\bm x,t) of constant rank on the domain; otherwise the index changes along the trajectory.
  • The permutation is not cosmetic: \bm P depends on (\bm x,t) through the pivot choice, and the “zero” rows are zero only within a tolerance. The separation is a numerical rank decision; near a point where the rank of \bm E changes no factorization makes the choice for you.

2.6 Dummy Variables

Differentiated constraints replace the original ones (stored as invariants) instead of enlarging the system.

Requirements. Semi-explicit form with differential variables \bm x_d\in\mathbb R^{n_d} and algebraic variables \bm x_a\in\mathbb R^{n_a}, n_d+n_a=n: {\color{RoyalBlue}\bm x_d'=\bm f(\bm x_d,\bm x_a,t)},\qquad {\color{Brown}\bm0=\bm g(\bm x_d,\bm x_a,t)}

Regularity condition: \bm x_a appears linearly, \bm f=\bm f_0(\bm x_d,t)+\bm A(\bm x_d,t)\bm x_a, \bm g=\bm g_0(\bm x_d,t)+\bm B(\bm x_d,t)\bm x_a. Algebraic variables are linear \bm x_l (linear or absent from the constraints) or nonlinear \bm x_n.

Preprocessing.

  1. Implicit DAE: variables whose derivative appears are differential, the others algebraic; each derivative occurring inside an equation is replaced by a new algebraic variable \bm w with \bm x'=\bm w.
  2. If \bm x_n\ne\emptyset: introduce \bm x_n'=\bm v_n; reclassify as new differential (\bm x_d,\bm x_n), new algebraic (\bm x_l,\bm v_n).
  3. The DAE now has the form {\color{RoyalBlue}\bm x_d'=\bm f(\bm x_d,t)+\bm A(\bm x_d,t)\bm x_a},\qquad {\color{Brown}\bm0=\bm g(\bm x_d,t)+\bm B(\bm x_d,t)\bm x_a}

Recipe (reduction on \bm B(\bm x_d,t)\bm x_a=-\bm g(\bm x_d,t)).

  1. If \det\bm B\ne0: index 1, \bm x_a=-\bm B^{-1}\bm g, stop. Otherwise continue.
  2. Let r=\operatorname{rank}\bm B, \bm Q_a a basis of \mathcal N(\bm B^T) (\bm Q_a^T\bm B=\bm0), \bm Q_d completing \bm Q=(\bm Q_d,\bm Q_a) to a nonsingular matrix. Multiply the constraints by \bm Q^T: \left\{ \begin{aligned} {\color{Brown}\bm B_d\bm x_a}&{\color{Brown}=-\bm g_d} && \text{\color{Crimson}part with algebraic variables}\\[0.5em] {\color{Brown}\bm g_a(\bm x_d,t)}&{\color{Brown}=\bm0} && \text{\color{Crimson}part free of algebraic variables, hidden constraint} \end{aligned} \right. with \bm B_d=\bm Q_d^T\bm B, \bm g_d=\bm Q_d^T\bm g, \bm g_a=\bm Q_a^T\bm g.
  3. Differentiate \bm g_a and substitute \bm x_d'=\bm f+\bm A\bm x_a: {\color{Brown}\frac{\partial\bm g_a}{\partial\bm x_d}\bm A\,\bm x_a =-\left(\frac{\partial\bm g_a}{\partial t}+\frac{\partial\bm g_a}{\partial\bm x_d}\bm f\right)} \qquad\text{\color{Crimson}new equation, linear in the algebraic variables} Stack it below \bm B_d\bm x_a=-\bm g_d: \widetilde{\bm B}\bm x_a=-\widetilde{\bm g},\qquad \widetilde{\bm B}=\begin{pmatrix}\bm B_d\\[0.3em] \dfrac{\partial\bm g_a}{\partial\bm x_d}\bm A\end{pmatrix},\quad \widetilde{\bm g}=\begin{pmatrix}\bm g_d\\[0.3em] \dfrac{\partial\bm g_a}{\partial t} +\dfrac{\partial\bm g_a}{\partial\bm x_d}\bm f\end{pmatrix} Go to step 1 with \widetilde{\bm B},\widetilde{\bm g}.
  4. Differentiation index = (number of differentiations, step 3) +1.
  5. At index 1: \bm x_a=-\widetilde{\bm B}^{-1}\widetilde{\bm g} (solve, do not invert) and \bm x_d'=\bm f+\bm A\bm x_a. The removed \bm g_a=\bm0 of every pass are the hidden constraints: \bm x_d(0) must satisfy them.
  6. Derivatives of the algebraic unknowns (for implicit solvers), for p any of t or a component of \bm x_d: differentiate \widetilde{\bm B}\bm x_a=-\widetilde{\bm g}, \widetilde{\bm B}\,\partial_p\bm x_a=-\partial_p\widetilde{\bm g}-(\partial_p\widetilde{\bm B})\bm x_a

Choosing what to differentiate (several constraints). Build the 0/1 dependency table (which algebraic variables each constraint contains). Differentiate only constraints that contain no algebraic variable (the rows of \bm g_a): they lower the index without introducing derivatives of algebraic variables. If none exists and \bm B is singular, combine constraints (step 2) to eliminate algebraic variables.

Watch out.

  • Structural rank of the 0/1 table (e.g. sprank) below its size proves \bm B singular; full structural rank does not prove it nonsingular.
  • Without the linearity of \bm x_a the algorithm does not apply: preprocess first.
  • Keep the original constraints as invariants: the reduced system alone does not enforce them.
  • Drift and Baumgarte stabilization of these constraints: see the Remedy in Section 2.7.

2.7 DAEs from Lagrangian Mechanics

Lagrangian. Generalized coordinates \bm q\in\mathbb R^n, kinetic energy T, potential energy U, mass matrix \bm M(\bm q) symmetric positive definite: L(\bm q,\dot{\bm q},t)=T(\bm q,\dot{\bm q})-U(\bm q,t),\qquad T=\tfrac12\dot{\bm q}^T\bm M(\bm q)\dot{\bm q}=\tfrac12\sum_{j,k}m_{jk}(\bm q)\dot q_j\dot q_k

Euler–Lagrange equations (stationary action, fixed endpoints; \bm\tau = non-conservative generalized forces, \bm\tau=\bm0 if absent): {\color{RoyalBlue}\frac{\mathrm d}{\mathrm dt}\left(\frac{\partial L}{\partial\dot{\bm q}}\right)^{T} -\left(\frac{\partial L}{\partial\bm q}\right)^{T}=\bm\tau}

Equations of motion (quadratic kinetic energy), componentwise and in matrix form: \begin{aligned} &{\color{RoyalBlue}\sum_{j=1}^{n}m_{ij}(\bm q)\ddot q_j+\sum_{j,k=1}^{n}h_{ijk}(\bm q)\dot q_j\dot q_k+g_i(\bm q)=\tau_i}\\[0.5em] &h_{ijk}=\frac{\partial m_{ij}}{\partial q_k}-\frac12\frac{\partial m_{jk}}{\partial q_i},\qquad g_i=\frac{\partial U}{\partial q_i}\\[0.5em] &{\color{RoyalBlue}\bm M(\bm q)\ddot{\bm q}+\bm C(\bm q,\dot{\bm q})\dot{\bm q}+\bm g(\bm q)=\bm\tau}, \qquad (\bm C\dot{\bm q})_i=\sum_{j,k}h_{ijk}\dot q_j\dot q_k \end{aligned} \bm C collects centrifugal and Coriolis effects.

Constrained mechanics. Holonomic constraints \bm\phi(\bm q,t)=\bm0, \bm\phi\in\mathbb R^m, multipliers \bm\lambda\in\mathbb R^m; write \bm\phi_{\bm q}=\partial\bm\phi/\partial\bm q. The modified action \bar S=\int_{t_1}^{t_2}\big(L+\bm\lambda^T\bm\phi\big)\mathrm dt is stationary (endpoints satisfy the constraints): \left\{ \begin{aligned} {\color{RoyalBlue}\frac{\mathrm d}{\mathrm dt}\left(\frac{\partial L}{\partial\dot{\bm q}}\right)^{T} -\left(\frac{\partial L}{\partial\bm q}\right)^{T}}&{\color{RoyalBlue}=\bm\phi_{\bm q}^T\bm\lambda\ \ (+\bm\tau)} && \text{\color{Crimson}dynamics}\\[0.5em] {\color{Brown}\bm\phi(\bm q,t)}&{\color{Brown}=\bm0} && \text{\color{Crimson}position constraint} \end{aligned} \right. \tag{2.4} If \operatorname{rank}\bm\phi_{\bm q}=m there are exactly n-m degrees of freedom. The term \bm\phi_{\bm q}^T\bm\lambda is the constraint force.

First-order form of Equation 2.4, \bm v=\bm q', \bm n=\bm\tau-\bm C(\bm q,\bm v)\bm v-\bm g(\bm q): \left\{ \begin{aligned} {\color{RoyalBlue}\bm q'}&{\color{RoyalBlue}=\bm v} && \text{\color{Crimson}kinematics}\\[0.5em] {\color{RoyalBlue}\bm M(\bm q,\bm v,t)\bm v'-\bm\phi_{\bm q}^T\bm\lambda}&{\color{RoyalBlue}=\bm n(\bm q,\bm v,t)} && \text{\color{Crimson}dynamics}\\[0.5em] {\color{Brown}\bm\phi(\bm q,t)}&{\color{Brown}=\bm0} && \text{\color{Crimson}position constraint} \end{aligned} \right.

Recipe (ODE reduction).

  1. Differentiate the constraint once: velocity-level hidden constraint {\color{Brown}\bm\phi_{\bm q}\bm v+\bm\phi_t=\bm0} (time-independent constraint: \bm v is orthogonal to the constraint gradients).
  2. Differentiate again: acceleration-level hidden constraint {\color{Brown}\bm\phi_{\bm q}\bm v'+\bm m(\bm q,\bm v,t)=\bm0},\qquad \bm m=\frac{\partial}{\partial\bm q}\big(\bm\phi_{\bm q}\bm v+\bm\phi_t\big)\bm v+\frac{\partial}{\partial t}\big(\bm\phi_{\bm q}\bm v+\bm\phi_t\big) \bm m collects the terms without \bm v'; for time-independent \bm\phi, \bm m=\frac{\partial^2\bm\phi}{\partial\bm q^2}[\bm v,\bm v].
  3. Replace \bm\phi=\bm0 by step 2: \begin{bmatrix}\bm I&\bm0&\bm0\\\bm0&\bm M&-\bm\phi_{\bm q}^T\\\bm0&-\bm\phi_{\bm q}&\bm0\end{bmatrix} \begin{bmatrix}\bm q'\\\bm v'\\\bm\lambda\end{bmatrix} =\begin{bmatrix}\bm v\\\bm n(\bm q,\bm v,t)\\\bm m(\bm q,\bm v,t)\end{bmatrix}
  4. The matrix is invertible iff \bm D=\bm\phi_{\bm q}\bm M^{-1}\bm\phi_{\bm q}^T is nonsingular (\bm M positive definite); guaranteed if \operatorname{rank}\bm\phi_{\bm q}=m for all \bm q,t. Then {\color{Brown}\bm\lambda=-\bm D^{-1}\left(\bm m+\bm\phi_{\bm q}\bm M^{-1}\bm n(\bm q,\bm v,t)\right)} and the system is an explicit ODE in (\bm q,\bm v).
  5. Consistent initial values: \color{OrangeRed}\bm\phi(\bm q_0,t_0)=\bm0 and \color{OrangeRed}\bm\phi_{\bm q}\bm v_0+\bm\phi_t=\bm0; \bm\lambda(t_0) then follows from step 4.
  6. Index: two differentiations determine \bm\lambda algebraically (index-1 DAE), a third gives \bm\lambda': differential index 3.

Pattern: planar pendulum (\bm q=(x,y)^T, y up, \bm\phi=x^2+y^2-\ell^2, \bm\phi_{\bm q}=2\bm q^T, \bm m=2\bm v^T\bm v): \left\{ \begin{aligned} {\color{RoyalBlue}m\ddot x=2x\lambda,\quad m\ddot y=2y\lambda-mg} && \text{\color{Crimson}dynamics}\\[0.5em] {\color{Brown}x^2+y^2=\ell^2} && \text{\color{Crimson}constraint}\\[0.5em] {\color{Brown}2\bm q^T\bm v=0} && \text{\color{Crimson}velocity constraint}\\[0.5em] {\color{Brown}2\bm v^T\bm v+2\bm q^T\bm v'=0} && \text{\color{Crimson}acceleration constraint} \end{aligned} \right. \qquad \lambda=-\frac{m}{2\ell^2}\left(\bm v^T\bm v-gq_2\right) In the minimal coordinate \theta: \ddot\theta+\frac g\ell\sin\theta=0.

Constraint drift. The ODE reduction replaces \bm\phi=\bm0 by \ddot{\bm\phi}=\bm0: the fictitious constraint \widetilde{\bm\phi}(\bm q,t)=\bm\phi(\bm q,t)+\bm a_0+\bm a_1t,\qquad \frac{\mathrm d^2\bm\phi}{\mathrm dt^2}=\frac{\mathrm d^2\widetilde{\bm\phi}}{\mathrm dt^2} has the same reduced system. Hence the original constraint is violated with an error growing in time, at best linearly (the term \bm a_1t has no effect on the reduced system), possibly faster because of numerical errors.

Remedy (Baumgarte stabilization). Replace the acceleration constraint \ddot{\bm\phi}=\bm0 by, with tuning parameters \eta,\omega>0, {\color{Brown}\ddot{\bm\phi}+2\eta\omega\,\dot{\bm\phi}+\omega^2\bm\phi=\bm0} \quad\text{i.e.}\quad {\color{Brown}\bm\phi_{\bm q}\bm v'+\bm m+2\eta\omega(\bm\phi_{\bm q}\bm v+\bm\phi_t)+\omega^2\bm\phi=\bm0} In the matrix equation of step 3 and in the formula for \bm\lambda, \bm m becomes \bm m+2\eta\omega(\bm\phi_{\bm q}\bm v+\bm\phi_t)+\omega^2\bm\phi. Other remedies: projection onto the position and velocity constraints, structure-preserving integrators (companion volume).

Baumgarte for any constraint. If a constraint c=0 was replaced by its k-th derivative c^{(k)}=0 in a reduction, replace that row by a stable combination of c,\dots,c^{(k)} (the degree equals the number of differentiations; \tau,\eta,\omega>0): {\color{Brown}c'+\frac{c}{\tau}=0}\ \ (k=1),\qquad {\color{Brown}c''+2\eta\omega\,c'+\omega^2c=0}\ \ (k=2) For larger k use a polynomial of degree k in \mathrm d/\mathrm dt with all roots in the left half-plane, e.g. (\mathrm d/\mathrm dt+\alpha)^kc=0, \alpha>0. In the dummy-variable system \widetilde{\bm B}\bm x_a=-\widetilde{\bm g} with k=1, the entries of \widetilde{\bm g} from the differentiated row become \frac{\partial\bm g_a}{\partial t}+\frac{\partial\bm g_a}{\partial\bm x_d}\bm f+\bm g_a/\tau.

Watch out.

  • Drift is intrinsic to the substitution, not a defect of a particular integrator or of insufficient accuracy: the reduced system has no mechanism that pulls the solution back onto the constraint.
  • Baumgarte stabilization only damps the violation: \eta,\omega are tuned, and too large values give stiffness and artificial damping.
  • Baumgarte needs a genuine chain c,c',c'',\dots (one constraint and its total derivatives along solutions, rows differentiated as they stand). After row recombination (Gauss route, or step 2 of the dummy-variable recipe) the algebraic rows of later passes are in general not the derivatives of the earlier ones and cannot be inserted in the stabilizing equation.
  • \bm\lambda is not free: \bm D must be nonsingular, i.e. linearly independent constraint gradients.

2.8 Summary

  1. Linear DAE (Section 2.1): \color{RoyalBlue}\bm E\dot{\bm x}=\bm A\bm x+\bm f(t)

  2. Semi-explicit DAE: {\color{RoyalBlue}\bm x'=\bm f(\bm x,\bm y,t)},\qquad {\color{Brown}\bm0=\bm g(\bm x,\bm y,t)}

  3. Quasi-linear DAE: \color{RoyalBlue}\bm E(\bm x,t)\bm x'=\bm G(\bm x,t)

  4. Constrained mechanics: {\color{RoyalBlue}\bm M\bm v'-\bm\phi_{\bm q}^T\bm\lambda=\bm n},\qquad {\color{Brown}\bm\phi(\bm q,t)=\bm0}

  5. Consistent initial values: all invariants \bm\Psi_j=\bm0 (original and hidden constraints, e.g. \bm G_{a,j} of every pass) hold at t_0: \color{OrangeRed}\bm\Psi_j(\bm x_0,t_0)=\bm0

Master problem

{\color{RoyalBlue}\bm E(\bm x,t)\bm x'=\bm G(\bm x,t)},\qquad {\color{OrangeRed}\bm x(t_0)=\bm x_0\ \text{consistent}}

Index tests

DAE index condition
\bm F_{\bm x'} nonsingular, or \bm E nonsingular 0 none
linear, regular pencil \nu \bm N^\nu=\bm0\ne\bm N^{\nu-1}
semi-explicit 1 \bm g_{\bm y} nonsingular
semi-explicit, \bm0=\bm g(\bm x,t) 2 \bm g_{\bm x}\bm f_{\bm y} nonsingular
\bm x'=\bm f(\bm x,\bm y,\bm z,t), \bm y'=\bm g(\bm x,\bm y,t), \bm0=\bm h(\bm y,t) 3 \bm h_{\bm y}\bm g_{\bm x}\bm f_{\bm z} nonsingular
Hessenberg of size r r \bm g_{\bm x_1}\bm f_{1,\bm x_2}\cdots\bm f_{r-1,\bm x_r} nonsingular
holonomic mechanics 3 \bm M positive definite, \bm\phi_{\bm q} full row rank
dummy-variable algorithm differentiations +1 \bm B nonsingular at the last pass

Index reduction

Given \bm E(\bm x,t)\bm x'=\bm G(\bm x,t) with \operatorname{rank}\bm E<n, repeat

\left\{ \begin{aligned} {\color{RoyalBlue}\bm E_d\bm x'}&{\color{RoyalBlue}=\bm G_d} && \text{\color{Crimson}differential rows}\\[0.5em] {\color{Brown}\bm0}&{\color{Brown}=\bm G_a(\bm x,t)} && \text{\color{Crimson}algebraic rows}\\[0.5em] {\color{Brown}\bm G_a^t+\bm G_a^x\bm x'}&{\color{Brown}=\bm0} && \text{\color{Crimson}differentiate, stack under differential rows} \end{aligned} \right.

until \widetilde{\bm E} is invertible; the number of differentiations is the index. The result is

\left\{ \begin{aligned} {\color{RoyalBlue}\widetilde{\bm E}\bm x'}&{\color{RoyalBlue}=\widetilde{\bm G}} && \text{\color{Crimson}underlying ODE}\\[0.5em] {\color{Brown}\bm G_{a,j}(\bm x,t)}&{\color{Brown}=\bm0},\quad j=1,\dots,\text{index} && \text{\color{Crimson}invariants (algebraic rows of pass }j\text{), to hold at }(\bm x_0,t_0) \end{aligned} \right.

For the linear DAE \bm E\bm x'+\bm A\bm x=\bm f: \bm G=\bm f-\bm A\bm x, so \widetilde{\bm E}=(\bm E_d;\bm A_a), \widetilde{\bm A}=(\bm A_d;\bm0), \widetilde{\bm f}=(\bm f_d;\bm f_a').

Dummy-variable loop

For \bm x_d'=\bm f+\bm A\bm x_a, \bm0=\bm g+\bm B\bm x_a, repeat until \widetilde{\bm B} is nonsingular (index = passes +1):

\left\{ \begin{aligned} {\color{Brown}\bm B_d\bm x_a}&{\color{Brown}=-\bm g_d} && \text{\color{Crimson}part with algebraic variables}\\[0.5em] {\color{Brown}\frac{\partial\bm g_a}{\partial\bm x_d}\bm A\,\bm x_a}&{\color{Brown}=-\left(\frac{\partial\bm g_a}{\partial t}+\frac{\partial\bm g_a}{\partial\bm x_d}\bm f\right)} && \text{\color{Crimson}differentiated part free of algebraic variables, stacked below} \end{aligned} \right.

Constrained mechanics

\left\{ \begin{aligned} {\color{RoyalBlue}\bm q'}&{\color{RoyalBlue}=\bm v} && \text{\color{Crimson}kinematics}\\[0.5em] {\color{RoyalBlue}\bm M\bm v'-\bm\phi_{\bm q}^T\bm\lambda}&{\color{RoyalBlue}=\bm n} && \text{\color{Crimson}dynamics}\\[0.5em] {\color{Brown}\bm\phi(\bm q,t)}&{\color{Brown}=\bm0} && \text{\color{Crimson}position constraint}\\[0.5em] {\color{Brown}\bm\phi_{\bm q}\bm v+\bm\phi_t}&{\color{Brown}=\bm0} && \text{\color{Crimson}velocity constraint (hidden)}\\[0.5em] {\color{Brown}\bm\phi_{\bm q}\bm v'+\bm m}&{\color{Brown}=\bm0} && \text{\color{Crimson}acceleration constraint (replaces position)}\\[0.5em] {\color{Brown}\bm\lambda}&{\color{Brown}=-\bm D^{-1}\left(\bm m+\bm\phi_{\bm q}\bm M^{-1}\bm n\right)} && \text{\color{Crimson}multiplier}\\[0.5em] {\color{Brown}\ddot{\bm\phi}+2\eta\omega\dot{\bm\phi}+\omega^2\bm\phi}&{\color{Brown}=\bm0} && \text{\color{Crimson}Baumgarte (against drift)} \end{aligned} \right.

with \bm D=\bm\phi_{\bm q}\bm M^{-1}\bm\phi_{\bm q}^T, \bm m the terms of \ddot{\bm\phi} without \bm v', \bm n=\bm\tau-\bm C\bm v-\bm g.