Modeling of disease propagation using a particle/collision formalism

Mehl Cédric
9 min readJun 12, 2020

--

A much commented article published in the Washington Post illustrated the importance of confinement by providing small didactic simulations to reproduce COVID-19 propagation. The idea is to model the population as a set of small particles which move and propagate the disease when they collide. I found the approach pretty interesting and was quite amazed by the nice trends which can be obtained, even with such a simple model. Therefore, I decided to go a step further and see how far I could get the approach by including more details in the model. In particular, I have decided to add the following elements:

  • Infection at contact is made with a probability p≤1. This stems from the fact that a contact between an infected person and a healthy person does not always lead to an infection.
  • An incubation time is added for the disease. A person will only be ill after a certain number of days after contact.
  • The disease death rate is included in the simulation.

In the present article, the model formalism will be explained in details first. Some results of the model based on COVID-19 data will then be shown. In particular, we will see the impact of (i) confinement; (ii) vaccination; (iii) use of personal protection devices. Note that the results presented here are only qualitative. Quantitative results would require the use of advanced epidemiological models, which is a whole research field in itself.

Modeling formalism

Principle

As was done in the simulations shown in the Washington Post article, each individual is represented by a small particle. For this study, we assume a domain of size 1km×1km, including 1000 particles. This leads to an area with a density of 1000 persons per km squared, which corresponds to a lightly populated urban area (the number of persons was kept at 1000 so that the code is able to run in a few minutes on a laptop). Each of the particles are bound to stay in the domain, and no particle can come in either. The radius of the particles is representative of an infection radius. A conservative value for contamination of 2m has been selected. The disease propagation is initiated by setting a few infected persons at the center of the domain. The state of the population at an initial instant is shown in the figure below.

Example of a population initial state. Blue particles corresponds to healthy persons while the red represent the initially infected people.

Note that for each new simulation, healthy persons are randomly distributed in the domain. The particles initially have a velocity v0, which is the same for each of them. The initial direction of the particles’ movement is however set at random. Collisions between particles is assumed elastic, and the velocities of the particles is therefore the same at any time during runtime. Only the direction of the particles’ movement can change through the collision with domain walls and other particles. The change of velocity direction with walls and other particles, respectively, is illustrated on the figure below.

Illustration of collisional behavior of particles. Left: particle-wall collision. Right: particle-particle collision.

Modeling assumptions

Whereas the simulations presented in the Washington Post article involved 3 categories of persons (susceptible, ill and recovered), the population is presently divided into five categories:

  • Healthy persons (blue dots in the simulation).
  • Persons infected by the virus without having developed symptoms (orange dots).
  • Persons who are infected and symptomatic (red dots).
  • Persons who have recovered from the disease (purple dots).
  • Persons dead from the disease (dots removed from the simulation).

Moreover, we assume that people infected without symptoms are not infectious. This basically means that we assume the incubation and latent times of the disease to be the same. While this might not be exactly true, it will be sufficient for obtaining qualitative results. The model could in fact be completed with a sixth category of population to capture this effect. The contamination process works as follows: when a particle is touched by an infected particle, it is contaminated with probability p, and if contamination happend the code decides if the particle is going to recover or to die. This decision is made with a uniform probability law, knowing the death rate of the considered disease. Particles tagged with recovery will then recover after a certain amount of time, while particle tagged with death will, well, die.

To be complete, the model thus needs the specification of several durations: (i) incubation duration (from infection to disease onset); (ii) duration before recovery (from disease onset to recovery); (iii) duration before death (from disease onset to death). These are disease specific quantities which should ideally be based on actual data. Instead of using constants times for these quantities, we will consider probability density functions. When a person in the simulation is infected, a duration of incubation is attributed to it. Once this period is reached, the particles is tagged as “going to die” or “going to recover”. This enables to have a slightly more refined representation of the disease propagation.

Results using Covid-19 data

The simulation approach is tested on the Covid-19 propagation. A baseline case is first run to show the evolution of the disease without any measure taken. Simulation are then performed to study (i) the effect of confinement; (ii) the effect of vaccination; (iii) the impact of using personal protective equipments.

Retained parameters and baseline result

Recent publications have investigated statistics about Covid-19. In particular, the study made in [1] provides useful data about incubation time and onset to deaths time. The data is based on Covid-19 cases which arose in China in January 2020. Most of these cases were located in the Wuhan region. Following the conclusions of this study, the incubation time is set using a Log-normal law [2]. The probability law parameters are chosen to get a mean value of 5.6 days and a standard deviation of 2.8 days. The onset to death duration is modeled by a Gamma law [3], with a mean of 14.5 days and a standard deviation of 6.7 days. Unfortunately no data was available regarding the recovery duration. We assumed that the recovery time was roughly similar to the onset to death time. The onset to recovery time is therefore set using a Gamma law with a mean of 14 days and a standard deviation of 5 days. The three probability laws are illustrated in the figure below.

The mortality rate has been set to 3.4%, which is the recommended value by the WHO as of March 2020 [4]. This value might however change in the future as more data about the disease will be analyzed. A simulation has been run for Covid-19 using the baseline parameters detailed above. The resulting evolution of each categories of persons is illustrated in the video below.

Evolution of the disease propagation using the baseline parameters.

The number of infected people in time is a bell shaped curve, which is qualitatively in agreement with more advanced epidemics model. A shift is observed between the persons infected without symptoms and the persons with symptoms. This shift is directly related to the incubation time of Covid-19. Furthermore, an effective reproduction factor R is computed at each time step. R is computed as the average number of persons that an infected person contaminates. While R>1, the number of infected persons grows rapidly. R=1 is reached approximately at the tip of the Gaussian curve and consequently takes values R<1, characteristic of a diminution of the number of infected people.

Impact of confinement

A second simulation is performed to assess the impact of confinement. In the present formalism, the confinement of a person is modeled by setting its velocity to zero. The rationale behind this choice is to assume that the person does not go out anymore. However, the person can still be contaminated due to interactions with people from the same household or deliverers, for instance.

In the simulation shown in the above video, the confinement ratio (i.e. the ratio of the population which is confined) is set to 0.6. We clearly see a more flattened contamination curve. This observation is in qualitative agreement with the observed effects of confinement.

Peak of infected people as a function of the confinement ratio

To go a bit further, we investigated the impact of several confinement ratios on the peak of infected people. As can be seen in the figure above, the peak drops as the confinement ratio increases.

Impact of vaccination

A second way to fight an epidemic is though a vaccine, should it be available. In this case, vaccinated people cannot contract the disease but can move freely. Simulations are performed by setting a certain proportion of the population to be vaccinated. The following plots shows the peak of infected people as a function of the vaccination ratio.

Peak of infected people as a function of the confinement ratio

Just as for confinement, we see that vaccination leads to a flattening of the curve, since the peak of infected people decreases with increasing vaccination ratio. The shape of the curve is however different from the curve obtained with confinement. The drop in the peak of infected person is indeed much stronger. In particular, when the ratio of vaccinations is 80%, almost no one gets infected by the virus. This corresponds to herd immunity, and the obtained value for getting herd immunity is in fact consistent with values found in the literature, which are about 70%.

Impact of personal protective equipments

Finally, an analysis is made to qualitatively assess the impact of protective equipments on the disease propagation. We model an increased use of protection equipments by decreasing the probability of infection at contact. Of course, it is very difficult to directly link the use of masks or alcoholic gel to a certain probability of infection. It depends among other things on people’s habits and social behaviors. The idea is only to obtain a qualitative result.

Peak of infected people as a function of the infection probability

We see here that a decreased probability of infection leads to a flattening of the infected people curve. The shape of the curve is similar to the curve obtained for confinement, and thus less steep than the one obtained for vaccination.

Conclusion

A small study of disease propagation has been made in this article by assimilating an enclosed population to a set of moving particles in a box. The population has been divided in 5 categories representative of the evolution of a disease. An attempt has been made to include advanced information about the incubation, onset to death and onset to recovery times. Probabilistic laws recommended by previously published studies have indeed been considered. Simulations were carried out by considering the case of the COVID-19.

Even with the simple approach adopted here, interesting qualitative results have been obtained regarding the propagation of an epidemic. In particular, the characteristic bell shaped curve for the number of infected people is recovered. The effects of confinement, vaccination and use of protective equipments is also retrieved. Interestingly, the critical vaccination rate to obtain herd immunity is in good agreement with commonly agreed on values.

One of the reasons why I did this study is because I like both modeling and coding. The code for the simulations of this article is written in Python and I’m happy to share it on Github: https://github.com/cmehl/EpidemicDynamics. In particular the routines for dealing with particles and collisions can be adapted to other problems.

References

[1] J. Clin. Med. 2020, 9(2), 538; https://doi.org/10.3390/jcm9020538

[2] https://en.wikipedia.org/wiki/Log-normal_distribution

[3]https://en.wikipedia.org/wiki/Gamma_distribution

[4] https://www.worldometers.info/coronavirus/coronavirus-death-rate/

--

--

Mehl Cédric

PhD graduate in the field of computational fluid dynamics. Now research engineer in numerical simulation in a French institute on energy and transports.