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

2 Simulation Examples-2025

The document discusses key concepts in simulation, including modeling inputs, events, and outputs, as well as the use of random numbers to represent uncertainty. It provides various simulation examples, such as queueing systems, inventory systems, and reliability problems, illustrating how to analyze system performance using simulation tables. The overall aim is to demonstrate the application of simulation techniques in different industrial contexts.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

2 Simulation Examples-2025

The document discusses key concepts in simulation, including modeling inputs, events, and outputs, as well as the use of random numbers to represent uncertainty. It provides various simulation examples, such as queueing systems, inventory systems, and reliability problems, illustrating how to analyze system performance using simulation tables. The overall aim is to demonstrate the application of simulation techniques in different industrial contexts.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 41

Industrial Systems Engineering - International University – VNU-HCM

Simulation Examples in a Spreadsheet


Book: Jerry Bank’s chapter 2

Dr. Pham Huynh Tram & Dr. Tran Duc Vi, Feb 2025

Discrete-Event System Simulation 1


Purpose
To illustrate some of the key concepts in simulation:

- way of thinking of a model in terms of inputs, events, states,


outputs/responses
- use of random numbers to represent uncertainty
- descriptive statistics for predicting system performance

2
Simulation Model (example)

3
Outline

Randomness

The simulations are carried out by following steps:


- Determine the input characteristics and response
- Construct a simulation table.
- For each repetition i, generate a value for each input, evaluate
the function, and calculate the value of the of the response y i.

4
Simulation examples:

● queueing (single and two-server system)


● inventory
● reliability and network analysis.

5
1. Simulation of Queueing Systems

How to describe a queueing system?

How to evaluate the performance of a queuing system?

6
2.1 Simulation of Queueing Systems

Example 1: Single-Channel Queue


Grocery store with only one checkout counter.
▪ Customers arrive at random times from ▪ The service times vary from 1 to 6
1 to 8 minutes apart, with equal minutes,
probability of occurrence: with probabilities:

What are the average waiting time, time spent in the grocery, server idle time?
7
Example 1: Single-Channel Queue (cont)

How to simulate the randomness (probability) of


arrival time and service time?

8
Examples of simulating probability of an event

9
Example 1: Single-Channel Queue (cont)

Grocery store with only one checkout counter.


▪ Customers arrive at random times from
1 to 8 minutes apart, with equal ▪ The service times vary from 1 to 6
probability of occurrence: minutes,
with probabilities:

relation? relation?

10
11
Example 1: Single-Channel Queue (cont.)

▪ Generate time-between-arrivals

12
Example 1: Single-Channel Queue (cont.)
▪ Generate service times

13
Example 1: Single-Channel Queue (cont)

14
Example 1: Single-Channel Queue (cont.)

15
1. Simulation of Queueing Systems

Example 2: The Able Baker Carhop Problem

▪ A drive-in restaurant where carhops take orders and bring food to the car.
▪ Assumptions
• Cars arrive in the manner shown in Table 2.11.
• Two carhops Able and Baker - Able is better able to do the job and works a
bit faster than Baker.
• The distribution of their service times is shown in Tables 2.12 and 2.13.

16
Example 2: The Able Baker Carhop Problem (cont)

– A simplifying rule is that Able


gets the customer if both
carhops are idle.
?
– If both are busy, the customer
begins service with the first
server to become free.

– To estimate the system


measures of performance, a ?
simulation of 1 hour of
operation is made.

– The problem is to find how


well the current arrangement is
working. ?

17
?

18
Example 2: The Able Baker Carhop Problem (cont)

– The row for the first customer is filled in manually, with the random-number
function RAND( ) in case of Excel or another random function replacing the
random digits.

– After the first customer, the cells for the other customers must be based on
logic and formulas. For example, the “Clock Time of Arrival” (column D) in
the row for the second customer is computed as follows:
D2 = D1 + C2

– The logic to computer who gets a given customer can use the Excel macro
function IF(), which returns one of two values depending on whether a
condition is true or false.
IF( condition, value if true, value if false)

19
Example 2: The Able Baker Carhop Problem (cont)

– The logic requires that we compute when Able and Baker will become
free, for which we use the built-in Excel function for maximum over a
range, MAX().

■ If the first condition (Able idle when customer 10 arrives) is true, then the
customer begins immediately at the arrival time in D10. Otherwise, a
second IF() function is evaluated, which says if Baker is idle, put nothing
(..) in the cell. Otherwise, the function returns the time that Able or Baker
becomes idle, whichever is first [the minimum or MIN() of their respective
completion times].

■ A similar formula applies to cell I10 for “Time Service Begins” for Baker.

– For service times for Able, you could use another IF() function to make the
cell blank or have a value:
G10 = IF(F10 > 0,new service time, "")
H10 = IF(F10 > 0, F10+G10, "") 20
Example 2: The Able Baker Carhop Problem (cont)

● The analysis of Table 2.14 results in the following:


– Over the 62-minute period Able was busy 90% of the time.

– Baker was busy only 69% of the time. The seniority rule keeps Baker less busy
(and gives Able more tips).

– Nine of the 26 arrivals (about 35%) had to wait. The average waiting time for all
customers was only about 0.42 minute (25 seconds), which is very small.

– Those nine who did have to wait only waited an average of 1.22 minutes, which
is quite low.

– In summary, this system seems well balanced. One server cannot handle all the
diners, and three servers would probably be too many. Adding an additional
server would surely reduce the waiting time to nearly zero. However, the cost of
waiting would have to be quite high to justify an additional server.

21
Example 2: The Able Baker Carhop Problem (cont)

● The analysis of Table 2.14 results in the following:


– Over the 62-minute period Able was busy 90% of the time.

– Baker was busy only 69% of the time. The seniority rule keeps Baker less busy
(and gives Able more tips).

– Nine of the 26 arrivals (about 35%) had to wait. The average waiting time for all
customers was only about 0.42 minute (25 seconds), which is very small.

– Those nine who did have to wait only waited an average of 1.22 minutes, which
is quite low.

– In summary, this system seems well balanced. One server cannot handle all the
diners, and three servers would probably be too many. Adding an additional
server would surely reduce the waiting time to nearly zero. However, the cost of
waiting would have to be quite high to justify an additional server.

22
2. Simulation of Inventory Systems
A simple inventory system, an (M, N) inventory system:

● This inventory system has a


periodic review of length N, at
which time the inventory level
is checked.
● An order is made to bring the
inventory up to the level M.

What is random in an inventory system?


What are assumptions in the figure above?
What are you interested to know?
23
2.2 Simulation of Inventory Systems (8)

Example 3: Simulation of an (M,N) Inventory System

– Suppose that the maximum inventory level, M, is 11 units and the review
period, N, is 5 days. The problem is to estimate, by simulation, the
average ending units in inventory and the number of days when a
shortage condition occurs.
– The distribution of the number of units demanded per day is shown in
Table 2.19.
– Lead time is a random variable, as shown in Table 2.20.
– Assume that orders are placed at the close of business and are received
for inventory at the beginning of business as determined by the lead time.

24
Example 3: Simulation of an (M,N) Inventory System (cont.)

– For purposes of this example, only five cycles will be shown.


– The random-digit assignments for daily demand and lead time are shown
in the rightmost columns of Tables 2.19 and 2.20.

25
26
Example 3: Simulation of an (M,N) Inventory System (cont.)

– The simulation has been started with the inventory level at 3 units and an
order of 8 units scheduled to arrive in 2 days' time.

Beginning Ending Inventory


= + new order
Inventory of Third of 2 day in first
day cycle

■ The lead time for this order was 1 day.

■ Notice that the beginning inventory on the second day of the third cycle
was zero. An order for 2 units on that day led to a shortage condition. The
units were backordered on that day and the next day also. On the morning
of day 4 of cycle 3 there was a beginning inventory of 9 units. The 4 units
that were backordered and the 1 unit demanded that day reduced the
ending inventory to 4 units.
■ Based on five cycles of simulation, the average ending inventory is
approximately 3.5 (88 ÷ 25) units. On 2 of 25 days a shortage condition
existed.
27
2. Simulation of Inventory Systems

Example 4: The Newspaper Seller’s Problem


– A classical inventory problem concerns the purchase and sale of newspapers.
– The paper seller buys the papers for 33 cents each and sells them for 50
cents each. (The lost profit from excess demand is 17 cents for each paper
demanded that could not be provided.)
– Newspapers not sold at the end of the day are sold as scrap for 5 cents each.
(the salvage value of scrap papers)
– Newspapers can be purchased in bundles of 10. Thus, the paper seller can
buy 50, 60, and so on.
– There are three types of newsdays, “good,” “fair,” and “poor,” with
probabilities of 0.35, 0.45, and 0.20, respectively.

28
Example 4: The Newspaper Seller’s Problem (cont.)

– The problem is to determine the optimal number of papers the newspaper


seller should purchase.
– This will be accomplished by simulating demands for 20 days and
recording profits from sales each day.
– The profits are given by the following relationship:

■ The distribution of papers demanded on each of these days is given in


Table 2.15.
■ Tables 2.16 and 2.17 provide the random-digit assignments for the types
of newsdays and the demands for those newsdays.

29
Example 4: The Newspaper Seller’s Problem (cont.)

30
Can we increase this profit?

31
Example 4: The Newspaper Seller’s Problem (cont.)

– The simulation table for the decision to purchase 70 newspapers is shown in


Table 2.18.
– The profit for the first day is determined as follows:
Profit = $30.00 - $23.10 - 0 + $.50 = $7.40
● On day 1 the demand is for 60 newspapers. The revenue from the sale of 60
newspapers is $30.00.
● Ten newspapers are left over at the end of the day.
● The salvage value at 5 cents each is 50 cents.
– The profit for the 20-day period is the sum of the daily profits, $174.90. It can
also be computed from the totals for the 20 days of the simulation as follows:
– Total profit = $645.00 - $462.00 - $13.60 + $5.50 = $174.90
– The policy (number of newspapers purchased) is changed to other values and the
simulation repeated until the best value is found.

32
3. Example of Simulation of Reliability Problem

Example 5: A Reliability Problem

■ Lifetime of bearings used in a mill is random


■ The delay time of the repair person's arriving at the milling
machine is random
■ Downtime for the mill is estimated at $5 per minute.
■ The direct on-site cost of the repair person is $15 per hour.
■ It takes 20 minutes to change one bearing, 30 minutes to
change two bearings, and 40 minutes to change three bearings.
■ The bearings cost $16 each.
■ A proposal has been made to replace all three bearings
whenever a bearing fails.

33
Example 5: A Reliability Problem (cont.)

■ The delay time of the repair person's


arriving at the milling machine is also a
random variable, with the distribution
given in Table 2.23.

■ The cumulative distribution function of


the life of each bearing is identical, as
shown in Table 2.22.

34
35
Example 5: A Reliability Problem (cont.)

– Table 2.24 represents a simulation of 20,000 hours of operation under the current
method of operation.

– Note that there are instances where more than one bearing fails at the same time.

– This is unlikely to occur in practice and is due to using a rather coarse grid of
100 hours.

– It will be assumed in this example that the times are never exactly the same, and
thus no more than one bearing is changed at any breakdown. Sixteen bearing
changes were made for bearings 1 and 2, but only 14 bearing changes were
required for bearing 3.

36
Example 5: A Reliability Problem (cont.)

– The cost of the current system is estimated as follows:


● Cost of bearings = 46 bearings × $16/bearing = $736
● Cost of delay time = (110 + 125 + 95) minutes × $5/minute = $1650
● Cost of downtime during repair =
46 bearings × 20 minutes/bearing × $5/minute = $4600
● Cost of repair persons =
46 bearings × 20 minutes/bearing × $15/60 minutes = $230
● Total cost = $736 + $1650 + $4600 + $230 = $7216

– Table 2.25 is a simulation using the proposed method. Notice that bearing
life is taken from Table 2.24, so that for as many bearings as were used in
the current method, the bearing life is identical for both methods.

37
38
Example 5: A Reliability Problem (cont.)

– Since the proposed method uses more bearings than the current method, the second
simulation uses new random digits for generating the additional lifetimes.

– The random digits that lead to the lives of the additional bearings are shown above
the slashed line beginning with the 15th replacement of bearing 3.

– The total cost of the new policy :


● Cost of bearings = 54 bearings × $16/bearing = $864
● Cost of delay time = 125 minutes × $5/minute = $625
● Cost of downtime during repairs = 18 sets × 40 minutes/set × $5/minute =
$3600
● Cost of repairpersons = 18 sets × 40 minutes/set × $15/60 minutes = $180
● Total cost = $864 + $625 + $3600 + $180 = $5269

– The new policy generates a savings of $1947 over a 20,000-hour simulation. If the
machine runs continuously, the simulated time is about 2 1/4 years. Thus, the
savings are about $865 per year.
39
Summary
● This lesson introduced simulation concepts via examples in
order to illustrate general areas of application and to
motivate the remaining lessons of the course.

● The examples illustrate the need for determining the


characteristics of the input data, generating random variables
from the input models, and analyzing the resulting response.

● Ad hoc simulation tables were used in completing each


example. Events in the tables were generated using
uniformly distributed random numbers.

40
More Questions to ponder
● How to simulate random events that we cannot come up
with the probability like in the given examples?

● How to translate the conceptual model (logic) into computer


(simulation) model for complicated cases that we cannot use
spreadsheet (excel)?

41

You might also like