0% found this document useful (0 votes)
84 views21 pages

Lecture 3

This document provides a summary of modeling and simulation concepts through examples. It discusses three main steps to simulation: determining input characteristics, constructing a simulation table to systematically track the system over time, and running repetitions to generate input values and calculate responses. Queueing system and inventory system examples are presented to demonstrate how to set up and run simulations. Key details like distributions, logic, and formulas used in the simulations are explained. The examples analyze results to find performance measures like resource utilization and shortage occurrences.

Uploaded by

nada.akram156
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views21 pages

Lecture 3

This document provides a summary of modeling and simulation concepts through examples. It discusses three main steps to simulation: determining input characteristics, constructing a simulation table to systematically track the system over time, and running repetitions to generate input values and calculate responses. Queueing system and inventory system examples are presented to demonstrate how to set up and run simulations. Key details like distributions, logic, and formulas used in the simulations are explained. The examples analyze results to find performance measures like resource utilization and shortage occurrences.

Uploaded by

nada.akram156
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Modeling and

Simulation
Simulation Examples

LECTURE 3
BY DR. SAMAH A . Z. HASSAN
Recap
Three steps of the simulations
1. Determine the characteristics of each of the inputs to the simulation. Quite often, these may be
modeled as probability distributions, either continuous or discrete.

2. Construct a simulation table. Each simulation table is different, for each is developed for the
problem at hand.

3. For each repetition i, generate a value for each of the p inputs, and evaluate the function,
calculating a value of the response yi. The input values may be computed by sampling values from
the distributions determined in step 1. A response typically depends on the inputs and one or more
previous responses.
Simulation Table
The simulation table provides a systematic method for tracking system state over time.
Inputs Response

Repetitions Xi1 Xi2 … Xij … Xip yi

1
2

·
·

n
2.1 Simulation of Queueing Systems (1)

Server
Waiting Line
Calling population

Fig. 2.1 Queueing System

A queueing system is described by its calling population, the nature of the arrivals, the
service mechanism, the system capacity, and the queueing discipline.
2.1 Simulation of Queueing Systems (24)
Example 2.2 The Able Baker Carhop Problem
Able

Baker

▪ 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.
2.1 Simulation of Queueing Systems (25)
Example 2.2 (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.
2.1 Simulation of Queueing Systems (26)

Example 2.2 (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)
2.1 Simulation of Queueing Systems (27)

Example 2.2 (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().

F10 = IF ( D10  MAX ( H $1 : H 9), D10, IF ( D10  MAX ( K $1 : K 9), "" ,


MIN ( MAX ( H $1 : H 9), MAX ( K $1 : K 9))))

◼ 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.
2.1 Simulation of Queueing Systems (28)

Example 2.2 (Cont.)


◦ 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, "")
2.1 Simulation of Queueing Systems (29)

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.
2.2 Simulation of Inventory Systems (3)

Example 2.3 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.
2.2 Simulation of Inventory Systems (4)

Example 2.3 (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:

 revenue   cost of   lost profit from   salvage from sale 


Pofit =   −   −   +  
 from sales   newspapers   excess demand   of scrap papers 

◼ 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.
2.2 Simulation of Inventory Systems (5)
2.2 Simulation of Inventory Systems (6)

Example 2.3 (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.
2.2 Simulation of Inventory Systems (7)

Example 2.4 Simulation of an (M,N) Inventory System


◦ This example follows the pattern of the probabilistic order-level inventory system shown in
Figure 2.7.
◦ 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.
◦ In this example, 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.
2.2 Simulation of Inventory Systems (8)

Example 2.4 (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.
2.2 Simulation of Inventory Systems (9)
Example 2.4 (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 Inventory of Ending Inventory of 2 + new order


=
Third day day in first 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.
21

Any
Questions

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy