Unit 13, lesson 78

Differential-Algebraic Equations

How a differential-algebraic equation joins rates with algebraic constraints, how to tell differential from algebraic variables, and how to check consistent initial values, hidden constraints and the differentiation index.

  • Video 78
  • Perturbation, Delay and Differential-Algebraic Equations

A bob on a rigid rod of length 11 swings on a circle around the pivot. Newton’s second law gives rates of change for its position and velocity, but the rod adds a condition on the position alone, with no derivative in it, that must hold at every instant. Can the bob start anywhere on the circle with any velocity, and what decides how hard the rod pulls? Throughout, tt is the independent variable and a prime means d/dtd/dt. This lesson shows how such models join rate equations with algebraic constraints, which initial values they accept, and what differentiating a constraint reveals.

Key terms

Differential-algebraic equation

Definition Let X(t)X(t) be an unknown vector function with nn entries. A differential-algebraic equation, or DAE, is a system of nn equations

F(t,X,X′)=0F(t, X, X') = 0

whose Jacobian matrix ∂F/∂X′\partial F/\partial X', taken with respect to the entries of X′X', is singular at every point of the region considered. Near a point where F=0F = 0 and this matrix is invertible, with FF continuously differentiable, the implicit function theorem would let one solve for X′X' and obtain an ordinary first-order system X′=f(t,X)X' = f(t, X), so the singular Jacobian is what sets a DAE apart. A common case is the linear-implicit form

MX′=φ(t,X)M X' = \varphi(t, X)

with a constant singular n×nn \times n matrix MM, often called the mass matrix. Because MM is singular, some nonzero row vector uTu^{T} satisfies uTM=0u^{T}M = 0, and multiplying the system by it gives uTφ(t,X)=0u^{T}\varphi(t, X) = 0, an equation without derivatives that has to hold at every time.

In plain words A DAE mixes rates of change with conditions that must hold at every instant. It cannot be solved for every derivative at once, so the conditions are part of the problem from the start, and they limit both the starting values and the motion.

Example For the unknown X=(x,z)TX = (x, z)^{T}, the system

x′=−x+z,0=x+z−1\begin{aligned} x' &= -x + z, \\ 0 &= x + z - 1 \end{aligned}

has the linear-implicit form with

M=[1000],φ(t,X)=[−x+zx+z−1].\begin{gathered} M = \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}, \\[0.4em] \varphi(t, X) = \begin{bmatrix} -x + z \\ x + z - 1 \end{bmatrix}. \end{gathered}

The matrix MM has determinant 00, and the row vector uT=(0,1)u^{T} = (0, 1) picks out the second row, the relation x+z−1=0x + z - 1 = 0 with no derivative in it. Written as F(t,X,X′)=0F(t, X, X') = 0, the system has F=(x′+x−z, x+z−1)TF = (x' + x - z,\ x + z - 1)^{T}, and its Jacobian with respect to (x′,z′)(x', z') is this same matrix MM. No derivative of zz appears anywhere, so the system as written gives no formula for z′z'.

Differential and algebraic variables

Definition A semi-explicit DAE has the form

x′=f(t,x,z),0=g(t,x,z),\begin{aligned} x' &= f(t, x, z), \\ 0 &= g(t, x, z), \end{aligned}

where x(t)∈Rmx(t) \in \mathbb{R}^m and z(t)∈Rkz(t) \in \mathbb{R}^k with k≥1k \ge 1 are columns that together make up the unknown XX. The entries of xx are the differential variables, because each has its own rate equation. The entries of zz are the algebraic variables, because no derivative of zz appears in the system. Each of the kk equations 0=gi(t,x,z)0 = g_i(t, x, z) is an algebraic constraint, a relation without derivatives that must hold at every time in the interval of the solution. The Jacobian of this system with respect to X′X' has an identity block for x′x' and zero rows for the constraints, so it is singular. A solution on an open interval II is a pair with xx differentiable and zz continuous on II such that both lines hold for every tt in II. The labels describe the system as written, so rewriting the model can change which variables count as algebraic.

In plain words The model hands each differential variable a rate. An algebraic variable gets no rate of its own, and in a well-posed model its values are whatever the constraints require at each instant, sometimes only after the constraints are differentiated. Those values can still change from moment to moment.

Example In the system x′=−x+zx' = -x + z, 0=x+z−10 = x + z - 1, the variable xx is differential and zz is algebraic, with m=k=1m = k = 1. The constraint gives z=1−xz = 1 - x, and substituting it leaves the linear equation x′+2x=1x' + 2x = 1. With the integrating factor e2te^{2t} it reads (e2tx)′=e2t(e^{2t}x)' = e^{2t}, so e2tx=12e2t+Ce^{2t}x = \tfrac{1}{2}e^{2t} + C and x=12+Ce−2tx = \tfrac{1}{2} + Ce^{-2t}. The start x(0)=0x(0) = 0 gives C=−12C = -\tfrac{1}{2}, and the constraint returns zz, so for all real tt

x=12(1−e−2t),z=12(1+e−2t).\begin{gathered} x = \tfrac{1}{2}\bigl(1 - e^{-2t}\bigr), \\[0.4em] z = \tfrac{1}{2}\bigl(1 + e^{-2t}\bigr). \end{gathered}

A check of every equation confirms this. The derivative x′=e−2tx' = e^{-2t} equals −x+z-x + z, the sum x+zx + z is 11, and the values at t=0t = 0 are x=0x = 0 and z=1z = 1. The algebraic variable falls from 11 toward 12\tfrac{1}{2}, so algebraic does not mean constant.

Consistent initial values

Definition Initial values X(t0)=X0X(t_0) = X_0 of a DAE are consistent if the DAE has a solution on some open interval containing t0t_0 that takes these values at t0t_0. Consistent values must satisfy every algebraic constraint at t0t_0, together with every hidden constraint. For a semi-explicit system with ff and gg continuously differentiable, suppose that

g(t0,x0,z0)=0g(t_0, x_0, z_0) = 0

and that the k×kk \times k Jacobian matrix ∂g/∂z\partial g/\partial z is invertible at (t0,x0,z0)(t_0, x_0, z_0). Then the values x(t0)=x0x(t_0) = x_0 and z(t0)=z0z(t_0) = z_0 are consistent, and any two solutions through them agree on some open interval containing t0t_0. In this case the differential values x0x_0 are the data one prescribes, and z0z_0 must then solve the constraint at t0t_0.

In plain words A starting point is allowed only when the model can actually move from it. Values that break a constraint, written or hidden, start no solution at all, and a computation started from them is working on a different problem.

Example For x′=−x+zx' = -x + z, 0=x+z−10 = x + z - 1, the derivative ∂g/∂z\partial g/\partial z equals 11, so any x0x_0 may be prescribed and the constraint forces z0=1−x0z_0 = 1 - x_0. With x(0)=0x(0) = 0 the only consistent value is z(0)=1z(0) = 1, and the pair x(0)=z(0)=0x(0) = z(0) = 0 is inconsistent, since 0+0−1≠00 + 0 - 1 \ne 0. From a general consistent start the solution is

x=12+(x0−12)e−2t,z=12−(x0−12)e−2t,\begin{gathered} x = \tfrac{1}{2} + \bigl(x_0 - \tfrac{1}{2}\bigr)e^{-2t}, \\[0.4em] z = \tfrac{1}{2} - \bigl(x_0 - \tfrac{1}{2}\bigr)e^{-2t}, \end{gathered}

which keeps x+z=1x + z = 1 for every tt and sends both variables to 12\tfrac{1}{2}. One free number, the value x0x_0, selects the solution.

Hidden constraint

Definition Along a solution on an interval II, a constraint 0=g(t,x,z)0 = g(t, x, z) holds at every tt in II, so its derivative with respect to tt along the solution is also zero wherever that derivative exists. Substituting the rate equations into this derivative gives a derived relation that every such solution obeys although it is not written in the system. When a derived relation contains no derivatives after this substitution and does not follow from the written constraints, it is a hidden constraint. It restricts the states a solution can pass through, so consistent initial values must satisfy it too. Differentiating again can reveal further hidden constraints. A derived relation adds to the original constraint. It can stand in for it only when the initial values satisfy the original constraint, because a zero derivative only says that gg stays constant along the solution, not that the constant is 00.

In plain words A constraint has to keep holding as time runs, and that requirement can impose conditions nobody wrote down. A rod of fixed length, for instance, forbids any motion toward or away from the pivot, so a condition on the position hides a condition on the velocity.

Example Consider x′=zx' = z, 0=x−sin⁡t0 = x - \sin t, with xx differential and zz algebraic. The constraint says nothing about zz directly. Differentiating it gives x′−cos⁡t=0x' - \cos t = 0, and substituting x′=zx' = z gives the hidden constraint

z=cos⁡t.z = \cos t.

So the only consistent initial values at t=0t = 0 are x(0)=0x(0) = 0 and z(0)=1z(0) = 1, and the solution is x=sin⁡tx = \sin t, z=cos⁡tz = \cos t. Here not even the differential variable has a free starting value. Compare the first system, x′=−x+zx' = -x + z with 0=x+z−10 = x + z - 1. Differentiating its constraint gives x′+z′=0x' + z' = 0, so the two rates are equal and opposite, and substituting x′=−x+zx' = -x + z gives z′=x−zz' = x - z. That derived relation fixes the rate of zz but places no new condition on the starting values.

Differentiation index

Definition Differentiate the equations of a DAE with respect to tt along solutions, all of them or only some, as many times as needed. The differentiation index is the smallest number ν\nu such that the original equations together with their derivatives up to order ν\nu determine X′X' as a continuous function of tt and XX by algebraic steps. The resulting ordinary system X′=ψ(t,X)X' = \psi(t, X) is called the underlying ODE, and an ordinary system X′=f(t,X)X' = f(t, X) has index 00. For a semi-explicit system with continuously differentiable ff and gg, write gtg_t, gxg_x, gzg_z and fzf_z for the partial derivatives and Jacobian matrices. If gzg_z is invertible along the solution, one differentiation of the constraint gives

gt+gx f+gz z′=0,g_t + g_x\,f + g_z\,z' = 0,

which can be solved for z′z', so the index is 11. If gg does not depend on zz, that first derivative contains no z′z', so the index is at least 22, and it equals 22 when the matrix gxfzg_x f_z is invertible. The index belongs to a formulation and to this convention. Rewriting a model can change it, and other notions, such as the perturbation index, are defined differently and need not give the same number for every system.

In plain words The index counts how many rounds of differentiating the constraints it takes before every unknown, the algebraic ones included, has a rate equation. A higher index means more differentiations between the model as written and an ordinary system, and numerical methods generally find such problems harder.

Example In x′=−x+zx' = -x + z, 0=x+z−10 = x + z - 1 the matrix gzg_z is the number 11, and one differentiation gives z′=x−zz' = x - z. The underlying ODE is

x′=−x+z,z′=x−z,\begin{aligned} x' &= -x + z, \\ z' &= x - z, \end{aligned}

so the index is 11. In x′=zx' = z, 0=x−sin⁡t0 = x - \sin t the constraint does not contain zz. The first differentiation gives the hidden constraint z=cos⁡tz = \cos t and the second gives z′=−sin⁡tz' = -\sin t, so the index is 22, in agreement with gxfz=1g_x f_z = 1. The underlying ODE can have more solutions than the DAE. Adding the two rows of the first underlying ODE gives (x+z)′=0(x + z)' = 0, so each of its solutions keeps x+zx + z constant, but only those with x+z=1x + z = 1 solve the DAE.

Constrained pendulum

Definition Scale the units so that the mass, the rod length and the gravitational acceleration all equal 11. Put the pivot at the origin, write the position of the bob as (x,y)(x, y) with yy positive upward and its velocity as (v,w)(v, w), and let the rod act on the bob with the force −λ(x,y)-\lambda(x, y). The constrained pendulum is the DAE

x′=v,y′=w,v′=−λx,w′=−1−λy,0=x2+y2−1.\begin{aligned} x' &= v, \\ y' &= w, \\ v' &= -\lambda x, \\ w' &= -1 - \lambda y, \\ 0 &= x^2 + y^2 - 1. \end{aligned}

The differential variables are xx, yy, vv and ww, and the multiplier λ\lambda is the algebraic variable. The rod force has magnitude ∣λ∣\lvert \lambda \rvert, and a positive λ\lambda means the rod pulls the bob toward the pivot. Differentiating the constraint and using x′=vx' = v, y′=wy' = w gives 2(xv+yw)=02(xv + yw) = 0, the hidden constraint

xv+yw=0.xv + yw = 0.

Differentiating that and inserting the accelerations gives v2+w2−y−λ(x2+y2)=0v^2 + w^2 - y - \lambda(x^2 + y^2) = 0, which on the circle reads

λ=v2+w2−y.\lambda = v^2 + w^2 - y.

A third differentiation gives

λ′=−2λ(xv+yw)−3w=−3w,\begin{aligned} \lambda' &= -2\lambda(xv + yw) - 3w \\[0.4em] &= -3w, \end{aligned}

which supplies the last missing rate, so this formulation has index 33. Consistent initial values put the bob on the circle, make its velocity tangent to the circle, and fix λ\lambda by the formula above. Of the five unknowns only two numbers are free, the starting point on the circle and the signed speed along it. Other formulations of the same motion have other indices. With the velocity constraint xv+yw=0xv + yw = 0 in place of the position constraint the index is 22, although the bob must still be started on the circle, and in the angle θ\theta with x=sin⁡θx = \sin\theta and y=−cos⁡θy = -\cos\theta the motion is the ordinary equation θ′′+sin⁡θ=0\theta'' + \sin\theta = 0, of index 00.

In plain words The rod pulls exactly as hard as needed to keep the bob on the circle. That pull is not an extra starting value to choose, because the position and velocity already decide it, and the fixed length hides a condition on the velocity.

Example At rest at the bottom, (x,y,v,w)=(0,−1,0,0)(x, y, v, w) = (0, -1, 0, 0). The bob is on the circle, the tangency condition xv+yw=0xv + yw = 0 holds, and the formula gives λ=0+0−(−1)=1\lambda = 0 + 0 - (-1) = 1. The accelerations are then v′=−1⋅0=0v' = -1 \cdot 0 = 0 and w′=−1−1⋅(−1)=0w' = -1 - 1 \cdot (-1) = 0, so the rod force balances gravity and the bob stays at rest, as it should. This small check also catches a sign error in the multiplier convention. Released from rest with the rod horizontal, at (1,0,0,0)(1, 0, 0, 0), the bob has λ=0\lambda = 0, so at that instant the rod exerts no force and the accelerations are v′=0v' = 0 and w′=−1w' = -1, the start of free fall.

Check yourself

  1. In the system x′=zx' = z, 0=z+3x−60 = z + 3x - 6, which variable is differential and which is algebraic? With x(0)=0x(0) = 0, find the consistent value of z(0)z(0) and solve the problem.
Show the answer

The derivative of xx appears, so xx is differential, and zz is algebraic. The constraint has ∂g/∂z=1\partial g/\partial z = 1, so the index is 11 and x(0)x(0) may be prescribed freely. At t=0t = 0 the constraint gives z(0)=6−3⋅0=6z(0) = 6 - 3 \cdot 0 = 6, the only consistent value. Eliminating z=6−3xz = 6 - 3x leaves x′+3x=6x' + 3x = 6. With the integrating factor e3te^{3t} this is (e3tx)′=6e3t(e^{3t}x)' = 6e^{3t}, so x=2+Ce−3tx = 2 + Ce^{-3t}, and x(0)=0x(0) = 0 gives C=−2C = -2. Hence

x=2−2e−3t,z=6e−3t.\begin{gathered} x = 2 - 2e^{-3t}, \\[0.4em] z = 6e^{-3t}. \end{gathered}

As a check, x′=6e−3t=zx' = 6e^{-3t} = z, the expression z+3x−6=6e−3t+6−6e−3t−6z + 3x - 6 = 6e^{-3t} + 6 - 6e^{-3t} - 6 is 00, and the values at t=0t = 0 are 00 and 66.

  1. A classmate replaces the constraint of x′=−x+zx' = -x + z, 0=x+z−10 = x + z - 1 by its derivative, which turns the problem into the ordinary system x′=−x+zx' = -x + z, z′=x−zz' = x - z, and starts it from x(0)=0x(0) = 0 and z(0)=12z(0) = \tfrac{1}{2}. Solve the classmate’s problem and explain why its solution does not solve the DAE.
Show the answer

Adding the two equations gives (x+z)′=0(x + z)' = 0, so x+zx + z keeps its starting value 12\tfrac{1}{2}. Then x′=−x+(12−x)=12−2xx' = -x + (\tfrac{1}{2} - x) = \tfrac{1}{2} - 2x, so x=14+Ce−2tx = \tfrac{1}{4} + Ce^{-2t} with C=−14C = -\tfrac{1}{4}, and

x=14(1−e−2t),z=14(1+e−2t).\begin{gathered} x = \tfrac{1}{4}\bigl(1 - e^{-2t}\bigr), \\[0.4em] z = \tfrac{1}{4}\bigl(1 + e^{-2t}\bigr). \end{gathered}

Both rate equations hold, since x′=12e−2t=−x+zx' = \tfrac{1}{2}e^{-2t} = -x + z and z′=−12e−2t=x−zz' = -\tfrac{1}{2}e^{-2t} = x - z. But x+z−1=−12x + z - 1 = -\tfrac{1}{2} at every time, so the original constraint fails throughout, and both variables approach 14\tfrac{1}{4} instead of 12\tfrac{1}{2}. The starting values were inconsistent, and the differentiated constraint preserved the wrong sum instead of correcting it. From the consistent start z(0)=1z(0) = 1 the same ordinary system gives the true solution, which is why the original constraint is kept beside its derivative and checked during a computation.

  1. For the constrained pendulum in scaled units, decide which of the starting states (x,y,v,w)=(0.6,−0.8,0.8,0.6)(x, y, v, w) = (0.6, -0.8, 0.8, 0.6) and (x,y,v,w)=(0.6,−0.8,0.6,0.8)(x, y, v, w) = (0.6, -0.8, 0.6, 0.8) is consistent. For the consistent one, find λ(0)\lambda(0) and the initial accelerations v′(0)v'(0) and w′(0)w'(0).
Show the answer

Both states put the bob on the circle, since 0.36+0.64=10.36 + 0.64 = 1. For the first state the hidden constraint holds, because xv+yw=0.48−0.48=0xv + yw = 0.48 - 0.48 = 0. The formula then gives λ(0)=0.64+0.36+0.8=1.8\lambda(0) = 0.64 + 0.36 + 0.8 = 1.8, and

v′(0)=−1.8⋅0.6=−1.08,w′(0)=−1+1.8⋅0.8=0.44.\begin{aligned} v'(0) &= -1.8 \cdot 0.6 \\ &= -1.08, \\[0.4em] w'(0) &= -1 + 1.8 \cdot 0.8 \\ &= 0.44. \end{aligned}

As a check, the component of this acceleration along the unit vector (x,y)(x, y) is (−1.08)(0.6)+(0.44)(−0.8)=−1(-1.08)(0.6) + (0.44)(-0.8) = -1, which is the inward acceleration −(v2+w2)=−1-(v^2 + w^2) = -1 needed to move on the unit circle at speed 11. For the second state, xv+yw=0.36−0.64=−0.28≠0xv + yw = 0.36 - 0.64 = -0.28 \ne 0, so its velocity has a component along the rod. It violates the hidden constraint, and no choice of λ(0)\lambda(0) makes it consistent.

How this lesson connects