SIR Model: The Boarding School Example - SAMSI
SIR Model: The Boarding School Example - SAMSI
SIR Model: The Boarding School Example - SAMSI
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Experiment with Values of β and γ<br />
time=[1:1:14];<br />
Infected=[3 6 25 73 222 294 258 237 191 125 69 27 11 4];<br />
beta= % Choose values for beta and gamma<br />
gamma =<br />
N=763;<br />
YInit=[760 3 0];<br />
options=[ ];<br />
[t,PredY]=ode15s(@<strong>SIR</strong>ode, time, YInit, options, beta, gamma, N);<br />
PredI=PredY(:,2);<br />
figure<br />
plot(time, Infected, ’*’, t, PredI, ’-’)<br />
xlabel(’Time (in Days)’)<br />
ylabel(’Number Infected’)<br />
legend(’Data’, ’<strong>Model</strong>’)<br />
<strong>SIR</strong> <strong>Model</strong>: <strong>The</strong> <strong>Boarding</strong> <strong>School</strong> <strong>Example</strong> – p. 4/8