Differential Equations
Units and Topics
Unit 5. Linear Systems
5.7 The Matrix Exponential and Forced Systems
The equation x′ = ax with x(0) = x₀ has the solution x = eatx₀. The system x′ = Ax has a solution of the same form, with the exponential of a matrix. This topic covers the matrix exponential, its calculation from the series and from the eigenvectors, and systems with a forcing term.
You need Topics 5.2 to 5.5 for this topic. The topic uses the power series of the exponential function, the sine, and the cosine, and the convolution of Topic 4.5.
1. The Exponential of a Matrix
The exponential function of a number is the sum of a power series.
ea = 1 + a + a²/2! + a³/3! + …The same series defines the exponential of a matrix. The powers of a matrix are products: A² = AA and A³ = AAA. The number 1 is replaced by the identity matrix I.
The matrix exponential. eAt = I + At + (At)²/2! + (At)³/3! + …
The series has a finite sum for each matrix A and each time t. The result eAt is a matrix with two rows and two columns, and its entries are functions of t.
At t = 0, all terms except the first one are zero matrices, so eA · 0 = I.
2. The Solution of the System
The derivative of the series is taken term by term. The derivative of (At)ⁿ/n! is A times the term before it.
(eAt)′ = A + A²t + A³t²/2! + …the derivative of each term(eAt)′ = A(I + At + (At)²/2! + …)factor out A(eAt)′ = AeAtthe series in the parentheses is eAtThe solution with the matrix exponential. The solution of x′ = Ax with the initial vector x(0) = x₀ is x(t) = eAtx₀.
The check: the derivative of eAtx₀ is AeAtx₀, which is Ax. At t = 0 the solution is Ix₀, which is x₀.
The matrix eAt moves each starting point to its position at the time t. It holds the solutions for all initial conditions at once. Its first column is the solution that starts at 10, and its second column is the solution that starts at 01.
Two more properties follow from the meaning of eAt. Moving forward by the time s and then by the time t is the same as moving forward by t + s, so eAteAs = eA(t + s). Moving backward undoes the motion, so the inverse of eAt is e−At.
3. Three Matrices with a Simple Series
For a diagonal matrix, the powers are taken entry by entry on the diagonal, and each diagonal entry gives its own exponential series.
A = a00da diagonal matrixAⁿ = aⁿ00dⁿthe powerseAt = eat00edtthe series for each entry on the diagonalThis agrees with the system x′ = ax, y′ = dy, which is not coupled. For a matrix that is not diagonal, the entries of eAt are not the exponential functions of the entries of At.
For the matrix of a body with no force, the series stops after two terms.
A = 0100the matrix of x′ = v, v′ = 0A² = 0000each row times each column is 0eAt = I + Atall higher terms are zero matriceseAt = 1t01add the two matricesThe solution eAtx₀ has the entries x₀ + v₀t and v₀: a motion with a constant velocity.
For the matrix of the center of Topic 5.4, the square is −I.
A = 01−10the matrix of x′ = y, y′ = −xA² = −Iby the rule for the productA³ = −A and A⁴ = Imultiply by A againeAt = I(1 − t²/2! + t⁴/4! − …) + A(t − t³/3! + …)collect the even powers and the odd powerseAt = I cos t + A sin tthe two series are the cosine and the sineeAt = cos tsin t−sin tcos tadd the two matricesThis matrix turns each vector clockwise by the angle t. The first column is the solution x = cos t, y = −sin t of Topic 5.1.
Try it: the series of the matrix exponential
The matrix is A = 01−10. The gray circle is the exact trajectory eAtx₀ from the start 10. The blue curve uses only the first N terms of the series. The sliders set the time t and the number N of terms.
4. The Fundamental Matrix
For most matrices the series has no simple pattern. The eigenvalues and eigenvectors then give eAt. Let x₁(t) and x₂(t) be two solutions of x′ = Ax that are not multiples of each other. The matrix with these two solutions as its columns is called a fundamental matrix, and it is written Φ(t).
The general solution c₁x₁ + c₂x₂ is the product of Φ(t) and the vector c of the two constants. The initial condition gives Φ(0)c = x₀, so c = Φ(0)⁻¹x₀.
x(t) = Φ(t)cthe general solutionx(t) = Φ(t)Φ(0)⁻¹x₀substitute ceAt = Φ(t)Φ(0)⁻¹compare with x(t) = eAtx₀The matrix exponential from solutions. If Φ(t) is a fundamental matrix of x′ = Ax, then eAt = Φ(t)Φ(0)⁻¹.
For A = 1232, Topic 5.3 found the solutions e4t23 and e−t1−1.
Φ(t) = 2e4te−t3e4t−e−tthe two solutions as columnsΦ(0) = 213−1at t = 0, with the determinant −2 − 3Φ(0)⁻¹ = 1/5113−2the rule for the inverse, with the factor 1/(−5) moved into the entrieseAt = 1/52e4t + 3e−t2e4t − 2e−t3e4t − 3e−t3e4t + 2e−tthe product Φ(t)Φ(0)⁻¹At t = 0 the result is (1/5) times 5005, which is I. For the initial vector with the entries 3 and 2, the first entry of eAtx₀ is
x = 1/5[3(2e4t + 3e−t) + 2(2e4t − 2e−t)]the first row times the initial vectorx = 1/5(10e4t + 5e−t)collectx = 2e4t + e−tdivide by 5This is the solution of Topic 5.3.
5. A Constant Forcing Term
A forced linear system has an added vector that does not depend on x.
x′ = Ax + fWhen f is constant and the determinant of A is not 0, the system has one equilibrium point xₑ, at which the right side is the zero vector.
Axₑ + f = 0the condition for an equilibrium pointxₑ = −A⁻¹fsolve for xₑLet z = x − xₑ be the difference between the state and the equilibrium point. Its derivative is x′, which is Ax + f. With f = −Axₑ, this is A(x − xₑ), so z′ = Az. The difference satisfies the homogeneous system.
A constant forcing term. The solution of x′ = Ax + f with x(0) = x₀ is x = xₑ + eAt(x₀ − xₑ), with xₑ = −A⁻¹f. The trajectories are those of the homogeneous system, moved from the origin to the point xₑ.
6. An Example from Physics
Two rooms share a wall, and each room has an outside wall and a heater. Let x and y be the temperatures of the two rooms above the outside temperature, in degrees Celsius, with t in hours. Each room loses heat to the outside and exchanges heat with the other room. For one house,
x′ = −x − (x − y) + 2 y′ = −y + (x − y) + 5The terms 2 and 5 come from the heaters. Collected, the system is x′ = −2x + y + 2, y′ = x − 2y + 5, with the matrix A = −211−2 of Topic 5.3 and the forcing vector with the entries 2 and 5.
−2x + y + 2 = 0the first equation at the equilibrium pointx − 2y + 5 = 0the second equation at the equilibrium pointy = 2x − 2solve the first equation for yx − 4x + 4 + 5 = 0substitute in the second equationx = 3 and y = 4the equilibrium temperaturesThe matrix has the eigenvalues −1 and −3, so the equilibrium point is a stable node. From each start, the temperatures approach 3 and 4 degrees above the outside temperature. With the eigenvectors 11 and 1−1 of Topic 5.3, the solution is
xy = 34 + c₁e−t11 + c₂e−3t1−1For rooms that start at the outside temperature, x(0) = 0 and y(0) = 0, the constants satisfy c₁ + c₂ = −3 and c₁ − c₂ = −4, so c₁ = −3.5 and c₂ = 0.5.
7. A Forcing Term That Depends on the Time
For a forcing vector f(t) that changes with time, the method is the integrating factor of Topic 2.2, with the matrix e−At.
x′ − Ax = f(t)move Ax to the left side(e−Atx)′ = e−Atf(t)multiply by e−At, which makes the left side a derivativee−Atx(t) − x₀ = ∫0t e−Aτf(τ) dτintegrate from 0 to tx(t) = eAtx₀ + ∫0t eA(t − τ)f(τ) dτmultiply by eAtThe solution of a forced system. x(t) = eAtx₀ + ∫0t eA(t − τ)f(τ) dτ
The first term is the response to the initial condition. The second term is the response to the forcing. It is a convolution, as in Topic 4.5: the forcing at the time τ acts as an impulse, and the matrix eA(t − τ) carries its effect forward to the time t. The matrix exponential is the impulse response of the system.
The integral of a vector is taken entry by entry. For example, solve x′ = y, y′ = t with x(0) = 0 and y(0) = 0. The matrix is 0100, with eAt = 1t01, and the forcing vector has the entries 0 and t.
eA(t − τ)f(τ) = 1t − τ010τthe matrix at the time t − τ times the forcing at τeA(t − τ)f(τ) = (t − τ)ττeach row times the vectorx = ∫0t (tτ − τ²) dτthe first entryx = t³/2 − t³/3integratex = t³/6subtracty = t²/2the integral of τ from 0 to tThe check: x′ = t²/2, which is y, and y′ = t.
Common Mistakes
- Taking the exponential function of each entry. The matrix eAt is defined by the series, and only a diagonal matrix has its exponential on the diagonal entry by entry.
- Leaving out the identity matrix in the series. The first term is I, and eA · 0 is I, not the zero matrix.
- Multiplying in the wrong order. The matrix exponential is Φ(t)Φ(0)⁻¹, with the inverse on the right.
- Using eA + B = eAeB for two matrices. This rule holds only when AB = BA.
- Forgetting the minus sign in the equilibrium point. For x′ = Ax + f, the equilibrium point is −A⁻¹f.
- Evaluating the matrix exponential at τ inside the integral. The matrix is eA(t − τ), and the forcing is evaluated at τ.
Summary
| Item | Result |
|---|---|
| Matrix exponential | eAt = I + At + (At)²/2! + (At)³/3! + … |
| Derivative | (eAt)′ = AeAt |
| Solution of x′ = Ax | x(t) = eAtx₀ |
| Diagonal matrix | eAt has eat and edt on the diagonal |
| From a fundamental matrix | eAt = Φ(t)Φ(0)⁻¹ |
| Constant forcing | x = xₑ + eAt(x₀ − xₑ), with xₑ = −A⁻¹f |
| Forcing f(t) | x(t) = eAtx₀ + ∫0t eA(t − τ)f(τ) dτ |
Practice
Work each problem on paper first. Then open the answer to check your work.
1. Write eAt for A = 300−2, and solve x′ = Ax with x(0) = 4 and y(0) = 1.
eAt = e3t00e−2ta diagonal matrixx = 4e3tthe first row times the initial vectory = e−2tthe second row times the initial vector
2. Calculate A² for A = 0200, and find eAt.
A² = 0000each row times each column is 0eAt = I + Atthe series stopseAt = 12t01add the two matrices
3. Use eAt = cos tsin t−sin tcos t to solve x′ = y, y′ = −x with x(0) = 2 and y(0) = 3.
x = 2 cos t + 3 sin tthe first row times the initial vectory = −2 sin t + 3 cos tthe second row times the initial vector
4. Find eAt for A = 0110, which has the solutions et11 and e−t1−1.
Φ(t) = ete−tet−e−tthe two solutions as columnsΦ(0) = 111−1at t = 0, with the determinant −2Φ(0)⁻¹ = 1/2111−1the rule for the inverseeAt = 1/2et + e−tet − e−tet − e−tet + e−tthe product Φ(t)Φ(0)⁻¹
5. Find the equilibrium point of x′ = −3x + y + 4, y′ = x − 3y + 4. Is it stable?
−3x + y + 4 = 0the first equation at the equilibrium pointx − 3y + 4 = 0the second equation at the equilibrium pointy = 3x − 4solve the first equation for yx − 9x + 12 + 4 = 0substitute in the second equationx = 2 and y = 2the equilibrium point
The matrix −311−3 has T = −6 and D = 8, and the discriminant 36 − 32 is positive. The equilibrium point is a stable node.
6. Solve x′ = −2x + 6 with x(0) = 1 as a system with one equation, using the result of Part 5.
xₑ = 3the equilibrium point, from −2x + 6 = 0x = xₑ + e−2t(x₀ − xₑ)the result of Part 5, with the number −2 in the place of the matrixx = 3 − 2e−2twith x₀ = 1
The check is x′ = 4e−2t, and −2x + 6 = −6 + 4e−2t + 6, which agrees.
Python Practice
Step 1. Powers of a matrix
The sign @ multiplies two matrices. The code below calculates A² and A³ for the matrix of the center in Part 3.
Python
The square is −I, and the third power is −A, as in Part 3. Now calculate the square of the matrix with the rows 0, 1 and 0, 0. The result should be the zero matrix.
Python
Step 2. The series of the matrix exponential
The code below adds the first 30 terms of the series for A of Part 3 at t = 1. Each term is the term before it times At, divided by the number n of the term. The matrix np.eye(2) is the identity matrix.
Python
The entries are cos 1 = 0.5403 and sin 1 = 0.8415, with a minus sign in the second row, as the formula of Part 3 says. Now calculate the matrix exponential at t = π. The result should be −I, a half turn.
Python
Step 3. The matrix exponential from the eigenvectors
The code below calculates eAt for the matrix of Part 4 at t = 0.5 in two ways: with the series, and with the product Φ(t)Φ(0)⁻¹. The instruction np.linalg.inv gives the inverse.
Python
Both results are the same matrix. Now do the same for the matrix of Practice 4, with the rows 0, 1 and 1, 0, at t = 0.5. Its solutions are et times the vector with the entries 1, 1 and e−t times the vector with the entries 1, −1. The first entry of the result should be 1.1276.
Python
Step 4. The solution from the matrix exponential
The code below calculates eAtx₀ for the matrix of Part 4 with the initial vector that has the entries 3 and 2, at t = 0.5. The second line of the output is the solution 2e4t + e−t and 3e4t − e−t of Topic 5.3.
Python
Both lines show 15.385 and 21.561. Now calculate the solution for the stable node with the rows −2, 1 and 1, −2 and the initial vector with the entries 3 and 1, at t = 0.5. Topic 5.3 found the values 1.436 and 0.990.
Python
Step 5. The equilibrium point of a forced system
For the two rooms of Part 6, the equilibrium point is −A⁻¹f. The instruction np.linalg.solve(A, -f) solves Ax = −f, which gives the same vector. The code below also follows the temperatures from 0 with the method of Euler until t = 10.
Python
The equilibrium point is 3 and 4, and the temperatures have reached it after 10 hours. Now turn the second heater off, so that the forcing vector has the entries 2 and 0. The equilibrium temperatures should be 1.333 and 0.667.
Python
Quiz
This quiz has 5 questions on this topic. A question asks you either to choose one answer or to type numbers. The page grades your answers and explains each one. A number can be typed as a whole number, a decimal, a fraction such as 1/3, or a calculation such as sqrt(18)/2 or arccos(1/2). The page shows the value of a calculation next to the box. Angles in a calculation are in degrees. The Calculator button under each question opens a calculator. Your answers are saved in your browser, so they are still on the page when you come back to it.
Choose how your answers are checked
1. What is eAt at t = 0?
In the series I + At + (At)²/2! + …, each term except the first one contains a positive power of t and is the zero matrix at t = 0. The first term is the identity matrix.
2. What is eAt for A = 200−5?
For a diagonal matrix, each entry on the diagonal gives its own exponential series, and the other entries stay 0. The system is x′ = 2x, y′ = −5y, which is not coupled.
3. For A = 0100, the matrix exponential is eAt = 1t01. The solution starts at x(0) = 2 and y(0) = 3. Find x and y at t = 4.
x = 1 · 2 + t · 3the first row times the initial vectorx = 14with t = 4y = 0 · 2 + 1 · 3the second row times the initial vectory = 3add
4. The matrix Φ(t) has two solutions of x′ = Ax as its columns. Which product is eAt?
The general solution is Φ(t)c, and the initial condition gives c = Φ(0)⁻¹x₀. The solution is Φ(t)Φ(0)⁻¹x₀, so eAt = Φ(t)Φ(0)⁻¹, with the inverse on the right.
5. Find the equilibrium point of x′ = −x + y + 1, y′ = −2y + 6.
−2y + 6 = 0the second equation at the equilibrium pointy = 3solve for y−x + 3 + 1 = 0the first equation with y = 3x = 4solve for x