The Epidemic Lab

System Dynamics

He feels a little chilly so he turns the electric blanket on his side from 5 up to 6. She feels a little warm and turns her side down from 5 to 4. Five minutes minutes later he still feels chilly and turns his up to 7; she still feels warm and turns hers down to 3. Eventually, he turns to her and, with teeth chattering, says “I got my side at 10 and I’m still freezing!” “Really,” she replies, “I’m sweating through the sheets and I have mine completely off.”

For a while, they feel frustration and direct their anger at their controls. Turning up the control supposedly causes the temperature to rise, not to fall. They have their controls working backward; turning them up causes the temperature to fall.

Part of their conundrum has to do with them having their wires crossed, so he controls her side, and vice versa. An even deeper problem has to do with their trying to think in terms of the myth of causality. Causality can get pretty confusing.

In the causal model, we have something acting on something else, to change it. For example, rain causes wet hair. Well, come to think of it, maybe it doesn’t always cause wet hair. So, maybe we can find a better example. Flipping the light switch to “up” causes the light to go on. So far so good.

However, taking this a bit further, something, in turn, must cause the light switch to flip up: perhaps a person who wants to see better. And, something causes him to want to see better: perhaps, a dark room. And something else causes the dark room: perhaps, even, our old friend the light switch. In this case, as in lots of cases, if you trace the chain of causality back a ways, you wind up with things ultimately causing themselves.

People with problems, want to know the cause so they can fix something. This method works pretty well in very simple single-cause situations. For more complex feedback systems, single causality does not apply; as with the hapless couple above, causal thinking can wind up making the situation worse.

If causal thinking does not apply to dynamic systems, then you may wonder what does.

One approach, the one I use to construct the model in the Epidemic Lab, uses four system elements.

1.

2. Flow

3.

4.

That’s it, you can build a model structure without resorting to causality by using these four elements.

Once you define the structure of your system from these elements, you can generate the model behavior, using step-by-step arithmetic.

You start by determining the Flow Rates from the Information about the Levels using the Policies. Next, you figure how the Flow Rates change the Levels for a very small interval. Finally, you update the Levels. This completes one step and advances your simulation by one interval.

By repeating the process and taking many small steps, you can generate the behavior of the system.

This way of thinking appears in Leonard Euler’s book,

To illustrate this process with an example, we can use a bucket with a hole.

We can use Euler’s Method to simulate how water flows out through a hole in a bucket.

We begin by formulating the system structure in terms of the four basic elements: Levels, Flow Rates, Information and Policies.

In this example, we have a

We can run experiments to determine the Policy that governs the Flow Rate at different Levels. In this case, we have this policy: Flow Rate = sqrt(Level)/ k, where the constant k incorporates gravity, viscosity and the shape and position of the hole.

From our diagram, we have:

1.

2.

3.

To run the simulation, we proceed step-by-step with arithmetic.

1. We start with an initial value for the Level

and a value for k. In this case, we use an easy one,

and a value for the small time interval

2. Continuing, we use the policy and information about the Level to compute the Rate:

3. Next, to get the change for a small step of 0.2 minutes; we multiply the Flow by 0.2 minutes.

4. Next, we adjust Level to reflect the change.

5. This completes the computation for the first interval; we may extend the length of the computation by repeating steps 2 through 4, over and over, on a spreadsheet.

We can model the structure of any dynamic system by diagramming the elements (Levels, Flow Rates, Information and Policies). In this model we have one of each. In the Immunity Lab Model, we have six levels and many more Flow rates and Policies.

From the system structure, we generate the system behavior using step-by-step arithmetic.

The system behavior follows exactly from the system structure.

The system structure contains the intention of the system; the resulting behavior follows exactly from the structure.

In short we might say, Structure ==> Behavior; Intentions = Results.

People who believe in causality generally have trouble relating to the Intentions = Results formula.

System thinkers observe a behavior and say, “I see the result (behavior) and I’d like to understand the intention (structure) of the system clearly enough so that I can simulate the behavior.

Causal thinkers do not follow this discipline; they want something or someone to blame.

In managing their own personal lives, system thinkers tend to notice the results they get and admit the results reflect their intention. They may also wonder which of their own policies they can change to change their intention and to get a different result.

Our legal system revolves determining guilt or innocence. Guilt and blame rest on causality. Thus, without causal thinking the whole legal and political system collapses. Our society functions under the myth of causality. The myth of causality prevents people from understanding how dynamic feedback systems work.

Little wonder we have our society careening out of control; our leaders do not really understand how our systems operate.

Theoretically, if everyone would realize that everything that happens reflects everyone’s intention, we might pivot and manifest a society without causality, blame or guilt, one in which everyone takes responsibility for everything.

Not likely.

For one thing, law and politics, as we know them, would cease to exist. Still, dreamers dream. In 1919 Bertrand Russel states:

If you want to see some creative prose, look up “Causality” in

Many simulation model builders follow the Euler method. They define structures of elements and then they use computers to generate the model behavior.

Others model builders use differential calculus. Differential calculus presents a way to write down the Levels and Flow Rates as differential formulas.

In Euler’s system, we have Flow Rates accumulating in Levels. Water flows from one bucket to another, making the water levels go up or down. We can compute the change in levels for very small time intervals and use the new levels to up date the flows.

Differential calculus runs the other way around. In this system, we do not think of Flow Rates accumulating (integrating) into Levels; we think a Flow Rate as equal to the rate-of-change of some Level.

While mathematically correct, this formulation invites confusion. Normally, in an equation, you have the computational output result on the left of the equal sign and the input arguments on the right.

Here, we plug in 3 for X and we get the result, 9, out for Y. If we plug in 5, we get the result, 25.

In our causal world view, fundamental confusion can arises out of the expectation that value of X somehow causes the value of Y.

With differential calculus, we wind up with two equations for flow:

The second equation follows our intuition; the Level informs the policy that controls the Rate. The first equation, however, might invite confusion. It implies the change in the level somehow causes the Flow. This runs counter to our experience with filling containers with water.

At this point we have two different equations, both trying to cause Flow.

The level (blue line) seems to look about right. As it falls, it slows its rate of descent. Still, we don’t have much intuitive understanding about how the system works or how the graph magically appears.

Getting from step 3 to step 4 requires considerable expertise with calculus. Health-care professionals, decision makers and voters might find this step incomprehensible. They might even put limits on their confidence in a model they find fundamentally obscure.

Equation 1. says “The Flow equals the rate of change of the Level.” One might think:

“The rate of change of Level causes the Flow Rate.”

This runs opposite to common experience about how fluids accumulate; normally we consider that the Flow causes the Level to change. Additional confusion may arise since we have another equation causing flow, one that depends on Information about the Level plus gravity, pressure and orifice.

The Hole-In-The-Bucket differential-calculus model above has the Flow linearly proportional to the Level. Even though the Flow more closely follows the square root of the Level, we have to make this s linear approximation in order to solve the equations

If we try to plug in the more accurate square-root formula, we complicate the model to the point of intractability; we cannot get a close-form solution. even world-class mathematicians cannot get from step 3. to step 4.

Differential-equation solvers have to use linear approximations to keep their equations tractable, so that they can find graphs that fit. The cost: inaccuracy.