The mathematics behind modelling

This is my first time using MATLAB and despite reading up on tutorials I am still confused in regards to how to utilise MATLAB. I am trying to simulate a SEIR model, which consists of a system of differential equations, for the spread of dengue fever in MATLAB with the following equations and parameters:
Thank you!!!

2 comentarios

John D'Errico
John D'Errico el 29 de Dic. de 2015
Please stop posting the identical question every hour just because you are in a hurry. I've now deleted most of your replicate questions.
Walter Roberson
Walter Roberson el 29 de Dic. de 2015
There was a Mathworks server problem this morning that prevented people from telling that their question had been posted.

Iniciar sesión para comentar.

 Respuesta aceptada

Josh Meyer
Josh Meyer el 31 de Dic. de 2015
You have a system of 7 coupled ODEs. You will need to code the equations into a function, define the initial conditions and interval for integration, then use an ODE solver such as ODE45 to solve the equations numerically. I got you started on your function, but you'll need to fill in the gaps and double check it:
function dSdt = denguefeverODE(t,S)
% Define parameters
Nh =
Nm =
uh =
um =
Pmh =
Phm =
beta =
nu_h =
epsilon_m =
tau_h =
f =
% Define the equations. Each element in the output contains the answer for
% one equation, so there are 7 components. For ex. S(1) is Sh while dSdt(1)
% is dSh/dt, and S(7) is Im while dSdt(7) is dIm/dt.
dSdt = zeros(7,1);
dSdt(1) = uh*Nh - (beta*Pmh*(S(7)/Nh)+uh)*S(1);
dSdt(2) = beta*Pmh*(S(7)/Nh)*S(1) - (tau_h+uh)*S(2);
.
.
.
dSdt(7) = epsilon_m*S(6) - um*S(7);
Once you are ready to solve, the solver syntax is
tspan = [t0 tf]; % Change to initial and final times
y0 = [a b c d e f g]; % Need 7 initial conditions, 1 for each variable
[t,y] = ode45(@denguefeverODE, tspan, y0)
Then you can see all of the solution components with
plot(t,y)

6 comentarios

Muse Riveria
Muse Riveria el 1 de En. de 2016
Editada: Walter Roberson el 4 de En. de 2016
I am tremendously thankful for your insightful answer, I hadn't approached the question in this manner before. I followed your steps and filled in the gaps, concluding the function with:
tspan = [to tf]; % Change to initial and final times
to = 0;
tf =100;
y0 = [5535002 50 50 0 0 0 0 ]; % Need 7 initial conditions, 1 for each variable
[t,S] = ode45(@denguefeverODE, tspan, y0)
plot(t,S)
Unfortunately, an error came up saying "undefined function or variable 't'". I thought I had defined 't' when I inputted to=0 and tf=100?
Additionally, is there a method to separate the 2 systems dSdt(1) to (4) (human population) and dSdt(5) to (7) (mosquito population) on two separate graphs?
Thank you so much for your help.
Walter Roberson
Walter Roberson el 4 de En. de 2016
We need to see your denguefeverODE code.
You will have to define t0 and tf before you define tspan:
to = 0;
tf =100;
tspan = [to tf]; % Change to initial and final times
y0 = [5535002 50 50 0 0 0 0 ]; % Need 7 initial conditions, 1 for each variable
[t,S] = ode45(@denguefeverODE, tspan, y0)
plot(t,S)
Best wishes
Torsten.
Muse Riveria
Muse Riveria el 7 de En. de 2016
Hi! Thank you for your reply, but even after I defined t0 and tf before defining tspan the error stating undefined function or variable t still appears.
Walter Roberson
Walter Roberson el 7 de En. de 2016
We need your updated code including the code for denguefeverODE, and you should also post the complete error message including the traceback showing where the error is occurring.
Muse Riveria
Muse Riveria el 7 de En. de 2016
Editada: Muse Riveria el 16 de Mzo. de 2016
>> denguefeverODE(t, S)
Undefined function or variable 't'.

Iniciar sesión para comentar.

Más respuestas (2)

Torsten
Torsten el 7 de En. de 2016
function main
to = 0;
tf = 100;
tspan = [to tf];
y0 = [5535002 50 50 0 0 0 0 ];
[t,S] = ode45(@denguefeverODE, tspan, y0);
plot(t,S)
title('Human Population Without Control')
xlabel('Time')
ylabel('Susceptible, Exposed, Infected, Recovered')
legend('Susceptible', 'Exposed', 'Infected', 'Recovered')
function dSdt = denguefeverODE(t,S)
Nh = 5535002;
Nm = 33210012;
uh = 0.0045;
um = 0.02941;
Pmh = 0.375;
Phm = 0.750;
beta = 1;
nu_h = 0.1666;
epsilon_m = 0.1;
tau_h = 0.1176;
f = 6;
dSdt = zeros(7,1);
dSdt(1) = uh*Nh - (beta*Pmh*(S(7)/Nh)+uh)*S(1);
dSdt(2) = beta*Pmh*(S(7)/Nh)*S(1) - (tau_h+uh)*S(2);
dSdt(3) = tau_h*S(2)-(nu_h+uh)*S(3);
dSdt(4) = nu_h*S(3)-uh*S(4);
dSdt(5) = um*Nm - (beta*Phm*(S(3)/Nh)+um)*S(5);
dSdt(6) = beta*Phm*(S(3)/Nh)*S(5);
dSdt(7) = epsilon_m*S(6) - um*S(7);
Best wishes
Torsten.

7 comentarios

Muse Riveria
Muse Riveria el 7 de En. de 2016
Thank you so much!!! In order to have two separate graphs, is it possible to compute the human population and vector population separately? I know I'm unable to change y0 = [5535002 50 50 0 0 0 0 ]; to y0 = [5535002 50 50 0 ];to just include the first 4 equations. But beyond this I'm unsure how to approach it.
You mean two plot-commands :
figure(1);
plot(t,S(:,1),t,S(:,2),t,S(:,3),t,S(:,4));
figure(2);
plot(t,S(:,5),t,S(:,6),t,S(:,7));
?
Best wishes
Torsten.
Muse Riveria
Muse Riveria el 7 de En. de 2016
Thank you so much!!!!
Muse Riveria
Muse Riveria el 7 de En. de 2016
Would it be possible to incorporate a constant control strategy (c = 0.084) to solve for the equations mentioned above? Whereby the control strategy (c = 0.084) is constant, with application of 8.4% capacity of insecticide 24 hours per day all the time. Following this administration, the number of infected mosquitos and humans should reduce.
Torsten
Torsten el 8 de En. de 2016
Editada: Torsten el 8 de En. de 2016
So you ask how to implement the equations of the article which already contain a control strategy ? Or do you ask how to modify your equations to include a control strategy ?
I ask this because the equations for the mosquitos in the article seem to differ from the equations you use.
Best wishes
Torsten.
Muse Riveria
Muse Riveria el 9 de En. de 2016
How to modify the equation, the article was used for reference as the data isn't completely applicable to the geographical location that used for this differential system. Would it be a simple task, or would it require the formation of more complicated subsequent equations?
Star Strider
Star Strider el 10 de En. de 2016
I doubt the DEs would change, since the epidemiology would be essentially the same, but the parameters likely would. (Islands in the Caribbean might be similar enough to not require any significant changes.) If you’re using them for a more northerly latitude in response to global warming, there are several changes you would have to consider. The human epidemiology would be the same, but you might have to consult with an entomologist with a particular interest in Aedes aegypti to determine what would have to change about the vectors.

Iniciar sesión para comentar.

MOUSSA DOUMBIA
MOUSSA DOUMBIA el 6 de Jun. de 2016

0 votos

Can anybody provide me a sample of an optimal control problem with 3 different control functions?

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 29 de Dic. de 2015

Respondida:

el 6 de Jun. de 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by