Hello everybody, welcome back to our second part of our tutorial on building and drawing systems dynamics model in the Vensim environment. So today we are going to build a system dynamics model from the scratch. And the model that I'm going to build is the same model. That you saw on the lecture presented to you by Dan Tyler, and I'm going to build the same SD model, which SD stands for System Dynamics. The same as the model in our Vensim environment. Before starting, just spend a minute trying to understand what this model is about. This model is about how dynamics of obese population affects the number of fast food restaurants. So the idea here is that as the number of obese population goes up it also effects the market demand for more fast food restaurants. And also, when you have more fast food restaurants, it's just going to reinforce the rate of people that become that turn to obese. Right, and if you remember from the lecture, here we have a set of stocks and a set of flows. So how many stocks do you see here? We have four stocks. And how many flows? We have two of them, Incidence and Changes in restaurants. So, let's just go back to Vensim and start building our model from scratch. So in order to have a new model, I need to come here on top left and click on new model. And it shows me this start up box prompting me for some information for time, so I'm going to like keep to the month period. And make time steps as every half a month. And make the simulation for 100 months. It's logical to spend more time every time you want to build a model. And think about what should be the time step and how long it's going to be. So I'm going to hit OK and go back. Here let's just start this for stocks first. So for doing that I need to come here on top and click on box variable for the stock. And then I come here on the empty area and I'm going to click, and it prompts me for a name to enter. So I'm going to enter the same name, non obese population, and then hit enter. You can see that our stock variable is now added to the model. We have four of them. Let's just continue the same way. Now I create the second one, which is obese population. Hit Enter, and then continue same way. Healthier. Hit Enter, and fast food restaurants. Hit Enter. So what else do we have? We have two flows here, incidence and changes in restaurants. So in order to add Rates to our model, I need to come here and choose rate, click on it, it would be active. And for adding a rate I need to first click the beginning of the place. I want just want to to add that, in this case non-obese population, and drag it all the way to the endpoint. In this case of this population. And it prompts me for the name And similarly, I can do that for the healthier restaurants to fast food restaurants Hit Enter. So it's worth to note that doesn't need to be necessarily between two stock variables. If I want to have a rate starting from open area, I could click here and then come all the way to this start variable. And just enter a text-optional one. And you can see, a cloud is now shown here, which shows the part that we actually don't care about it. And if I just want to delete something, I can come here on top, click on Delete, and then click on the item I just want to be removed. So let's just go back to the model. We have two auxiliary variables, a rate of change, and effect of obesity. Let's just go and add those too. For doing that, I need to click on variable instead of box variable here, and then come and follow the same path. Clicking here, rate of change, hit enter. And here on bottom. Effect of obesity. Hit Enter. Now I need to add arrows to my model. So we can see that there are actually five of them. Let's just go ahead and add those five to our model. So I'm going to come here and first click on arrow, and rate of change is going to effect the incidence rate of non obese population to obese population. So I'm going to connect these two, clicking on the beginning part very similar rate and clicking on the end part. Which, in the case of rate, would be the middle point for non-obese population, which is going to affect the incidence rate. I'm going to click here, and this time, I'm going to click on the middle point first, and then click here. And notice that when you do that, it's just going to create a circular shape. And also I could come here and take this middle point and grab it and change the shape of this arrow in a way that I want. So let's just continue with other arrows. We have three of them. So the number of this population is going to also affect the rate in changes in restaurants. So I'm going to click here, come here, and click here. Let's just make this smaller. Effective obesity, which determines how much obese population is contributing to changes in restaurants this way. And the number of fast food restaurants is also going to the incidence, right? So I'm going to connect these two. So now we have our structure of model ready and it's time to go ahead and enter equations. So if you remember from our last part of tutorial, in order to do that I need to come here and click on equations and you notice that all of the variables now become black. And that means that none of them are defined and we need to come up with the equation for them. So if I click on any of them, it will open this variable dialog box for me. We should notice also that Vensim itself just added this part to my equation, minus incidence. It's because this incidence rate is going outside of the stock, so there is a minus of that rate. So I'm just going to leave it that way. And you also should notice that the type that is suggested by Vensim for this variable is level, which I am also going to leave it that way, which makes sense. It's a level type and it's just similar to the way that a bathtub work, it increases and decreases. And for the unit I'm going to leave it for now, but usually it's just good practice to enter units. And unit check is actually just one of the best ways to have quality control for your model, to make sure the model is consistent. So we are going to come back to it later. The only thing I need to enter now here is the initial value for the number of non-obese population, which I'm going to enter 1,000. So, if I click here on Check Syntax it's just going to only check syntax for that specific variable and you can see it says that the equation okay. So I'm going to hit OK here and you will notice that it's not black anymore. So I'm going to continue the same way, rate of change. I'm going to keep it constant and enter 0.2 here. And hit OK. So for incidence, in order to add that, Vensim shows me the options that I have. So these are the variables that are connected to incidence. Wo I'm going to click on them, and when I click on them, there are going to be added to my equation part. So I'm going to click on rate of change times fast food restaurant, times non-obese population. But actually a portion of them, which I'm going to click here, divided by, and I'm going to use my keyboard to enter 1,000. So it's just a very small portion of my whole population. And this is the formula I'm going to use. So we are not going to talk about the logic of these formulas. But you can spend some time, try to understand why they make sense. And once again, it's up to the designer to come up with the equations that they want. But you also can notice that the number of fast food restaurants has a direct relation on the incidence rate, right? So let's just move on for now and hit OK. For obese population, I'm going to leave it that way and just assume that there is no obese population in my case, and hit OK. Healthy restaurants, I'm just going to just enter the initial value and leave type the way it is, and also equation with what it is right now. You might also notice that actually our model at some point is going to have like no healthy restaurants or no non-obese population. Which doesn't seem realistic but that's enough for our purpose. So here I'm going to assume that we have 100 restaurants, 97 of them are healthier or healthy restaurants. And, here three of them are actually fast food or not healthy restaurants, and hit OK. For changes in restaurants, I'm going to use this formula which is going to be a small portion of them, 0.1, it's just arbitrarily a portion of them. Plus I'm going to use this right part and click on effect of obesity multiplied by obese population, the number of obese population and hit OK. And for effect of obesity, for now, I'm going to just assume that it has no effect, and I'm going to just enter 0. And give the type constant, hit OK. So now let's just go back and enter the units. Let's just start with a stock variables, non-obese population. Which I'm going to just enter for instance people or persons. Okay, and for obese population the same. Actually I don't need to enter it since it's already added to this drop down, I can just choose it, people, and hit OK. For incidence, since it's a rate connecting these two, I'm going to use people per month. And for healthier restaurants it's number of restaurants so I'm going to just enter restaurants. And similarly for fast food restaurants. Hit OK. And for changes in restaurants, since it's a rate, I'm going to enter restaurant per month. And now if I go to the model and check units, it's just going to tell me that two of them are not defined yet. So let's just go and define these two. So for this one, I'm going to enter one over restaurant times month. So this is beyond the scope of our tutorial, but the important thing is that the way the units are working should be such that they are consistent with each other. So, it probably takes time to describe why we came up with this and we just leave it for a later time, but We can just enter it for now, but you can try to see why they are consistent with each other. And then here for effect of obesity, I'm going to enter restaurant, Over month times people. And hit OK. Now let's just go back and check the units again. It says that units are okay. So, now I'm ready to simulate my model in the same way that I just covered in the previous tutorial. I need to give my run a name, and actually it's just a good practice to save my work first. And, Enter a name for my run, probably baseline, and, We can use simulate for this time. And once again, the model is so fast, the running is so fast, it doesn't show us the process of that. This time, instead of using this toolbox on the left, which we covered last time, I'm going to add IO objects. So imagine that I just wanted to see the number of obese population or fast food restaurants. So I'm going to click here on IO object and come here and click to add IO object. I'm trying to add to graphs that will show the size of obese population and the number of fast food restaurants. I'm going to click here and open this dialog box to me. I'm going to choose output work bench tool and let me just bring it to the right. Since I want to have the obese population and it's like a stock variable, I'm going to choose level. Here, it shows me the list of stops. And I choose obese population. Hit OK. And here I choose graph and hit OK. And you will notice that it's just the preview mode, because we are still in the editing phase. Move it a bit to the bottom by clicking here and coming and grabbing that, and bring it to the bottom. And I can do the same for another graph, clicking here and then here. Output workbench tool, level, number of fast food restaurants, hit OK, and choosing graph here, OK. And we'll also move it to the bottom. So, if I go unlock this cage, you will see the charts that are showing. So we can see that over the course of 100 months of our simulation, how the size of obese population and number of fast food restaurants are changing. And as we learn in the previous part of our tutorial, you can use Synthethim to play with the rates here and have different sets of results. So I'm going to stop here but I also encourage you to spend some more time to probably think of other ways of adding different components to this model. And playing with the two parameters, two sliders that we have, rate of change and effect of obesity. And try to also think that what are the other ways that you can modify or add different components to this model.