Wednesday, June 3, 2020

Epidemiological Models: A Simple Explanation of How they Work


There is a certain logic in the way the universe works and so it is not surprising that the same models can describe phenomena that seem to be completely different. Here, I'll show you how the same equations describe chain reactions that govern such different phenomena as the spread of an epidemic, the cycle of extraction of crude oil, and even the nuclear reaction that creates atomic explosions. All these phenomena depend on the efficiency of energy transfer, the parameter that's known in energy studies as EROI (energy return on energy invested), related to the "transmission factor" (R) of epidemiological models. Above, a classic clip from Walt Disney's 1957 movie, "Our friend, the atom." 


You may be surprised to discover that epidemiological models share the same basic core of peak oil models. And it is not just about peak oil, the same models are used to describe chemical reactions, resource depletion, the fishing industry, the diffusion of memes on the Web, and even the nuclear chain reaction that leads to nuclear explosions. It is always the same idea: reinforcing feedbacks lead the system to grow in a frenzy of exploitation of an available resource: oil, fish, atomic nuclei, or people to be infected. In the end, it is perhaps the most typical way the universe uses dissipate potentials. As always, entropy rules everything!

Modeling these phenomena has a story that starts with the model developed in the 1920s by Vito Volterra and Alfred Lotka. They go under the name of "Lotka-Volterra" models or, sometimes, "Prey-Predator" models. This heritage is not normally recognized by people in the field of epidemiology, but the model is the same: the virus is a predator and we are the prey. The only difference is that an epidemic cycle is so short, typically a few months, that the prey, people, don't reproduce during the cycle. Then, if you think that oil companies are predators and oil fields are the prey, then we have again the same model. Finally, you can see the atomic chain reaction that takes place during fission as generated by neutrons acting as predators and atomic nuclei acting as prey. In the Walt Disney interpretation, shown in the clip above, ping-pong balls are the predator and mousetraps are the prey.
 
To describe the model, let's focus on epidemiology. These models are called "SIR," with the acronym standing for "Susceptible, Infected, Recovered." The idea is that the Infected stock grows proportionally to both the Susceptible and the Infected stocks -- it is a feedback loop. No feedback, no growth, this is how these models work. Then, of course, the virus will gradually run out of susceptible people, growth will slow down and, eventually, the infected stock will start declining. Then, the epidemic will be over.

So, let's see what the model produces in its simplest version. I made it using the Vensim (TM) system dynamics package (see at the end of the post for the details *)


Note how the number of susceptible people (blue curve) gradually declines. Instead, the number of cases per unit time (green curve) and the total infected people (red curve) show a cycle of growth and decline. Finally, the recovered people (gray curve) grow and then stabilize. (they might also die, the equations won't change.)

Let's compare with peak oil models: the names of the variables change, but the model is the same

Susceptible  --> Oil Resources
Infection rate --> oil production
Infected --> Extracted Oil
Recovered --> Pollution

Note the green curve in the figure. It is symmetric and bell-shaped: it is the typical "Peak Oil" curve. In the case of oil, the curve describes the production in barrels per day. In the case of an epidemic, it describes the number of new cases of infections per day. The curve for the victims should be the same, but (hopefully) smaller and shifted forward in time to take into account that you die after having contracted the virus. The red curve in the figure is proportional to the amount of oil extracted and not yet burned. It is the "capital" of the oil industry. As oil is burned, it becomes pollution and disappears from the model 

You can play the same game with other phenomena. For instance, in the case of the "mousetrap model" developed by Disney studios, the one shown in the clip at the beginning of this post, you have that

Susceptible --> trapped balls
Infection rate --> number of traps springing per unit time.
Infected --> number of flying balls
Recovered --> balls on the ground



In general, epidemiological models are normally much more complicated than the basic SIR model that I showed above. That is, in my opinion, a weakness of these models. Attempting to evaluate such parameters as how many people will contact each other per day, and from that estimating the infection rate is nearly hopeless and, indeed, these models have a poor record in terms of quantitative forecasting. Even peak oil models, although not so bad, turned out to be unsuccessful in estimating the data of the peak, at least in terms of volumes of liquids produced.

But this is a long story and I won't get into it, here. Let me just say that, in general, models may be useful even (and perhaps especially) when you don't ask them to make exact predictions. Often, a correct warning may be much more useful than an incorrect prediction. That's true when the models are well-grounded in physics and can tell you what will happen, even though not necessarily when.

Something that you can learn from these models is how the behavior of the system is determined by an efficiency parameter called R in epidemiology and EROI (energy return on energy invested) in peak oil studies. Yes, these two parameters are the same -- apart from some details. They share the property that they need to have a minimum value in order for the chain reaction (the epidemics or a cycle of extraction) to start. In epidemiology, you can show that R must be >1 for the infection to grow. As the epidemic proceeds, R becomes smaller. When R=1, you have the "peak virus" and the number of infected people starts declining. That's called "herd immunity."

Things are not so simple for the peak oil curves, but the story is the same. You can show that an energy-producing resource cannot be produced with a positive energy yield unless you have EROI=1/η at the beginning of the extraction cycle, with η the efficiency of the transformation of the energy of the extracted resource into useful energy (exergy). For crude oil, we may probably take η as equal to 0.1-0.2. The implication is that oil extraction is not viable for EROI<5-10, which is consistent with the current situation. We are close to EROI values that correspond to an unavoidable decline of the industry. (Note that this condition is for "peak capital" -- "peak oil" comes for even larger values of the EROI)

Ah... by the way, these limits of the EROI values are valid only for exhaustible resources such as crude oil. They do not hold for renewable energy sources such as solar energy -- of course, you can't run out of sunlight!
_________________________________________________________________________

The R and the EROI parameters of chain reaction models -- a quick explanation


Ro is defined as the expected number of cases generated by one case in a population where all individuals are susceptible to infection, that is, at the initial stages of the epidemic. As the epidemic proceeds, varying proportions of the population become immune. To account for this, the "effective reproduction number" is used, written as Rt or simply R. It is the average number of new infections caused by a single infected individual at time t. When the fraction of the population that is immune increases so much that R drops below 1, it is said that "herd immunity" has been achieved. It means that the number of infected people does not grow any longer and gradually decreases toward zero.

The EROI (or EROEI) (energy return of energy investment) factor in oil extraction is defined as the number of barrels of oil produced using the energy obtained from one barrel. It is more general than that, but let's remain with crude oil. Obviously, when the EROEI goes below one, the whole enterprise of oil extraction becomes useless in terms of producing useful energy. But "peaking" of oil production starts well before the EROI goes below one, as we'll see in the following.

R and EROI look similar and, indeed, they are the same thing. To say something more about this matter, we need to write down the equations of the model. Here they are for the SIR system, with S=susceptible, I=infected, and R= recovered


dS/dt = - k1SI

dI/dt = k1SI  - k2I

Note that the coefficient k1 is the same in both equations because the number of people who become infected is equal to the number of those who cease being susceptible -- these two coefficients won't be the same in the equivalent equations for oil extraction. The other coefficient, k2, is the frequency of recovery of the infected people. There is a third equation describing the growth of the "recovered" stock, but it is simply equal to k2I and we can neglect it here. 

Now, from the equations above, we can say that the R factor is equal to the number of new infections divided by the number of infected people. We need to take also into account the recovery frequency: the gradual disappearance of people from the "infected" stock. So that the result is:

R Sk1/k2

Note that the variables in this model are usually expressed in terms of fractions. So, the number of susceptible people at the very start of the epidemic is supposed to be 100% of the population, that is, unity. There follows that

Ro= k1/k2

Now we can determine the value of R needed for attaining "herd immunity." the value needed for stopping the growth of the infection. For this, we take the second equation of the two of the model. We want to know when the number of infected people, I, starts to decline. That means to find when dI/dt <0. That is:


k2R-k2 <0

Or, R<1.  

This is the condition for herd immunity. It explains the attention dedicated to this number for the current coronavirus epidemic. 

Measuring R may be a good idea but, in reality, it is not a very useful way to forecast the trajectory of an epidemic. To measure R you need to know S, but normally you don't know who is susceptible and who is not unless you try to infect them. So, saying that "R has become smaller than one" is the same thing as saying that "the number of infected people in the population has started declining." And the latter term is what you can actually measure or, at least, estimate. As someone said, "Models are accurate only when they become irrelevant."

How about the EROI? The equations are the same, but with a small difference. Whereas people move quantitatively from the "Susceptible" to the "Immune" stock, transforming a unit of energy embedded in underground oil into a unit of usable energy cannot be 100% efficient. So, you need another coefficient in the equations, a "transformation efficiency", η as a coefficient of k1 in the second equation. Obviously, it must be that η<1 because of the 2nd law of thermodynamics.

We go through the same mathematical tricks and we find the condition for the amount of stored energy (the "capital" of the industry) starts declining. It has to be:

EROI < 1/η

For the transformation of crude oil into useful energy into a thermal engine, we can roughly estimate a life cycle efficiency of the order of 10%-20%. There follow that oil extraction is not thermodynamically viable for an EROI < 5-10, which agrees with independent estimates of EROI for crude oil. It was probably around 30 during the early stages of exploitation and therefore allowed the industry to grow. Currently, the average EROI for oil extraction is probably around 10-15, so that we are close to the start of the irreversible decline of the industrial system that exploits it. Or, it may have already started. 

Note that the condition EROI < 1/η does NOT correspond to "peak oil" as it is normally defined. It is, rather, "peak capital". Peak oil refers to oil production, which is not the same thing. But it is not possible to find an equivalent simple expression that correlates the EROI of the system with the occurrence of the peak. We can only say that it occurs earlier and, therefore, for larger values of the EROI.


___________________________________________________________________

(*) Here is the Vensim model I used for the graph shown in this post. If you want the code, just write to me. 




Who

Ugo Bardi is a member of the Club of Rome, faculty member of the University of Florence, and the author of "Extracted" (Chelsea Green 2014), "The Seneca Effect" (Springer 2017), and Before the Collapse (Springer 2019)