diff --git a/SRI_matlab/main.m b/SRI_matlab/main.m index b7274a582d5b0067c5208c2e9756020bb9adf044..4c03c908798572b53848c38419fb08dc9d0169a7 100644 --- a/SRI_matlab/main.m +++ b/SRI_matlab/main.m @@ -1,27 +1,27 @@ 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'); diff --git a/SRI_matlab/model.m b/SRI_matlab/model.m index 22b14306445eefa909672c96469d75ec4f2277cc..8a1c0a717dcb8ab600c3c5074eb0f324a9e0aa63 100644 --- a/SRI_matlab/model.m +++ b/SRI_matlab/model.m @@ -14,7 +14,8 @@ classdef model < handle else 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 diff --git a/SRI_matlab/step.m b/SRI_matlab/step.m index eb70acb1caa5f3b5f9fc52ddafe69b2728d510e7..eb13ac5b698c0b79eefec5835e51e22bceec1c1f 100644 --- a/SRI_matlab/step.m +++ b/SRI_matlab/step.m @@ -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));