Welcome, this is Professor David Bishai and this is our lecture on stock-and-flow diagrams. And this is the section where we talk about defining stocks and how to decide what is a stock and what is not a stock. The basic principle of system dynamics modeling is the principle of accumulation, and this is a belief that all dynamic behavior in the world occurs when flows accumulate in stocks. Now, that sounds like a very serious claim. But, if you think about it, imagine that, if we were to set all inflows, and outflows equal every lake had it's inflow river equal to it's outflow river. Every bathtub had the inflow rate equal to the outflow. Every population had the birth rate equal to the death rate. If all inflows equalled all outflows then according to this principle of accumulation, there would be no dynamics and there would be nothing to say about system dynamics. And would be very hard to understand a system like that. When we know what is triggering accumulation, that is when we develop insight into our systems. So this is the idea that one has to have accumulation in order for there to be dynamics, and it is the states of the system that do all of the accumulating. So when we're looking for what is a state, we want to look for what is accumulating. So how do you decide what should be a stock? Well, one of the first decisions that's going to come in your modeling is what is your time horizon. Are you looking at something that takes place in millisecond, in days, months, years, decades, centuries. You have to make a decision here. It's not possible to have a useful model that combines both the molecular events in factions of a second. In the same model as something going on in centuries. Obviously, all thing happen but one of the important boundaries in practice is that there really should be only one clock in your simulation and everything you care about in the model has to be on that same clock. It's just going to take too long for a model of biological evolution to have a clock that runs in seconds. And it's just not reasonable. So you decide early on what time scale your phenomenon is occurring. And in that time scale, it should be apparent to you what things are durable. What things last along the entire range of that time scale. What things would last for many decades or many milliseconds. The third principle is that the stock should be countable and, in principle, measurable. It's not necessary that somebody has actually counted it, or that the data is widely available, but it just has to be something that you could in principle measure. In some way or other, and we'll see examples later in the lecture. They do not have to be physical items in space and time. Knowledge and attitudes can be stocks, and money or digital money can be a stock. And money is very common stock in our models. So there are three important properties of stocks. The first important property is memory. A stock will remember where it was the last point in the clock time. So if we turn off the inflow in our state, it doesn't go to zero right away. It will drift down gradually because it remembers where it was. It has this principle of durability and that is different from other things. There are things where if you turn off the process that leads to it, it just goes away. The second principle is that stocks are useful in decoupling different flows. Here is a simple model which has an undefined source going into a state, going into an undefined sink. What the state does for us, it says that the first flow rate on the left can be qualitatively different from the second flow rate on the right. So the state can get in the way and make those flow processes have nothing to do with each other if that's what we want to say. That way we'll put in a state when we think that there are different pieces of flow that we want to distinguish. It de-couples flow into multiple types of flow. And that's a useful reason to define a stock, to save interesting things about flow that isn't homogeneous in a system. The third property of the stock is that the stock can create delay. You can put units in your model into a stock and hold them while time goes by so a very common part of social science and public health models is to know that things don't happen all at once and so one would want a place to park people and one could divide your population into childhood and adult in order to create a delay. To park people for a while in the childhood state until something happens to them later. And differentiating states that differ because of the timing of the model, something doesn't happen to them for a while, it would be nice to define a state to create that delay. This can happen with inventory flows, with information that has to move around. It's just a useful thing to think about it defining stocks. So what are examples of stocks? People in their various categories are great to have as stocks. Especially when they're making state transitions from healthy to sick, from non smoking to smoking, from unvaccinated to vaccinated. Very important thing to do with stocks. If we have counts of our productive units, our workers, our medicines, our buildings and that is changing over time and we care about how many workers, or medicines, or buildings that would be a great stock. One can define the technical knowledge of our worker if that's a focus of the model sure enough it is in principle countable. One can give the workers performance tests and measure it. And it could have inflows and decay processes that we could model. The quality of our work can also in principle measured, although we seldom measure it, it is in principle measurable and could be a stock. The motivation of workers to do something is in principle measured and if necessary can be a stock. You see I'm pushing you to get off of thinking that it's always some physical object or some noun. If you care about it and you can imagine it having a memory and durability then it might make sense to be modeled as a stock. So, the role of measurement is important. They have to be in principal measured, so technical knowledge, and quality and motivation are in principal measured. The one caveat is that we have to have a theory of their dynamics. Just because they're important doesn't make it a great idea to put them in a model, so go back to the causal loop diagram, check it, and see if we actually have a meaningful theory of their dynamics. And at the end of this lecture we'll show you a causal loop diagram and a stock and flow model of quality and worker's technical knowledge. So remember that meaningful state variables are going to be tracked over time so they should typically change in time. Second is that state variables would be nice if they actually mattered to stakeholders and policymakers. It's great to have things that people care about. Because we are going to create output data that tracks them over time and that's why money is such a great state variable, everybody cares about money. Inventory is a great state variable, because people have to worry about their inventory. And in public health, people as they make transitions from healthy to sick, alive to dead, or employed to unemployed make great and meaningful state variables. People care about those outcomes a lot. Now, I want to raise the Markov principle. Markov systems have a basic property which is at the state variable at time T at any given point in time all of the information to predict the future can be known if we simply know the value of the state variables. Now in system dynamics, we carry information about our system not just in the state variables but in the control variables which is what we'll talk about in the next section. And it's true, that in a system dynamics model the union of all of the state and all of the control variables contains all of the information to predict the course of the system. So once we know the values of all of the Ss and all of the Cs, we're done and we can completely predict for the rest of the course of our system dynamics system. So think about that and if you think that there's something in the past that has to be remembered and brought back, you probably need a state to do it. If you think that there's something left over that the current state doesn't fully convey into the dynamics you will probably need a state to hold on to that information to bring it to work in the model. Another principle is initialization. We have to be able to get our system dynamics model to run, so we'll have to be able to set up initial values at the beginning of the model. Not only that, we'll have to find the equilibrium where all the values can stay constant forever. That's right, we need to be able to predict the frozen world version of our model or nothing changes. That might sound contradictory. I just told you a few minutes ago that the accumulation principle was key. That all dynamics come from accumulation, so why am I saying we need to be able to freeze our models? And I'll tell you why. We need to be able to freeze our models so that we can be sure that any dynamics we're seeing are traceable to one event. If we set up our model and it starts to move at the very first time we run it, we're never sure exactly where the motion is coming from. Only when we can be sure we can freeze our model can we be sure that we can trace the source of the dynamics. So at the very start of modeling one has to set up states with initial values that are close to where they want to be in a frozen equilibrium state. Now you'll notice in many of my diagrams that I've drawn these little clouds of sources and sinks. These are unspecified states once we draw a cloud that's all we have to say about it. I don't have to tell you anything about what's going on in that source. And this is how we diagram the boundaries on our systems. We say, sure there's something going on there. But I'm not going to tell you about that today. For places where money is coming, we just don't worry about how the consumer got their money before they spend it on our product. It sets up boundaries where we just say, it comes from some place and all we care about is the rate of flow after it comes out of that place. Just to point out the point I made in the last section, we have states because they lend themselves extremely well to equations. And so, the the fundamental archetype of a System Dynamics Equation is shown here in this slide where the systems level at time K is equal to the systems level at time J plus Inflow from the time between J and K minus an outflow from time J to K. And these equations are what makes the computer able to know what to do. And it's simply going to trace out the flow of the model this way. And if you look at that equation and you think about programs you know. You could easily program that equation in a program as simple as Excel. You could have three columns and simply have an inflow and outflow and an S column. And you could get an Excel spreadsheet to actually do system dynamics it can be done. You don't need to get fancy software in order to do it. Because that equation is something that is quite simple. So, that's the end of our section on states and picking states. And in the next session we'll talk about flow variables and control variables.