Professional Documents
Culture Documents
MATH2110
MATH2110
• 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
Assessment
Building models
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
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');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%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');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%