Created
May 29, 2020 01:34
-
-
Save sunprinceS/8af98e7d8f419bc9fbc4cf76f10cfe5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GAMMA =1.0/10 # (1/D) | |
### Model ### | |
def sir_diff_eq(y, t, r0, gamma, N, t_y_interpolated): | |
S, I, R = y | |
def beta(t): | |
try: | |
return t_y_interpolated[int(t)] * r0 * gamma | |
except: | |
return t_y_interpolated[-1] * r0 * gamma | |
dSdt = -beta(t) * I * S / N | |
dIdt = beta(t) * I * S/N - gamma * I | |
dRdt = gamma * I | |
return dSdt, dIdt, dRdt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment