By virtue of this question, I am clearly not an epidemiologist but am interested (as I am sure many are at the moment). A lot of the models are beyond the scope of understanding of the majority of people, so I've been thinking of a more basic model:
Assumptions:
- uniform distribution of infection transfer 'attempts' from an individual during their infectious period
- An infection transfer 'attempt' only results in an infection if the target has not been infected before
- no learnings or countermeasures etc to reduce transfer rate
- People can only be infected once
This gives the probability per day of an infected individual transferring to an uninfected individual of Pr(transfer per day) = alpha = (R0 / infectious_duration). The proportion of the population that is susceptible is (1 - (n/p)), where n is the number so far infected and p is the population. That results in the probability of transfer per day for an infected individual as Pr(transfer per day) = alpha*(1 - (n/p)).
This is easy to model in a spreadsheet, with a row per day and columns of day number, infections at start of day, new infections per day, ended infections per day, infections at end of day. Example curves with R0=3, infectious_duration=12 and population p=66 million:
Final cumulative figure is 95% of population in this example.
Without an infectious duration (i.e. remaining infectious indefinitely) there is a simple analytical solution to the cumulative number of infections, n, against time, t:
- dn/dt = alpha.n.(1 - (n/p))
- n = p / (1 + (p-1).EXP(-alpha.t))
- gives early stage doubling time of t_double = LN(2) / alpha
The key benefit here is you only need to know the doubling time and you can generate the infection curve.
How can the differential equation be changed to factor in the end of infection so that the model works for infections that are not permanent?


The model you've described here is the logistic curve model, which is probably the easiest model that gives semi-realistic results. Indeed, it is the model used for most of the "flatten the curve graphs"
I think the simplest modification to have a finite infectious period is to move to the SIR model. Let S be the number of yet-to-be-infect, I be the infected and R be the recovered/no longer infectious. Let $N=S+I+R$ be the population size. Then we have two parameters $a,b$ representing the infection rate and the recovery rate respectively. The model is given by something like
$$\frac{dS}{dt} =-aSI$$ $$\frac{dI}{dt} =aSI-bI$$ $$\frac{dR}{dt} =bI$$
The Wikipedia article on this is quite informative and presents a more detailed explanation of the parameters and how they are used to describe infectivity. I would recommend have a look if you are interested.