Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dynamique-populations
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Martin Lehoux
dynamique-populations
Commits
429c8112
Commit
429c8112
authored
7 years ago
by
Paul CACHEUX
Browse files
Options
Downloads
Patches
Plain Diff
Model is now working
parent
470eb3b8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
SRI_matlab/main.m
+10
-10
10 additions, 10 deletions
SRI_matlab/main.m
SRI_matlab/model.m
+6
-1
6 additions, 1 deletion
SRI_matlab/model.m
SRI_matlab/step.m
+3
-3
3 additions, 3 deletions
SRI_matlab/step.m
with
19 additions
and
14 deletions
SRI_matlab/main.m
+
10
−
10
View file @
429c8112
clear
figure
clear
figure
N
=
200
;
N
=
4
*
365
;
S
=
99
0
;
S
=
41000000
0
;
I
=
10
;
I
=
55595
;
R
=
0
;
R
=
0
;
coeffs
=
options
;
coeffs
=
options
;
coeffs
.
InfectionRate
=
0.0
2
;
coeffs
.
InfectionRate
=
2e-
2
;
coeffs
.
ImmunisationRate
=
0.029
;
coeffs
.
ImmunisationRate
=
0.029
;
coeffs
.
ImmunisationLossRate
=
2.7e-4
;
coeffs
.
ImmunisationLossRate
=
2.7e-4
;
coeffs
.
DeathRate
=
1.3e-2
;
coeffs
.
DeathRate
=
1.3e-2
;
coeffs
.
NaturalDeathRate
=
2e-
5
;
coeffs
.
NaturalDeathRate
=
2e-
4
;
coeffs
.
NatalityRate
=
5e-
5
;
coeffs
.
NatalityRate
=
5
.3
e-
4
;
VaccinationVector
=
build_vacc_rate
(
2.4e-4
,
2
.4e-
3
,
5
0
,
N
);
VaccinationVector
=
build_vacc_rate
(
0
,
4
.4e-
4
,
0
,
N
);
% VaccinationVector = build_vacc_rate(0, 0, 50, N);
% VaccinationVector = build_vacc_rate(0, 0, 50, N);
m
odel
=
model
(
S
,
I
,
R
,
12
,
N
);
m
=
model
(
S
,
I
,
R
,
12
,
N
);
t
=
1
:
N
;
t
=
1
:
N
;
for
i
=
t
for
i
=
t
m
odel
.
step
(
i
,
coeffs
,
VaccinationVector
);
m
.
step
(
i
,
coeffs
,
VaccinationVector
);
end
end
% figure
% figure
...
@@ -30,7 +30,7 @@ end
...
@@ -30,7 +30,7 @@ end
% plot(t, Ilist);
% plot(t, Ilist);
% plot(t, Rlist);
% plot(t, Rlist);
% plot(t, Dlist);
% plot(t, Dlist);
area
([
m
odel
.
Slist
.
', m
odel
.Wlist.'
,
m
odel
.
Ilist
.
', m
odel
.Rlist.'
]);
area
([
m
.
Slist
.
', m.Wlist.'
,
m
.
Ilist
.
', m.Rlist.'
]);
legend
(
'Susceptible'
,
'Waiting'
,
'Infected'
,
'Immunized'
);
legend
(
'Susceptible'
,
'Waiting'
,
'Infected'
,
'Immunized'
);
title
(
'Evolution of virus in population'
);
title
(
'Evolution of virus in population'
);
...
...
This diff is collapsed.
Click to expand it.
SRI_matlab/model.m
+
6
−
1
View file @
429c8112
...
@@ -15,6 +15,7 @@ classdef model < handle
...
@@ -15,6 +15,7 @@ classdef model < handle
repeat = 100;
repeat = 100;
end
end
obj.vector = zeros(1, 3 + Waiting);
obj.vector(1) = S;
obj.vector(1) = S;
obj.vector(2) = I;
obj.vector(2) = I;
obj.vector(3) = R;
obj.vector(3) = R;
...
@@ -34,6 +35,10 @@ classdef model < handle
...
@@ -34,6 +35,10 @@ classdef model < handle
obj.Wlist(i) = sum(obj.vector(4:length(obj.vector)));
obj.Wlist(i) = sum(obj.vector(4:length(obj.vector)));
obj.vector = step(obj.vector, coeffs, VaccinationVec(i));
obj.vector = step(obj.vector, coeffs, VaccinationVec(i));
end
end
function goto(obj, other)
end
end
end
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
SRI_matlab/step.m
+
3
−
3
View file @
429c8112
...
@@ -11,9 +11,9 @@ for i=5:length(X)
...
@@ -11,9 +11,9 @@ for i=5:length(X)
end
end
if
length
(
X
)
>
3
if
length
(
X
)
>
3
% infect
er = sum(X(4:length(X)
)
+
I
)
;
% infect
ion = S * (1 - 25 * options.InfectionRate / N
)
^
I;
infect
ion
=
S
*
(
1
-
25
*
options
.
InfectionRate
/
N
)
^
I
;
infect
er
=
sum
(
X
(
4
:
length
(
X
)
)
+
I
)
;
%
infection = options.InfectionRate * S * infecter/N;
infection
=
options
.
InfectionRate
*
S
*
infecter
/
N
;
new_waiting
(
1
)
=
infection
;
new_waiting
(
1
)
=
infection
;
dS
=
-
infection
;
dS
=
-
infection
;
dI
=
X
(
length
(
X
));
dI
=
X
(
length
(
X
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment