Lots of important processes can be modeled as "stocks" (anything we can count or measure and care about the amount of) and "flows" changes in stocks — flows in and flows out. This is the "bathtub" model of reality with the added feature that a system can consist of multiple bathtubs linked together in interesting ways.

Goals

The components of stock and flow models
Relationship between stock and flow and difference equations
Introduction to the idea of causal loops (where they come from, that there are positive and negative feedback loops)
How to start with Excel

Basics

Definitions. The stock is the total supply or amount of some "commodity" of interest. It can be people, medicine, classrooms, water, money, equipment or supplies, you name it. A flow is just a change in a stock. Typically, the change in one stock is the opposite change in another stock (as when freshwomen become sophomores or workers become retirees), but this is not a requirement (for example, leakage from a reservoir might just "disappear" as far as our model is concerned.
Diagrams. Part of the power of stock and flow models comes from a standardized approach to making diagrams of them. The diagrams consist of five components:
stock
pipe
valves
control arrows
clouds
Example

Earlier in the text we looked at two problems involving population. In a totalitarian state there was no migration, only births and deaths and in a Shaker community there were no births, just recruitment and deaths. Let's draw these as stock and flow.

We start with the population as our stock and we draw flows — fat arrows — flowing into and out of the stock.

stock-n-flow-01.gif

Next we show valves on the flows. The idea here is simply that the flows are variable.
stock-n-flow-02.gif

The next question is what "controls" the flow — what opens or closes the valves. In our two population models, there is a rate (don't worry about the details of the rate for the moment) at which people flow into the population (births or recruits) and a rate at which people flow out of the population (death). We start with a generic little box with the names of these variables and a thin arrow indicating that they contribute to how open or closed a given valve is.
stock-n-flow-03.gif

Now we come to thinking a little more closely about these rate things. Let's start with the totalitarian state. We said we had a birth rate (babies per 100 population) and a death rate (deaths per 100 population). The actual flow of bodies in and bodies out depends on these numbers (B and D) AND the population. Thus, we draw an arrow from the population stock to each of these valves. And so here's the stock and flow model of the population of the totalitarian state.

stock-n-flow-03b.gif

Now recall that we wrote the difference equation for this model like this:

(1)
\begin{equation} P _{i+1} = (1+B-D) P _i \end{equation}

Another way to see this equation would be

(2)
\begin{equation} Stock _{i+1} = Stock _i + INFLOW _i - OUTFLOW _i \end{equation}

or

(3)
\begin{equation} Stock _{i+1} = P _i + B P _i - D P _i \end{equation}

Now what about our Shaker community? The difference here is that the inflow does not depend on the population. So, we remove that one arrow that connects the inflow valve and the population stock.

stock-n-flow-04.gif

What did this look like in equations?

(4)
\begin{equation} P _{i+1 }= (1-D) P _i + R \end{equation}

Another way to see this equation would be

(5)
\begin{equation} Stock _{i+1} = Stock _i + INFLOW _i - OUTFLOW _i \end{equation}

or

(6)
\begin{equation} Stock _{i+1} = P _i + R - B P _i \end{equation}
(7)
\begin{equation} stock _{i+1} = P _i + R - B P _i \end{equation}
We can draw our diagram a little more schematically like this:
index_clip_image031.gif
index_clip_image031.gif

Let's look at this for a moment. We have labeled each of our arrows with a plus or minus sign. What do these mean? The minus sign on the arrow from deaths to population means that the more deaths there are, the smaller the population gets. The plus arrow from population to deaths means that the more the population, the more deaths there are.

There is something different between the birth loop and the death loop. On the left the loop consists of two arrows, both of which are plus arrows. On the right, though, are two arrows and one is plus and one is minus.
More

Queuing models are appropriate when we have servers and a flow of clients and our job is to "handle" the flow optimally (meaning a balance between excess resources and wait time). Here the issue is the raw material waiting for the system. A related set of problems goes by the name "inventory" and is the obverse: the processes of the system need raw material to work on so as to produce outputs. One distinction that will start to become clear is that between "wholist" or "aggregate" models and individualist models. We'll see here a new way to think about feedback and to focus our attention again on full system performance over time. We'll cover concepts like stock, flow, valve, feedback, reinforcing loops, causal loops, balancing loops.

index_clip_image035.gifcausal-diagram-1.gifcausal-diagram-2.gifcausal-loopdiagram-1.gif

Related Models

Queues