# SIRモデル

## 感染ダイナミクス (連続)

$$
\begin{align}
  \dfrac{\mathrm{d} S(t)}{\mathrm{d}t} &= - \beta S(t)I(t)
  \\
  \dfrac{\mathrm{d} I(t)}{\mathrm{d}t} &= (\beta S(t) - \gamma)I(t)
  \\
  \dfrac{\mathrm{d} R(t)}{\mathrm{d}t} &= \gamma I(t)
\end{align}
$$


## 感染ダイナミクス (離散)


$$
\begin{align}
   S(t+\Delta t) &= S(t) \mathrm{e}^{-\beta \Delta t I(t)}
  \\
  I(t+\Delta t) &= I(t)+ S(t) (1-\mathrm{e}^{-\beta \Delta t I(t)}) - \gamma \Delta t I(t)
  \\
  R(t+\Delta t) &= R(t) + \gamma \Delta t I(t)
\end{align}
$$

## 定式化およびアルゴリズム詳細

* [report.pdf](report.pdf)


```python
import numpy as np
import math
import matplotlib.pyplot as plt
%matplotlib inline
import SIR_Solver as SS

plt.style.use('default')
```


```python
prm = SS.Prameter(R0=2.0, gamma=1)
dt = 0.1
model = SS.Model(prm=prm, I=0.001, T=20, dt=dt)
model_Euler = SS.Model(prm=prm, I=0.001, T=20, dt=dt)
model_Heun = SS.Model(prm=prm, I=0.001, T=20, dt=dt)
model_Runge_Kutta = SS.Model(prm=prm, I=0.001, T=20, dt=dt)
```


```python
model.solve_Anly()
model_Euler.solve_Euler()
model_Heun.solve_Heun()
model_Runge_Kutta.solve_Runge_Kutta()
```


```python

plt.plot(model.I_list, color='black', label='Discrete model')
plt.plot(model_Euler.I_list, color='red', label='Euler')
plt.plot(model_Heun.I_list, color='blue', label='Heun')
plt.plot(model_Runge_Kutta.I_list, color='green', label='Runge-Kutta')

plt.xticks([i*50 for i in range(6)], [i*5 for i in range(6)])
plt.xlim([0,200])
plt.ylim([0.0,0.17])

plt.legend(fontsize=8)
```

dcf589f0eca57e18ed666b39af754f4d273ca811
ipynb
Jupyter Notebook
SIR/Run.ipynb
takala4/takala-bako
e7405e3240567860ce5b5164f2da9083787e6d18
MIT
2018-12-28T10:33:06.000Z
2018-12-28T10:33:06.000Z
SIR/Run.ipynb
takala4/takala-bako
e7405e3240567860ce5b5164f2da9083787e6d18
MIT
SIR/Run.ipynb
takala4/takala-bako
e7405e3240567860ce5b5164f2da9083787e6d18
MIT
Qwen/Qwen-72B
1. YES
2. YES