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 2
Learning outcomes
Be able to analyse non-linear systems in multiple dimensions
Understand how to simplify the form of a system using parameter re-scaling
Understand how to use conservation and the quasi-steady state approximation to reduce the number of equations
Understand the concept of a phase plane
Be able to identify the nullclines and fixed points of a non-linear system
Be able to sketch the phase plane of a non-linear system
Be able to plot the phase plane of a non-linear system using matplotlib in Python
YouTube lecture recording from October 2020
A recording of this lecture from October 2020; the material has changed a little since.
Why simplify systems?
In lecture 14 we solved systems of first order, linear differential equations in two dimensions exactly, with three methods, and diagonalisation extends to systems of any size.
Most models in biology are nonlinear, often with many variables and many parameters, and we usually can't solve them by hand.
In this lecture we look at two things we can still do:
Simplify a system, so that it has fewer parameters (by rescaling) or fewer equations (by conservation, or the quasi-steady state approximation).
Draw its phase plane, which shows how its solutions behave without solving it, using nullclines to find its fixed points.
In lecture 16 we use eigenvalues to decide whether those fixed points are stable.
System simplification: rescaling
Rescaling tells us which combinations of the parameters really matter.
This predator-prey model is in dimensional terms and contains 5 parameters:
dTdNdTdP=rN(1−KN)−bNP,=ebNP−mP.
r: prey intrinsic growth rate
K: prey carrying capacity (bound to logistic growth)
b: predation rate
e: conversion efficiency
m: per capita predator mortality rate
We substitute
N=θn,P=ϕp,T=τt,
where θ, ϕ and τ are constants: typical values of N, P and T, which we are free to choose.
The new variables n, p and t are nondimensional: they have no units.
For example, if N and θ are both numbers of prey per km2, then n=N/θ is a plain number, such as 0.5 for half the typical population.
In the same way, if T and τ are both in days, then t=T/τ counts time in units of τ.
Note that, when we are rescaling time, by the chain rule
dTd=dtddTdt=τ1dtd.
Substituting into the original system gives
τθdtdnτϕdtdp=θrn(1−Kθn)−bθϕnp,=ebθϕnp−mϕp.
Then we divide the first equation by θ/τ and the second by ϕ/τ:
dtdndtdp=τ(rn(1−Kθn)−bϕnp),=τ(ebθnp−mp).
Now we choose the scales.
Choosing θ=K will remove the parameter K from the equations:
dtdndtdp=τ(rn(1−n)−bϕnp),=τ(ebKnp−mp).
Choosing τ=1/m (or τ=1/r) will remove a further parameter:
dtdndtdp=mrn(1−n)−mbϕnp,=mebKnp−p.
Finally, ϕ=m/b gives the two parameter system
n˙p˙=mrn(1−n)−np,=mebKnp−p,
where n˙ is short for dn/dt, and p˙ for dp/dt.
We have shifted the groups of parameters to only two places.
We could make it more obvious that there are only two "tuning dials", v1=r/m and v2=ebK/m, by writing it as
n˙p˙=v1n(1−n)−np,=p(v2n−1).
Any choice of the five original parameters behaves like one of these: only v1 and v2 change the shape of the solutions.
For example, with v1=1 and v2=2, starting from n=0.9 and p=0.1, the prey and predators oscillate as they settle to the fixed point n=1/v2, p=v1(1−1/v2):
If v2<1 instead, the predators die out, and the prey settle at n=1.
System simplification: conservation
Consider a chemical system where a product is formed from a substrate via an intermediate complex involving an enzyme.
S+Ek−1⇌k1C→k2P+E
By mass action (lecture 11), this system can be written as a system of 4 ODEs for s,e,c,p, which describe the concentrations of S,E,C and P:
In the previous example it may be known that the rate of conversion to complex (from k1 and k−1) is much faster than the degradation of complex into product (rate k2).
If this is the case, then we can assume that the concentration of C quickly arrives at some level c∗ (a quasi-steady state), and then moves very slowly.
This is the Michaelis-Menten equation from lectures 1 and 9.
So, the quasi-steady state approximation explains where it comes from, and what its two constants mean: Vmax is the rate when every enzyme is in a complex, and Km is the concentration of substrate at which the rate is half of Vmax.
This means that we have used conservation and quasi-steady state to go from a 4-dimensional system (s,e,c,p) to a two-dimensional approximation which captures some of the behaviour.
Phase planes and nullclines
With two variables x and y, we can draw the phase plane: the (x,y) plane, with an arrow at each point showing the direction of (x˙,y˙).
Each solution follows a path through it, as in the figures in lecture 14.
A system of nonlinear ODEs may have more than one fixed point (or may have none).
Finding fixed points in two-dimensional systems is aided by nullclines.
An x-nullcline is a line where x˙=0, and a y-nullcline is a line where y˙=0.
(These are straight lines in the linear case.)
At a fixed point x˙=y˙=0, so the fixed points are where an x-nullcline crosses a y-nullcline.
For example, take the system
x˙y˙=x(1−x)−xy,=2y(1−2y)−3xy.
Factorising,
x˙y˙=x(1−x−y),=y(2−y−3x).
So the x-nullclines are x=0 and y=1−x, and the y-nullclines are y=0 and y=2−3x.
The fixed points are where one of each kind cross:
x=0 and y=0 cross at (0,0)
x=0 and y=2−3x cross at (0,2)
y=1−x and y=0 cross at (1,0)
y=1−x and y=2−3x cross at (1/2,1/2)
Note that (0,1), where the two x-nullclines meet, is not a fixed point: there x˙=0, but y˙=1=0.
On an x-nullcline x˙=0, so the arrows there point straight up or down: they can only cross the x-nullclines vertically, and in the same way the y-nullclines horizontally.
Between the nullclines, the signs of x˙ and y˙ do not change, so the arrows point in roughly the same direction throughout each region.
By following the arrows we can sketch the behaviour of solutions (green lines, from the green dots):
Almost every solution that starts with x and y both positive ends up at (1,0) or (0,2).
In lecture 16 we will see why, from the eigenvalues at each fixed point.
Python code to plot the phase plane
The function streamplot draws the paths of the solutions through a grid of arrows.
We add the nullclines on top, and solutions from chosen starting points, found with solve_ivp:
import numpy as np
from matplotlib import pyplot as plt
from scipy.integrate import solve_ivp
deff(t, X): x, y = X
return[x *(1- x)- x * y,2* y *(1- y /2)-3* x * y]# the direction field, as streamlinesx, y = np.meshgrid(np.linspace(0,1.1,23), np.linspace(0,2.1,22))dx, dy = f(0,[x, y])plt.streamplot(x, y, dx, dy, color='lightgray')# the nullclinesxs = np.linspace(0,1.1,100)plt.plot(xs,1- xs, color='C0', label='x-nullclines')plt.axvline(0, color='C0')plt.plot(xs,2-3* xs, color='C1', label='y-nullclines')plt.axhline(0, color='C1')# solutions from a few starting pointsstarts =[(1.05,1.0),(0.9,1.3),(0.7,1.6),(0.5,1.8),(0.5,0.2),(0.32,0.2),(0.1,0.2)]for start in starts: sol = solve_ivp(f,(0,40), start, t_eval=np.linspace(0,40,400)) plt.plot(sol.y[0], sol.y[1], color='green') plt.plot(*start,'go')plt.xlim(0,1.1)plt.ylim(0,2.1)plt.xlabel('x')plt.ylabel('y')plt.legend()
Summary
Rescaling to dimensionless quantities shows which combinations of parameters matter, and can reduce their number.
Conservation (e.g. a total amount of enzyme) can remove an equation.
The quasi-steady state approximation removes an equation that relaxes quickly, e.g. giving the Michaelis-Menten equation.
Nullclines are a powerful way of finding fixed points, and of sketching the phase plane.
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 chemistry problems on fixed points and rescaling, 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
Find the fixed points 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.
At a fixed point x˙=0 and y˙=0, so in each case we solve a pair of simultaneous equations.
x+3y=0 gives x=−3y.
Substituting into −6x+5y=0 gives 18y+5y=0, so y=0 and x=0.
The fixed point is (0,0).
Multiply the first equation by 6 and add it to the second:
(6x+18y+24)+(−6x+5y−1)=23y+23=0
So, y=−1, and then x=−4−3y=−1.
The fixed point is (−1,−1).
In the same way, (6x+18y+6)+(−6x+5y)=23y+6=0, so y=−6/23, and then x=−1−3y=−5/23.
The fixed point is (−5/23,−6/23).
Introductory problems 2
Find the fixed points of the following nonlinear systems:
x˙=−4y+2xy−8y˙=4y2−x2;
x˙=y−x2+2,y˙=2(x2−y2).
y˙=0 gives x2=4y2, so x=2y or x=−2y.
Substitute each into x˙=0.
x=2y: −4y+4y2−8=0, so y2−y−2=(y−2)(y+1)=0.
This gives y=2, x=4 and y=−1, x=−2.
x=−2y: −4y−4y2−8=0, so y2+y+2=0.
This has no real solutions, because 12−4×2<0.
The fixed points are (4,2) and (−2,−1).
x˙=0 gives y=x2−2, and y˙=0 gives y=x or y=−x.
y=x: x2−x−2=(x−2)(x+1)=0, which gives (2,2) and (−1,−1).
y=−x: x2+x−2=(x+2)(x−1)=0, which gives (−2,2) and (1,−1).
There are four fixed points: (2,2), (−1,−1), (−2,2) and (1,−1).
Main problems
Main problems 1
Consider the chemical reaction network:
⟶k0Ak−1⇌k1B⟶k2
Write down the system of two linear ODEs which describe the evolution of the concentrations of A and B in this system under the law of mass action.
Find the ratio of concentrations of A and B for which this system is in steady state: that is the concentrations do not change over time.
Let a=[A] and b=[B].
A is produced at the constant rate k0, turns into B at rate k1a, and is made from B at rate k−1b.
B is removed at rate k2b.
So,
dtdadtdb=k0−k1a+k−1b=k1a−k−1b−k2b
In steady state db/dt=0, so k1a=(k−1+k2)b, and
ba=k1k−1+k2
We can also find the concentrations themselves.
Adding the two equations gives k0−k2b=0, so b∗=k0/k2, and then a∗=k0(k−1+k2)/(k1k2).
Main problems 2
Consider the reversible enzyme reaction:
S+Ek−1⇌k1Ck−2⇌k2P+E
Verify the Haldane relation, which states that when the reaction is in equilibrium,
sp=k−1k−2k1k2,
where p and s are the concentrations of P and S, respectively.
Let s, e, c and p be the concentrations of S, E, C and P.
By mass action,
dtdsdtdp=−k1se+k−1c=k2c−k−2pe
In equilibrium the concentrations do not change, so both are zero:
k1se=k−1candk2c=k−2pe
The first gives c=k1se/k−1.
Substituting this into the second,
k−1k1k2se=k−2pe
The enzyme concentration e cancels, so
sp=k−1k−2k1k2
(We can check that dc/dt=k1se−k−1c−k2c+k−2pe is then zero too.)
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.
By a suitable change of scales show that these equations may be put in the simpler form
y˙=(1−x)y,x˙=αx(1−yx),
where α=c/a.
Sketch the phase flow across the following lines:
y=x;
x=0;
y=0;
x=1;
y=βx, for β greater than and less than 1.
As in the lecture, let T=τt, P=θx and H=ϕy, where τ, θ and ϕ are scales still to be chosen, so that d/dT=(1/τ)d/dt.
Then
τϕy˙=(a−bθx)ϕyandτθx˙=(c−ϕykθx)θx
so
y˙=τ(a−bθx)yandx˙=τ(c−ϕykθx)x
Choosing τ=1/a and θ=a/b gives y˙=(1−x)y, and
x˙=(ac−bϕykx)x=acx(1−bcϕkayx)
Finally, choosing ϕ=ka/(bc) gives x˙=αx(1−x/y), with α=c/a.
Now the flow across each line.
x and y are populations, so we only need x≥0 and y>0.
On y=x, x˙=0 (this is an x-nullcline), so the flow crosses it vertically.
y˙=(1−x)x, so the flow is upwards for x<1 and downwards for x>1.
On x=0, x˙=0 and y˙=y>0, so the flow is up the y axis.
With no parasites, the hosts grow exponentially.
On y=0, y˙=0 (a y-nullcline).
The equations are not defined on the line itself, because of x/y, but just above it x/y is very large, so x˙ is large and negative and the flow moves sharply to the left.
With almost no hosts, the parasites die out.
On x=1, y˙=0 (a y-nullcline), so the flow crosses it horizontally.
x˙=α(1−1/y), so the flow is to the right for y>1 and to the left for y<1.
On y=βx, x˙=αx(1−1/β) and y˙=βx(1−x).
For β>1 (above the line y=x) the flow is to the right, and for β<1 (below it) the flow is to the left.
In both cases it is upwards for x<1 and downwards for x>1.
Putting these together, the flow goes clockwise around the point (1,1), where the nullclines y=x and x=1 cross (we find out what happens there in the next lecture).
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.xlabel('x (parasites)')plt.ylabel('y (hosts)')plt.legend()
Main problems 4
Consider a lake with some fish attractive to anglers.
We wish to model the fish-angler interaction under the following assumptions:
the fish population grows logistically in the absence of fishing;
the presence of anglers depresses the fish growth rate at a rate jointly proportional to the size of the fish and angler populations;
anglers are attracted to the lake at a rate directly proportional to the number of fish in the lake;
anglers are discouraged from the lake at a rate directly proportional to the number of anglers already there.
Write down a mathematical model for this situation, clearly defining your terms.
Use a suitable scaling to show that a non-dimensionalised version of the model is
x˙=rx(1−x)−xy,y˙=βx−y
Let F(T) be the number of fish and A(T) the number of anglers at time T.
Then
dTdFdTdA=aF(1−KF)−bFA=cF−eA
where all the constants are positive:
a is the growth rate of the fish, and K is the largest number of fish the lake can support (its carrying capacity);
b measures how quickly anglers catch fish;
c measures how strongly the fish attract anglers;
e is the rate at which anglers are discouraged and leave.
As in the lecture, let F=θx, A=ϕy and T=τt, so that d/dT=(1/τ)d/dt.
Then
x˙y˙=τax(1−Kθx)−τbϕxy=ϕτcθx−τey
Choosing θ=K, τ=1/e and ϕ=e/b gives
x˙=eax(1−x)−xyandy˙=e2bcKx−y
which is the model given, with r=a/e and β=bcK/e2.
Main problems 5
Consider the reaction chain
S⟶k1I⟶k2P
in which a substrate is converted to a product through a short-lived intermediate.
Write down the system of three ODEs for s, i and p under the law of mass action.
Show that s+i+p is constant, and use this to eliminate p.
Suppose the second step is much faster than the first (k2≫k1).
Use a quasi-steady state for i to find i∗ in terms of s, and hence an approximate equation for dp/dt.
Explain why the rate at which P is made depends only on k1 in this approximation.
Each step uses up one species and makes the next, so
dtdsdtdidtdp=−k1s,=k1s−k2i,=k2i.
Adding the three equations,
dtd(s+i+p)=−k1s+k1s−k2i+k2i=0
so s+i+p=T, where T is a constant: the total amount of material.
Then p=T−s−i, and the system reduces to the two ODEs for s and i.
If k2≫k1, the intermediate is used up almost as soon as it is made, so i quickly reaches a quasi-steady state.
Solving di/dt=0:
k1s−k2i∗=0⇒i∗=k2k1s
This is small, because k1/k2 is small, and it moves slowly with s.
Substituting it into the equation for p,
dtdp=k2i∗≈k1s
In this approximation, every molecule of I is turned into P almost straight away, so P is made as fast as I is made, which is k1s.
The first step is the slow one, so it limits the rate of the whole chain.
This is often called the rate-limiting step.