-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
149 lines (148 loc) · 6.32 KB
/
index.html
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>SEIR disease model</title>
<script type="text/javascript" src="d3.min.js" charset="utf-8">
</script>
<link rel="stylesheet" type="text/css" href="seir.css" />
<link rel="stylesheet" type="text/css" href="slider.css" />
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: { equationNumbers: {
autoNumber: "AMS",
extensions: ["color.js"]
}}});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div id="diagram">
<img src="model-diagram.png" />
</div>
<div id="legend">
The plot below shows the number of
<span class="varS">Susceptible</span>,
<span class="varE">Exposed</span>,
<span class="varI">Infectious</span>, and
<span class="varR">Resistant</span> individuals over time
(in days) as percentages of the entire population.
</div>
<div id="plot-container">
<div id="plot">
</div>
</div>
<div id="model-container">
<div id="model-eqns">
<h2>Equations</h2>
<script type="math/tex; mode=display">% <![CDATA[
\begin{align*}
\beta &= R_0 \cdot \gamma \\
\frac{{d\class{varS}{S}}}{dt} &= - \beta \class{varI}{I} \cdot \left(\frac{\class{varS}{S}}{N}\right)^\eta + \sigma \class{varR}{R} \\
\frac{d\class{varE}{E}}{dt} &= \beta \class{varI}{I} \cdot \left(\frac{\class{varS}{S}}{N}\right)^\eta - \alpha \class{varE}{E} \\
\frac{d\class{varI}{I}}{dt} &= \alpha \class{varE}{E} - \gamma \class{varI}{I} \\
\frac{d\class{varR}{R}}{dt} &= \gamma \class{varI}{I} - \sigma \class{varR}{R} \\
\end{align*}
%]]></script>
</div>
<div id="model-params">
<h2>Parameters</h2>
<span class="plot-control">
<input id="R0" type="range" min="0" max="0" />
<label for="R0">R<sub>0</sub>:</label>
<span class="show_value"></span>
</span>
<span class="plot-control">
<input id="lat_durn" type="range" min="0" max="0" />
<label for="lat_durn">Latent period
\(\left(\frac{1}{\alpha}\right)\):</label>
<span class="show_value"></span>
</span>
<span class="plot-control">
<input id="inf_durn" type="range" min="0" max="0" />
<label for="inf_durn">Infectious period
\(\left(\frac{1}{\gamma}\right)\):</label>
<span class="show_value"></span>
</span>
<span class="plot-control">
<input id="res_durn" type="range" min="0" max="0" />
<label for="res_durn">Duration of resistance
\(\left(\frac{1}{\sigma}\right)\):</label>
<span class="show_value"></span>
</span>
<span class="plot-control">
<input id="eta" type="range" min="0" max="0" />
<label for="eta">Mixing exponent
\(\left(\eta\right)\):</label>
<span class="show_value"></span>
</span>
<span class="plot-control">
<input id="susc_frac" type="range" min="0" max="0" />
<label for="susc_frac">Initial susceptibility
\(\left(S(t=0)\right)\):</label>
<span class="show_value"></span>
</span>
<span class="plot-control">
<input id="n_days" type="range" min="0" max="0" />
<label for="n_days">Days:</label>
<span class="show_value"></span>
</span>
<span class="plot-control">
<input id="y_max" type="range" min="0" max="0" />
<label for="y_max">Upper bound for Y axis:</label>
<span class="show_value"></span>%
</span>
</div>
</div>
<div id="footer">
<a href="https://bitbucket.org/robmoss/seir-demo-javascript">Available on Bitbucket</a>
</div>
<script type="text/javascript" src="seir.js" charset="utf-8"></script>
<script type="text/javascript">
var param_vals = {
n_days: [{value: 90}, {value: 180}, {value: 360, default: true}],
y_max: [{value: 5}, {value: 10}, {value: 15}, {value: 20},
{value: 25}, {value: 30}, {value: 35}, {value: 40},
{value: 45}, {value: 50}, {value: 55}, {value: 60},
{value: 65}, {value: 70}, {value: 75}, {value: 80},
{value: 85}, {value: 90}, {value: 95},
{value: 100, default: true}],
R0: [{value: 1.0}, {value: 1.1}, {value: 1.2},
{value: 1.4, default: true}, {value: 1.6}, {value: 1.8},
{value: 2.0}, {value: 2.5}, {value: 3.0}, {value: 4.0},
{value: 5.0}, {value: 10.0}],
lat_durn: [{value: 0.5, label: '½ day', default: true},
{value: 1.0, label: '1 day'},
{value: 2.0, label: '2 days'},
{value: 4.0, label: '4 days'},
{value: 7.0, label: '1 week'},
{value: 14.0, label: '2 weeks'}],
inf_durn: [{value: 0.5, label: '½ day'},
{value: 1.0, label: '1 day'},
{value: 2.0, label: '2 days'},
{value: 4.0, label: '4 days', default: true},
{value: 7.0, label: '1 week'}],
res_durn: [{value: 7, label: '1 week'},
{value: 30, label: '1 month'},
{value: 180, label: '6 months'},
{value: 365, label: '1 year'},
{value: -1, label: 'Permanent', default: true}],
eta: [{value: 1, label: '1 (homogeneous)', default: true},
{value: 1.2, label: '1.2 (heterogeneous)'},
{value: 1.4, label: '1.4 (heterogeneous)'},
{value: 1.6, label: '1.6 (heterogeneous)'},
{value: 1.8, label: '1.8 (heterogeneous)'},
{value: 2.0, label: '2.0 (heterogeneous)'},
{value: 2.5, label: '2.5 (heterogeneous)'},
{value: 3.0, label: '3.0 (heterogeneous)'}],
susc_frac: [{value: 0.25, label: '25%'},
{value: 0.50, label: '50%'},
{value: 0.75, label: '75%'},
{value: 0.90, label: '90%'},
{value: 1.00, label: '100%', default: true}]
};
SIR.plot('#plot', '#model-params', param_vals);
</script>
</body>
</html>