Skip to content
Snippets Groups Projects
Commit 429c8112 authored by Paul CACHEUX's avatar Paul CACHEUX
Browse files

Model is now working

parent 470eb3b8
No related branches found
No related tags found
No related merge requests found
clear figure
N = 200;
N = 4*365;
S = 990;
I = 10;
S = 410000000;
I = 55595;
R = 0;
coeffs = options;
coeffs.InfectionRate = 0.02;
coeffs.InfectionRate = 2e-2;
coeffs.ImmunisationRate = 0.029;
coeffs.ImmunisationLossRate = 2.7e-4;
coeffs.DeathRate = 1.3e-2;
coeffs.NaturalDeathRate = 2e-5;
coeffs.NatalityRate = 5e-5;
VaccinationVector = build_vacc_rate(2.4e-4, 2.4e-3, 50, N);
coeffs.NaturalDeathRate = 2e-4;
coeffs.NatalityRate = 5.3e-4;
VaccinationVector = build_vacc_rate(0, 4.4e-4, 0, N);
% VaccinationVector = build_vacc_rate(0, 0, 50, N);
model = model(S, I, R, 12, N);
m = model(S, I, R, 12, N);
t = 1:N;
for i=t
model.step(i, coeffs, VaccinationVector);
m.step(i, coeffs, VaccinationVector);
end
% figure
......@@ -30,7 +30,7 @@ end
% plot(t, Ilist);
% plot(t, Rlist);
% plot(t, Dlist);
area([model.Slist.', model.Wlist.', model.Ilist.', model.Rlist.']);
area([m.Slist.', m.Wlist.', m.Ilist.', m.Rlist.']);
legend('Susceptible', 'Waiting', 'Infected', 'Immunized');
title('Evolution of virus in population');
......
......@@ -15,6 +15,7 @@ classdef model < handle
repeat = 100;
end
obj.vector = zeros(1, 3 + Waiting);
obj.vector(1) = S;
obj.vector(2) = I;
obj.vector(3) = R;
......@@ -34,6 +35,10 @@ classdef model < handle
obj.Wlist(i) = sum(obj.vector(4:length(obj.vector)));
obj.vector = step(obj.vector, coeffs, VaccinationVec(i));
end
function goto(obj, other)
end
end
end
\ No newline at end of file
......@@ -11,9 +11,9 @@ for i=5:length(X)
end
if length(X) > 3
% infecter = sum(X(4:length(X)) + I);
infection = S * (1 - 25 * options.InfectionRate / N) ^ I;
% infection = options.InfectionRate * S * infecter/N;
% infection = S * (1 - 25 * options.InfectionRate / N) ^ I;
infecter = sum(X(4:length(X)) + I);
infection = options.InfectionRate * S * infecter/N;
new_waiting(1) = infection;
dS = -infection;
dI = X(length(X));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment