43 Modeling dynamics
It is a truism that starting a painting with a blank canvas can be daunting: so much choice and so many possibilities can be disabling. The same is true when it comes to constructing a model of a new phenomenon. You will need to decide what are the essential features of the phenomena, how they are connected to one another and how they connect to the question you seek to answer with the model you will eventually build.
For painters, there are numerous ways to confront the blank-canvas function. For instance, there are different types of paintings: landscapes, portraits, abstract, and so on. And there are different styles of painting: impressionist, rococo, cubist, art deco, and so on. I don’t think that painters would use this term, but I think of these aids to decision making as a framework, an organization of what you know to guide decision making.
Three of the frameworks for modeling that we have worked with in this book might be called:
- Function shape. Possibilities are hump, sigmoid, oscillatory, exponential, and so on. We’ve also worked with the low-order polynomial as a function-shape framework, which reduces the decision making to which terms to include in the polynomial.
- Differential equations. Constructing a model as a differential equation enables the modeler to separate the accounting work of accumulation over time and focus on capturing the relationships that tell, at any instant in time, which way the change will go. In working with this framework, the modeler decides what will be the state variables. Then, the modeler turns to the function shape framework to describe how the state variables themselves determine in which direction the change of each goes.
- Modeling cycle. Most people are taught that mathematics is about precision, exactitude, and a correct answer. In many settings, this is appropriate. But often the role of mathematics is to provide a language to express ideas about relationships and then to play out the consequences of those ideas. It is not usually critical that the relationships are being exactly described; observing the calculated consequences from a given statement of the relationships can provide deeper understanding of the system being studied or reveal that the description of the relationships does not lead to realistic consequences and so is incomplete or wrong.
43.1 A single state quantity
We will start with situations that can be modeled with a single state variable. Throughout our examples, we will call that state variable
In principle, there is an infinite number of shapes for
If
If there are no fixed points, then the only possible dynamics are continuous increase in
Figure 43.1 shows four generic dynamical function shapes where these is one fixed point. The location of the fixed point is, of course, the
The fundamental distinction is between models with stable and models with unstable fixed points. When the situation being modeled has a steady equilibrium, only the stable shapes of
A setting for a linear stable model is the cooling or warming of an object to the ambient temperature.
Another classic setting for a linear, stable model is radioactive decay. The rate at which the atoms in a mass of a radioactive isotope decay is a constant
An example of a setting where the bounded stable model applies is one where
Remember that in a differential equation
The linear unstable model is often used to model population growth. The underlying idea, which might or might not correspond to reality, is that there is a set reproduction rate per member of the population. The differential equation is
with
Take care to use the parameters
Under ideal reproductive conditions, some bacteria can split in two every 20 minutes. What does this tell us about
It is easy to get confused. For instance, a single bacterium that splits every 20 minutes will go from an initial population of
The correct way to calculate
The dynamics are
. Therefore the solution is .According to the given information about splitting, when the initial condition is that
,
- Working from
gives the parameter value we see: .
For bacteria, the linear unstable model may be realistic for short periods of time, or, more precisely, for as long as the population is small compared to the carrying capacity. (See ?sec-nonlinear-on-line.) In contrast, human and other animal populations often have an important age structure, which is just to say that neither a 6 nor a 60 year old person has the same reproduction rate as a 26 year old. Such an age structure calls for a dynamical state with multiple components.
But if the environment is steady—no food shortages, no disease, economy unchanging, etc.—it can be reasonable to describe even age-structured populations as a percentage growth per unit time, e.g. percent per year. Realize that such a description is not only about the biology of reproduction, but summarizes the whole system of aging, death, and reproduction. This summary description may no longer be relevant when the system as a whole changes. An example of this in the human population is seen in countries where the number of births per woman has fallen substantially—by half or more—over the time of a generation. Such falls typically accompany a growth in economic wealth and the realization that more resources (e.g. education) needs to be provided to each offspring.
The bounded unstable model is a way to incorporate factors that interfere with sustained exponential growth. Exponential growth requires that the growth rate
An application of the bounded unstable model is seen in the description of micro-organism growth given by Jacques Monod (1910-1976), a Nobel Prize winning biochemist. His idea was that the organisms are reproducing in a kind of sea that has a limited concentration of an essential nutrient, but very large amounts of the nutrient spread out over space. Even though the nutrient is begin consumed by the organisms, more nutrient diffuses in from far away to keep the concentration steady. At large population sizes, the growth rate is nutrient concentration limited, hence constant.
In Chapter 14 we introduced the idea of a modeling cycle: taking an initial model, examining the consequence/predictions of that model, and then modifying the model to better correspond to observed reality or new mechanism.
A case in point is the linear unstable model for population growth. The linear model is always appropriate near a fixed point. This is just a consequence of the calculus idea that any function can be approximated by a linear function over a small enough domain. In defining derivatives, the question was what constitutes “small enough.” So a linear dynamical function is a good starting point for dynamics near a fixed point. But, as we’ve seen, extending the linear model far from the fixed point leads to population explosion: exponential growth. This can be a valid idea for modeling a pathogen growing in a bowl of room-temperature chicken salad: the pathogen need not consume all the salad to become a threat, so in the domain of interest—human health—the linear model can do the job.
But we observe generally that exponential growth does not continue indefinitely. The demographer Thomas Malthus (1766-1834) famously propounded a “principle of population” which held that it is in the nature of populations to growth exponentially until linally limited by famine or disease. He wrote, “[G]igantic inevitable famine stalks in the rear, and with one mighty blow levels the population with the [lack of] food of the world.”
Malthus’s model is exponential growth that runs into a wall of limited food. Malthus saw human reproduction as the engine of the immense poverty and suffering of the lower classes in early industrial Britain. This became the basis of an important political dispute, two poles of which are “there is no point helping the poor, because they create their own poverty,” and “the poverty is due to exploitation, not reproduction.”
For us in calculus, there is a middle road: Malthus’s mathematical model, the unstable linear model, is much too abrupt and narrow minded and can easily be made more realistic. Adding that realism removes the “one mighty blow” from the situation. Let’s add that realism now.
Recall the earlier suggestion that the linear unstable model
Even in Malthus’s time, there were calls to alleviate poverty by encouraging people to leave for less crowded lands: emigration. In the dynamics, emigration corresponds to a negative value for
Making
But there are other things that come into play. One of them is that the parameter setting the death rate,
But the death rate can also be a function of population
Similarly, birth rate can depend on population, that is
These models for
Let’s plug in the refined models for birth and death rates into the population models. We get:
A little algebraic simplification reduces this to:
Whatever are the size of the quantities
One of the major flaws with the Malthusian viewpoint is that it treated all the dynamical functions as linear, whereas in reality the functions can have a quadratic shape. The classical differential equation for limited population growth,
Another important flaw with Malthus’s model is that it failed to account for the transition from purely agricultural economies to economies that produced large amounts of other goods and services. It turns out as populations grow wealthier, their reproduction rates decrease. With wealth available in non-food terms—clothing, public health, education—reproduction rates can go down even without the “one mighty blow” of starvation and disease.
The next section examines both of these factors—the introduction of multiple state variables and the ability to “soften” the explosive unstable linear dynamics with nonlinear corrections—in making subtle models of the behavior of systems.
43.2 Multiple state quantities
The previous section examined dynamics of a single state variable. Now we will consider the possibilities when there is a second state variables. It turns out that adding more state variables above two does not introduce many fundamentally new behaviors, so we will focus on dynamical systems with two variables. We will continue to use capital letters, like
A starting observation is that for dynamics to be genuinely two-dimensional, the differential equations for the state variables need to be coupled to one another. For example, a dynamical system that nominally has two state variables
The state variables here are not coupled, since the change in each variable depends only on the value of that variable and not on the other.
Coupled state variables have dynamics that look like this:
The most mathematically simple form of coupled dynamics is this:
What type of real-world setting might such a simple model correspond to? Surprisingly, even this simple model has important things to say about complex phenomena such as love and warfare.
We will start with warfare, where the signs of the parameters are easy to determine. The model, called Lanchester’s Law, is
The state variables
The model describes the rate of reduction in the armies as being proportional to the size of the opposing army. But the two armies can be different in their efficiency of causing casualties, reflected by possibly different values of the
The dynamics are not exponential. Exponential decay of the army size would correspond to a model like
We will defer for a moment finding the trajectories of the state variables in the course of battle. (Hint: in the model, one army wipes out the other.) Instead, we will focus on a surprisingly rich implication of of such simple dynamics.
Lanchester’s Law has a surprising consequence for measuring the overall strength of a force in a way that combines size (
Lanchester proposed that the quantity
It is hard to say how Lanchester came up with the formula
Applying the chain rule we find that
The conserved quantity
To illustrate, consider a battle between two armies of archers. The B-army archers are more skilled: they can fire 12 arrows per minute. The R-army archers can fire at only half the rate—6 arrows per minute. But the R army is twice the size of the B army.
Are the armies equally matched? It may at first glance seem so, since both armies can fire at the same rate. For instance, if there are 1000 archers in the R army and 500 in the B army, both armies start capable of firing 6000 arrows per minute. But Lanchester’s Law tells us that the R army is twice as capable as the B army:
To see why the R army is superior, remember that each arrow can take out only one of the opposing archers. For each B arrow that is on target, the firing rate of R is reduced by 6 arrows per minute. But for each R arrow that hits, the firing rate of B is reduced by 12 arrows per minute. The initial casualty rate for the two armies is the same, but B sees a twice as large reduction in its firing rate.
Mathematician Steven Strogatz proposed in the 1990s that similar equations might be used to describe how love between two people varies over time. Strogatz’s equations are usually written with state variables R and J, standing for Romeo and Juliet. Positive values represent love, negative values are hate. And best to think of the model as a cartoon, but a cartoon that captures some of the behavior seen in reality.
To start, let’s consider a form of love that is really more like warfare:
$$_t R = -j J\
_t J = - r R .$$ In this pathological relationship, the more Romeo loves Juliet, the faster Juliet’s love decreases toward hate. And vice versa.
Imagine that, somehow, these two perverse people started out in love:
Strangely, if Romeo and Juliet started out mutually hating each other, their personalities would still lead to one having unbounded love for the other, who hates their partner without limit.
A mathematically small change in the Romeo-Juliet dynamical system can lead to a profound change in the outcome. For instance, changing one sign, as in
The two dynamical functions in the previous examples,
where the coefficients
Whether Strogatz’s love model is realistic or not, it does illustrate a basic idea of model building: start with simple dynamical functions, check out their consequences, then modify the dynamical functions. We will do this now, with the modifications being purely mathematical along the lines of including different terms in low-order polynomial approximations and considering positive and negative coefficients. As you will see, the simple models correspond to a surprisingly wide range of behaviors.
43.3 Classical phase-plane models
We have been using the term state space to refer to the set of possible values for the state variables. When there is only one state variable, the state space corresponds to the number line, or perhaps just the positive half of the number line. When there are two state variables, the state space corresponds to the coordinate plane; any point in the plane is a legitimate state for the system.
Historically, another term is used for the two-variable state space: the phase plane. This is just a matter of terminology, but it is so prevalent that you will occasionally see it mentioned. We don’t use it since dynamical systems can have a state space that is 1, 2, 3, or higher dimensional, but the phrase “phase plane” only works for 2-dimensional state spaces.
In this section, we will look at some famous models that involve two state variables. Out of respect for history, we will call these “classical phase plane” models, but this is entirely equivalent to saying “classical dynamical models with two state variables.”
Our purpose in studying these classical models is two-fold: to show how simple models can make it easier to draw out the consequences of the mechanisms that we think are at work in real-world systems; and to show you how modifications to purely linear models can produce dynamics that are realistic even away from fixed points.
To start, let’s return to the Rabbit-Fox dynamics models. Classically this is called the predator-prey model. It is also called the “Lotka-Volterra” model in honor of it is inventors: American biophysicist Alfred Lotka (1880-1949) and Italian mathematical physicist Vito Volterra (1860-1940).
The two first-order differential equations in the Lotka-Volterra model are
Rewriting the model provides a bit of insight:
The two equations are coupled so that the rabbit population alternating between growth and decay leads the fox population to so alternate, and vice versa.
43.4 Epidemic
In a communicable disease, such as COVID-19, the infectious agent is transmitted from an infective person to another person who is susceptible. The time course of an epidemic can be modeled simply with two state variables. We will let
The dynamics of the
The dynamics of the
This is famously called the SIR model, standing for the susceptible, infective, recovered chain of events.
In the model, recovery means “no longer able to infect.” Thus, a person who has been isolated is considered “recovered,” whether or not they display symptoms of the disease.
We usually think of recovery in terms of a time span, for instance taking a week to recover. But
Of course, the solution to this simplified differential equation is
To show the dynamics of the SIR model, we need to propose numerical values for
Figure 43.3 shows the flow field for
43.5 Exercises
Exercise 43.01
Lewis Fry Richardson (1881-1953) was an English scientist who worked in many areas, including weather prediction. (See Block 1.) This problem concerns a model Richardson built to account for arms races between countries.
In the model,
The terms
The parameters
The parameters
Part A What should the signs of
positive negative zero
Part B What should be the signs of
positive negative zero
Part C What should be the signs of
positive negative zero
Depending on the values of the parameters
- In each of the three plots, start from initial point
, that is, a situation where Freedonia is more armed than Jackavia, and trace out the trajectory over time. - For each of the three plots, find any equilibrium point and say whether it is stable or unstable. If there is no equilibrium, move on.
- Identify which of the three plots is NOT the Richardson dynamics.
- In the non-Richardson flow, which coefficient has been reversed: it is one of
, , , , , or .
Part D Which of the previous plots are Not the Richardson Dynamics?
Flow Field A Flow Field B Flow Field C
Part E In this plot which if the parameters is reversed?
a b m n r s
Exercise 43.02
Lanchester’s model of combat is $$_t R = - b B\
_t B = -r R$$ with both parameters
Obviously, the state variables
Locate the fixed point of the model of combat.
Is it stable? In answering this question, consider two different state spaces and explain why your answer is different in the two spaces:
- All four quadrants of the
plane. - Only the first quadrant—that is,
—of the pane.
- All four quadrants of the
At a stable fixed point the state quantities—
The text introduced this conserved quantity for Lanchester’s model:
Part A 3. Calculate
Part B 4. Perform the similar calculation
- Yes
- No
- Depends on
and . - Depends on
and .
Here are two more candidates for conserved quantities:
Take the derivative with respect to time of each of them to determine if they are conserved.
Part C 5. Which of (a) and (b) are conserved?
Just (a). Just (b). Both (a) and (b). Neither (a) nor (b).
Exercise 43.03
Part A Which of the three flows below corresponds to Lanchester’s Law?
A B C
Part B Which of these sentences best describes the dynamics of Lanchester’s Law?
- Both forces battle to complete annihilation.
- The stronger force wipes out the weaker force.
- The weaker force holds off the stronger force.
Exercise 43.04
Here are three different first-order differential equations with fixed points at
The functions are graphed below.
A. For each of the equations, match the number (i, ii, iii) to the color (magenta, blue, black). Comment on the differences in shape among them.
B. Integrate each of the differential equations from initial condition
## Solution containing functions x(t).
## Solution containing functions x(t).
## Solution containing functions x(t).
Comment: Usually, many different mathematical functions can be used to model a given phenomenon. The different functions will have similar shapes, but do not need to be identical.
Exercise 43.06
The Susceptible-Infective-Recovered (SIR) model has only two parameters,
The
- Set
so that the half-life for infectiveness is 5 days.
Using
and as in (1), set up a numerical integration of the SIR model. Integrate out to from an initial condition of and , corresponding to 0.1% of the population being infected. Plot out the time series . From the time series, what fraction of the population eventually get the disease?One sort of government tactic to keep small the spread of disease is to close borders, with the idea that there will be fewer infectives at the start of the epidemic which will keep the epidemic smaller. Public health professionals are skeptical of this common-sense tactic. Follow the same procedure in (2), but set the initial condition to
and . Does common sense hold?Another strategy is “social distancing” and isolating infectives. To model this, reduce
, the rate at which susceptibles interact with infectives. Keeping at the value you determined in (1), set that only about half the susceptibles are ever infected.
Exercise 43.07
In the rabbit/fox system, the quantity
This means that each of the level curves (contours) in the contour plot of
Make a contour plot of
over the domain , for .From the graph you made in (1), choose an appropriate initial condition that falls on one of the contours.
Using
integrateODE()
, find the trajectory from from the initial condition in (1) for . Add a layer to the graphic in (1) showing the trajectory to confirm that the conserved quantities are indeed conserved.Symbolically, calculate
. You will need to use the chain rule, which will leave you with terms and . Plug in the values for these from the differential equations and show that .
Exercise 43.08
Newton’s Law of Cooling is about how a hot (or cold) object comes into equilibrium with the ambient temperature. For instance, you might have a cup of coffee at
Part A What are the units of the output of
degrees F per minute degrees F 1/minute 1/degrees F
Part B What are the units of
degrees F per minute degrees F 1/minute 1/degrees F
Part C What is
- the room temperature
- the initial temperature of the coffee
- the instantaneous coffee temperature as a function of time
- the fixed rate at which the coffee cools
- the instantaneous rate at which the coffee cools as a function of time
Part D What is
- the room temperature
- the initial temperature of the coffee
- the instantaneous coffee temperature as a function of time
- the instantaneous rate at which the coffee cools as a function of time
Exercise 43.09
Our generic model for limited growth is
which you can see as a modification of the proportional-growth model
The proportional-growth model will lead to
The limited growth model involves a carrying capacity
Part A If the units of
rabbits rabbits per day rabbits per week rabbits per year
Part B Suppose the units of
- 1/month
- rabbits per month
- months per rabbit
- rabbits per month-squared
Part C Even without finding the full solution