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

Correction du probleme (ajout reel des fichiers)

parent a520eed4
No related branches found
No related tags found
No related merge requests found
SRI_matlab @ e1cf190f
Subproject commit e1cf190f20b898a299b35b52dd8141a6558306e8
clear figure
S = 990;
I = 10;
R = 0;
n_pop = S + I + R;
input = [S, I, R];
coeffs = options;
coeffs.InfectionRate = 0.06;
coeffs.ImmunisationRate = 0.01;
coeffs.ImmunisationLossRate = 0.001;
coeffs.VaccinationRate = 0.02;
coeffs.DeathRate = 0.04;
coeffs.NaturalDeathRate = 0.002;
coeffs.NatalityRate = 0.003;
N = 10000;
Slist = zeros(1, N);
Ilist = zeros(1, N);
Rlist = zeros(1, N);
t = 1:N;
for i=t
input = step(input, coeffs);
Slist(i) = input(1);
Ilist(i) = input(2);
Rlist(i) = input(3);
end
% figure
% hold on
% plot(t, Slist);
% plot(t, Ilist);
% plot(t, Rlist);
% plot(t, Dlist);
area([Slist.', Ilist.', Rlist.']);
legend('Susceptible', 'Infected', 'Immunized');
title('Evolution of virus in population');
xlabel('Time');
ylabel('Population');
% axis([1, N, 0, n_pop]);
\ No newline at end of file
classdef options
properties
InfectionRate
ImmunisationRate
ImmunisationLossRate
VaccinationRate
DeathRate
NaturalDeathRate
NatalityRate
end
properties(Dependent)
R0
end
methods
function R0=get.R0(obj)
R0 = obj.InfectionRate / (obj.ImmunisationRate + obj.DeathRate + obj.VaccinationRate);
end
end
end
function res = step(X, options)
S = X(1);
I = X(2);
R = X(3);
N = S + I + R;
dS = -options.InfectionRate * S * I / N - options.VaccinationRate * S / N + options.ImmunisationLossRate * R + options.NatalityRate - options.NaturalDeathRate * S/N;
dI = options.InfectionRate * S * I / N - options.ImmunisationRate * I - options.DeathRate * I;
dR = options.ImmunisationRate * I + options.VaccinationRate * S / N - options.ImmunisationLossRate * R - options.NaturalDeathRate * R/N;
res = [S + dS, I + dI, R + dR];
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment