8.3 Spreading of Disease: A System of First Order ODEs
235
8.3.7 Time-Restricted Immunity
Let us now assume that immunity after the disease only lasts for some certain time
period. This means that there is transport from the R state to the S state:
Modeling the loss of immunity is very similar to modeling recovery from the
disease: the amount of people losing immunity is proportional to the amount of
recovered patients and the length of the time interval Δt. We can therefore write the
loss in the R category as −νΔtR in time Δt, where ν −1 is the typical time it takes
to lose immunity. The loss in R(t) is a gain in S(t). The “budgets” for the categories
therefore become
S
n+1
= S
n
− βΔtS
n I
n
+ νΔtR
n ,
(8.30)
I
n+1
= I
n
+ βΔtS
n I
n
− γ ΔtI
n ,
(8.31)
R
n+1
= R
n
+ γ ΔtI
n
− νΔtR
n .
(8.32)
Dividing by Δt and letting Δt → 0 gives the differential equation system
S
= −βSI + νR,
(8.33)
I
= βSI − γ I,
(8.34)
R
= γ I − νR .
(8.35)
This system can be solved by the same methods as we demonstrated for the original
SIR model. Only one modification in the program is necessary: adding dt*nu*R[n]
to the S[n+1] update and subtracting the same quantity in the R[n+1] update:
for n in range(N_t):
S[n+1] = S[n] - dt*beta*S[n]*I[n] + dt*nu*R[n]
I[n+1] = I[n] + dt*beta*S[n]*I[n] - dt*gamma*I[n]
R[n+1] = R[n] + dt*gamma*I[n] - dt*nu*R[n]
The modified code is found in the file SIR2.py.
Setting ν −1 to 50 days, reducing β by a factor of 4 compared to the previous
example (β = 0.00033), and simulating for 300 days gives an oscillatory behavior
in the categories, as depicted in Fig. 8.13. It is easy now to play around and study
how the parameters affect the spreading of the disease. For example, making the
disease slightly more effective (increase β to 0.00043) and increasing the average
time to loss of immunity to 90 days lead to other oscillations, see Fig. 8.14.
Précédent

- 255/350

Suivant