Solution (source code)

= Solution

Assume $S_0>0$ and scale by the initial susceptible count:
$$
\boxed{u=\frac S{S_0},\quad v=\frac I{S_0},\quad w=\frac R{S_0},\quad\tau=\gamma t,\quad
v_0=\frac{I_0}{S_0},\quad\mathcal R_0=\frac{\beta S_0}{\gamma}.}
$$
Substitution into the <SIR model equations> gives
$$
\frac{du}{d\tau}=-\mathcal R_0uv,\qquad
\frac{dv}{d\tau}=(\mathcal R_0u-1)v,\qquad
\frac{dw}{d\tau}=v.
$$
The initial data become $u(0)=1$, $v(0)=v_0$, $w(0)=0$. The conserved total is $u+v+w=1+v_0$, since the scaling is by $S_0$, not by $S_0+I_0$. With this normalization, $\mathcal R_0$ is the reproduction ratio at the initial susceptible level.