vensim chapter 6 v1

32
Vensim Chapter 6 Building a Simulation Model December 2010 Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Upload: diana-lim

Post on 20-Jun-2015

2.354 views

Category:

Self Improvement


7 download

TRANSCRIPT

Page 1: Vensim chapter 6 v1

Vensime sChapter 6

Building a Simulation Model

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 2: Vensim chapter 6 v1

Naming ConventionsgLevels – initial capital letters; e.g., PopulationRates auxiliaries constants lookups data variables – all lowerRates, auxiliaries, constants, lookups, data variables – all lower case; e.g., average lifetime

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 3: Vensim chapter 6 v1

Sketch ConventionsSketch Conventions

Levels or stocks are entered with the Box Variable toolLevels or stocks are entered with the Box Variable toolRates are entered with the Rate tool

Box Variable - Level Rate

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 4: Vensim chapter 6 v1

Sketching the Rabbit ModelgFile > New Model

12

52

3

Type the name Population and press

t3 enter

4

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 5: Vensim chapter 6 v1

Sketching the Rabbit Modelg

9

67 8

9

56 6

7 7

8

7 7

A positive feedback loop from Population to births increases Population, and a negative feedback loop from deaths decreases Populationdecreases Population

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 6: Vensim chapter 6 v1

Writing Equationsg qbirths = population * birth rateBi th t h t it i t t i th d lBirth rate has not causes; it is constant in the model

Equations All the variables in the model will turn black.

The highlights indicate which variables still require equations or require equations or have incompleteequations

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 7: Vensim chapter 6 v1

Checking your modelg yModel > Units Check

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 8: Vensim chapter 6 v1

Variable Type: Auxiliaryyp yClick on variable births

2

1

2

1

3

44

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 9: Vensim chapter 6 v1

Variable Type: LevelypClick on variable population

equation is already present in the equation editing box

Rates constructed by clicking first outside, and then on the Level

2

are considered positive (inwards) flows; rates constructed by clicking on the Level, and then outside the Level are considered negative (draining) flows

1

3

4

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 10: Vensim chapter 6 v1

Variable Type: Constantypbirth rate

2

11

3 this means that the fractional birth rate is measured in fraction (of rabbits) per year.

4

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 11: Vensim chapter 6 v1

Variable Type: Constantypaverage lifetime

1

2

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 12: Vensim chapter 6 v1

Variable Type: Auxiliaryyp yClick on variable deaths

1

2

3

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 13: Vensim chapter 6 v1

Checking your modelg yModel > Check Model

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 14: Vensim chapter 6 v1

Checking your modelg yModel > Units Check

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 15: Vensim chapter 6 v1

Unit Equivalents (Synonyms)q ( y y )Fail in Units check because Vensim does not see the plural form as the same wordform as the same wordModel > Settings...

1

2

3

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 16: Vensim chapter 6 v1

Simulating the Modelg

21

Double click on the Runname editing box on the Toolbar and type equilib for yp qthe first run name.

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 17: Vensim chapter 6 v1

Model AnalysisyClick on the Level Population in the sketch.Cli k th G h t l A h f P l ti i t dClick on the Graph tool. A graph of Population is generated:

1Graph

2

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 18: Vensim chapter 6 v1

Model Analysisy

P l i fl li h f h hPopulation appears as a flat line at the top of the graph at 1000 rabbits. To check that no change is occurring,l k h bl lClick on the Table tool

Output window shows that shows that Population is unchanging.

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 19: Vensim chapter 6 v1

Simulation ExperimentspClick on the SyntheSim button . Answer yes to whether you want to overwrite the existing runwhether you want to overwrite the existing run.The toolbar will change to 

and you will see variable behavior for all elements on the didiagram.

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 20: Vensim chapter 6 v1

Simulation ExperimentspClick on the Runname editing box and replace equilib with the name growthname growth.Drag the slider beneath birth rate up till it shows 0.2 as its value.value.

The blue lines show the current run and the red line the equilib run resultsequilib run results.Click on the Stop button to stop SyntheSim.Vi >Sh B h i t b h i h iView>Show Behavior to see behavior graphs again.

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 21: Vensim chapter 6 v1

Alternative Simulation SetuppClick on the Set up a Simulation buttonThe Toolbar changes to the simulation toolbarThe Toolbar changes to the simulation toolbar.

ti th t th t t t i t ll d ith blnotice that the constants turn into yellow words with blue backgroundAlso the sketch tools are grayed out preventing work in theAlso, the sketch tools are grayed out, preventing work in the sketch window.

Click on the variable birth rate and in the editing boxtype the value 0.2

This is a temporary change for this run only and does not permanently alter the value in

d l

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

your model.

Page 22: Vensim chapter 6 v1

Causes Strip Graphp pClick on Population to select it into the workbench.Cli k th C t l P l b ttClick on the Control Panel button

1

2

The last run you made (growth) is loaded first (at the top of the dialog).

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 23: Vensim chapter 6 v1

Causes Strip Graphp pClick on the Graph tool. A graph will show both runs

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 24: Vensim chapter 6 v1

Causes Strip Graphp pNow click on the Causes Strip tool.

Causes Strip

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 25: Vensim chapter 6 v1

Runs ComparepClick on the Runs Compare tool.shows the differences in the Constant birth rate for runs equilib and growth.

Runs Compare

Population grew in the growth run because the birth rate was set to a higher value than the equilibrium value. This made the positive feedback loop through births stronger than thepositive feedback loop through births stronger than the negative feedback loop through deaths, resulting in Population growth over time.

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 26: Vensim chapter 6 v1

Exponential Decayp ymake changes to a model Constant to generate exponential decay or decline in the populationdecay or decline in the population

124

1

Drag the Slider under average lifetime till it di l l f 4displays a value of 4.

Click on the Stop Button

3Button

Click the Simulate button and the model will simulate

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 27: Vensim chapter 6 v1

Exponential Decayp yClick on the Graph tool and compare the three runs.

1

double clickon the run equilib in h i h b hi ill

2

the right box; this will unload the run so the Analysis tools will not examine itnot examine it.

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 28: Vensim chapter 6 v1

Exponential Decayp yClick on the Causes Strip tool to show Population and itsto show Population and its causes— births and deaths, for the two last runsthe two last runs.

P l i d li i h d Population declines in the decay run because the average lifetime was set to a lower value than the equilibrium value. This made the negative feedback loop through deaths stronger than the positive feedback loop through births, resulting in p g gPopulation decline over time.

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 29: Vensim chapter 6 v1

Input and Output Objectsp p jClick on the Control Panel button and then select the Graphs tabGraphs tab.

1

22

33

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 30: Vensim chapter 6 v1

Input and Output Objectsp p j

1

Do the same for births (select births f h li ) d

23 4

from the list) and deaths (select deaths from the list)

25

56

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

56

Page 31: Vensim chapter 6 v1

Input and Output Objectsp p jSelect the Input Output Object sketch tool

24

1

24

3

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim

Page 32: Vensim chapter 6 v1

Input and Output Objectsp p jClick the SyntheSim buttonE i t ith i th lid d d iExperiment with moving the sliders around and seeing the results on the graph.

December 2010Vensim Chapter 6: Building a Simulation Model Presented by Diana Lim