This is Doctor David Bishai continuing our study of stock and flow diagrams. And in this section I'm going to talk about flow and control variables. As I said earlier in the lecture, we must initialize the model so that inflow of every state equals outflow. We need to start our models at flat line so that we can know where the source of motion is. So later, once we prove to ourselves we can make the model frozen, we can make the model move by a single change in the model that we have put in. And typically one would take an inflow and induce a step function to make it change for one or two time periods. Or we could make it ramp up getting bigger and bigger and bigger over five or six time periods. In any case, we want to be sure that we know exactly what has created the dynamics. That way we know we haven't created a mistake in our computer code and having a situation where there are multiple errors that are leading to the motion. And believe me if this happens a lot and it's quite a chore to get your models to be frozen but very much worth while, otherwise you'll be chasing dynamics that were never there to begin with. So, one idea when you are modelling a flow is to model the outflow in relationship to the time units that you're using. A typically rule of thumb is that a lot of outflow rates in systems follow this equation where the outflow rate is equal to the number of units in the state times one over T where T is the average time a unit stays in that state. If you think about that state, let's say the state is the human population. One would say that the average human life is, let's say, 70 or more years. When we'd use that average dwell time idea to produce an outflow rate. And that would correspond to a crude death rate of about 14 deaths per thousand. That's actually quite a easy approximation to populations in the world that have life expectancies of 70. So, this isn't always the case but it's a useful, handy rule of thumb for you to use in modeling outflow rates, because very often we know, the life expectancy of the units in a state, but we're not as intuitive on what their outflow rate is, and this is one way to get that done. Very useful with inventory and with money if you can get an idea of how long the units stay in that state then one can get an equation for the outflow time. Now when we're making flows they need to be connected to states in some way meaning there should be some flow of information and signal from the states to their governing flow levels. If you don't tie your states to their flow you're definitely going to have a situation where the state will explode up to infinity or decay to zero because it's just not controlling its inflow and outflow rate. Now if you're modeling a system or explosions and decay to zero are really part of what you want to care about, then you would absolutely put in a lack of feedback from the state to its flows. Typically you don't want to make flows tied directly to flows. Certainly, you don't want to make Inflows tie directly to outflows. That sort of defeats the purpose of having the decoupling property that the state offers. So what do you do if you think that flows somehow influence other flows, and the solution is to use the control variables. Control variables are typically information and that information doesn't necessarily accumulate or flow in the conventional sense. The information can affect the flows and it can thus affect the states. And that information inside the control variable can be drawn from multiple states and for other controls. So here is an important tip in using stack and flow diagrams and making stack and flow models. You always, always want to minimize the number of states, and to do that you can push a lot of your modeling into control variables. Every time you invoke a brand new state in your model you're multiplying a lot of the complexity of your model. And your model is trying to make nature simple, so one of the rules that you should obey, is to make nature simple don't proliferate stocks. If you need to cover some type of phenomenon, cover it as much as possible using these control variables where you say it's information that's driving the system. Don't duplicate states. Don't split them up into tiny little pieces. The more states you have the less track to pull the model. And I would give you a guideline that five states is good. More than that, it's getting worse and worse. If you put in more than ten states, you probably have too much. You're not going to be able to understand your model. Nor will anybody be able to read a stock and flow model. So that sets limits into how many different states you want to have. In contrast, you could easily have dozens and dozens of control variables without a problem. So you want to minimize the number of states and put all of that insight that you have in the model into the control variables. So let's end the lecture by looking at an example and we'll be going into this example a lot more in the next lecture. I wanted to show you a causal Loop diagram that we are working on here at Johns Hopkins with the help of investigators in the International Health Department and with Doctor Etac Egosa from the Engineering Department. This is a model that's inspired by our work in Afghanistan where we care mostly about quality of services. So remember this is a causal loop diagram and just because there are boxes doesn't mean we're saying anything about whether these are stocks or flows or control variables. We're just saying what we care about is technical quality and we'll believe technical quality has three influencing concepts, qualities being affected on the left by motivation and a separate entity of staff satisfaction. And it's being reduced when there are a lot of patients in the healthcare unit, that the clinic is very crowded, that is a negative influence on quality. So moving over to the right hand side, the volume of service, we have a lot to say about the influences on the volume of service. On the top and on the right of the volume of service, you see that patient satisfaction, patient education, community health worker, or CHW activities, and patient transportation opportunities. All of these are going to increase the volume of service. But we also believe that the technical quality would increase the volume of service, and the end, idea is that the word gets out about how good things are and this creates demand because patients want to go to the better health care facilities. So you see in our insights into quality we have some tension. We have a central negative feedback loop. That, when they have a lot of quality, they work harder, because more patients come. And this limits the improvement of quality. So this causal loop diagram. Gives us a very pessimistic outlook that quality is always going to be bounded. Every time they try to bump up their quality they're beaten down by higher demands upon their time. So, we wanted to check this out. This is an insightful model that was produced with a lot of collaborators. And if we stop it right here, it's like Pinocchio that has not come to life. We want to move this diagram into a simulation model and get the ability to test it out, to try things that would change quality or change volume, and just see what the dynamics are. So think for a minute on this diagram. What would you decide would be the stocks? There are not a lot of nouns here. I don't see any people. I don't see any money. I see these things that are amorphous. I think I can measure just about everything. But I'd have to work to do it. I'd have to actually measure with some survey instrument the technical quality. And I'd have to measure patient education and so on. So, I'm not about to begin by investing a lot of money in measuring all of this and doing a regression to see how it matters, that's going to be really expensive and so it makes sense to try to do this as a simulation. Well, let me fast forward where we show how the team is working on turning that causal loop diagram into a stock and flow model. What they chose as their states were the things they cared about the most. They were in the center of the causal loop diagram because they mattered the most. And so, they've chosen to make technical quality and the volume of service to stocks and they're in the middle of the diagram as stocks. Now here's an interesting thing, we don't really have much to say about all of the inflows and outflows of most of our states. We simply drive them, we drive quality with an outflow of quality loss. And we say nothing about where it comes from. And we drive volume by an inflow into volume, and we simply regulate that volume with the inflow rate. That's a pretty advanced way to do things. I don't suggest you start with this, but I'm just pushing you on seeing how flexible this can be. So we only have an outflow on quality, we only have an inflow on on volume. And now the diagram of the causal loop diagram has all of those control variables affecting the rates. You can see those processes affecting the quality rate, the quality outflow rate, and you can see the same processes affecting the volume of service inflow rate. And then the stocks themselves are controlled by their flows. So that gives you some sense of how one might try to move from a causal loop diagram towards the stock and flow model. In the next lecture we will truly bring this technical quality and volume model to life by putting it into Vensim and running it, and seeing what it can tell us about the dynamics of health care quality in this system. So let me summarize my key points. Stock and flow diagrams make a very important distinction about the different things that are going on in the model. Unlike, causal loop diagrams where you throw anything in and throw an arrow on it, we say that there are different entities in our system. There's a difference between a state that has a memory and accumulates, and that accumulates due to changes in the flow. Those are separate entities from controls that can change due to processes that really don't have a flow. Stock and flow diagrams have the advantage because they make this distinction. Causal loop diagrams do not distinguish the entities and they're agnostic. They say nothing about accumulation. In system dynamics, we believe that all dynamics come from the process of accumulation. Why we make it central in the model. Finally, I've emphasized that states, when we selected them properly and modeled them properly, they are entities that have a memory, they have durability. States can decouple flows, stop different flow processes from being treated the same, and they can create delays that can be places where we can park units and wait for time to pass before we bring them back into the process. So I hope you've enjoyed this lecture. I'd like you to get ready for the subsequent lecture on stock and flow modeling by making sure you've downloaded Vensim. And also that you've been able to start to work with the stock-and-flow diagram of technical quality, and volume of service. In addition, you'll be asked to start using the health bound model, which is on the internet and there's an exercise to do on the health bound model that I think you'll find very helpful in your study of stock and flow modeling. Thank you for your attention. [MUSIC]