Objectives:
- Gain experience working with Vensim.
- Gain experience building and running System Dynamics models.
- Learn about the behavior of systems with reinforcing feedback loops.
- Learn about the behavior of a system with balancing feedback loops.
- Learn to create a custom graph.
- Learn to number the lines on a graph.
- Learn to place a comment on a stock and flow diagram.
- Learn to annotate an information arrow.
Review of Important Points on Using Vensim:
- Draw Stocks first, then flows, then auxillary variables, then information arrows.
- When drawing flows and information arrows always click on a name to start and end the the arrow except when you want a flow to be connected to a cloud.
- When entering an equation do not enter commas in numbers, e.g. 1000 not 1,000.
- Vensim enters the equation for a stock from the diagram as inflow
minus outflow. You may have to update the equation if you modify the diagram. You also have to enter the initial value for a stock.
- Use parenthesis in equations to determine the sequence of evaluation.
- When entering equations do not type in variable names, click on the name provided in the equations window.
The Behavior of Feedback Loops:
Draw a stock and flow diagram for births increasing a population.
Set the initial value of the population at 282,000,000.
Set the Birth Rate at 14.1 per 1000 (14.1/1000).
Compute the number of births each year as the Birth Rate times 282,000,000.
Simulate the model for 100 years. Call this run1.
Note that this model does not contain a feedback loop.
The graph of population is a straight line sloped up to the right. The graph is
a straight line since the same number of births occur each year.
Modify the model to contain a reinforcing feedback loop between Population and Births.
Compute the number of births each year as the Birth Rate times the Population. Call this run2.
The graph of population now is not a straight line. The slope increases each year
since the number of births is a percentage of population which increases each year.
Modify the model to contain a balancing feedback loop between Population and Deaths.
Compute the number of Deaths each year as the Death Rate times the Population.
Use a Death Rate of 8.55 per 1000. Change the equation for Population to be
Births - Deaths. Call this run3.
Compare the population growth with that of the model with no deaths. The population still
increases but not as rapidly. The reinforcing "Birth" loop acts to increase the population
while the balancing "Death" loop acts to decrease it.
Remember the birth rate is 14.1 per 1000 which is larger
than the death rate which is 8.55 per 1000. Thus, the Birth loop is said to be the
"stronger" or "dominate" loop.
These models demonstrate that a reinforcing
feedback loop acts to accelerate a change in a stock and a balancing feedback loop acts to counter the change.
Default Graph:
We have been using the default graph displayed by the Graph tool. It displays only the work bench variable. Values for more than one run can be displayed but for
only one variable at a time. However, Vensim allows a user to create a
custom graph, which can contain two or more different variables.
Defining a Custom Graph:
Let's model the circumstance of taking a pill and then having the drug
absorbed into the bloodstream. There will be two stocks, the drug in the stomach
and the drug in the bloodstream (the pill bottle is the 'cloud' that is the source of
the medicine).
Draw the following model:
(Remember to draw the components in the order-stocks, flows, auxiliary
variables, information arrows.)
The model contains three balancing loops. In a balancing loop an increase
in a stock acts to cause a decrease in the same stock.
- Drug in Stomach(up)- Concentration in Stomach(up)- difference in concentration(up) - Absorbing (up)-Drug in Stomach(down)
- Drug in Bloodstream(up) - Concentration in Bloodstream(up)- difference in concentration(down) - Absorbing (down) - Drug in Bloodstream(down)
- Drug in Bloodstream(up) - Metabolizing(up) - Drug in Bloodstream(down)
When this system containing balancing loops is simulated it yields the generic behavior of growth to a limit. In this case, the drug in the bloodstream grows quickly
and then tapers off as it nears a limiting value. Actually, the rate of growth begins high but decreases until it eventually approaches a slope of zero (a horizontal line).
Compare this to the explosive growth behavior seen with a system that has a reinforcing feedback loop. There the slope begins with a low value and then increases.
Enter this model yourself using the following:
- ingesting equals 0.05
- metabolizing equals drug in bloodstream times metabolism fraction
- drug in stomach is the accumulation of ingesting minus absorbing
- the initial value of drug in stomach is zero
- drug in bloodstream is the accumulation of absorbing minus metabolizing
- the initial value of drug in bloodstream is zero
- concentration in stomach equals the drug in stomach divided by the stomach volume
- blood volume equals 3500 plus the product of 10 times the body weight
- concentration in blood equals the drug in bloodstream divided by the blood volume
- difference in concentration equals concentration in stomach minus concentration in blood
- absorbing equals difference in concentration times
stomach volume times absorption fraction
- absorption fraction equals .344
- metabolism fraction equals the .344 divided by 8
- stomach volume equals 500
- body weight equals 150
Save this model under the name Drug (C:\temp\drug.mdl).
Run the model (run1) to simulate 100 hours.
Create a custom graph containing the graphs of two variables, (the graph will contain the drug in stomach and
drug in bloodstream from run1)
- Click Windows on the menu bar
- Select Control Panel
- Select Graphs
- Click New to create a new graph
- Enter graph1 in Graph name box
- Enter Drug Levels in Title
- Select a Drug in Stomach variable from "Sel" button from run1
- Select a Drug in Bloodstream variable from "Sel" button from run1
- Mark the first check box under "Scale"
- The window will then look like...
- Click "OK"
- Click the "Display" button on the graph tab of the control panel and you should see...
Run another simulation creating a dataset named run2 with
"ingesting" equal to .07.
- Click on the Equations icon
- Click on the ingesting variable
- Change the value to .07
- Click OK
Create another custom graph (the graph will contain drug in stomach
and drug in bloodstream from both run1 and run2)
- Click the Modify button on the graph tab
- Click the Copy to button
- Name the new graph "graph2"
- You have now created a second graph, "Graph2"
- Enter the following data:

- Click "OK", select "GRAPH2" and then "Display"

- To print digits on each graph line:
- From Options, select Options...
- Mark the check box "Show Line Markers on Graph Lines"

- Click "OK"
- Then display the graph

Adding Comments to a Stock and Flow Diagram:
To add a comment to a drawing, Click on the Comment icon
Then position the cursor where you want the comment to be and Click. The following window will be displayed.
Type a comment in the "Comment" box, select the font face, size, color, etc. and
Click OK.
Exercise:
Modify the Drug stock and flow diagram using the comment tool to insert a green "(B)" inside each of the three balancing loops.
Annotating Information Arrows:
To place a small plus or minus sign next to an information arrow, Click on the
Arrow icon
or the Move/Size icon
and then right Click on the arrowhead or the small
circle on the arrow you wish to annotate. The following window will be displayed.
Click on the sign you want, + or - or S or O, then choose "inside" or "outside"
and Click OK.
Exercise:
Modify the Drug stock and flow diagram to annotate the relationships that define the
three balancing loops.
This is the end of the lab exercise. Submit Drug.mdl to blackboard.
|