Session 2 - Modeling With Vensim
Session 2 - Modeling With Vensim
SESSION 2
PGP 2021-23
4th February 2023
LEARNING TO USE VENSIM
Title Bar Main Toolbar
Menu
Sketch Tools
THE
VENSIM
USER
INTERFACE
Analysis Tools
Status Bar
The Story
You have opened a savings bank account with a balance of ₹1000 and plan to
make an annual deposit of ₹5000, and withdraw 3% of the account balance
during the year to meet expenses. The annual interest rate for the account is
7%.
You also need to plan for the following capital expenditure over the next 10
years: ₹1000 per year for first 3 years, ₹2000 per year for years 4 and 5, and
₹1500 per year for years 6 to 10.
Click on the drop-down box for Units for Time, and select Year.
Click on OK (or Press Enter).
BUILDING A SIMULATION MODEL
Select the Box Variable sketch tool and click somewhere in the
middle of the sketch.
An editing box will appear. Type the word Account Balance, and press the enter key.
Select the Rate sketch tool. Click once (single click and release of the mouse button)
about 5 cm to the left of the Level Account Balance,
then move the cursor to Account Balance and click once again.
Type the name growth and press Enter.
Click once on the Level Account Balance then move the cursor about 5 cm to the right
And click again. Type the name depletion and press Enter.
Select the Variable sketch tool.
Click on the sketch below growth, type interest rate and press Enter.
Click on the sketch below depletion, type withdrawal rate and press Enter.
Select the Arrow sketch tool.
Click once on Account Balance, then once on the sketch a little below and right of
Account Balance, and then once on the rate variable depletion.
Select the Variable sketch tool.
Click on the sketch above growth, type deposits and press Enter.
Click on the sketch above depletion, type block expenses rate and press Enter.
Click the Save button and save your model, naming the model SD1.
WRITING EQUATIONS
Click on the Equations sketch tool. All the variables in the model will
turn black. The highlights are used as a visible check of completeness.
Click on the variable growth.
The Equation editor opens. The type of variable is auxiliary.
(Vensim considers Rates and Auxiliaries to be the same type of variable).
The Equation editor opens. Insert the value 0.07 in the equations box.
The Equation editor opens. Insert the value 0.03 in the equations box.
Click OK.
Click on variable deposits.
Click OK.
Click on variable block expense.
The drop down box now shows the type of variable: Level.
Before we simulate the model, we should check it for errors in equations and units.
Select Model > Check Model from the menu; you should get a message saying
“Model is OK”. If the model has errors, then the Equation Editor opens up with the
Variable containing the error.
Select Model > Units Check from the menu; you should get a message saying
“Units are AOK”, or else an units error will be generated.
RUNNING A SIMULATION
Double click on the Simulation results file name editing box on the Main Toolbar
and type sim1 for the first run name.
What is the effect on the account balance over the ten year period if the interest rate increase
or decreases? We shall carry out two simulations with interest rate assumed to be 6% and
8% respectively.
Enter the name sim2 in the simulation results file name box.
Now, enter the name sim3 in the simulation results file name box.
The output graph of the baseline and simulation results for the box variable account
balance is given below.
SYNTHESIM
Once you do this you will see small graphs over all dynamic variables and sliders
will be created for all the constants. As you move a slider the model will be
simulated and the graphs automatically drawn. deposits <Time> block expenses
Account Balance
growth depletion
(06) growth=
Account Balance*interest rate+deposits
Units: Rs
(07) INITIAL TIME = 0
Units: Year
The initial time for the simulation.
(08) interest rate=
0.07
Units: Dmnl
(09) SAVEPER =
TIME STEP
Units: Year [0,?]
The frequency with which output is stored.
(10) TIME STEP = 1
Units: Year [0,?]
The time step for the simulation.
(11) withdrawal rate=
0.03
Units: Dmnl
THANK YOU