Lab 00: Introduction to Vensim
Submit the lab before May 2nd 2024, 20:00
Introduction
Welcome to the first lab with Vensim. To be accurate, it is lab00 - this assignment gives you the opportunity to get used to the modelling environment that we will use during large parts of the course. As such, several of the exercises will appear simple to you and you probably will finish them within a relatively short time. Below, we will guide you through each individual exercise using screenshots. At the end of each exercise, we will ask you to either extract some numbers from the output of Vensim or generate screenshots of one or more graphs. You will have to go into moodle, navigate to the submission mask of this assignment, and submit the requested information in form of a quiz. Important: while we require you to do and finish the assignment, we won’t assign you a grade for the exercises below. The whole purpose of this exercise is to get you set up with Vensim so that the following weeks will run smoothly for you.
Preparation work
Please open Vensim either on the seminar server or on your local machine. Make yourself familiar with the environment. As a general rule you should for each individual model (i.e., from each exercise today and in future labs) create an individual folder to avoid overwriting results. For less complex models and simulations this may seem unnecessary, but we want to you adapt a working habit that is compatible with more complex modelling tasks in the future.
Some basic terminology and functions in Vensim
During the presentation, we talked about terminology, such as stocks, flows, etc. Below you find a table for the name of each term and the tool name in Vensim including the symbol.
Lecture Term | Tool in Vensim | Icon to look for |
---|---|---|
Stocks | Stock tool | |
Auxiliary Variables | Variable tool | |
Flows | Flow tool | |
Connectors | Arrow tool |
Exercise I: A simple model
Navigate to Vensim and create a new model. Add a stock A
and a flow in_A
. Save the resulting model in a location of your choice. Your model should look like the example below:
Afterwards, select the Equation tool . In this window, we are now setting all the variables and boundary conditions for our model. Elements in your model, that were not specified yet, will be highlighted in black. Prior to running any simulation, we will have to specify (aka define) all elements. Double-click on any of the elements (i.e., A
or inA
), so that the following window opens:
This is now the menu in which we edit all the necessary parameters. In the red box we can see all variables that we can edit/modify. You probably noticed already our two variables A
and inA
. Those we are going to edit first. When you click on A
you see in the blue box the values you can edit for the variable. The initial value
describes that the stock at the beginning of the simulation. Set initial value = 0
, meaning that our stock is empty. Next, switch to inA
, and set Equations = 10
. Now, we have set the main parameter of our first model.
What is left is defining the boundary parameters. For this model, we need to edit INITIAL TIME
, FINAL TIME
and TIME STEP
. Activate them, and set via the equations box INITIAL TIME = 1900
, FINAL TIME = 1950
, and TIME STEP = 1
. Last, have for all three variables a look at the green box and change unit to Year
. Afterwards, close the equations tool. We are all set to run our first model. On the top next to icon you can edit a custom name for the model (e.g., my first model). Hit the button to run your first simulation in Vensim. If no error message pops up, then your model ran successfully. Let’s check our output. Click on the button (if not already activated) and click on A
to activate it. Now check out the tools on the left and to see and visualize the simulation results. What model behavior do you observe?
Exercise II: Expand the model
In this exercise we want you to adapt the model from exercise I. To do this, make sure that you save the model in a new folder and with a new name to avoid overwriting the results. You can do this via File \(\rightarrow\) Save As. Once saved, adapt your model as follows: add a new stock B
and an outflow out_B
. Choose suitable parameters for the initial values of B
and outB
. Simulate the model and examine the system behavior by visualizing a graph that shows stocks A
and B
. You can do this by holding the SHIFT-Button when selecting multiple stocks. Once you are done, answer the following question.
Exercise III: Introducing feedbacks
In this exercise we add complexity to simple flow models by adding auxiliary variables as well as causal links to the model. To do that, repeat what we did in exercise I and implement stock A
and flow inA
in the same way (however: do not specify them yet!). Afterwards add an auxiliary variable valueA
and a causal link (blue arrows) by clicking on the respective from and to element in the sketch (Hint: curved arrows are created by clicking on the from-element, then on an empty spot on the sketch, then on the to-element). Do this between A
and inA
and between valueA
and inA
. Your model should look similar to the one below:
Now we focus on the specification. Set as initial values A = 10
to 10 and valueA = 0.1
. For inA
we don’t specify a constant value, but instead we define it as inA = valueA * A
. Define the model settings (INITIAL_TIME
, etc.) similar to exercise I. We could run the model now, but instead lets add some graphical IO element to our sketch and have a graph directly presented at the end of the model run. To do that, click first the Control Panel button ( and select the Graphs tab. Because there were no graphs yet defined, we have to click New. Give the graph a Name and a Title of your choice. Then select as values for the x-Axis the variable Time and on the bottom the variable A that we want to visualize. Click OK. The defined graph should now show up in the control panel. If so, everything done here, click „Close“.
Back in the sketch, select the menu that allows you to add graphs. You can find it in the top menu and it can have the icon or the icon. Then, click in an empty location of your sketch; the Input Output Object settings dialog should appear. Here, select Output custom graph as Object Type and then the graph we defined in the previous step. Click OK. You’ll see that the blank graph is now added to the sketch. Place it into a location of your choice. After that, we are ready to run the simulation. The outputs are now directly visualized. Examine the graph and answer the question below.
In the next step we want to (a) modify the properties of valueA
. Modify this variable by defining a minimum value of 0, a maximum value of 10, and the increment to 0.1. After confirming these changes, run the simulation again. This time, however, use the SyntheSim function to do so. Observe the dynamic adjustment of the graph by moving the slider for valueA
There is nothing to report for this part of the exercise, but I encourage you to play around with it for a little.
Exercise IV: A real-world application
In this fourth exercise we are moving away from purely abstract (and simple) simulation models towards a real-world application. Specifically, we will parameterize a population model for Papua New Guinea. Below you find the concept of a very basic population model with one stock (i.e., the variable we are interested in), two flows and two auxiliary variables.
Your task is to build this model in Vensim using the parameterizations from the table below for the period 2010 to 2050. After that, answer the questions below the table. After that, please answer the two questions.
Variable | Value |
---|---|
Population estimate in 2010 | 6,064,515 |
Birth rate (per 1000 inh.) | 24.0 |
Death rate (per 1000 inh.) | 6.5 |
Exercise V: Non-linear response modelling
In our last exercise we will implement a non-linear response to our models. As a first step, implement the model scheme below in Vensim. As initial values for the various stocks and flows please consult the table below the model scheme.
Variable | Value |
---|---|
A (initial value) | 1 |
inA | A * inA fraction |
outA | A * outA fraction |
inA fraction | 0.25 (min: 0.001, max: 0.5) |
outA fraction | A * k |
k | 0.0025 (min: 0.001, max: 0.05) |
For the visualization I want you to create two I/O chart objects inside the sketch: one to visualize changes in the stock, and one to visualize the in/out rates (Hint: to add more than one variable in a graph, simply add more than one element inside the graph definition). Run the model using these model settings. Describe the sensitivity of the models to changes in k
applying different values for k
using the simulate button.