I'm attempting to make a simulation of the SEIR epidemic model. It contains four parts:
- Susceptibles (non-infected)
- Exposed (infected but not infectious yet)
- Infectious (infected and infectious)
- Removed (recovered/dead)
where gamma γ is the infection rate and beta β is the reovery/death rate.
I've previously used the SIR model, a more basic model where E and I are combined, which uses these equations:
From another thread I've used a solution to simulate SIR using this code:
double dS = (beta * S.get(day) * I.get(day) / N);
double newS = (S.get(day) - dS);
double newI = (I.get(day) + dS - gamma * I.get(day));
double newR = (R.get(day) + gamma * I.get(day));
This works fine using the Euler's method. However, I've tried to manipulate this to try and fit the SEIR model (which has these equations:)
where u is the death rate, delta is the birth rate and a is the incubation period. I've made an attempt to try and use a similar method to work for SEIR but I'm unsuccessful to simulate it well at all. This isn't really a problem with the variables but as a whole differentiating these complex equations. Wondering if anyone could help, thanks.