This material has been adapted from material by Fergus Cooper and others from the "Essential Mathematics" module at the Doctoral Training Centre, University of Oxford.
This course material was developed as part of UNIVERSE-HPC, which is funded through the SPF ExCALIBUR programme under grant number EP/W035731/1
Systems of differential equations 3
Learning outcomes
Be able to describe the behaviour of a system using eigenvalue analysis
Understand the nature of a system's stability from its eigenvalues
YouTube lecture recording from October 2020
A recording of this lecture from October 2020; the material has changed a little since.
Why stability?
In lecture 11 we decided whether a steady state s∗ of ds/dt=f(s) is stable from the slope f′(s∗).
In lecture 14 we saw that the solution of a linear system is a sum of eigenvectors, each growing or shrinking at a rate set by its eigenvalue.
In lecture 15 we found the fixed points of a nonlinear system from its nullclines.
In this lecture we put these together.
Close to a fixed point, a nonlinear system behaves like a linear one, so eigenvalues tell us whether each fixed point is stable, and so where the system ends up.
The example from lecture 15
We will come back to the system
x˙y˙=x(1−x)−xy,=y(2−y)−3xy,
where y(2−y) is the same as lecture 15's 2y(1−y/2).
Its nullclines cross at four fixed points: (0,0), (1,0), (0,2) and (1/2,1/2).
Which of them do solutions settle at, and why?
Linear systems
The decoupled ODE system
x˙y˙=λ1x,=λ2y,
has a fixed point or steady state where x˙=y˙=0, at the origin.
Solutions look like x=Aeλ1t and y=Beλ2t, and thus grow exponentially or shrink exponentially depending on the signs of λ1 and λ2.
If λ1<0 and λ2<0, then all the flow is towards the fixed point.
If λ1 or λ2 is positive, then some flow will be driven away (towards infinity).
Adding in a constant (inhomogeneous) component shifts the fixed point away from the origin.
For example, the system
x˙y˙=λ1x+10,=λ2y+10
has x˙=y˙=0 at x=−10/λ1, y=−10/λ2.
Its solutions behave in the same way as before, but around this point instead of the origin.
Coupling the system has the effect of altering the principal directions over which the exponential terms apply (changing the basis).
This means that the homogeneous linear system
x˙y˙=ax+by,=cx+dy,
has a fixed point at the origin.
As in lecture 14, its solution is
x=c1v1eλ1t+c2v2eλ2t,
where λ1, λ2 and v1, v2 are the eigenvalues and eigenvectors of the matrix
A=(acbd).
So the long-term growth or shrinkage of solutions over time is determined by the eigenvalues, along the eigenvectors.
For example, with lecture 14's matrix A=(1210), the eigenvalues are −1 and 2: solutions come in along the first eigenvector (dashed blue) and go out along the second (dashed orange), which makes the origin a saddle:
When the eigenvalues are complex, the solutions turn around the fixed point instead: they spiral in if the real part is negative, and out if it is positive.
More generally, the inhomogeneous linear system
x˙y˙=ax+by+p,=cx+dy+q,
can be written
(x˙y˙)=(acbd)(xy)+(pq).
It has a fixed point at
(xy)=−(acbd)−1(pq).
The long-term growth or shrinkage of solutions over time is again determined by the eigenvalues of the matrix.
Nonlinear systems: linearisation
A more general two-dimensional nonlinear system is
x˙y˙=f(x,y),=g(x,y),
where f and g can be any functions whatever.
We can write a polynomial (Taylor) expansion for the system when it is close to a fixed point (x∗,y∗), with the partial derivatives evaluated at (x∗,y∗):
At a fixed point f(x∗,y∗)=g(x∗,y∗)=0, so the first terms drop out.
The terms we have left out (the "…") involve (x−x∗)2, (x−x∗)(y−y∗) and so on, which are much smaller still when we are close to the fixed point.
So, close to the fixed point:
x˙y˙≈∂x∂f∂x∂g∂y∂f∂y∂gx−x∗y−y∗.
This means that (really close to the fixed point) we can approximate with a linear system.
The eigenvalues λ1, λ2 of the Jacobian matrix
J=∂x∂f∂x∂g∂y∂f∂y∂g
will determine if a small perturbation away from (x∗,y∗) will decay or grow.
J plays the part that the slope f′(s∗) played in lecture 11: there, a steady state was stable if f′(s∗)<0.
Steady state classification
A fixed point is stable if every eigenvalue of J has a negative real part, and unstable if any has a positive real part.
More precisely, its type depends on the eigenvalues as follows:
λ1<λ2<0: stable node
λ1=λ2<0: stable star if J is a multiple of I (every direction is an eigenvector), otherwise a stable degenerate node (only one eigenvector direction)
λ1>λ2>0: unstable node
λ1=λ2>0: unstable star or unstable degenerate node, in the same way
λ1<0<λ2: saddle (or hyperbolic) point, unstable
Complex λ: spiral (with the real part determining stability)
Imaginary λ: centre (solutions cycle round the fixed point)
If an eigenvalue has a real part of exactly zero (a centre, for example), the linear approximation cannot decide the stability of a nonlinear system: the terms we left out decide it.
(this τ is the trace, not the time scale from lecture 15).
Solving the quadratic,
λ=2τ±τ2−4Δ.
So, from the trace and determinant alone:
Δ<0: the square root is larger than ∣τ∣, so the eigenvalues have opposite signs, and the fixed point is a saddle
Δ>0 and τ<0: stable
Δ>0 and τ>0: unstable
τ2<4Δ: the eigenvalues are complex, and the fixed point is a spiral
The diagram below shows each type in the (Δ,τ) plane, with a small phase portrait of an example in each region.
Stars and degenerate nodes lie on the parabola τ2=4Δ, and centres on the positive Δ axis:
Both eigenvalues are positive, so this is an unstable node.
At (1/2,1/2):
J(1/2,1/2)=−21−23−21−21,τ=−1,Δ=−21.
Δ<0, so this is a saddle.
Solving λ2+λ−1/2=0,
λ±=−21±23,
one positive and one negative.
At (1,0):
J(1,0)=(−10−1−1),τ=−2,Δ=1⟹λ1=λ2=−1.
This is stable.
J is not a multiple of I (it has only one eigenvector direction, (1,0)T), so it is a stable degenerate node.
At (0,2):
J(0,2)=(−1−60−2),τ=−3,Δ=2⟹λ1=−1,λ2=−2.
Both eigenvalues are negative, so this is a stable node.
If we now look again at the phase plane, after having calculated the stability of the fixed points, we can see that the arrows move towards the stable fixed points, and away from the unstable ones.
Below, the stable fixed points are filled and the unstable ones are open:
The dashed line is the separatrix: the solutions that come into the saddle along its stable eigenvector, (1,3)T (for λ−=−1/2−3/2).
Solutions that start on one side of it go to (1,0), and on the other side to (0,2).
So, almost every solution with x and y both positive ends up at one of the two stable fixed points: which one depends on which side of the separatrix it starts.
Summary
Linear systems: the eigenvalues of A decide whether solutions grow or shrink, along its eigenvectors.
Nonlinear systems: close to a fixed point, the system behaves like a linear one with matrix J, the Jacobian, evaluated at the fixed point.
A fixed point is stable if every eigenvalue of J has a negative real part, and the trace and determinant of J give its type quickly.
The stable fixed points, and the separatrices between them, tell us where a system ends up.
Introductory problems
Tip
For more practice, an AI tool can write new problems like the ones below.
Ask it for problems of the same type and difficulty, or for problems set in your own field.
For example, you could ask it to "write five epidemiology problems on classifying steady states, at the level of these ones".
Work them on paper first, then ask the tool to check your answers and to explain any step you are unsure of.
Introductory problems 1
Each matrix below is the Jacobian at a fixed point.
Find its trace, determinant and eigenvalues, and classify the fixed point.
As in the lecture, the eigenvalues satisfy λ2−τλ+Δ=0, where τ is the trace and Δ is the determinant.
(a) τ=−4 and Δ=3, so λ2+4λ+3=(λ+1)(λ+3)=0.
The eigenvalues λ=−1 and −3 are both negative, so this is a stable node.
(b) τ=6 and Δ=9−1=8, so λ2−6λ+8=(λ−2)(λ−4)=0.
The eigenvalues λ=2 and 4 are both positive, so this is an unstable node.
(c) τ=2 and Δ=1−4=−3, so λ2−2λ−3=(λ−3)(λ+1)=0.
The eigenvalues λ=3 and −1 have opposite signs, so this is a saddle (unstable).
(d) τ=−2 and Δ=1+4=5, so λ2+2λ+5=0 and
λ=2−2±4−20=−1±2i
The eigenvalues are complex with a negative real part, so this is a stable spiral.
(e) τ=0 and Δ=4, so λ2+4=0 and λ=±2i.
The eigenvalues are purely imaginary, so this is neutral: solutions cycle round the fixed point.
Notice that a negative determinant always gives a saddle, because then the two eigenvalues multiply to give a negative number.
Introductory problems 2
The system
x˙=x−xy,y˙=x2−y
has fixed points at (0,0), (1,1) and (−1,1).
Find the Jacobian, evaluate it at each fixed point, and classify each one.
With f=x−xy and g=x2−y,
J=(∂x∂f∂x∂g∂y∂f∂y∂g)=(1−y2x−x−1)
At (0,0), J=(100−1).
The eigenvalues are the diagonal entries, λ=1 and −1, so (0,0) is a saddle (unstable).
At (1,1), J=(02−1−1), with τ=−1 and Δ=0+2=2.
So, λ2+λ+2=0 and
λ=2−1±1−8=2−1±i7
These are complex with a negative real part, so (1,1) is a stable spiral.
At (−1,1), J=(0−21−1), with τ=−1 and Δ=0+2=2.
These are the same trace and determinant as at (1,1), so (−1,1) is also a stable spiral.
Main problems
Note
These questions are extensions of questions on the previous page.
Main problems 1
Classify the fixed points and discuss stability of the following linear systems:
x˙=x+3y,y˙=−6x+5y;
x˙=x+3y+4,y˙=−6x+5y−1;
x˙=x+3y+1,y˙=−6x+5y.
The constants disappear when we differentiate, so all three systems have the same Jacobian:
J=(1−635)
Its trace is τ=6 and its determinant is Δ=5+18=23, so the eigenvalues satisfy
λ2−6λ+23=0⟹λ=3±i14
The eigenvalues are complex with a positive real part, so each fixed point is an unstable spiral.
The fixed points, found on the previous page, are (0,0), (−1,−1) and (−5/23,−6/23).
Adding the constants moves the fixed point, but does not change the flow around it.
Main problems 2
Classify the fixed points and discuss stability of the following nonlinear systems:
x˙=−4y+2xy−8y˙=4y2−x2;
x˙=y−x2+2,y˙=2(x2−y2).
We found the fixed points on the previous page.
At each one, we calculate the Jacobian, and its eigenvalues from λ2−τλ+Δ=0, where τ is the trace and Δ the determinant.
J=(2y−2x2x−48y)
At (4,2), J=(4−8416), with τ=20 and Δ=96.
So, λ=8 or 12, both positive, and (4,2) is an unstable node.
At (−2,−1), J=(−24−8−8), with τ=−10 and Δ=48.
So, λ=−5±i23, complex with a negative real part, and (−2,−1) is a stable spiral.
J=(−2x4x1−4y)
At (2,2), J=(−481−8), with τ=−12 and Δ=24.
So, λ=−6±23, both negative (as 23≈3.5), and (2,2) is a stable node.
At (−1,−1), J=(2−414), with τ=6 and Δ=12.
So, λ=3±i3, complex with a positive real part, and (−1,−1) is an unstable spiral.
At (−2,2), J=(4−81−8), with τ=−4 and Δ=−24.
So, λ=−2±27, one positive and one negative, and (−2,2) is a saddle (unstable).
At (1,−1), J=(−2414), with τ=2 and Δ=−12.
So, λ=1±13, one positive and one negative, and (1,−1) is a saddle (unstable).
Note, whenever Δ<0 the eigenvalues have opposite signs, so the fixed point is a saddle.
Main problems 3
The population of a host, H(t), and a parasite, P(t), are described approximately by the equations
dTdH=(a−bP)H,dTdP=(c−HkP)P,H>0,
where a,b,c,k are positive constants.
Previously, by a change of scales, these equations were put in the simpler form
y˙=(1−x)y,x˙=αx(1−yx),
where α=c/a.
Find and classify the fixed points of these simplified equations.
Sketch the phase flow diagram including these fixed points and the information from the previous sketch.
That is, include the flow across:
y=x;
x=0;
y=0;
x=1;
y=βx, for β greater than and less than 1.
Fixed points.y˙=0 when y=0 or x=1, and x˙=0 when x=0 or x=y.
The equations are only defined for y>0 (because H>0), so y˙=0 needs x=1, and then x˙=0 needs y=x=1.
So, the only fixed point is (1,1).
Classification.
With f=αx(1−x/y) and g=(1−x)y,
J=(α(1−y2x)−yy2αx21−x)soJ(1,1)=(−α−1α0)
The trace is τ=−α and the determinant is Δ=α, so
λ=2−α±α2−4α
If α<4, the eigenvalues are complex with a negative real part, so (1,1) is a stable spiral.
If α>4, the eigenvalues are real, and both are negative (because α2−4α<α), so (1,1) is a stable node.
If α=4, there is a repeated eigenvalue λ=−2, and (1,1) is still stable.
Either way, the host and parasite populations settle to steady values, which in the original variables are H=ka/(bc) and P=a/b.
Phase flow.
The flow across the lines is as on the previous page.
It goes clockwise around (1,1), upwards along x=0, and sharply to the left just above y=0.
Now we know that (1,1) is stable, so trajectories wind in towards it (for α<4), or approach it without winding round (for α>4).
For example, with α=1:
import numpy as np
from matplotlib import pyplot as plt
alpha =1x, y = np.meshgrid(np.linspace(0.01,2.5,30), np.linspace(0.01,2.5,30))xdot = alpha * x *(1- x / y)ydot =(1- x)* y
plt.streamplot(x, y, xdot, ydot, color='grey')plt.plot([0,2.5],[0,2.5], color='#0072bd', label='x-nullcline y = x')plt.axvline(0, color='#0072bd', label='x-nullcline x = 0')plt.axvline(1, color='#F39200', label='y-nullcline x = 1')plt.axhline(0, color='#F39200', label='y-nullcline y = 0')plt.plot(1,1,'ko', label='stable fixed point (1, 1)')plt.xlabel('x (parasites)')plt.ylabel('y (hosts)')plt.legend()
Main problems 4
In the previous parts of this question a model of fish and anglers was developed and simplified.
This question analyses the simplified model.
The simplified version of the model is
x˙=rx(1−x)−xy,y˙=βx−y
where x and y represent fish and angler populations, respectively.
The x˙ notation represents the derivative with respect to non-dimensional time.
Calculate the steady states of the system.
Determine the stability of the fixed points in the case β=r=4.
Draw the phase plane, including the nullclines and phase trajectories.
You can sketch it by hand, or plot it in Python by adapting the phase plane code from the previous lecture.
x˙=x(r(1−x)−y)=0 when x=0 or y=r(1−x), and y˙=0 when y=βx.
If x=0, then y=0, which gives the steady state (0,0).
If y=r(1−x) and y=βx, then βx=r−rx, so x=r/(r+β) and y=rβ/(r+β).
So, the steady states are (0,0) and (r+βr,r+βrβ).
With β=r=4, the steady states are (0,0) and (1/2,2).
The Jacobian is
J=(r−2rx−yβ−x−1)=(4−8x−y4−x−1)
At (0,0), J=(440−1).
The top right entry is zero, so the eigenvalues are the diagonal entries, λ=4 and −1.
One is positive and one negative, so (0,0) is a saddle (unstable).
At (1/2,2), J=(−24−1/2−1), with τ=−3 and Δ=2+2=4.
So, λ=(−3±i7)/2, complex with a negative real part, and (1/2,2) is a stable spiral.
In other words, as long as there are some fish, the fish and angler populations settle down to x=1/2 and y=2, overshooting and coming back a few times on the way.
The x-nullclines are x=0 and the line y=4(1−x), and the y-nullcline is the line y=4x.
They cross at the two steady states.
Along x=0 (no fish) the anglers leave, and the flow runs down the y axis towards (0,0).
From near (0,0), the flow moves away into the region with fish, and trajectories spiral anticlockwise into (1/2,2):
import numpy as np
from matplotlib import pyplot as plt
r =4beta =4x, y = np.meshgrid(np.linspace(0,1.2,30), np.linspace(0,4.5,30))xdot = r * x *(1- x)- x * y
ydot = beta * x - y
plt.streamplot(x, y, xdot, ydot, color='grey')s = np.linspace(0,1.2,2)plt.plot(s, r *(1- s), color='#0072bd', label='x-nullcline y = r(1 - x)')plt.axvline(0, color='#0072bd', label='x-nullcline x = 0')plt.plot(s, beta * s, color='#F39200', label='y-nullcline y = beta x')plt.plot([0,0.5],[0,2],'ko', label='steady states')plt.xlabel('x (fish)')plt.ylabel('y (anglers)')plt.legend()
Extension problems
Extension problems 1
A population F of foxes feeds on a population H of hares.
A model for the changes in the population is given by
dTdHdTdF=aH−bHF=cHF−dF(H>0),(F>0).
Define the four parameters a,b,c,d.
Find the fixed point of the system and describe the motion in its neighbourhood.
What does this mean in terms of the population of hares and foxes?
All four are positive constants:
a is the rate at which the hares grow when there are no foxes;
b measures how quickly the foxes eat the hares;
c measures how quickly the foxes increase from eating hares (the rate of eating, times how efficiently the food becomes new foxes);
d is the rate at which the foxes die when there are no hares.
dH/dT=H(a−bF)=0 when H=0 or F=a/b, and dF/dT=F(cH−d)=0 when F=0 or H=d/c.
Both populations are positive, so the fixed point is (H,F)=(d/c,a/b).
The Jacobian there is
J=(a−bFcF−bHcH−d)=(0ac/b−bd/c0)
with τ=0 and Δ=ad.
So, λ2+ad=0, and λ=±iad.
The eigenvalues are imaginary, so the fixed point is neutral, and nearby solutions cycle round it.
The eigenvalues only describe the linear approximation, and small nonlinear terms could turn the cycles into spirals.
Here they do not, because the quantity
V=cH−dlnH+bF−alnF
does not change over time.
Differentiating with respect to T, using the chain rule on each term,
So, each solution stays on a curve of constant V.
These curves are closed loops around the fixed point, so the solutions really do go round and round.
The populations of hares and foxes oscillate forever.
When there are many hares the foxes increase, then the hares fall because they are being eaten, then the foxes fall because there is less food, and then the hares recover, and so on.
The size of the oscillations depends on the starting populations.