Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
math_tech_info
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
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
Show more breadcrumbs
orestis.malaspin
math_tech_info
Commits
16fb6e59
Commit
16fb6e59
authored
5 years ago
by
orestis.malaspin
Browse files
Options
Downloads
Patches
Plain Diff
added legend
parent
78c8478c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#10224
passed
5 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
covid/python/covid.py
+16
-0
16 additions, 0 deletions
covid/python/covid.py
covid/python/seir.py
+4
-1
4 additions, 1 deletion
covid/python/seir.py
with
20 additions
and
1 deletion
covid/python/covid.py
+
16
−
0
View file @
16fb6e59
...
...
@@ -6,6 +6,22 @@ swiss = np.array([18, 27, 42, 56, 90, 114, 214, 268, 337, 374, 491, 652, 858, 11
days
=
np
.
array
(
range
(
1
,
len
(
swiss
)
+
1
))
def
F
(
yx
,
yy
,
yz
,
t
):
return
sigma
*
(
yy
-
yz
),
rho
*
yx
,
(
mu
*
yx
+
yz
)
def
rk2
(
yx
,
yy
,
yz
,
t
,
dt
):
yx_tmp
,
yy_tmp
,
yz_tmp
=
F
(
yx
,
yy
,
yz
,
t
)
yx0
=
yx
+
dt
/
2
*
yx_tmp
yy0
=
yy
+
dt
/
2
*
yy_tmp
yz0
=
yz
+
dt
/
2
*
yz_tmp
y1x
,
y1y
,
y1z
=
F
(
yx0
,
yy0
,
yz0
,
t
+
dt
/
2
)
return
yx
+
dt
*
y1x
,
yy
+
dt
*
y1y
,
yz
+
dt
*
y1z
def
yx
(
dt
,
yx0
,
yy0
,
yz0
,
sig
):
return
yx0
+
dt
*
sigma
*
(
yy0
-
yz0
)
def
s
(
dt
,
beta
,
S0
,
I0
,
N
):
return
S0
-
dt
*
(
beta
*
S0
*
I0
/
N
)
...
...
This diff is collapsed.
Click to expand it.
covid/python/seir.py
+
4
−
1
View file @
16fb6e59
...
...
@@ -14,7 +14,9 @@ def update(i, lines, t, p):
lines
[
j
].
set_data
(
t
[
0
:
i
],
p
[
j
][
0
:
i
])
return
lines
def
policy_r0
(
R_i
,
t
):
# def policy_r0(R_0, R_target, t, delta_t):
# if (t <= )
def
seir
(
y
,
t
,
R_0
,
Tinf
,
Tinc
):
...
...
@@ -104,6 +106,7 @@ lines = [plt.semilogy([], [], 'r-')[0],
# anim = animation.FuncAnimation(fig, functools.partial(update, lines=lines, t=t, p=p),
# frames=n_steps, interval=10, blit=True)
ax
.
legend
([
'
Sain
'
,
'
Exposé
'
,
'
Infectieux
'
,
'
Rétablis
'
,
'
Hospitalisés
'
,
'
Soins intensifs
'
])
anim
=
animation
.
FuncAnimation
(
fig
,
functools
.
partial
(
update
,
lines
=
lines
,
t
=
t
,
p
=
p
),
frames
=
n_steps
,
interval
=
10
,
blit
=
True
)
...
...
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