Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sloppy Models in epidemiological models
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IBG-1
ModSim
Sloppy Models in epidemiological models
Commits
62b4681a
Commit
62b4681a
authored
1 year ago
by
B.Brodda
Browse files
Options
Downloads
Patches
Plain Diff
update 2/11
parent
8b1ccc55
No related branches found
No related tags found
1 merge request
!2
update 2/11
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SEIR/CompartmentModels.jl
+5
-5
5 additions, 5 deletions
SEIR/CompartmentModels.jl
SEIR/simple_SEIR.ipynb
+440
-304
440 additions, 304 deletions
SEIR/simple_SEIR.ipynb
with
445 additions
and
309 deletions
SEIR/CompartmentModels.jl
+
5
−
5
View file @
62b4681a
...
...
@@ -22,7 +22,7 @@ module CompartmentModels
gE
::
Float64
# rate of E to I compartment
gI
::
Float64
# rate of I to R compartment
contactFrequency
::
Float64
population
::
Float64
=
0
# total population, set automatically in solveSEIR from u0
#
population::Float64 = 0 # total population, set automatically in solveSEIR from u0
end
# Inplace modification due to performance, see https://docs.sciml.ai/DiffEqDocs/stable/tutorials/faster_ode_example/
...
...
@@ -32,11 +32,11 @@ module CompartmentModels
# I Infected
# R Recovered (or Dead)
# parameters are log parameters
function
SEIR!
(
du
,
u
,
p
::
NamedTuple
{(
:
beta
,
:
gE
,
:
gI
,
:
contactFrequency
,
:
population
)},
t
)
function
SEIR!
(
du
,
u
,
p
::
NamedTuple
{(
:
beta
,
:
gE
,
:
gI
,
:
contactFrequency
)},
t
)
# dS/dt
du
[
1
]
=
-
u
[
1
]
*
u
[
3
]
*
exp
(
p
.
beta
)
*
exp
(
p
.
contactFrequency
)
/
p
.
population
du
[
1
]
=
-
u
[
1
]
*
u
[
3
]
*
exp
(
p
.
beta
)
*
exp
(
p
.
contactFrequency
)
/
sum
(
u
)
# dE/dt
du
[
2
]
=
u
[
1
]
*
u
[
3
]
*
exp
(
p
.
beta
)
*
exp
(
p
.
contactFrequency
)
/
p
.
population
-
u
[
2
]
*
exp
(
p
.
gE
)
du
[
2
]
=
u
[
1
]
*
u
[
3
]
*
exp
(
p
.
beta
)
*
exp
(
p
.
contactFrequency
)
/
sum
(
u
)
-
u
[
2
]
*
exp
(
p
.
gE
)
# dI/dt
du
[
3
]
=
u
[
2
]
*
exp
(
p
.
gE
)
-
u
[
3
]
*
exp
(
p
.
gI
)
# dR/dt
...
...
@@ -48,7 +48,7 @@ module CompartmentModels
# E Exposed
# I Infected
# R Recovered (or Dead)
function
solveSEIR
(
u0
,
parameters
::
NamedTuple
{(
:
beta
,
:
gE
,
:
gI
,
:
contactFrequency
,
:
population
)},
tspan
,
start_date
)
function
solveSEIR
(
u0
,
parameters
::
NamedTuple
{(
:
beta
,
:
gE
,
:
gI
,
:
contactFrequency
)},
tspan
,
start_date
)
prob
=
ODEProblem
(
SEIR!
,
u0
,
tspan
,
parameters
);
...
...
This diff is collapsed.
Click to expand it.
SEIR/simple_SEIR.ipynb
+
440
−
304
View file @
62b4681a
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