Answers To Exercises For Chapter 17 INTRODUCTION TO DELAYS
Answers To Exercises For Chapter 17 INTRODUCTION TO DELAYS
Nancy Roberts
David F. Andersen
Jonathan Choate
Ralph M. Deal
Michael S. Garet
William A. Shaffer
by
Kamil Msefer
Mark Choudhari
Prepared for
August 5, 1994
2 D-4415-5
The Chapter has also been provided under Road Maps Five in pdf format.
4 D-4415-5
Computer Simulation by Nancy Roberts et. al. However, the chapter in the book
has its models built using the DYNAMO simulation language, and as you are
probably using Vensim, STELLA or iTHINK, we have translated the models for
your convenience. This paper contains these translated versions of the models for
the first seven exercises from the book. Later, we also suggest answers to these
NOTE FROM THE TRANSLATOR: All the models in this paper have rates that
flow in both directions. This is to encourage the readers to make the direction of the
flow explicit in the equation, and not in the plumbing. In DYNAMO, there is no
biflow-uniflow toggle. All rates are biflows.
INIT NOBUG = 0
OUTFLOWS:
ABSORB_RATE = NOBUG/NAT
NAT = 2
D-4415-5 5
NOBUG
These equations show that the level of NOBUG in the Sparkill River is
influenced by the DUMP RATE and the ABSORB RATE; and the ABSORB RATE
is equal to the level of NOBUG divided by the Nobug Absorption Time NAT (2
days).
b. Rerun the model, setting the Nobug Absorption Time, NAT = 4. How do the
results differ? Rerun the model, setting NAT = 1. How do these results differ?
1: DUMP RATE
1: 1680.00
1: 840.00
1: 0.00 1 1 1 1
0.00 6.25 12.50 18.75 25.00
The PULSE function can also be used to examine the response of the system
D-4415-5 7
to the dumping of just one batch of NOBUG. It is possible to do this by making the
following change in the equation for DUMP RATE.
DUMP RATE = PULSE(420,1,0)
This equation indicates that the dumping rate rises from zero to 1680 on day
one (for only a quarter of the day)and stays at zero for the rest of the simulation.
Figure 3 shows a simulation of the Nobug system, with one batch of Nobug
released into the river on day one. As can be seen, the level of NOBUG in the river
rises sharply to 420 gallons on day one, and then drifts slowly toward zero.
1: 1000.00
2: 250.00
3: 125.00
2
3
1: 0.00 2 3
2: 0.00 2 3
3: 0.00 1 2 1 1 1
0.00 2.50 5.00 7.50 10.00
one pulse.
PULSE function to simulate the effect of dumping 420 gallons of Nobug into the
river at 7-day intervals. Compare your results with the data shown in , Figure 4
above.
b. Assume Martan Chemical Inc. changed the chemical composition of Nobug,
such that the halving time of Nobug was lengthened to seven days, resulting in an
increase in the Nobug absorption time NAT. Change the value of NAT in your
model to reflect the change in the chemical composition of Nobug. How does the
system respond?
INFLOW OUTFLOW
ADJUSTMENT TIME
When a first-order material delay is used in a model, there are two ways to
write the equations. One approach is to simply to write out individual equations,
exactly as was done in the Nobug case. But because first-order material delays are
frequently used, a special STELLA function is available that can be used to replace
the set of individual equations. Note that we are using the equivalent STELLA
functions instead of the DYNAMO functions used in the book. The following
equation can be used to indicate that the OUTFLOW rate is a first-order delayed
response to the INFLOW rate, with an adjustment AT.
10 D-4415-5
LEVEL
INFLOW OUTFLOW
The SMTH1 function is simply a shorthand notation. When the model is run,
STELLA will substitute the full level and rate formulation for a first-order delay,
whenever the SMTH1 function appears in the model.
Apartments
Apartments Desired
Construction Rate
Please read the chapter for a discussion of why a delay should be added to the
model. One way to do this is shown in figure 9.
Initiation Time
Completion Time CT
Desired Apartments
Difference
Exercise 7: Apartments-Part II
For the questions in this exercise, please refer to the chapter.
INFORMATION DELAYS
Please read the chapter for an introduction to information delays.
NOTE FROM THE TRANSLATOR: This paper presents only the first seven
exercises from Chapter 7 in the book. We will discuss higher order delays later in
Road Maps.
Answers to Exercises
Exercise 1
a.
NOBUG
INFLOWS:
DUMP_RATE = 60/TIME_CONSTANT
DOCUMENT: The DUMP RATE is how fast Nobug is dumped into the river. In this case it is
60 gallons per day, which was given in the text.
Units: gallons/day
TIME_CONSTANT = 1
14 D-4415-5
DOCUMENT: The time constant is the time over which the dump rate is calculated.
Units: days
The DUMP RATE is not shown in the graph below because it is constant. As the
content of NOBUG increases (because of the DUMP RATE), the ABSORB RATE also
increases since it is dependent on the content of NOBUG in the river. The system
reaches equilibrium when the ABSORB RATE equals the DUMP RATE at 60
gallons/day and the level of Nobug is 120 gallons.
1: NOBUG 2: ABSORB RATE
1: 250.00
2: 100.00
2 2 2
1: 125.00
2: 50.00 1 1 1
1
1: 0.00
2: 0.00
0.00 6.25 12.50 18.75 25.00
2 2
1: 125.00 2
2: 50.00
1
1: 0.00
2: 0.00
0.00 6.25 12.50 18.75 25.00
2 2 2
1: 125.00 2
2: 50.00
1 1 1
1
1: 0.00
2: 0.00
0.00 6.25 12.50 18.75 25.00
Exercise 2
a. The level of NOBUG drops from 420 gallons at day 1 to about 210 gallons in 2.5
days. The halving time is then about 1.5 days.
b. After experimentation, you should find that an increase or decrease in the Nobug
Absorption Time correspondingly increases or decreases the halving time.
c. Figure 4 shows a halving time for NOBUG of about 1 day (ie. half-life = 1 day). The
value of NAT that produces this behavior can be calculated as (half-life)/.69 or 1.4
days. With this value for NAT the outcome matches Figure 4.
Exercise 3
a. When the model is run with 420 gallons dumped by MARTAN every 7 days, with a
NAT of 2 days, the output is a good match. Note that a run of NAT = 1.4 would give
essentially the same run.
1: NOBUG
1: 420.00
1: 210.00
1: 0.00 1
0.00 8.00 16.00 24.00 32.00
b. With the halving time of Nobug lengthened to seven days, the new value of NAT is
12 days (ie. half-life/.69). Since halving time is so long, Nobug is not eliminated from
the river within the 7 days. As a result, content of Nobug continues to increase with
each successive dumping of Nobug. However, the level of Nobug stabilizes again!
The level stabilizes when the quantity of Nobug dumped into the river (ie. 420 gallons
once a week) is equal to the quantity absorbed (ie. the area under the curve of the
ABSORB RATE) during the week.
D-4415-5 17
1
1: 500.00
2: 80.00
1
2
2
2
1: 0.00
2: 0.00
0.00 18.75 37.50 56.25 75.00
Graph 3 Days 8:01 PM 7/25/94
Exercise 4
a.
BILLING
+
BILLS IN
RATE
- MAIL
BILLS
+
ARRIVAL
RATE
18 D-4415-5
INIT Bills_in_the_mail = 0
Units: bills
INFLOWS:
Billing_Rate = PULSE(1000,1,0)
DOCUMENT: 1000 bills are sent out on the first day of the month. The interval was set to 0
because in this case we are only interested in studying the first pulse.
Units: bills/day
OUTFLOWS:
Bill_Arrival_Rate = Bill_Arrival_Rate/Mail_Arrival_Delay
DOCUMENT: This is a first order material delay, where bills arrive on average 3 days after
Units: bills/days.
Mail_Arrival_Rate = 3
Units: days
Another way of modeling the same behavior using the SMTH1 function is shown below.
The behavior of this model should be the same as the graph below.
Billing_Rate = PULSE(1000,1,0)
Bill_Arrival_Rate = SMTH1(Billing_Rate, 3)
b.
D-4415-5 19
2 1
1: 500.00
2: 166.67
1: 0.00 2
2: 0.00 1 2
0.00 5.00 10.00 15.00 20.00
Graph 1 Days 3:11 PM 7/26/94
The pattern in the output is a mail arrival rate that decays exponentially from an initial
peak just after the mail is sent. This is an unrealistic modeling of the mail process since
no mail will be received immediately after the mail is sent.
c. From the tabular output, at the end of 6 days, 806 bills have been received or
194 bills (ie. 1000-806) will take more than 6 days to arrive.
Exercise 6
a.
Apartments
Apartments Desired
Construction Rate
Adjustment Rate
Gap
INIT Apartments = 0
Units: apartments
INFLOWS:
Construction_Rate = Gap/Adjustment_Rate
20 D-4415-5
Units: apartments/year
Adjustment_Rate = 1
Units : years
Apartments_Desired = 10000
Gap = Apartments_Desired-Apartments
DOCUMENT: Difference between the number of desired apartments and actual apartments.
Units: apartments.
b.
1: Construction Rate 2: Apartments
1: 10000.00 2 2
2:
2
1
1: 5000.00
2:
2
1
1:
2: 0.00 1 1
0.00 1.50 3.00 4.50 6.00
Graph 2 Years 3:42 PM 7/26/94
From the plot, the number of apartments at equilibrium will be 10000, as expected for
this simple model with no demolition process.
1: 4000.00
2: 7500.00
1: 0.00 1
2: 0.00 1 1
0.00 1.50 3.00 4.50 6.00
Graph 2 Years 3:47 PM 7/26/94
Exercise 7
a.
Apartments in Construction Total # of Apartments
Initiation Time
Completion Time CT
Desired Apartments
Difference
INFLOWS:
Initiation_Rate = Difference/Initiation_Time
OUTFLOWS:
Completion_Rate = Apartments_in_Construction/Completion_Time_CT
Total_#_of_Apartments(t) = Total_#_of_Apartments(t - dt) + (Completion_Rate) * dt
INIT Total_#_of_Apartments = 10000
22 D-4415-5
INFLOWS:
Completion_Rate = Apartments_in_Construction/Completion_Time_CT
Completion_Time_CT = 4
Desired_Apartments = 10000+STEP(5000,1)
Difference = Desired_Apartments-Total_#_of_Apartments
DOCUMENT: Difference between the number of desired apartments and actual apartments.
Units: apartments.
Initiation_Time = 1
b& c. Set the Total # of Apartments equal to 10,000 to start the model in equilibrium.
The STEP function is used to increase the Desired Apartments from 10,000 to 15,000.
The stock for the Total # of Apartments must not be left checked as a non-negative
stock in the dialog box for this stock. This is because it is possible to have a negative
construction rate. See part (f) for further explanation.
1: 0.00 3 4 2
2: 15000.00 4 2 1 4
1 3
3: 0.00 3 1
4:
1
2
4
1: -4000.00 2
2: 10000.00
3:
4: -6000.00
0.00 10.00 20.00 30.00 40.00
Graph 1: Page 1 Years 6:50 PM 7/26/94
c. The system generates oscillating behavior. The oscillations in this case are
damped oscillations. The Total # of Apartments oscillates around 15,000 apartments
and eventually converges to this value in equilibrium.
d. A delay in a negative feedback loop leads to oscillation. There are different types
of oscillatory behavior- sustained, expanding and damped oscillations. The linkage
between the stock for the Total # of Apartments and it’s outflow causes the system to
exhibit damped oscillations.
D-4415-5 23
e. Try three runs with Completion Times CT of 3, 4, and 6 years. In all cases, the
number of apartments will oscillate about the equilibrium value, the main effect of
changing the construction delays time is to change the period of oscillation. An
increase in the Completion Time increases the period of oscillation and makes it take
longer for the system to achieve equilibrium. In all cases, the oscillations are damped,
becoming smaller and smaller in amplitude from each cycle to the next.
Vensim Examples:
Introduction to Computer Simulation
By Lei Lei and Samitha Samaranayake
October 2001
Nobug
absorb rate
dump rate
NOBUG/DAY NOBUG
ABSORPTION
INITIAL NOBUG TIME
Figure 10: Vensim Equivalent of Diagram of the Martan Case without Pulse Function
Units: day
(08) "NOBUG/DAY" = 60
Units: gallons/day
125 gallons 2 2 2 2 2 2 2
2 1 1 1 1 1 1
50 gallons/day 1 1
1
2
0 gallons
0 gallons/day 1
0 5 10 15 20 25
Time (days)
125 gallons 2 2 2 2 2
1 2
2
50 gallons/day
2
0 gallons 2
0 gallons/day 1
0 5 10 15 20 25
Time (days)
125 gallons 2 2 2 2 2 2 2 2
50 gallons/day 2
1 1 1 1 1 1 1 1 1
0 gallons
0 gallons/day 1
0 5 10 15 20 25
Time (days)
Nobug
dump rate absorb rate
<TIME STEP>
NOBUG/DAY NOBUG ABSORPTION TIME
INITIAL NOBUG
Figure 14: Vensim Equivalent of Figure 1: Diagram of Martan Case
(02) dump rate = "NOBUG/DAY"*( PULSE(1 ,TIME STEP)+ PULSE(8 ,TIME STEP)+
PULSE(15 ,TIME STEP)+ PULSE(22 ,TIME STEP))
Units: gallons/day
420 gallons of Nobug are dumped each quarter of a day, so 1680 gallons of Nobug are
dumped on the first day of each week
Note: This formulation is used because Vensim does not have a repeated pulses
function. We have inserted individual pulses at intervals of 7 days instead.
840
0
1 1 1 1 1 1 1 1 1 1 1 1
0 4 8 12 16 20 24 28 32
Time (days)
Graph of Dump rate, Nobug, and Absorb Rate for One Pulse
2,000 gallons/day
500 gallons
250 gallons/day
1,000 gallons/day 3
250 gallons
125 gallons/day
0 gallons/day 2
0 gallons 3
0 gallons/day 2 3
12 1 1 1 2 31 2 31 2 3 1 23 1 23 1 23 12 3 12 3 12 3
0 4 8 12 16 20 24 28 32
Time (days)
Figure 16: Vensim Equivalent of Figure 3: Simulation of release of one batch of Nobug
316.28
1
1 1
210.85
1
1
105.42
1 1
1 1 1
0 1 1 1 1
1
0 4 8 12 16 20 24 28 32
Time (days)
1,000 gallons
1
160 gallons/day 1
1
1
1
1
500 gallons 1 1
1
80 gallons/day 1 2
2 2 2
2 2
2 2 2
1 2
2
2
0 gallons
0 gallons/day
1
0 10 20 30 40 50 60 70
Time (days)
Figure 18: Vensim Equivalent of Simulation of Nobug and Absorb Rate for NAT = 12
BILLS/DAY MAIL
<TIME STEP> ARRIVAL
DELAY
Figure 19: Vensim Equivalent of Mail Delay Model
(03) Bills in the Mail =INTEG (+billing rate-bill arrival rate, INITIAL BILLS IN THE MAIL)
Units: bills
Initially there are no bills in the mail.
(04) Bills Received = INTEG (bill arrival rate, INITIAL BILLS RECEIVED)
Units: bills
1 1 1 1 1 1
1,000 bills 1 1
333.32 bills/day 1
1
500 bills 1
166.66 bills/day 2
2
0 bills
2 2
0 bills/day 2 2 2
2
1 1 2 2 2
0 2 4 6 8 10 12 14 16 18 20
Time (day)
Figure 20: Vensim Equivalent of Simulation of Bills Received and Bill Arrival Rate
INITIAL APARTMENTS
Apartments
construction rate
APARTMENTS
ADJUSTMENT DESIRED
RATE gap
Units: apartments
Apartments built so far.
4,000 apartments/year 1
7,500 apartments
1
0 apartments/year 1
0 apartments 1 1
1 1 1 1 1
0 1 2 3 4 5 6
Time (year)
CONSTRUCTION APARTMENTS
Apartments in
Total # of
Construction
initiation rate completion rate Apartments
COMPLETION
TIME CT
INITIATION TIME
difference
DESIRED APARTMENTS
Figure 23: Vensim Equivalent of Apartments Model-Part 2
D-4415-5 35