-
Notifications
You must be signed in to change notification settings - Fork 0
/
SIYR_Aparicio_ScaleFree.st
63 lines (52 loc) · 1.61 KB
/
SIYR_Aparicio_ScaleFree.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
siyrConcern := KEModelPart new.
siyrConcern attributes:
{#status->#(#S #I #Y #R)}.
siyrConcern addParameters:
{#lambda. #gamma. #sigma}.
siyrConcern
addTransitionFrom: {(#status -> #S)}
to: {(#status -> #I)}
probability: 'lambda'.
siyrConcern changeParameter: #lambda
value: 'it_gen*tau_gen*alpha_gen'.
siyrConcern
addTransitionFrom: {(#status -> #I)}
to: {(#status -> #Y)}
probability: 'gamma'.
siyrConcern
addTransitionFrom: {(#status -> #Y)}
to: {(#status -> #R)}
probability: 'sigma'.
aparicioConcern := KEModelPart new.
aparicioConcern addParameter: #alpha_gen
value: 'tau+gamma'.
aparicioConcern addParameter: #it_gen
value: 'I/N'.
aparicioConcern addParameter: #tau_gen
value: 'R0'
model := siyrConcern + aparicioConcern.
model atCompartment: {(#status -> #S)} put: 9950.
model atCompartment: {(#status -> #I)} put: 30.
model atCompartment: {(#status -> #Y)} put: 20.
model atCompartment: {(#status -> #R)} put: 0.
model atParameter: #R0
assignValue: 'tau*(meank2 - meank)/(meank*(tau+gamma))'.
model atParameter: #tau assignValue: 0.025.
model atParameter: #gamma assignValue: 0.1.
model atParameter: #sigma assignValue: 1.
model atParameter: #meank assignValue: 10.
"Correct value of meank2 below for scale free network"
model atParameter: #meank2 assignValue: 950.
simulator := KESimulator
new: #RungeKutta
from: 0.0
to: 200
step: 0.1.
simulator executeOn: model.
chart := KEChart new.
chart addDataFrame:
((simulator timeSeriesOutputsAt:
{(#status -> #I)})/10000).
chart yLabel: 'New infections per day'.
chart legendTitle: 'Aparicio Scale free Network'.
chart plot