Scientia sine finibus

Linear Algebra / Unit 5, Eigenvalues and Eigenvectors / Topic 5.5

Units and Topics

Unit 5. Eigenvalues and Eigenvectors

5.5 Systems of Differential Equations and the Matrix Exponential

This topic uses eigenvalues and eigenvectors to solve systems of linear differential equations, in which several quantities change continuously and affect each other. It also defines the exponential of a matrix, which is the form that the solution takes in quantum mechanics.

You need Topics 5.1 and 5.3 for this topic. You also need the derivative of the exponential function.

1. One Equation

The simplest differential equation says that a quantity changes at a rate proportional to itself.

dx/dt = ax has the solution x(t) = x(0) eat

The solution grows when a is positive and dies away when a is negative. Radioactive decay, the cooling of an object, and the discharge of a capacitor follow this equation with a negative a.

2. A System of Equations

When two quantities affect each other, each rate depends on both quantities.

dx/dt = −2x + y dy/dt = x − 2y

For example, x and y can be the temperatures of two objects, measured from the temperature of the room. Each object loses heat to the room and exchanges heat with the other object. In matrix form, with x = (x, y),

dx/dt = Ax with A = −211−2

The two equations are coupled: neither can be solved alone.

3. Solutions from Eigenvectors

Look for a solution that keeps one direction and changes only its size, x(t) = eλtv, where v is a fixed vector. Its derivative is λeλtv, and Ax is eλtAv. The two sides are equal when

Av = λv

Each eigenvector v of A, with its eigenvalue λ, gives the solution eλtv. Along an eigenvector, the system behaves like the single equation of Part 1.

The system is linear, so a combination of solutions is a solution. If A has n independent eigenvectors, the general solution is

x(t) = c₁eλ₁tv₁ + c₂eλ₂tv₂ + … + cₙeλₙtvₙ

The constants come from the starting value. At t = 0 each exponential is 1, so x(0) = c₁v₁ + … + cₙvₙ. The constants are the coordinates of x(0) in the basis of eigenvectors.

Compare this with Topic 5.4. For repeated steps, each term was multiplied by λk. For continuous change, each term is multiplied by eλt.

The example

The matrix A has the trace −4 and the determinant 3, so λ² + 4λ + 3 = 0, and the eigenvalues are −1 and −3. The eigenvectors are (1, 1) for λ = −1 and (1, −1) for λ = −3. Take the starting value x(0) = (3, 1).

31 = 2 11 + 1 1−1the starting value in the basis of eigenvectorsx(t) = 2e−t 11 + e−3t 1−1each part is multiplied by its exponentialx(t) = 2e−t + e−3tthe first componenty(t) = 2e−t − e−3tthe second component

Both eigenvalues are negative, so both temperatures go to the temperature of the room. The term with e−3t dies away faster. It holds the difference between the two temperatures, so the two objects first reach a common temperature, and then cool together.

Try it: the paths of the solutions

Choose a system and drag the blue point to set the starting value. The curve is the path of the solution x(t) as time passes, and the arrowhead shows its direction. The dashed lines are the lines of the eigenvectors, when the eigenvalues are real.

4. What the Eigenvalues Decide

EigenvalueIts term as time passes
Real and negativeDies away
Real and positiveGrows without limit
ZeroStays constant
Imaginary, such as i and −iOscillates with a constant size
Complex with a negative real partOscillates and dies away
Complex with a positive real partOscillates and grows

A system is called stable when all of its solutions die away. That happens exactly when the real part of each eigenvalue is negative. Unit 8 explains how eλt with a complex λ produces sines and cosines.

5. Oscillations and Normal Modes

Newton’s second law gives equations with second derivatives. Two equal masses m are joined to each other and to two walls by three equal springs with the spring constant k. If x₁ and x₂ are the displacements of the masses from equilibrium, then

m x₁″ = −2k x₁ + k x₂ m x₂″ = k x₁ − 2k x₂

In matrix form, mx″ = −Kx, where K is the matrix with the rows 2k, −k and −k, 2k. Look for a motion in which both masses oscillate with one angular frequency ω, x(t) = cos(ωt)v. Its second derivative is −ω² cos(ωt)v, so the equation requires

Kv = mω²v

This is an eigenvalue problem for K. The matrix with the rows 2, −1 and −1, 2 has the eigenvalues 1 and 3, with the eigenvectors (1, 1) and (1, −1).

EigenvectorMotionAngular frequency
(1, 1)The masses move together, in the same directionω = √k/m
(1, −1)The masses move in opposite directionsω = √3k/m

These two motions are called the normal modes of the system. Any motion of the two masses is a combination of the two normal modes. In the second mode the middle spring is stretched and compressed, which is the reason for its higher frequency.

6. The Exponential of a Matrix

The solution of the single equation is x(t) = eatx(0). The solution of the system can be written in the same form, x(t) = eAtx(0), if the exponential of a matrix is defined by the same series as the exponential of a number.

eAt = I + At + (At)²/2! + (At)³/3! + …

The series adds up to a matrix for any square matrix A. Taking the derivative of each term shows that the derivative of eAt is AeAt, so eAtx(0) solves the system, and at t = 0 it is equal to x(0).

The exponential of a diagonalizable matrix

If A = PDP⁻¹, then each power is (At)k = P(Dt)kP⁻¹, as in Topic 5.3, and the series becomes

eAt = P eDt P⁻¹

The exponential of the diagonal matrix Dt is the diagonal matrix with the entries eλ₁t, …, eλₙt. For the example of Part 3, P has the columns (1, 1) and (1, −1), and

eAt = 1/2 e−t + e−3te−t − e−3te−t − e−3te−t + e−3t

Multiplying this matrix by (3, 1) gives the solution of Part 3.

Rules

  • eAt is the identity matrix at t = 0.
  • The inverse of eAt is e−At. The exponential of a matrix always has an inverse.
  • If v is an eigenvector of A with the eigenvalue λ, then it is an eigenvector of eAt with the eigenvalue eλt.
  • eA + B is equal to eAeB only when AB = BA. For matrices that do not commute, the rule for numbers fails.

The exponential that rotates

Let J be the matrix of the rotation by 90°, with the rows 0, −1 and 1, 0. Its square is −I, so the powers of J repeat: J, −I, −J, I. The terms of the series with even powers collect into the series for cos t, and the terms with odd powers collect into the series for sin t.

eJt = (cos t) I + (sin t) J = cos t−sin tsin tcos t

The exponential of Jt is the rotation by the angle t. The system dx/dt = Jx moves each point around a circle at a constant rate.

This is the form of the main equation of quantum mechanics. The Schrödinger equation is a linear system, dψ/dt = −(i/ħ)Hψ, where H is the matrix or operator of the energy. Its solution is ψ(t) = e−iHt/ħψ(0). Each eigenvector of H is multiplied by e−iEt/ħ, where E is its eigenvalue, the energy. Topic 9.8 develops this.

Common Mistakes

  • Using λk in place of eλt. Powers belong to repeated steps, and exponentials belong to continuous change.
  • Finding the constants from the standard components of x(0). The constants are the coordinates of x(0) in the basis of eigenvectors.
  • Calculating eA by taking the exponential of each entry of A. That works only for a diagonal matrix.
  • Using eA + B = eAeB for matrices that do not commute.
  • Deciding stability from the determinant or from one eigenvalue. All of the eigenvalues must have negative real parts.
  • Reading the frequency of a normal mode as the eigenvalue. The eigenvalue of K is mω², so the frequency contains a square root.

Summary

FactStatement
Systemdx/dt = Ax
Solution from an eigenvectoreλtv
General solutionc₁eλ₁tv₁ + … + cₙeλₙtvₙ, with the constants from x(0)
Stable systemThe real part of each eigenvalue is negative
Normal modesThe eigenvectors of K, with Kv = mω²v
Matrix exponentialeAt = I + At + (At)²/2! + … = PeDtP⁻¹
Solution with the exponentialx(t) = eAtx(0)

Practice

Work each problem on paper first. Then open the answer to check your work.

1. Solve dx/dt = 3x and dy/dt = −y with x(0) = 2 and y(0) = 5.

The matrix is diagonal, so the equations are not coupled.

x(t) = 2e3t and y(t) = 5e−t.

2. Find the general solution of dx/dt = Ax for A = 1221.

The eigenvalues are 3 and −1, with the eigenvectors (1, 1) and (1, −1).

x(t) = c₁e3t(1, 1) + c₂e−t(1, −1).

3. For the system in Problem 2, find the solution with x(0) = (4, 0), and describe it for large t.

c₁ + c₂ = 4the first components at t = 0c₁ − c₂ = 0the second components at t = 0c₁ = 2add the two equations, then divide by 2c₂ = 2because c₁ = c₂x(t) = 2e3t(1, 1) + 2e−t(1, −1)the solution

For large t the second term dies away, and the solution grows along the direction (1, 1).

4. Is the system with A = −140−2 stable?

The matrix is triangular, so the eigenvalues are −1 and −2.

Both are negative, so all solutions die away. The system is stable.

5. Find eAt for A = 200−1.

The matrix is diagonal, so eAt is the diagonal matrix with the entries e2t and e−t.

6. Two equal masses of 0.5 kg are joined to each other and to two walls by three springs with the spring constant 8 N/m. Find the angular frequencies of the two normal modes.

ω = √k/m = √16 = 4 rad/sthe mode in which the masses move togetherω = √3k/m = √48 ≈ 6.93 rad/sthe mode in which they move in opposite directions

Python Practice

Step 1. The exponential function

The instruction np.exp calculates the exponential function. The code below prints e¹ and e⁻¹.

Python

The results are about 2.718 and 0.368.

Step 2. Evaluate a solution

The solution of the example in Part 3 is x(t) = 2e−t(1, 1) + e−3t(1, −1). The code below calculates it at t = 1. The * sign means multiplication.

Python

At t = 1 the two temperatures are about 0.786 and 0.686. They are already close to each other, because the term with e−3t has almost died away.

In the next box, change the time so that the code prints the starting value of the solution.

Python

Step 3. Build the exponential of a matrix

From Part 6, eAt = PeDtP⁻¹. The instruction np.linalg.eig gives the eigenvalues and a matrix whose columns are eigenvectors. When np.exp is given a list, it takes the exponential of each number in the list, so np.exp(w * t) holds eλt for each eigenvalue. The instruction np.diag puts these numbers on the diagonal of a matrix.

Python

The first result is the matrix eAt at t = 1. The second result is that matrix times the starting value (3, 1). It agrees with the solution in Step 2.

Now find the two temperatures at t = 2 for a different starting value, (4, 0). Two lines have to change.

Python

Step 4. Add up the series

The series of Part 6 can be added up with a loop. From Topic 5.4, the line for k in range(1, 20): repeats the indented lines, with k equal to 1, then 2, and so on up to 19. Each repeat builds the next term of the series from the term before it, and adds it to the sum. The instruction np.eye(2) is the 2 by 2 identity matrix, and np.pi is the number π.

The code below adds up the series for eJt with t = π/2, where J is the rotation by 90°. The instruction np.round rounds each entry to 6 decimal places.

Python

The result has the rows 0, −1 and 1, 0. The exponential of Jt with t = π/2 is the rotation by 90°, as Part 6 states. Python may print a 0 as -0. The value is the same.

Now change t so that the result is the rotation by 180°, which is the matrix −I.

Python

Step 5. Find the normal modes

The code below finds the normal modes of Practice Problem 6. The matrix K has the rows 2k, −k and −k, 2k, with k = 8 and m = 0.5. The eigenvalues of K are mω², so the angular frequencies are the square roots of the eigenvalues divided by m. The instruction np.sqrt calculates a square root.

Python

The angular frequencies are about 6.93 and 4 radians per second. The columns of V are the two modes. In one column the two components have opposite signs, and that column belongs to the higher frequency: the masses move in opposite directions.

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. Which function solves dx/dt = −4x with x(0) = 3?

2. The matrix A of the system dx/dt = Ax has the eigenvalues −2 and 1. Is the system stable?

3. The starting value is x(0) = (5, 1), and the eigenvectors are (1, 1) and (1, −1). Find the constants c₁ and c₂ in (5, 1) = c₁(1, 1) + c₂(1, −1).

4. For two masses on springs, Kv = mω²v. One eigenvalue of K is 12 N/m, and each mass is m = 3 kg. Find the angular frequency ω, in radians per second.

5. In which case is eA + B equal to eAeB?

Next: Topic 6.1, Projections