An analytic approximate solution of the SIR model