Skip to content

Linear differential equations

Follow points as a matrix pushes them through the plane, solve du/dt = Au with eigenvectors, and read stability from the eigenvalues.

Helps to know first
This topic

First, the picture

At every point of the plane, a matrix sets a velocity. Watch points flow along it: into the origin, or in and back out.

How a system flows

du/dt = Au: at every point a velocity; paths follow the arrows.

At every point the equation du/dt = Au gives a velocity, drawn as a small arrow. The two lines are the eigenvector directions (2, 1) and (1, −1).

matrix
A_node: λ = −1, −2.5
the path from the start
t = 0: (3, 0)
0.00 / 15.00 s
Describe this picture

One square panel covered with small arrows, the velocity du/dt=Au\mathrm{d}\mathbf{u}/\mathrm{d}t=\mathbf{A}\mathbf{u} at each point, and the two eigen-lines along (2,1)(2,1) and (1,−1)(1,-1), dashed. Two matrices play in turn, about 7 s each. First Anode=[−1.510.5−2]\mathbf{A}_\text{node}=\begin{bmatrix}-1.5&1\\0.5&-2\end{bmatrix}: six paths from a ring of starting dots, and a highlighted path from (3,0)(3,0), pour into the origin, each turning to slide in along the line of (2,1)(2,1). Then the arrows fade and come back for Asaddle=[0.510.50]\mathbf{A}_\text{saddle}=\begin{bmatrix}0.5&1\\0.5&0\end{bmatrix}: the paths come in along the line of (1,−1)(1,-1) and leave along the line of (2,1)(2,1). Readouts name the matrix with its eigenvalues and give where the path from the start has got to. One control after the clip: drag the start point, which begins at (3,0)(3,0), or move it with the arrow keys in steps of 0.5.

A velocity at every point

Many systems change at a rate set by where they are: a cooling cup, a swinging spring, a circuit. With two quantities u=(u1,u2)\mathbf{u}=(u_1,u_2) changing together, and each rate a fixed mix of both, the rule is

dudt=Au.\frac{\mathrm{d}\mathbf{u}}{\mathrm{d}t}=\mathbf{A}\mathbf{u}.

At every point u\mathbf{u} of the plane, Au\mathbf{A}\mathbf{u} is a velocity: the direction and speed of the point at that moment. The picture draws those velocities as arrows, and a solution is a path that follows the arrows from its start.

Along an eigenvector

Most arrows point off at an angle, so paths curve. But on an eigenvector line, Au=λu\mathbf{A}\mathbf{u}=\lambda\mathbf{u} points along the line itself, so a point there stays on it. Write u(t)=c(t) v\mathbf{u}(t)=c(t)\,\mathbf{v}. The equation becomes c′(t) v=λ c(t) vc'(t)\,\mathbf{v}=\lambda\,c(t)\,\mathbf{v}, an ordinary equation for one number:

c′=λc⟹c(t)=c(0) eλt.c'=\lambda c\qquad\Longrightarrow\qquad c(t)=c(0)\,e^{\lambda t}.

So along an eigenvector the point grows like eλte^{\lambda t} when λ>0\lambda>0 and dies away when λ<0\lambda<0.

The solution as a mix

Split the starting point along the eigenvectors, u(0)=c1v1+c2v2\mathbf{u}(0)=c_1\mathbf{v}_1+c_2\mathbf{v}_2. Each part follows its own line, so

u(t)=c1eλ1t v1+c2eλ2t v2.\mathbf{u}(t)=c_1e^{\lambda_1t}\,\mathbf{v}_1+c_2e^{\lambda_2t}\,\mathbf{v}_2.

The two matrices in the picture are the matrix A=[1.510.51]\mathbf{A}=\begin{bmatrix}1.5&1\\0.5&1\end{bmatrix} of Eigenvectors, shifted: Anode=A−3I\mathbf{A}_\text{node}=\mathbf{A}-3\mathbf{I} and Asaddle=A−I\mathbf{A}_\text{saddle}=\mathbf{A}-\mathbf{I}. Subtracting c Ic\,\mathbf{I} keeps the eigenvectors (2,1)(2,1) and (1,−1)(1,-1) and lowers each eigenvalue by cc. So Anode\mathbf{A}_\text{node} has eigenvalues −1-1 and −2.5-2.5, and Asaddle\mathbf{A}_\text{saddle} has 11 and −0.5-0.5.

The start (3,0)(3,0) is (2,1)+(1,−1)(2,1)+(1,-1), so c1=c2=1c_1=c_2=1. For the saddle:

u(t)=et (2,1)+e−0.5t (1,−1).\mathbf{u}(t)=e^{t}\,(2,1)+e^{-0.5t}\,(1,-1).

At t=1t=1 this is (6.043,  2.112)(6.043,\;2.112). At t=0t=0 its slope is (2−0.5,  1+0.5)=(1.5,1.5)(2-0.5,\;1+0.5)=(1.5,1.5), which is Asaddle(3,0)\mathbf{A}_\text{saddle}(3,0), as the equation demands.

For the node, u(t)=e−t (2,1)+e−2.5t (1,−1)\mathbf{u}(t)=e^{-t}\,(2,1)+e^{-2.5t}\,(1,-1), which at t=1t=1 is (0.818,  0.286)(0.818,\;0.286).

Stability

The eigenvalues say where every path goes.

  • Both negative (the node): every part dies away, and every path ends at the origin. The faster part, e−2.5te^{-2.5t}, dies first, so paths slide in along the slow line, (2,1)(2,1).
  • One positive, one negative (the saddle): the (1,−1)(1,-1) part dies and the (2,1)(2,1) part grows. Paths come in along one line and leave along the other. Only a start exactly on the line of (1,−1)(1,-1) reaches the origin.
  • Both positive: every path runs away from the origin.

So the system is stable, every path settles to zero, exactly when every eigenvalue is negative. When eigenvalues are complex, as on Complex eigenvalues, the rule reads: every real part negative.

The matrix exponential

For one number, u′=auu'=au is solved by u(t)=eatu(0)u(t)=e^{at}u(0). The same works for a matrix, with the exponential defined by the same series as for numbers:

eAt=I+At+12(At)2+16(At)3+⋯\begin{aligned} e^{\mathbf{A}t}&=\mathbf{I}+\mathbf{A}t+\tfrac12(\mathbf{A}t)^2\\ &\quad+\tfrac16(\mathbf{A}t)^3+\cdots \end{aligned}

Differentiate term by term and you get A eAt\mathbf{A}\,e^{\mathbf{A}t}, so u(t)=eAt u(0)\mathbf{u}(t)=e^{\mathbf{A}t}\,\mathbf{u}(0) solves the equation. Every power in the series is a matrix power, so when A=XΛX−1\mathbf{A}=\mathbf{X}\boldsymbol{\Lambda}\mathbf{X}^{-1}, as in Diagonalisation and matrix powers,

eAt=X eΛt X−1,e^{\mathbf{A}t}=\mathbf{X}\,e^{\boldsymbol{\Lambda}t}\,\mathbf{X}^{-1},

where eΛte^{\boldsymbol{\Lambda}t} is diagonal with entries eλkte^{\lambda_kt}. For the saddle, with the two projections P1\mathbf{P}_1 and P2\mathbf{P}_2 of that page,

eAsaddlet=et P1+e−0.5t P2=13 et[2211]+13 e−0.5t[1−2−12].\begin{aligned} e^{\mathbf{A}_\text{saddle}t}&=e^{t}\,\mathbf{P}_1+e^{-0.5t}\,\mathbf{P}_2\\ &=\tfrac13\,e^{t}\begin{bmatrix}2&2\\1&1\end{bmatrix}\\ &\quad+\tfrac13\,e^{-0.5t}\begin{bmatrix}1&-2\\-1&2\end{bmatrix}. \end{aligned}

At t=1t=1 it is about [2.011.410.701.31]\begin{bmatrix}2.01&1.41\\0.70&1.31\end{bmatrix}, and times (3,0)(3,0) it gives (6.04,  2.11)(6.04,\;2.11), the point found above.

Watch out

eAe^{\mathbf{A}} is not ee raised to each entry. For Asaddle\mathbf{A}_\text{saddle}, exponentiating the entries gives [1.652.721.651]\begin{bmatrix}1.65&2.72\\1.65&1\end{bmatrix}, which is not the matrix above and does not solve the equation. The matrix exponential is the series, a sum of matrix powers.

One more check: the determinant of eAte^{\mathbf{A}t} is et tr Ae^{t\,\mathrm{tr}\,\mathbf{A}}, the product of the eλkte^{\lambda_kt}. For the saddle at t=1t=1 that is e0.5=1.649e^{0.5}=1.649, the area by which the flow stretches the plane in one second.

A spring as a system

A damped spring obeys a second-order equation, for example y′′+3y′+2y=0y''+3y'+2y=0. Keep the position and the speed together, u=(y,y′)\mathbf{u}=(y,y'). Then y′y' is the second entry, and y′′=−2y−3y′y''=-2y-3y', so

ddt[yy′]=[01−2−3][yy′].\frac{\mathrm{d}}{\mathrm{d}t}\begin{bmatrix}y\\y'\end{bmatrix}=\begin{bmatrix}0&1\\-2&-3\end{bmatrix}\begin{bmatrix}y\\y'\end{bmatrix}.

The matrix has trace −3-3 and determinant 2, so its eigenvalues are −1-1 and −2-2, with eigenvectors (1,−1)(1,-1) and (1,−2)(1,-2). Release the spring from y(0)=1y(0)=1 at rest: (1,0)=2 (1,−1)−(1,−2)(1,0)=2\,(1,-1)-(1,-2), so

y(t)=2e−t−e−2t.y(t)=2e^{-t}-e^{-2t}.

Mass on a spring

y'' + 3y' + 2y = 0 as a system for u = (y, y').

y'' + 3y' + 2y = 0 with y(0) = 1, y'(0) = 0, written as u = (y, y'): du/dt = [0 1; −2 −3] u.

t
0
(y, y')
(1, 0)
0.00 / 9.20 s
Describe this picture

Two panels (stacked on a phone). On the left, the position y(t)=2e−t−e−2ty(t)=2e^{-t}-e^{-2t} drawn against time from t=0t=0 to 6, starting at 1 and sinking towards 0 without crossing it. On the right, the plane of (y,y′)(y,y'), where a point starts at (1,0)(1,0), dips below the axis while the mass speeds up, and slides into the origin as the curve is drawn. Readouts give tt and (y,y′)(y,y'). There is no control.

Watch the curve: it sinks to 0 and never crosses it. Both eigenvalues are real and negative, so there is no swing: the spring is overdamped. At t=1t=1 the position is 0.6000.600, and at t=2t=2 it is 0.2520.252.

In signal processing · poles and stability

Poles, zeros and the s-plane, in the signal processing course, reads an analog system’s stability from its poles: stable when every pole lies in the left half-plane. The poles are the eigenvalues of the system’s matrix, and the left half-plane is “every real part negative”. This spring’s poles are −1-1 and −2-2.

Worked example

1. The saddle. u(t)=et(2,1)+e−0.5t(1,−1)\mathbf{u}(t)=e^{t}(2,1)+e^{-0.5t}(1,-1); at t=1t=1, (2e+e−0.5,  e−e−0.5)=(6.043,  2.112)(2e+e^{-0.5},\;e-e^{-0.5})=(6.043,\;2.112).

2. The node. u(t)=e−t(2,1)+e−2.5t(1,−1)\mathbf{u}(t)=e^{-t}(2,1)+e^{-2.5t}(1,-1); at t=1t=1, (0.818,  0.286)(0.818,\;0.286). Both parts die, so the path ends at the origin.

3. The exponential. eAsaddle≈[2.011.410.701.31]e^{\mathbf{A}_\text{saddle}}\approx\begin{bmatrix}2.01&1.41\\0.70&1.31\end{bmatrix}, with determinant e0.5=1.649e^{0.5}=1.649.

4. The spring. y(t)=2e−t−e−2ty(t)=2e^{-t}-e^{-2t}: y(0)=1y(0)=1, y′(0)=−2+2=0y'(0)=-2+2=0, y(1)=0.600y(1)=0.600, y(2)=0.252y(2)=0.252.

Try these before you read the answers.

  • Eigenvalues −1-1 and −3-3: stable? Yes.
  • Eigenvalues −1-1 and 0.20.2: stable? No: one direction grows.
  • Is eAe^{\mathbf{A}} the exponential of each entry? No.
  • In the node, which line do paths hug as they reach the origin? The slow one, (2,1)(2,1).

Where you’ll meet this

Circuits and machines. Every linear circuit or mechanism with several places to store energy, such as capacitors, inductors, masses and springs, obeys du/dt=Au\mathrm{d}\mathbf{u}/\mathrm{d}t=\mathbf{A}\mathbf{u} when left alone. Its eigenvalues are its natural rates.

Feedback. Whether a feedback loop settles or runs away is read from the real parts of the eigenvalues of its matrix.

Simulation. A computer that simulates such a system at a sample period TsT_s steps the state by the fixed matrix eATse^{\mathbf{A}T_s}. That step is exact, not an approximation, and it is the idea behind Impulse invariance.

Reference card

QuantityFormulaNotes
Equationdu/dt=Au\mathrm{d}\mathbf{u}/\mathrm{d}t=\mathbf{A}\mathbf{u}a velocity at every point
Along an eigenvectorc(t)=c(0) eλtc(t)=c(0)\,e^{\lambda t}the point stays on its line
Solutionu(t)=∑kckeλktvk\mathbf{u}(t)=\sum_kc_ke^{\lambda_kt}\mathbf{v}_ku(0)=∑kckvk\mathbf{u}(0)=\sum_kc_k\mathbf{v}_k
Stableevery Re λk<0\mathrm{Re}\,\lambda_k<0every path ends at the origin
Node, saddleboth negative; one of each signin along both lines; in along one, out along the other
ExponentialeAt=∑m≥0(At)m/m!=XeΛtX−1e^{\mathbf{A}t}=\sum_{m\ge0}(\mathbf{A}t)^m/m!=\mathbf{X}e^{\boldsymbol{\Lambda}t}\mathbf{X}^{-1}never entry by entry
Determinantdet⁡eAt=et tr A\det e^{\mathbf{A}t}=e^{t\,\mathrm{tr}\,\mathbf{A}}
Second ordery′′+by′+cy=0y''+by'+cy=0 as u=(y,y′)\mathbf{u}=(y,y')matrix [01−c−b]\begin{bmatrix}0&1\\-c&-b\end{bmatrix}

Keep reading with a free account.

By creating an account you accept the terms of use.

Sign in

Already have an account? Use the service you signed up with.

Or keep reading: get new lessons by email

Are you 13 or over?

Accounts and email updates are for people aged 13 or over. We keep only your answer, never your date of birth.

End of the lesson

Where to go next.

Phasorium

Account

Sign inKeep your place on any device

Subjects

Site

Look