0% found this document useful (0 votes)
67 views

Simulation: Build Model Item Provides Access To Some Specific Models That Are Constructed by The Add-In

This document describes using Excel to simulate an iterative inventory management system over multiple time periods. Key points: 1) Excel is useful for modeling iterative systems with each row representing a single time period. Formulas can reference cells in the current and previous rows to model interactions over time. 2) The simulation add-in allows building models with random variables and running simulations over many rows. Statistics are automatically calculated to analyze results. 3) As an example, a simple time series model of product demand is built, with demand based on mean and random variation. The add-in constructs a worksheet to run the simulation and track statistics over multiple iterations.

Uploaded by

scudelcu
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

Simulation: Build Model Item Provides Access To Some Specific Models That Are Constructed by The Add-In

This document describes using Excel to simulate an iterative inventory management system over multiple time periods. Key points: 1) Excel is useful for modeling iterative systems with each row representing a single time period. Formulas can reference cells in the current and previous rows to model interactions over time. 2) The simulation add-in allows building models with random variables and running simulations over many rows. Statistics are automatically calculated to analyze results. 3) As an example, a simple time series model of product demand is built, with demand based on mean and random variation. The add-in constructs a worksheet to run the simulation and track statistics over multiple iterations.

Uploaded by

scudelcu
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Simulation

Often systems operate in an iterative manner. Say the manager of a store maintains an
inventory holding an expensive product. The manager looks at the inventory at the end of each
day to see if a replenishment order should be placed. If the inventory level is low, he will place an
order for some number of the product. The manager knows that even if an order is placed, it will
not arrive right away. Rather there is some lead-time during which demand may exceed the
available inventory and customers will be disappointed.
There are a variety of contradictory considerations that affect the manager's decisions about
replenishment orders. First there is a cost for placing an order that discourages too frequent
replenishments. Second there is a cost of holding inventory that discourages ordering too many
units in a single replenishment. Third there is a cost associated with the customer who is
disappointed when there is no product in inventory when the customer wants it.
To make decisions the manager has only information about the present and the past. He
knows the various parameters associated with the system. He can observe the current inventory
level, has a record of the demands in each of the previous days and knows the status of
replenishment orders placed previously. He must use this information to make decisions that will
affect the future.
Excel is useful for modeling and simulating such an iterative system.
We model each iteration as a row on an Excel worksheet. A model of the
inventory system for 50 days will consist of 50 rows. Any particular row
holds a model of the various costs and interactions for a single iteration.
The model can include formulas that reference current information (stored
in cells in the current row) and past information (stored in cells from
previous rows).
When all iterations have the same model it is easy to build an analysis
of an arbitrary number of iterations. We create a model of the first day on
one row or the worksheet. Then we select the first row and any additional
number of rows below the first. We then select the "Fill Down" command of
Excel. This copies all the formulas from the first row into all the rows
below. Because the copy command creates relative addresses in the
formulas, the interactions modeled in the first row are maintained for all the
following rows. Using the statistical functions of Excel, summary results for
all rows are easily obtained. The statistics can be used to experiment with
alternative parameters settings. For instance the inventory manager might use them to find an
optimum policy for choosing the frequency and size of replenishments.
The simulation add-in builds and runs multiline simulation models. When installed, the menu
items on the figure above appear under the OR_MM menu. We show the menu with both the
Random Variables and Simulation add-ins installed. The former is often useful when the
simulation model includes random variables.
In the following pages, we describe the operations of the add-in. The Build Sim item builds
and changes a structure on which a multiline simulation model can be constructed and run. The
Build Model item provides access to some specific models that are constructed by the add-in.
The Add Buttons and Remove Buttons commands are useful for creating a template or when
moving models from one computer to another. Buttons cause linking problems when a model
created on one computer is moved to another. Use the Remove Buttons command to remove all
the simulation buttons before saving. The Add Buttons command puts them back. When a
workbook uses functions from the Random Variables add-in, use the Relink Functions command
to fix the links.

1
There are several other pages on this site where simulation models are described.
• Simulation of Random Variables
• Simulation of Discrete Time Markov Chains
• Simulation of Continuous Time Markov Chains
• Simulation of Queuing Stations
• Simulation in Economic Analysis
• Simulation in Project Management
• Simulation in Forecasting
Games can be constructed that use simulation with the control option. Time advances in one
period intervals and the user (or game player) makes decisions.
• P & G (Production Control) Game
• Inventory Game
• Multistage Production Game

2
General Model
To build a general simulation model choose the Build Sim... item
from the Simulation menu.
For this introduction we are simulating a simple time series that
represents the demand for some product. The model for the time series
is described mathematically by the equation below.

The demand is based on a specified mean demand and the standard deviation of the random
variation term. The variation is Normally distributed with a mean value of zero. We require that
the time series return a nonnegative integer as indicated by the brackets in the top expression.
The Build Sim option calls a VBA program that presents the dialog shown below. The dialog
requires a name. We provide the name TS_1. The name should be short and representative of
the model. The name must start with a letter, have no spaces and include no punctuation except
the underline symbol (_). The name cannot represent a cell on the worksheet. The name must be
unique to all other names used in the workbook. The five fields under the name determine the
number of rows and columns of the display.

Building the Simulation Form


The worksheet constructed by the add-in is shown below. The sheet has the name TS_1.
Since several ranges on the sheet are given names prefaced by the worksheet name, the name
cannot be changed once the sheet is constructed.
Notice that the display has three columns, the first is labeled "RN. 1 ", and the other two have
the labels "Base" and "Demand". The first column is the Random Number column. In general, there
may be more than one. The last two columns are the Simulation columns. In general, there may
be many of these. The associated fields on the dialog determine the number of columns of each
type. The columns originally had default names that were changed to represent the current

3
problem.
At the very top of the display, we see parameters obtained from the dialog box. They are
colored yellow to indicate that the user should not change them. Rows 10, 11 and 12 hold
statistics for the simulation. Row 15 is the initial row and holds numbers that initialize the formulas
of the simulation. Only one initial row is shown, but the Initial Rows field of the dialog controls the
number. Row 16 of the worksheet holds row 1 of the simulation. This is an especially important
row as it contains the formulas that describe the situation being modeled. The 24 rows starting
with row 17 are the remaining iterations of the simulation. The Sample Size field of the dialog
determines how many rows are in this category.
Clicking the Change button located in column A modifies most of the structural features of the
display. Then the dialog above is again presented. Specifying new values on the dialog can
change all the fields on the dialog, except the name.

The contents of several cells are expanded with the outlined text boxes in the figure above.
Cell Description
F10 This cell is in a random number column of the statistics display. Its content,"***",
indicates that statistics concerning this column are not maintained. Generally, the
add-in does not maintain statistics about random number columns.
G10 This cell holds the Excel function: =AVERAGE(G16:G40). It computes the average,
or the statistical mean, of the simulated numbers in the Base column. Cell H10
holds a similar function for the Demand column. The contents of the cells in this
area are controlled by the Show Statistics area near the bottom left of the dialog.
Buttons are determine whether no statistics are computed, only the mean or both
the mean and standard deviation. For a large simulation, computing the mean and
standard deviation of every column may be difficult computationally. When a single
column is to be specified, there is a field on the dialog in which the column index is
to be specified. Note that the number used in this field is the simulation column

4
number.
G11 This cell holds the Excel function that computes the standard deviation of the
simulated numbers in the Base column =STDEV(G16:G40). A similar function is
provided in cell H11 for the Demand column.
G12 This cell is provided for the user to specify some other statistical function than
"AVERAGE" or "STDEV". There are a number of statistics one might like to gather
and Excel has a variety of functions for this purpose.
F13 This is a "seed" for the random numbers in the column below F13. The seed is
initially obtained using a random number generated by Excel, but the user may
change the seed. For a positive seed, the sequence of random numbers will always
be the same. This is useful for some applications. If the Randomize Seeds button is
checked on the dialog, the program randomly generates a new seed for every run of
the simulation.
F15 When a simulation is run (by clicking the Simulate button), the seed in F13 is
transferred into cell F15. This in turn controls the sequence of random numbers
below F15.
F16 Here we see a User-Defined function: =SIM_rand(-F15). The function is provided by
the Simulation add-in and has the purpose of generating a uniformly distributed
random number between 0 and 1. The function uses the random number generator
provided by Excel. Notice that the function points to cell F15. This provides the
connection between the random number generated and the seed. The function
requires a negative argument, thus we negate the reference to F15.
F40 This cell is in the last row of the column and holds the function: =SIM_rand(-F39).
Thus the contents of cell F40 depend on the contents of cell F39. All the cells from
F16 through F40 have the same relative reference, so all are controlled by the seed
at the top of the column.
F15:H15 This range is the initial row, which is labeled row 0 in this case. The random
columns will hold the seeds in this range. The simulation columns will hold initial
values for the simulation. For example, an inventory model would require an "initial
inventory" quantity. This would be placed in an appropriate column in the initial row.
Some models will require more than one initial row.
F16:H16 This important row holds the formulas that describe the simulation model. The
computer fills the random columns, but the user must fill the simulation columns. For
some systems, the formulas in these cells may be very complicated. The complexity
of the situation that can be modeled depends a great deal on the inventiveness of
the user and the user's skill at manipulating Excel formulas.

Filling Row 1
The simulation columns of row 1 hold formulas that define the iterative simulation model. The
model can be very complex with as many columns as Excel allows. For example, a multiline
simulation model of a three-channel queue constructed by the Queuing add-in has 19 columns.
Below we show the contents of row 1 for the example time series model.

5
The model for the time series example is placed in two cells in row 1, cells G16 and H16, Cell
E16 holds the row index, which is also computed with a formula.
Cell Description
E16 This cell holds the row index. The cell holds the simple expression
=E15+1
The index is one greater than the contents of the row above. Since the index of the
initial row is 0, the index of this first row is 1. This formula is automatically provided by
the add-in, but the user can change it. For example if the simulation was to show 10
day intervals, the formula could be
=E15+10.
G16 This cell computes the value of

Notice that in range (B15:C18) we have defined the random variable "Base". The cells
in this range were filled by the Add RV command of the Random Variables add-in. The
distribution is specified as a Normal distribution with mean 25 and standard deviation
5. Simulating from this distribution is accomplished in cell G16 with the function:
=RV_sim(Base,F16)
RV_sim is a user-defined function provided by the Random Variables add-in. That add-
in must be installed in order for this function to be available. The example illustrates
the arguments of the function. The first argument is the random variable name and the
second is a seed. The seed for the cell G16 points to F16, the cell just to the left.
If the mean or standard deviation stored in cells C17 and C18 are changed, the
number in cell G16 changes accordingly. The Random Variables add-in provides a

6
large variety of discrete and continuous probability distributions.
G17 This cell completes the computation of the required time series value for t=1.

The Excel expression in cell G17 is


=MAX(ROUND(G16,0),0)
where the ROUND function converts the contents of G16 to an integer and the MAX
functions assures that it is nonnegative.
The contents of cells G16 and G17 could have been combined into a single column for
this simple example.

Performing the Simulation


Clicking the Simulate button copies the formulas in row 1 into rows 2 through 25. Since
relative addresses are preserved, each row computes the values for one iteration. The simulation
statistics are computed in rows 10 and 11 for the sample.

Chart
To make a chart of the simulation results, select the Chart button at the top of the page. The
dialog is presented below. The x-column and y-column numbers determine the columns of the
simulation to be charted. The default values are the first column (holding the index) and the last
column. Various features of the chart are set in the fields of the dialog.

7
The chart for the example shows the time series for 25 periods. (The Line option does not
work at this writing.) The chart shows the simulated time series.

Larger Simulation Runs


When developing a model, it is good practice to keep the sample size small. Here we have
used 25 iterations. During the development, the user often will add and delete columns. This is
easily accomplished with the Change button. When columns are inserted they are added in a
manner that does not invalidate functions or references already created.
When the model is perfected however, a larger sample size is necessary to obtain statistically
valid results. Again, this is easily accomplished by changing the sample size in the dialog
(reached with the Change button). We have increased the sample size to 1000.

8
A simulation model created by this procedure is dynamic. Cells are linked to each other by
active formulas. When a random number seed or a problem parameter is changed, the entire
simulation responds. This allows a variety of analysis procedures not usually available with a
simulation model. We review these possibilities more fully on a later page.

9
Time Series Model
Predefined models are reached by choosing Build Model from the Simulation
menu.
The model dialog appears with a list of model types currently available.
Four model types are currently available. In this section we describe the Time
Series model. Checkboxes determine if the series should have a trend
component or a step component. We illustrate below the case when both are
chosen.

The mathematical model describing the situation is shown below. Note that the trend
component is accumulated since the beginning of the simulation with the sum term. The step
component is a quantity added to the base demand at each iteration.

The trend component is itself a random variable described in the following.

At each iteration, the trend is the trend value at the previous iteration plus a new trend added
in the current iteration. The addition is from a Normal distribution with a specified standard
deviation and a mean of 0. However, whether the current value is added or not depends on a
Bernoulli random variable taking on the value 0 or 1. The Bernoulli distribution has the probability
parameter given as 0.1 specified on the dialog.

10
In practice, this represents a situation where the series is affected by random influences that
either causes a trend change or not. The probability of the change is given by the parameter of
the Bernoulli distribution.
The step component is similarly affected by a random variable with a Bernoulli distribution. It
represents some shock that affects the constant term added to the base demand. The model for
the step component is similar to the trend component, but it is affected by different random
variables.

Although this model seems complicated, it might represent a situation where demand is not
constant over time. Such a model could be a useful start for a variety of situations involving time
series.

The Worksheet Model


Pressing the OK button on the model dialog, brings forth a second dialog that provides the
features of the multiline simulation model for the process. The problem name is fixed as the name
given in the Model dialog and the parameters are set to their proper values. The numbers of
columns may be increased to accommodate additional model features, but they should not be
reduced or it will not be possible to build the time series model. The sample size is selected here
to illustrate the affects of trend and step changes.

Pressing OK for this dialog, builds the worksheet for the time series model. All expressions
are automatically placed in row 1 and the random variable definitions are placed on the
worksheet. Dialogs are presented for each random variable, so the user can select the types and
parameters of the distributions. The figure below shows the random variable definitions, which
are placed in columns B and C. The parameters of the distributions can be changed to suit the
situation.

11
The simulation model is shown below. This model has five random variables, represented by
the five columns, F through J. The columns necessary for the simulation are columns K through
R. The model is complete and the simulation for 25 iterations is shown in the figure. The
simulated demand is shown in column R. All the other columns are necessary to compute the
trend and step components. Again the model is dynamic. Any parameter change is immediately
reflected in the simulation results.

Row 1 for the Simulation


The critical part of the model consists of the simulation cells in row 1. The expressions in
these cells are expanded into text boxes to show the model used for the simulation. Color and
formats are added to the cells in row 1 and are filled to the cells below when the simulation button
is clicked.

12
This model has a variety of uses. For example, it could be used to illustrate forecasting
procedures such as a moving average forecast. A column could be added to the model to
compute the moving average for a certain number of iterations. A second additional column could
compare the forecast with the simulated value. To implement the moving average method,
additional initial rows are necessary to provide data for the forecast in the first row. The time
series model would also be useful for an adaptive inventory control simulation.

13
Inventory Model
Here we illustrate the second model type available, the inventory model. The simulation
describes a reorder point - lot size system. The inventory holds a single product and is reviewed
periodically, weekly for the example. The inventory level is decreased by demand described as a
random variable. When the inventory level reaches some reorder point specified as a parameter,
an order is placed. The amount of the order is also a parameter of the simulation. After a
predetermined lead-time, the replenishment is delivered and added to the inventory. During the
lead-time, the inventory may be exhausted and shortages may occur. We assume that shortages
are backordered and satisfied when the next order is delivered. An option models the lost sales
case.
There are costs associated with replenishment, backorders and inventory level. We will
construct a simulation of this situation. The goal of the analysis might be to choose a reorder
point and lot size that minimizes the average daily cost. Simulation does not answer that question
directly, but it can be used to evaluate alternative choices.
The model is constructed by choosing the Build
Model command and filling in the dialog that is
presented. The model name can contain no spaces or
punctuation. The name is used to identify various
ranges on the worksheet and cannot be changed after
the worksheet is constructed. The default is to
backorder shortages, but the lost sales model is
obtained if that box is checked. The Control Simulation
box operates the inventory one period at a time and
the user makes reorder decisions. The initial inventory
is entered as a parameter, but it may changed on the
worksheet. The lead-time affects the simulation
structure and once it is defined here it cannot be easily
changed.

The Worksheet Model


Pressing the OK button on the model dialog, brings forth a second dialog that provides the
features of the multiline simulation model that will describe the process. The problem name is
fixed as the name given in the Model dialog and the parameters are set to their proper values.
The numbers of columns may be increased to accommodate additional model features, but they
should not be reduced or the program will not be able to build the inventory model.

14
As the worksheet is constructed, a third dialog will ask for the distribution of the demand. For
the example we suppose that the demand is normally distributed random variable with mean 25
per week and a standard deviation of 5. Pressing OK for this dialog, builds the worksheet for the
inventory model. All expressions are automatically placed in row 1 and the random variable and
parameter definitions are placed on the worksheet. The figure at the left shows the top corner of
the worksheet. The buttons control the operation of the simulation.

The parameters of the system are placed in columns B and C starting at row 16. The order
quantity (C17) and reorder point (C19) are the decision variables. The initial inventory is in C21
and the cost parameters are in C25, C27 and C29. The mean and standard deviation of the
demand are in C32 and C33. All these numbers may be changed to represent the system under
study.
The lead-time parameter in C23 is shown in yellow. This indicates that the lead-time should
not be changed. Changing the lead-time in C23will not affect the results because it is fixed in the
expressions defining the system. If you want to analyze the system with a different lead-time,
create another model.
The seed in F13 is used for Monte Carlo simulation. It controls the sequence of demands
realized for the simulation. Clicking the Simulate button changes the seed and produces a new
simulation run.
The Change button controls aspects of the simulation. An option useful here is the number of
observations in the simulation. The Chart button produces a chart of one of the simulated
columns.
At the top of the worksheet are simulation parameters in columns E and I. Results for the
simulation run are in column L.

15
The simulation model is shown in two parts below. This model has a single random variable
for demand governed by the simulated values in column F. The columns necessary for the
simulation are columns G through T. The model is simulated for 25 weeks, but only the first five
weeks are shown. The interesting result is in column T that shows the cost per week. The other
columns are necessary to determine the replenishment orders, backorder amounts and inventory
amounts.

The initial conditions are in the rows labeled -3 through 0. The only nonzero value shown is in
cell K10. This cell holds a formula that links its value to the initial inventory level in cell C21.

The cells in column V, W and X summarize the results for the 25 simulated weeks.

Row 1
The simulation is implemented by the formulas in table row 1, Row 19 on the worksheet. To
create the other rows of the simulation, we simply perform the Excel function Fill Down on the
simulation form. In this way all the rows have the same formulas as row 1, but displaced in
reference. A few of the cells are named for the formulas.
• Inv_1_Demand is the range {C31...C33}. This range identifies the normal distribution
for the demand and specifies the mean and standard deviation.
• Inv_1_r is the number in cell C19. This is the order point. When the inventory position
reaches the order point an order must be placed.
• Inv_1_Q is the number in cell C17. It is the order quantity that is placed at each
replenishment order.
• Inv_1_BO_Cost , Inv_1_Inv_Cost, and Inv_1_RO_Cost are in C25, C27 and C29
respectively. They are the cost parameters for the inventory system.

16
Column Quantity Formula

F Demand Random =SIM_rand(-F18)

Beginning
G =K18
Inventory
H Delivery =O15
Inventory +
I =G19+H19
Delivery
J Demand =MAX(ROUND(RV_sim(Inv_1_Demand,-F19),0),0)
K Ending Inventory =I19-J19
L On Order =L18-H19+O18
M Inventory Position =L19+K19
N Reorder =IF(M19<=Inv_1_r,1,0)
O Order Quantity =IF(N19=1,Inv_1_Q,0)
P Inv. Less Shortages =I19-J19
Q Fraction Backorder =IF(I19>0,IF(P19>0,0,-P19/ABS(J19)),IF(P19>0,-I19/ABS(J19),1))
R Back Orders =IF(Q19=1, -K19 -P19 /2,-MIN(K19,I19 )*Q19/2)
S On Hand =IF(Q19=0, K19 +J19 /2,MAX(K19,I19 )*(1-Q19)/2)
T Cost =S19*Inv_1_Inv_Cost + R19*Inv_1_BO_Cost + N19*Inv_1_RO_Cost

We identify several interesting cells in row 0 and row 1.


Cell Description
I18 This cell holds the initial inventory amount. It may be changed, as well as the other cells in
the initial rows of the model.
H19 This cell is interesting because it points several rows higher (earlier) in the simulation. Cell
H19 represents the replenishment amount received in day 1 and points to the order quantity
that occurred four days earlier (in cell M15). We are assuming here that orders are placed at
the end of the day and are available for sale three whole days later. The amount will be
available for sale during the fourth day following the order.
In general, expressions may point to any cell that describes the system earlier in time. It is
necessary to provide one more initial row than the lead-time. Otherwise the expression would
point to a non-numerical cell.
Expressions may also point to cells in row 1. It is good practice to only point to cells to the left
in row 1. Otherwise it is possible to create circular references. Excel does not allow this. It is
not reasonable to point to cells lower (later) in the simulation. Circular references will almost
certainly be created.
N19 This cell holds an "IF" expression, that returns 1 if the inventory position in cell M19 is less
than the reorder point. Thus it indicates if an order will be placed.
O19 This cell holds an expression that places the order quantity into the cell if the previous cell,
N19, is 1.

17
T19 This cell computes the cost per day based on the cost parameters and the decision to order,
the backorder amount and the inventory amount. Both of the latter are computed at the end
of the day.
By increasing the sample size, the model can be simulated for a large number of days to
determine the average cost of operating the inventory. The figure below shows the results of
1000 observations with a reorder point of 75 and an order quantity of 150. A number of rows and
columns are hidden for clarity. Whenever the ending inventory plus the amount on order is less
than 75 and order is placed. The order amount is 150.
At the top of the worksheet, the add-in has added summary information about the simulation
run. The cost of this policy is $111 per week. To use the simulation for decision making, we would
vary the reorder point and order quantity to minimize the total cost. Since the simulation is
dynamic, this can be done without rebuilding the model.

This model has been implemented as the Inventory Game using the Control option. The
student observes the results at the end of each week and makes real-time decisions regarding
the inventory policy.

18
Mortgage Model
The mortgage model builds a multiline structure that
computes the payments associated with a mortgage.
The model dialog accepts the loan amount, term in years
and annual interest rate. The model assumes payments
are monthly and the interest is paid each month on the
principal balance.
Pressing OK for this dialog, presents a second
dialog. Press OK on this dialog to build the worksheet
describing the mortgage payments. The worksheet
contains one more line than the number of monthly
payments. The model is interesting because there are no
random aspects. The simulation formulas implement the
standard annuity computations. The formulas in all the
lines are identical except for the relative references. Only
the first two years of payments are shown. The table has
61 rows.

One interesting feature of this simulation is that it incorporates a column for extra payments.
On the left we see parameters for the amount borrowed, the term in years and the interest per
year. These can be changed and the dynamic simulation will change accordingly. The
corresponding monthly term and interest are computed by formulas, as indicated by the yellow
color of these cells. The payment amount is computed with an Excel Financial function. The extra
payment value is a fixed amount that is entered in cell C28. The figure below shows the
simulation with an extra payment of $50 per month. As indicated, the extra payments reduce the
time of the last payment to 46 months. The total interest paid is also reduced.

19
The means and standard deviations of the columns are not interesting in this case, and we
have chosen not to show them. We do include other statistics in the third row of the statistics
area. The formula in cell F12 computes the time of the last payment. The cells in row 12 of G, H, I
and K compute the sums of the corresponding columns.

The parameters of the model in column C that are not colored yellow can be changed and the
spreadsheet values will adjust. The loan amount, term in years, the annual interest rate and the
extra payment each month are not colored yellow, so these parameters can be changed. The
yellow cells hold formulas. Although they can be changed, the formulas are lost. For example the
monthly payment is computed by an Excel financial function.

20
Production Model
The production model is adapted from a story in The Goal by Goldratt. We first describe the
story and then use the add-in to model the more general sequential production process. The story
involves three boy scouts playing with matches. The game involves throwing dice and passing
matches from one boy to the next. The scoutmaster is at the end of the line trying to light a fire
with the matches produced by the third boy.
We start with a big pile of matches to the left of the first boy. Boy 1 throws a single die. The
number showing is his production, so in this case the first boy produces 4 matches. These
matches are the raw materials for the second boy.

The second boy throws the die. His production capability is the amount shown on the die, but
he can only produce as much as available from the first boy. His production is the minimum of his
capability or the number remaining from the first boy. There are 4 matches available, but the
capacity of the second boy is only 2. He passes these to the third boy, leaving 2 matches
remaining. These two are called work in progress (WIP).

The raw materials for the third boy are the matches provided by the second boy. Again, he
produces the minimum on his die or the matches available. For this case the capacity of the third
boy is 5, but only 2 matches are available as raw material. The remaining 3 units of capacity are
wasted. This is disappointing to the third boy because his capacity was so much greater than his
production. There is no additional WIP.

The scoutmaster has a demand that also depends on the throw of the die. For the first
iteration, the scoutmaster demands 4 matches. The third boy has only produced 2, so the
scoutmaster takes these two. The unsatisfied demand is lost. The scoutmaster is disappointed
with the third boy who seems to be the bottleneck in this system.

21
In this first iteration, the system produces 2 matches. Two matches remain in the system as
WIP waiting for processing by boy 2. This WIP has already been processed by boy 1 and is
available to boy 2 for processing in the next iteration.
Goldratt told this story to illustrate the negative effects of statistical variation on a serial
production line. The simulation model allows the system to have as many stations as desired and
the statistical variation to be governed by any of the common probability distributions.

The Excel Model


This story describes a serial production system
with a specified number of stations. To create the
model in Excel, click the Production button on the
model dialog. The dialog has a field for Number of
Stations. The checkbox adds a feature to the model
that controls the flow of raw material into the system.
This is illustrated later. The Raw Material Supply field is
only relevant if this box is checked.
After clicking OK, the multiline dialog will be
presented. Click OK. Then a series of dialogs will be
presented asking about the probability distributions of
the production amount at each stage. The uniform
distribution representing the throw of a single die is the
default. The add-in finally constructs a spreadsheet
model of the multistage process. We illustrate the features below.

Parameters
The cost parameters of the model are below. We assume that
an iteration reflects a one-week interval. The first three entries
are the cost parameters. The inventory cost is the per unit cost
of WIP per week. The cost does not depend on the location of
the WIP in the process. The order cost is the cost of placing a
nonzero order for raw materials. For the example, this cost is
expended in every week. It is relevant when manual control of
reorders is controlled manually. The lost sales cost is the unit
cost of demand that is unmet by production.
We have chosen the integer-uniform distribution for demand
and production capacities. The integer-uniform distribution
models the throw of a die.

22
Worksheet
The worksheet illustrates a three-station example. Station 1 accepts raw material, performs its
operation and then passes the material to station 2. Station 2 performs a second operation and then passes
the material to station 3. After the operation at station 3 the material enters a finished good inventory. The
demanded quantity is withdrawn from this inventory. If demand is greater than the amount available, lost
sales are experienced. Because it has so many columns we present the worksheet in two parts.
Columns G through J hold the random numbers that govern the capacities for the three stations and the
finished good demand. Column K holds the materials purchased in each week. For the example, the
purchase amount is exactly the capacity of the first station. The input capacity is unlimited.

The station 1 information is outlined in blue. We review the equations for period 1, row 17 on the
worksheet. Column L holds the input WIP. It is equal to the output WIP of the previous period. Cell L17
holds a formula that is "=P16". Since station 1 always produces its capacity, the WIP is always 0. Column
M holds the amount of material available for production "=K17+L17". Column N holds the capacity for
production. This is a random amount taken from the RN1 random variable "=RV_sim(Prod_1_Cap1,-
G17)". Column O holds the actual production, "=MIN(M17,N17)". Column P holds the WIP available for
the next period, "=M17-O17". The results of station 1 are not too interesting, given that it produces an
amount equal to its capacity. Station 2 has more interesting results. The formulas for station 2 are the same
as for station 1, but the columns references are advanced by 5.
The columns for station 3 and the finished goods inventory are below. The formulas again are similar
to stations 1 and 2. Columns AF compute lost sales, "=MAX(0,AC17-AD17)", total WIP,
"=L17+Q17+V17+AA17", and total cost,
"=AG17*Prod_1_Inv_Cost+IF(K17>0,Prod_1_RO_Cost,0)+AF17*Prod_1_LS_Cost".

To the right of the station and demand simulation we see summary results for the 52 weeks simulated.
Although the mean production capacity at each station is 3.5 per week, the average sales per week is just

23
above 3. The average demand is 3.5 per week, so the lost sales are about 0.5. The average WIP per week is
about 20.4. The average time required for a match to move from station 1 to sales is the cycle time. By
Little's Law:
Cycle Time = WIP/Sales
For the example the average cycle time is about 6.8 weeks.

The results indicate that the sequential production process with statistical variability is not very
efficient. The effect of reducing variability is illustrated when we change the lower and upper limits on the
uniform distributions to 3 and 4. The random variables have the same mean values but much less variance.
The system results shown below are much better.

With integer variables we cannot reduce the variability to zero and maintain a mean value of 3.5 per
week, but we can set the lower and upper limits to 4. This eliminates variability, and results in an average
production rate of 4. When variability is eliminated, lost sales, WIP and cycle time all go to zero.

In this model, the minimum cycle time is 0, because material does not enter inventory if it passes
through the system in a single period.

Controlling Raw Material Flow


One suggestion for controlling a system such as
this is to control the input flow of raw material. This is
an option available for the model. To investigate this
option click the Control Raw Material box.
With the control option a new column is included
in the model shown as column AI below. The column
shown in green is the order quantity that will be
delivered in the next period. When the worksheet is
created this column has zero's except for the yellow
entry at the top. We have filled in the column with the
value 3. This puts a steady flow of 3 units into the
system at each period.

24
The results of the 52-week simulation are below. Since the average demand is 3.5, there will
be lost sales. Because of statistical variability there is still a considerable amount of WIP and
cycle time is greater than the minimum value of 0.

The control column is very general in that order quantities can be entered by hand or with
formulas. There are a number of questions one might explore with this model.
• What is the effect of reducing the variability of the production capacities?
• What is the effect of having more production stations? The model allows the analysis
of any number of stages.
• If one were to add more capacity, would be better at the beginning of the line or at
the end? Capacity is added by increasing the upper range on the uniform distribution.
• Can a similar simulation be constructed for a pull system of production, rather than
the push system illustrated here?
• Using the control column, how would you model a CONWIP inventory policy? This
policy orders raw materials in exactly the amounts sold in each period. The WIP
remains constant at the initial value throughout the simulation.
• Would it be useful to adopt an order level-order quantity policy? In some periods the
order quantity could be zero, thus reducing the reorder cost.

The Game
The control option is built into the Production Game provided as a template in the Template
section of this site. The game reveals the situation one week at a time. The student fills in the
order quantity during each period. The goal of the game is to select order quantities to minimize
the total cost of operating the system.

25
26
Fractals
The remarkable picture is
called a Fractal. Its points were
computed with the Simulation add-
in using two sets of two-
dimensional equations. The chart
was constructed automatically
using the chart option of Excel.
The fractal is constructed
using Iterated Function Systems
(IFS). The theory of the process is
described in a paper by J. C.
(Sprott, J.C., Automatic Generation
of Interacted Functions Systems,
Computers and Graphics, Vol. 18.
No. 3, pp 417-425). The 16
examples built into the add-in are
from this paper. The Sprott web
site has many illustrations of
fractals including the ones
programmed into the add-in.
To construct a fractal click the
Fractal button in the model dialog.
The Letter Code and Default Probability options are best for the new user. All the examples use 2
equations, but more equations can be used. The Model Number refers to the models described in
the Sprott paper. A number from 1 to 16 should be entered. The model parameters can be
changed after the worksheet is constructed. We use 1000 replications for the example, but that
number can be changed. After this dialog is accepted a second dialog sets the parameters for the
simulation. Click OK to accept the options provided.

After the worksheet is constructed, a third dialog follows with the options for the graph to be
constructed. We start the graph at row 20 to reject initial transients. You can experiment with the
line and point parameters, however, the parameters shown give the graph at the top of this page.
The Include Line option connects adjacent points, but the lines tend to confuse the chart.
Finally, pressing the OK button of the Graph dialog constructs the worksheet and builds the
chart.

27
The Worksheet
We use the example to describe the worksheet and show how the method works. In the figures,
some rows and columns are hidden for clarity. The hidden rows and columns may be unhidden
be the Unhide commands on the Format menu.
We see at the top of the worksheet the usual information about the simulation model. Clicking the
Change button allows the number of iterations to be changed. Clicking the Simulate button
regenerates the model with a new random number seed. Clicking the Chart button presents the
Graph dialog shown above so the chart parameters may be changed.

The method of Iterated Function Systems uses sets of linear equations also called linear affine
transformations. In two dimensions the general equations are below, where a, b, c, d, e, and f are
numerical parameters. The equations will be solved iteratively with (x, y) indicating the current
point and (x', y') the next point.

The first set of equations used for the example has the parameters a through f in row 19 of the
worksheet.

Following Sprott, the parameters are represented by a letter code where A represents the value -
1.2, B is -1.1, and so on. Each subsequent letter adds 0.1 to the parameter value. Thus Y
represents the largest value of 1.2. A little reflection will convince you that the letter code in row
15 is equivalent to the numeric code in row 19. The formulas in row 19 perform this translation.
Using letter coding a particular pair of linear equations is represented by a sequence of six letters.
Thus, the first set of equations is KJPSVU.
The method uses two or more of these sets of equations. The built-in examples all use two sets.
The second set for the case below has the code HDVJNR. Translating the letters we obtain the
equation set:

The method is applied sequentially. We start at an arbitrary solution, say (x, y) = (0,0). One of the
equation sets is chosen at random, say set 2. Using (x, y) = (0,0) we compute (x', y') = (0.1, 0.5).
Now we let (x, y) = (0.1, 0.5) and again choose set 2 to find the new point (x', y') = (-0.4, 0.44). .
Now we let (x, y) = (-0.4, 0.44) and choose set 1 to find the new point (x', y') = (0.848, 0.944).
We use the figure below to illustrate the process. We are choosing the equation sets at random

28
with equal probabilities. The figure below shows a sequence of 13 iterations. At each iteration we
draw a random number as shown in column F. If the number is less than 0.5, set 1 is used for the
transformation. If it is greater than 0.5, set 2 is used. The three calculations illustrated above are
shown as the first three rows of the table.

It happens that choosing the set with equal probabilities does not result in a very good chart.
Rather, it is better to choose the sets in proportion to their relative determinants of the Jacobian
matrices. The determinant is:

The determinants are computed in cells O18 and O19. For the example the determinants are
0.03 and 0.96. Since these do not sum to 1 we use the probabilities 0.03/0.99 = 0.0303 and
0.96/0.99 = 9697 for the selection. For the example, it is much more likely to choose equation set
2 for the transformation than set 1. The first 13 transformations all use set 2. The sequence
depends on the random number seed, so every time the simulation button is clicked a new series
is generated.

It is interesting that the chart at the top of the page looks very much the same for every sequence
and for every starting point. We skip the first 20 transformations when building the chart, so that
the initial conditions do not have much affect.
The two figures above show how the add-in handles the computations. The random number
determines the equation number and formulas transfer the equation coefficients to the body of the
table in columns H through M. The values of (x, y), in columns N and O, for one iteration are set
equal to the values of (x', y'), in columns P and Q, for the previous iteration. Columns P and Q
compute (x', y') from the coefficients in columns H through M.

Selecting Parameters
The entire computation is dynamic. Changing any equation parameter or the initial point
changes the entire table and the attached chart. This makes it easy to experiment with other
parameter selections.
It is amazing that simple linear equations, solved repeatedly with random selection results in

29
such interesting graphs. It is unfortunate, however, that many affine transformations result in
charts that appear as randomly placed dots. The purpose of the Sprott paper referenced above
was to automatically generate "good" sets. Sprott generated all possible sets using the letter
scheme noted above and discovered 16 sets that gave interesting pictures. He represented the
equation pairs by concatenating the two 6 letter sequences into 12 letters. Series 7 used for the
example has the code: "KJPSVUHDVJNR". The complete set is below.
"GNGUVETDSNWK", "GOHRHRNVFLNO", "IFEROWOSIRQI", "IIDQIKFMNUSK",
"IPUDJIHVEIQY", "KDOWQMMYEMWD", "KJPSVUHDVJNR", "KWMRVRUCOWWB",
"LGMRYBSCSSQR", "MCGMGGJQORXH", "NYDEQPKLOOKY", "RFUSIENLJVCN",
"RIGIEDMIBOWR", "TLPVPLMQEIFC", "TTGUJNMRLWBR", "UIPUDROEPLPM"
The chart for set 5 is below. More iterations provides a more detailed figure, but takes more
time to generate. Try the other series to get a complete set of charts. Experiment with more
iterations and try three or more equations.

30

You might also like