Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Systems of homogeneous linear first-order ODEs with constant coefficients can be written in the form:

y=Ay\vv{y}' = \vv{A} \vv{y}

Let’s guess a solution of the form:

y=eλtxy=λeλtx\begin{align} \vv{y} &= e^{\lambda t} \vv{x} \\ \vv{y}' &= \lambda e^{\lambda t} \vv{x} \end{align}

Substituting in the ODE:

λeλtx=Aeλtλx=Ax\begin{align} \lambda e^{\lambda t} \vv{x} &= \vv{A} e^{\lambda t}\\ \lambda \vv{x} &= \vv{A} \vv{x} \end{align}

We find that our solution must satisfy an eigenvalue problem! λ\lambda is an eigenvalue and x is an eigenvector of A. We know an n x n matrix has n eigenvalues. Let’s suppose the corresponding eigenvectors are all linearly independent. What do we do?

In practice, this means that

y=i=1ncieλitxi=c1eλ1tx1++cneλntxn\vv{y} = \sum_{i=1}^n c_i e^{\lambda_i t} \vv{x}_i = c_1 e^{\lambda_1 t}\vv{x}_1 + \cdots + c_n e^{\lambda_n t}\vv{x}_n

(There are some cases this fails, but we will not cover them.) To apply the initial condition y(0)=y0\vv{y}(0) = \vv{y}_0, substitute and rewrite as a linear system:

y(0)=c1x1+cnxn=y0Xc=y0\begin{align} \vv{y}(0) = c_1 \vv{x}_1 + \cdots c_n \vv{x}_n &= \vv{y}_0 \\ \vv{X} \vv{c} &= \vv{y}_0 \end{align}

where X=[x1xn]\vv{X} = [\vv{x}_1 \cdots \vv{x}_n] is the matrix whose columns are the eigenvectors of A and c is the column vector of unknown coefficients.

Example: Reaction network (again)

We previously analyzed the concentration of three species (A, B, and C) undergoing a sequence of first-order reactions, ABCA \to B \to C, where the first reaction has rate constant k1k_1 and the second reaction has rate constant k2k_2. It gave rise to a system of first-order ODEs:

c=Ac,c(0)=[cA,000]\vv{c}' = \vv{A} \vv{c}, \quad \vv{c}(0) = \begin{bmatrix} c_{{\rm A},0} \\ 0 \\ 0 \end{bmatrix}

where

c=[cAcBcC]A=[k100k1k200k20]\vv{c} = \begin{bmatrix} c_{\rm A} \\ c_{\rm B} \\ c_{\rm C} \end{bmatrix} \qquad \vv{A} = \begin{bmatrix} -k_1 & 0 & 0 \\ k_1 & -k_2 & 0 \\ 0 & k_2 & 0 \end{bmatrix}

Solve again using eigenvalues and eigenvectors.


A is lower triangular, so its eigenvalues are: λ1=k1\lambda_1 = -k_1 λ2=k2\lambda_2 = -k_2, and λ3=0\lambda_3 = 0. We need to find the corresponding eigenvectors. Starting with λ1=k1\lambda_1 = -k_1:

Aλ1I=[000k1k2+k100k2k1]\vv{A} - \lambda_1 \vv{I} = \begin{bmatrix} 0 & 0 & 0 \\ k_1 & -k_2 + k_1 & 0 \\ 0 & k_2 & k_1 \end{bmatrix}

from which we obtain two equations:

k1x1(k2k1)x2=0k2x2+k1x3=0\begin{align} k_1 x_1 - (k_2 - k_1) x_2 &= 0 \\ k_2 x_2 + k_1 x_3 &= 0 \\ \end{align}

with x3x_3 free. Taking x3=1x_3 = 1 gives

x1=[k2k1k2k1k21]\vv{x}_1 = \begin{bmatrix} \dfrac{-k_2 - k_1}{k_2} \\ \dfrac{-k_1}{k_2} \\ 1 \end{bmatrix}

Next, we will solve with λ2=k2\lambda_2 = -k_2, which gives:

Aλ2I=[k2k100k1000k2k2]\vv{A} - \lambda_2 \vv{I} = \begin{bmatrix} k_2-k_1 & 0 & 0 \\ k_1 & 0 & 0 \\ 0 & k_2 & k_2 \end{bmatrix}

from which we obtain:

x2=[011]\vv{x}_2 = \begin{bmatrix} 0 \\ -1 \\ 1 \end{bmatrix}

Finally, we solve with λ3=0\lambda_3 = 0, which gives:

Aλ3I=[k100k1k200k20]\vv{A} - \lambda_3 \vv{I} = \begin{bmatrix} -k_1 & 0 & 0 \\ k_1 & -k_2 & 0 \\ 0 & k_2 & 0 \end{bmatrix}

from which we obtain:

x3=[001]\vv{x}_3 = \begin{bmatrix} 0\\ 0 \\ 1 \end{bmatrix}

Hence, the general solution is

c=a1ek1t[k2k1k2k1k21]+a2ek2t[011]+a3e0t[001]\vv{c} = a_1 e^{-k_1t} \begin{bmatrix} \dfrac{-k_2 - k_1}{k_2} \\ \dfrac{-k_1}{k_2} \\ 1 \end{bmatrix} + a_2 e^{-k_2t} \begin{bmatrix} 0 \\ -1 \\ 1 \end{bmatrix} + a_3 e^{0 t} \begin{bmatrix} 0\\ 0 \\ 1 \end{bmatrix}

Now, we apply the initial condition:

[k2k1k200k1k210111][a1a2a3]=[cA,000]\begin{align} \begin{bmatrix} \dfrac{-k_2 - k_1}{k_2} & 0 & 0 \\ \dfrac{-k_1}{k_2} & -1 & 0 \\ 1 & 1 & 1 \end{bmatrix} \begin{bmatrix} a_1 \\ a_2 \\ a_3 \end{bmatrix} = \begin{bmatrix} c_{{\rm A},0}\\ 0 \\ 0 \end{bmatrix} \end{align}

Thus,

a1=cA,0k2k2k1a2=k1k2a1=cA,0k1k2k1a3=a1a2=cA,0\begin{align} a_1 &= -c_{{\rm A},0}\frac{k_2}{k_2-k_1} \\ a_2 &= -\frac{k_1}{k_2}a_1 = c_{{\rm A},0}\frac{k_1}{k_2-k_1} \\ a_3 &= -a_1 - a_2 = c_{{\rm A},0} \end{align}

Finally, substitute these constants into the general solution and add across the rows to obtain solutions for each concentration:

cA(t)=a1ek1tk2k1k2=cA,0ek1tcB(t)=a1ek1tk1k2a2ek2t=cA,0k1k2k1(ek1tek2t)cC(t)=a1ek1t+a2ek2t+a3=cA,0(1k2k2k1ek1t+k1k2k1ek2t)\begin{align} c_{\rm A}(t) &= a_1e^{-k_1t}\frac{-k_2-k_1}{k_2} = c_{{\rm A},0}e^{-k_1t} \\ c_{\rm B}(t) &= a_1e^{-k_1t}\frac{-k_1}{k_2} - a_2e^{-k_2t} \\ &= c_{{\rm A},0}\frac{k_1}{k_2 - k_1}(e^{-k_1t} - e^{-k_2t}) \\ c_{\rm C}(t) &= a_1e^{-k_1t} + a_2e^{-k_2t} + a_3 \\ &= c_{{\rm A},0}\Biggl(1 - \frac{k_2}{k_2 - k_1} e^{-k_1t} + \frac{k_1}{k_2 - k_1} e^{-k_2t}\Biggr) \end{align}

This matches our old answer!

Example: Diffusion cell

Consider a diffusion cell consisting of two compartments with solute concentrations c1c_1 and c2c_2 separated by a membrane.

Diffusion cell

Based on unsteady mole balances, the concentrations change according to:

c1=0.1c1+0.1c2c2=0.1c10.1c2\begin{align} c_1' &= -0.1c_1 + 0.1c_2 \\ c_2' &= 0.1c_1 - 0.1c_2 \end{align}

Solve for c1c_1 and c2c_2 as a function of time if they are initially 1 M and 0 M, respectively.


Write in matrix form c=Ac\vv{c}' = \vv{A} \vv{c}, where

c=[c1c2]A=[0.10.10.10.1]\vv{c} = \begin{bmatrix}c_1 \\ c_2\end{bmatrix} \qquad \vv{A} = \begin{bmatrix} -0.1 & 0.1 \\ 0.1 & -0.1 \end{bmatrix}

Since A is symmetric, it has real eigenvalues:

AλI=0.1λ0.10.10.1λ=(λ+0.1)20.12=λ2+0.2λ=λ(λ+0.2)=0\begin{align} |\vv{A} - \lambda \vv{I}| &= \begin{vmatrix} -0.1 - \lambda & 0.1 \\ 0.1 & -0.1 - \lambda \end{vmatrix}\\ &= (\lambda + 0.1)^2 - 0.1^2 \\ &= \lambda^2 + 0.2\lambda \\ & = \lambda(\lambda + 0.2) = 0 \end{align}

So, the eigenvalues are λ1=0\lambda_1 = 0 and λ2=0.2\lambda_2 = -0.2. Next, we find the eigenvectors:

Aλ1I=[0.10.10.10.1]x1=[11]Aλ2I=[0.10.10.10.1]x2=[11]\begin{align} \vv{A}-\lambda_1 \vv{I} &= \begin{bmatrix} -0.1 & 0.1 \\ 0.1 & -0.1 \end{bmatrix} \to \vv{x}_1 = \begin{bmatrix} 1 \\ 1 \end{bmatrix} \\ \vv{A} - \lambda_2 \vv{I} &= \begin{bmatrix} 0.1 & 0.1 \\ 0.1 & 0.1 \end{bmatrix} \to \vv{x}_2 = \begin{bmatrix} 1 \\ -1 \end{bmatrix} \end{align}

The general solution is:

c(t)=a1e0t[11]+a2e0.2t[11]=a1[11]+a2e0.2t[11]\begin{align} \vv{c}(t) &= a_1 e^{0t} \begin{bmatrix} 1 \\ 1 \end{bmatrix} + a_2 e^{-0.2t} \begin{bmatrix} 1 \\ -1 \end{bmatrix} \\ &= a_1 \begin{bmatrix} 1 \\ 1 \end{bmatrix} + a_2 e^{-0.2t} \begin{bmatrix} 1 \\ -1 \end{bmatrix} \end{align}

Apply the initial conditions by solving Xa=c(0)\vv{X}\vv{a} = \vv{c}(0) using Gauss-Jordan elimination:

[111110]R1R1[111021]R1÷2[111011/2]R2R2[101/2011/2]\begin{align} \begin{bmatrix} 1 & 1 & 1\\ 1 & -1 & 0\end{bmatrix} \begin{matrix}\vphantom{R_1} \\ -R_1 \end{matrix} &\to \begin{bmatrix} 1 & 1 & 1\\ 0 & -2 & -1\end{bmatrix} \begin{matrix}\vphantom{R_1} \\ \div -2 \end{matrix} \\ &\to \begin{bmatrix} 1 & 1 & 1\\ 0 & 1 & 1/2\end{bmatrix} \begin{matrix} -R_2 \\ \vphantom{R_2} \end{matrix} \\ &\to \begin{bmatrix} 1 & 0 & 1/2 \\ 0 & 1 & 1/2\end{bmatrix} \end{align}

so a1=a2=1/2a_1 = a_2 = 1/2. Substituting back, the general solution for c(t)\vv{c}(t) becomes:

c(t)=12[11]+12e0.2t[11]\vv{c}(t) = \frac{1}{2} \begin{bmatrix} 1 \\ 1 \end{bmatrix} + \frac{1}{2} e^{-0.2t} \begin{bmatrix} 1 \\ -1 \end{bmatrix}

or equivalently

c1(t)=12(1+e0.2t)c2(t)=12(1e0.2t)\begin{align} c_1(t) &= \frac{1}{2} \left(1 + e^{-0.2 t}\right) \\ c_2(t) &= \frac{1}{2} \left(1 - e^{-0.2 t}\right) \end{align}

Types of critical points

We can use the eigenvalues and eigenvectors to anticipate what solutions around critical points (y=0\vv{y}' = \vv{0}, or steady states) look like. We will focus our discussion on only 2 x 2 systems.

Skill builder problems

Solve the inital value problem y=Ay \vv{y}' = \vv{A}\vv{y} with y(0)=[10]T\vv{y}(0) = [1 \quad 0]^{\rm T} for the following matrices. Also classify the type of critical point using the eigenvalues.

Solution to Exercise 1

A is upper triangular, so its eigenvalues are on its diagonal, λ1=λ2=2\lambda_1 = \lambda_2 = -2. Its eigenvectors are:

x1=[10]x2=[01]\vv{x}_1 = \begin{bmatrix} 1 \\ 0 \end{bmatrix} \qquad \vv{x}_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix}

since Aλ1,2I=0\vv{A} - \lambda_{1,2} \vv{I} = 0. The general solution is:

y=c1e2t[10]+c2e2t[01]\vv{y} = c_1 e^{-2t} \begin{bmatrix} 1 \\ 0 \end{bmatrix} + c_2 e^{-2t} \begin{bmatrix} 0 \\ 1 \end{bmatrix}

To solve for the initial condition, form the augmented matrix for Xc=y(0)\vv{X}\vv{c} = \vv{y}(0),

[101010]\begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 0 \end{bmatrix}

so c1=1c_1 = 1 and c2=0c_2 = 0.

Hence,

y=e2t[10]\vv{y} =e ^{-2t} \begin{bmatrix} 1 \\ 0 \end{bmatrix}

or

y1=e2ty2=0\begin{align} y_1 &= e^{-2t} \\ y_2 &= 0 \end{align}

The critical point is a stable proper node because λ1=λ2<0\lambda_{1} = \lambda_{2} < 0 and A is a multiple of I.

Solution to Exercise 2

First, find the eigenvalues of A:

AλI=λ312λ=λ236=0λ1,2=±6\begin{align} |\vv{A}-\lambda \vv{I}| &= \begin{vmatrix} -\lambda & 3 \\ 12 & -\lambda \end{vmatrix} \\ &= \lambda^{2}-36=0 \\ \lambda_{1,2} &= \pm 6 \end{align}

For λ1=6\lambda_1 = 6,

Aλ1I=[63126]x1=[12]\vv{A}-\lambda_1\vv{I} = \begin{bmatrix} -6 & 3 \\ 12 & -6 \end{bmatrix} \to \vv{x}_1 = \begin{bmatrix} 1 \\ 2 \end{bmatrix}

For λ2=6\lambda_2 = -6,

Aλ2I=[63126]x2=[12]\vv{A}-\lambda_2\vv{I} = \begin{bmatrix} 6 & 3 \\ 12 & 6 \end{bmatrix} \to \vv{x}_2 = \begin{bmatrix} 1 \\ -2 \end{bmatrix}

The general solution is:

y=c1e6t[12]+c2e6t[12]\vv{y} = c_1 e^{6t} \begin{bmatrix} 1 \\ 2 \end{bmatrix} + c_2 e^{-6t} \begin{bmatrix} 1 \\ -2 \end{bmatrix}

To solve for the initial condition, form the augmented matrix for Xc=y(0)\vv{X}\vv{c} = \vv{y}(0),

[121220]R1R1[111042]R1÷4[1110112]R2R2[10120112]\begin{align} \begin{bmatrix} 1 & 2 & 1 \\ 2 & -2 & 0 \end{bmatrix} \begin{matrix} \vphantom{R_1} \\ -R_1 \end{matrix} & \to \begin{bmatrix} 1 & 1 & 1 \\ 0 & -4 & -2 \end{bmatrix} \begin{matrix} \vphantom{R_1} \\ \div -4 \end{matrix} \\ & \to \begin{bmatrix} 1 & 1 & 1 \\ 0 & 1 & \frac{1}{2} \end{bmatrix} \begin{matrix} -R_2 \\ \vphantom{R_2} \end{matrix} \\ & \to \begin{bmatrix} 1 & 0 & \frac{1}{2} \\ 0 & 1 & \frac{1}{2} \end{bmatrix} \end{align}

so c1=1/2c_1 = 1/2 and c2=1/2c_2 = 1/2 and

y=12e6t[12]+12e6t[12]\vv{y} = \frac{1}{2}e^{-6t} \begin{bmatrix} 1 \\ 2 \end{bmatrix} + \frac{1}{2}e^{-6t} \begin{bmatrix} 1 \\ -2 \end{bmatrix}

or

y1=12(e6t+e6t)y2=e6t+e6t\begin{align} y_1 & =\frac{1}{2}(e^{6t}+e^{-6t}) \\ y_2 &= e^{6t}+e^{-6t} \end{align}

The critical point is a saddle because the eigenvalues are real and λ1>0\lambda_1 > 0 but λ2<0\lambda_2 < 0.

Solution to Exercise 3

First, find the eigenvalues of A:

AλI=λ44λ=λ2+16=0λ1,2=±4i\begin{align} |\vv{A} - \lambda \vv{I}| &= \begin{vmatrix} -\lambda & 4 \\ -4 & -\lambda \end{vmatrix} \\ &= \lambda^2 + 16 = 0 \\ \lambda_{1,2} &= \pm 4i \end{align}

For λ1=4i\lambda_1 = 4i,

Aλ1I=[4i444i]x1=[i1]\vv{A}-\lambda_1\vv{I} = \begin{bmatrix} -4i & 4 \\ -4 & -4i \end{bmatrix} \to \vv{x}_1 = \begin{bmatrix} -i \\ 1 \end{bmatrix}

For λ2=4i\lambda_2 = -4i,

Aλ2I=[4i444i]x2=[i1]\vv{A}-\lambda_2\vv{I} = \begin{bmatrix} 4i & 4 \\ -4 & 4i \end{bmatrix} \to \vv{x}_2 = \begin{bmatrix} i \\ 1 \end{bmatrix}

The general solution is:

y=c1e4it[i1]+c2e4it[i1]\vv{y} = c_1 e^{4it} \begin{bmatrix} -i \\ 1 \end{bmatrix} + c_2 e^{-4it} \begin{bmatrix} i \\ 1 \end{bmatrix}

To solve for the initial condition, form the augmented matrix for Xc=y(0)\vv{X}\vv{c} = \vv{y}(0),

[ii1110]swapR2[110ii1]R1R1[11002i1]R1÷2i[1100112i]R2R2[1012i0112i]\begin{align} \begin{bmatrix} -i & i & 1 \\ 1 & 1 & 0 \end{bmatrix} \begin{matrix} {\rm swap} \\ \vphantom{R_2}\end{matrix} &\to \begin{bmatrix} 1 & 1 & 0 \\ -i & i & 1 \end{bmatrix} \begin{matrix} \vphantom{R_1} \\ -R_1 \end{matrix} \\ &\to \begin{bmatrix} 1 & 1 & 0 \\ 0 & 2i & 1 \end{bmatrix} \begin{matrix} \vphantom{R_1} \\ \div 2i \end{matrix} \\ &\to \begin{bmatrix} 1 & 1 & 0 \\ 0 & 1 & \frac{1}{2i} \end{bmatrix} \begin{matrix} -R_2 \\ \vphantom{R_2} \end{matrix} \\ &\to \begin{bmatrix} 1 & 0 & -\frac{1}{2i} \\ 0 & 1 & \frac{1}{2i} \end{bmatrix} \end{align}

so c1=1/(2i)=i/2c_1 = -1/(2i) = i/2 and c2=1/(2i)=i/2c_2 = 1/(2i) = -i/2 and

y=i2e4it[i1]i2e4it[i1]\vv{y} = \frac{i}{2} e^{4it} \begin{bmatrix} -i \\ 1 \end{bmatrix} - \frac{i}{2} e^{-4it} \begin{bmatrix} i \\ 1 \end{bmatrix}

This solution is acceptable, but we can simplify it further using Euler’s identity:

y=12(cos4t+isin4t)[1i]12(cos4tisin4t)[1i]=[cos4tsin4t]\begin{align} \vv{y} &= \frac{1}{2} \left( \cos 4t + i \sin 4t \right) \begin{bmatrix} 1 \\ i \end{bmatrix} - \frac{1}{2} \left( \cos 4t - i \sin 4t \right) \begin{bmatrix} -1 \\ i \end{bmatrix} \\ &= \begin{bmatrix} \cos 4t \\ -\sin 4t \end{bmatrix} \end{align}

so

y1=cos4ty2=sin4t\begin{align} y_1 &= \cos 4 t \\ y_2 &= -\sin 4t \end{align}

The critial point is a center because the eigenvalues are purely imaginary.

Solution to Exercise 4

First, find the eigenvalues of A

AλI=2λ222λ=(λ2)2+4=0λ1,2=2±2i\begin{align} \vv{A} - \lambda\vv{I} &= \begin{vmatrix} 2- \lambda & -2\\ 2 & 2-\lambda \end{vmatrix} \\ &= (\lambda - 2)^2 + 4 = 0 \\ \lambda_{1,2} &= 2 \pm 2i \end{align}

For λ1=2+2i\lambda_1 = 2+2i,

Aλ1I=[2i222i]x1=[i1]\vv{A}-\lambda_1\vv{I} = \begin{bmatrix} -2 i & -2\\ 2 & -2i \end{bmatrix} \to \vv{x}_1 = \begin{bmatrix} i \\ 1 \end{bmatrix}

For λ2=22i\lambda_2 = 2-2i,

Aλ2I=[2i222i]x2=[i1]\vv{A}-\lambda_2\vv{I} = \begin{bmatrix} 2 i & -2\\ 2 & 2i \end{bmatrix} \to \vv{x}_2 = \begin{bmatrix} -i \\ 1\end{bmatrix}

The general solution is:

y=c1e(2+2i)t[i1]+c2e(22i)t[i1]=e2t(c1e2it[i1]++c2e2it[i1])\begin{align} \vv{y} &= c_1 e^{(2+2i)t} \begin{bmatrix} i\\ 1 \end{bmatrix} + c_2 e^{(2-2i)t} \begin{bmatrix} -i\\ 1 \end{bmatrix} \\ &= e^{2t} \Biggl( c_1 e^{2it} \begin{bmatrix} i\\ 1 \end{bmatrix} + + c_2 e^{-2it} \begin{bmatrix} -i\\ 1 \end{bmatrix}\Biggr) \end{align}

To solve for the initial condition, form the augmented matrix for Xc=y(0)\vv{X}\vv{c} = \vv{y}(0),

[ii1110]swapR2[110ii1]R1iR1[11002i1]R1÷2i[1100112i]R2R2[1012i0112i]\begin{align} \begin{bmatrix} i & -i & 1\\ 1 & 1 & 0 \end{bmatrix} \begin{matrix}{\rm swap} \\ \vphantom{R_2}\end{matrix} &\to \begin{bmatrix} 1 & 1 & 0\\ i & -i & 1 \end{bmatrix} \begin{matrix}\vphantom{R_1} \\ -i R_1 \end{matrix} \\ &\to \begin{bmatrix} 1 & 1 & 0\\ 0 & -2i & 1 \end{bmatrix} \begin{matrix}\vphantom{R_1} \\ \div -2i \end{matrix} \\ &\to \begin{bmatrix} 1 & 1 & 0\\ 0 & 1 & \frac{-1}{2i} \end{bmatrix} \begin{matrix} -R_2 \\ \vphantom{R_2}\end{matrix} \\ &\to \begin{bmatrix} 1 & 0 & \frac{1}{2i}\\ 0 & 1 & - \frac{1}{2i} \end{bmatrix} \end{align}

so c1=1/(2i)=i/2c_1 = 1/(2i) = -i/2 and c2=1/(2i)=i/2c_2 = -1/(2i) = i/2. Hence,

y=e2t(i2e2it[i1]+i2e2it[i1])\vv{y} = e^{2t} \Biggl( - \frac{i}{2} e^{2it} \begin{bmatrix} i \\ 1 \end{bmatrix} + \frac{i}{2} e{-2it} \begin{bmatrix} -i\\ 1 \end{bmatrix} \Biggr)

Simplifying using Euler’s identity eix=cosx+isinxe^{ix} = \cos x + i \sin x and adding across the rows gives

y1=e2tcos2ty2=e2tsin2t\begin{align} y_1 &= e^{2t} \cos 2t\\ y_2 &= e^{2t} \sin 2t \end{align}

The critical point is an unstable spiral because the eigenvalues are complex, and the real part is positive.