from sympy import *
= symbols('R_0 b g dIdt dSdt S I')
R_0, b, g, dIdt, dSdt, S, I
= - b*S*I
dSdt = + b*S*I - g*I
dIdt = dIdt / dSdt #-(I*S*b - I*g)/(I*S*b)
dSdI
# b <- R0*g
-(I*S*R_0*g - I*g)/(I*S*R_0*g)) simplify(
-1 + 1/(R_0*S)
Jong-Hoon Kim
October 16, 2023
I attempted to replicate some of the simple analytical results presented in the book, Mathematical Epidemiology by Brauer et al.
\[ \begin{align} \mathrm{d}S/\mathrm{d}t &= -\beta I S \\ \mathrm{d}I/\mathrm{d}t &= \beta I S - \gamma I\\ \end{align} \] The first part is simply to compute \(dI/dS\).
from sympy import *
R_0, b, g, dIdt, dSdt, S, I = symbols('R_0 b g dIdt dSdt S I')
dSdt = - b*S*I
dIdt = + b*S*I - g*I
dSdI = dIdt / dSdt #-(I*S*b - I*g)/(I*S*b)
# b <- R0*g
simplify(-(I*S*R_0*g - I*g)/(I*S*R_0*g))
-1 + 1/(R_0*S)
The second part is integrate the equation, \(\text{d}I/\text{d}S\)