You are on page 1of 17

1

MATH2110

Mathematical Modelling and Differential Equations

Week 1 F2F Lecture

Two lectures and one SGTA each week

• Weeks 1-6 – Christian Thomas: • Weeks 7-12 – Catherine


Penington:
1. Mathematical modelling
1. Nonlinear systems of ODEs
2. 1st-order ODEs 2. 2nd-order ODEs
3. Linear systems of ODEs
2

MATH2110

Mathematical Modelling and Differential Equations

Lectures & SGTAs

• Weeks 1-6
– Lecture material presented in bite-sized pre-recorded videos and
released week before.
– During live lectures, work through additional examples.
• Weeks 7-12
– Lecture material presented during live lectures.
• SGTAs on Thursday’s 12pm-2pm; work through exercise sheets and
collaborate on projects.
3

MATH2110

Mathematical Modelling and Differential Equations

Assessment

• Final Exam, 50%


• Two Assignments, 10% each, due weeks 5 and 11
• Project, 30%
– Presentation slides (3-4 slides), 5%, due week 7
– Final report (8-10 pages), 25%, due week 12
Use LaTeX for project - see iLearn for templates and further information

In week 2, students will be asked to choose a project (see list on iLearn)


4

Building models

• Construction: Translate physical problem into Mathematics, using


assumptions, physical laws or compartment modelling.

• Analysis: Solve analytically, determine critical points, apply linear


stability, and solve numerically.

• Observation: Interpret results and relate back to physical problem. Do


results make sense? If necessary, re-evaluate and start again.
5

Rates of change, law of mass action, and compartment modelling

• Rates of change: When modelling populations, p, we assume birth,


death, and migration rates are proportional to the number of individuals
in the population, i.e., p.

• Law of mass action - one population: When individuals within a


population, p, interact, we assume the rate of interaction is
proportional to square of the number of individuals, i.e., p2.

• Law of mass action - two populations: When individuals from two


populations, p and q, interact, we assume the rate of interaction is
proportional to product of the two populations, i.e., pq.

• Compartment modelling: A flow diagram, describing the exchange of


quantities (including inputs and outputs) between different states.
6

Example
Develop a model for the population of
Australia:
7

Example
Develop a model for the populations of
Australia and Wales:
8

Example
Develop a model for the populations of
Australia, Wales and the rest of the world:
9

Example
Develop a model for the population of
Australia, accounting for limited
resources, i.e., food and space:
10

Example
A 150 litre tank contains 10 litres of water
at time t = 0. At time t = 0, water flows into
the tank at 3 litres per minute and flows out
at 1 litre per minute. Develop a model for
the volume of water within the tank. When
does it overflow?
11

Example

• A tank contains 100L of pure water at


time zero.
• Pipe 1 pumps salt water into the tank at
2L/min with 1g/L.
• Pipe 2 pumps the salt water solution
out of the tank at 2L/min.
12
15

Example
Consider the SIS model for the spread of
an infectious diseases, such as the
common cold:
• Susceptible individuals can become
infected through interaction with
infected individuals.
• Infected individuals become
susceptible again after recovering
from the disease.
16
%Matlab script for week 1 F2F examples

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%

%Population of Australia
%Solve using ode45
tspan = [0 5];
x0=[26];
k = 0.1;
[t,x]=ode45(@(t,x) k*x,tspan,x0);
plot(t,x,'-','linewidth',2);
xlabel('$t$','interpreter','latex');
ylabel('$x$','interpreter','latex');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%

%Population of Australia-Wales
%Solve using ode45
tspan = [0 20];
x0=[26 3];
a1 = 0.1;a2 = 0.05;
b1 = 0.1;b2 = 0.05;
c1 = 0.1;c2 = 0.1;
[t,x]=ode45(@(t,x) [(a1-a2-c1)*x(1)+c2*x(2);c1*x(1)+(b1-b2-
c2)*x(2)],tspan,x0);
plot(t,x(:,1),'-',t,x(:,2),'--','linewidth',2);
xlabel('$t$','interpreter','latex');
ylabel('$x$','interpreter','latex');
legend('Australia','Wales');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%

%Population of Australia-Wales-RestOfWorld
%Solve using ode45
tspan = [0 30];
x0=[26 3 8000];
a1 = 0.1;a2 = 0.05;
b1 = 0.1;b2 = 0.05;
c1 = 0.1;c2 = 0.05;
[t,x]=ode45(@(t,x) [-(a1+b1)*x(1)+a2*x(2)+b2*x(3);...
a1*x(1)-(a2+c1)*x(2)+c2*x(3);...
b1*x(1)+c1*x(2)-(b2+c2)*x(3)],tspan,x0);
plot(t,x(:,1),'-',t,x(:,2),'--',t,x(:,3),'-.','linewidth',2);
xlabel('$t$','interpreter','latex');
ylabel('$x$','interpreter','latex');
legend('Australia','Wales','Rest of World');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%

%One Tank mixing problem, solve using ode45


tspan = [0 300];
x0 = [0]; %Vary initial conditions
[t,x]=ode45(@(t,x) [2-x/50],tspan,x0);
plot(t,x,'-',linewidth',2);
xlabel('$t$','interpreter','latex');
ylabel('$x$','interpreter','latex');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%

%SIS Model
%x(1), x(2) and x(3) represent population susceptible, infected and
recovered
tspan = [0 60];
x0 = [99 1];
beta = 0.005;
gamma = 0.2;
[t,x]=ode45(@(t,x) [-beta*x(1)*x(2)+gamma*x(2);beta*x(1)*x(2)-
gamma*x(2)],tspan,x0);
plot(t,x(:,1),'-',t,x(:,2),'--','linewidth',2);
xlabel('$t$','interpreter','latex');
legend('$S$','$I$','interpreter','latex');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%

%SIR Model
%x(1), x(2) and x(3) represent population susceptible, infected and
recovered
tspan = [0 60];
x0 = [99 1 0];
beta = 0.005;
gamma = 0.2;
[t,x]=ode45(@(t,x) [-beta*x(1)*x(2);beta*x(1)*x(2)-
gamma*x(2);gamma*x(2)],tspan,x0);
plot(t,x(:,1),'-',t,x(:,2),'--',t,x(:,3),'-.','linewidth',2);
xlabel('$t$','interpreter','latex');
legend('$S$','$I$','$R$','interpreter','latex');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%

You might also like