Docsity

Discrete Systems Modeling and Simulation: Simulation Examples, Lecture notes of Business Systems

Toggle sidebar
bg1
COP 4300/CAP 5805: Discrete Systems Modeling and Simulation
Simulation Examples (notes: textbook - Chapter 2)
Basic Procedure for hand calculation:
1. Determine the input characteristics
2. Use this information to construct a "simulation table"
typically in the format:
Repetition # Inputs Response
x1, x2, . . ., xn y
1
2
3
.
.
.
t
3. For each repetition, generate values for the inputs and calculate the
response
Example 1: A single server queue:
population
waiting line server
(queue)
Assumptions:
1. The population is infinite
i.e., the arrival rate is unaffected by population size
2. Arrivals are one at a time (in random fashion) in accord with
some (fixed) probability distribution
3. Service times are of some (random) length in accord with some
(fixed) probability distribution
4. System capacity is unlimited
5. Service is in order of arrival (FIFO - First-In, First-Out)
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Discrete Systems Modeling and Simulation: Simulation Examples and more Lecture notes Business Systems in PDF only on Docsity!

COP 4300/CAP 5805: Discrete Systems Modeling and Simulation

Simulation Examples ( notes: textbook - Chapter 2 )

Basic Procedure for hand calculation :

  1. Determine the input characteristics
  2. Use this information to construct a "simulation table" typically in the format:

Repetition # Inputs Response x 1 , x 2 ,.. ., xn y 1 2 3... t

  1. For each repetition, generate values for the inputs and calculate the response

Example 1 : A single server queue:

population

waiting line server (queue) Assumptions :

  1. The population is infinite i.e., the arrival rate is unaffected by population size
  2. Arrivals are one at a time (in random fashion) in accord with some (fixed) probability distribution
  3. Service times are of some (random) length in accord with some (fixed) probability distribution
  4. System capacity is unlimited
  5. Service is in order of arrival (FIFO - First-In, First-Out)

Systems Components for Example 1

Entity (item of interest)

  1. customer
  2. server Attribute (characteristic of an entity)
  3. service needed (customer)
  4. mean service time for a service (server) Activity (process causing change, given by a period of specified length)
  5. preparing service materials (customer)
  6. serving customer (server) Event (discrete occurrence that may change system state)
  7. arrival of a customer (endogenous event)
  8. initiation of service (endogenous event)
  9. completion of service (endogenous event) State (collection of variables needed to describe the system at any point in time that an event occurs in order to handle the event)
  10. server state (busy or idle)
  11. customer queue (first and last, empty or not empty) Remarks: a) on an arrival event, the server state is needed to determine whether to queue the customer or have an initiation of service event. b) on a completion of service event, the queue state is needed to determine whether to have an initiation of service event or go idle

Food for thought : In providing outcomes information for average customer queue times, if a customer arrives and the server is idle, do we log 0 time on queue? i.e., do we reflect the customer as having been in line for 0 time?

Trial Run for Example 1

Suppose arrival times occur with uniformly distributed interarrival times (times between consecutive customers) with the values 1 through 6; note that the expected value of the interarrival time is

[to be uniformly distributed, each possible interarrival time (1,2,3,4,5,6) must be equally likely, and so has the same probability (1/6)].

For stability , the expected service time must be less than the expected interarrival time.

Suppose service times uniformly distribute among 1,2,3,4 (so the expected value of the service time is 10/4 = 2.5).

Suppose 6 customers are introduced to the system, with randomly obtained interarrival times and service times (acquired randomly, say by rolling a die) as follows:

customer interarrival time service time arrival time on clock 1 - 2 0 2 2 1 2 3 4 3 6 4 1 2 7 5 2 1 9 6 6 4 15

Then the Simulation Table is as follows:

customer arrival service time service begins service ends (clock) (clock) (clock) 1 0 2 0 2 2 2 1 2 3 3 6 3 6 9 4 7 2 9 11 5 9 1 11 12 6 15 4 15 19

i i 6

E

6

1

6

1

× = =

= āˆ‘ Ɨ āˆ‘

Timeline of simulation:

x x x x x x x x x x 0 5 10 15 20 a(1) d(1) a(3) d(3) a(6) d(6)

a(2) d(2) a(4) d(4)

a(5) d(5)

customer is in system customer is receiving service customer is in queue

Graphical representation of the simulation:

c4 c 1 c1 c2 c3 c4 c5 c x x x x x x x x x x 0 2 3 5 6 7 9 10 11 12 15 19 20

Typical Findings from the "Simulation"

  1. Average waiting time (for those who waited):
  2. Probability a customer had to wait :
  3. Percentage of time the server was idle :
  4. Average time in system (time in queue + service time):
  5. Average service time :
  6. Average time between arrivals :

Input

Characteristics ( can be predicted

on queue

#ofcustomerswhowaited

time inqueue(aggregate)

#ofcustomers

whowaited

= =

totaltime

idle time = =

  1. 2 (2.5istheexpected value) 6

#ofcustomers

total servicetime = =

  1. 0 (3.5is expected) 5

#ofcustomers- 1

interarriv altimes = =

#ofcustomers

customer times = =

Simulation Statistics

Other Examples :

I. Inventory System : Every N units of time, inventory is checked, at which time an order is made to bring inventory up to level M.

inventory

Assumptions: Lead time is 0 between making and receiving an order. Demand is uniform over each N unit review interval (linear decrease). N N N time

amount Qi to order : backorder

Remarks: There are costs associated with

  1. excess inventory
  2. more frequent review (making N smaller)
  3. running short on inventory

The model can measure performance (cost/profit) with M and N adjusted as inputs.

At the end of each period i , an order quantity Qi = M – inventory is made.

Assumptions:

  1. Lead time is 0 (time between making and receiving an order)
  2. Demand is uniform over a review period (linear decrease)

M

II. Vendor : A newspaper seller buys papers for 13Ā¢ and sells them for 20Ā¢. Unsold papers go for scrap at 2Ā¢. Papers are purchased in bundles of 10. There are 3 types of newsdays: "good", "fair", and "poor" with probabilities 0.35, 0.45, and 0.2. The demand distributes as follows:

Demand good day fair day poor day 40 .03 .10. 50 .05 .18. 60 .15 .40. 70 .20 .20 .12 may want to interpolate 80 .35 .08. 90 .15 .04. 100 .07 .00. 1.00 1.00 1.

Question: What is the optimal number of papers to purchase? (potential profit = revenue - cost of newspapers - lost profit from excess demand + salvage)

debatable: 7Ā¢ per copy

Procedure: Use as input the number of papers purchases - run the simulation over an extended period (say a month) to estimate the profit. Increase the purchase until a profit decrease occurs.

Simulation Procedure :

Simulate long enough for at least 12 repair events, say 20,000 hours. Then model a) the current repair tactic (bearings treated separately) b) the proposed repair tactic (or other variations) and compare the simulation outcomes.

Simulation Setup :

a) Bearing treated separately - assume no two bearings ever fail simultaneously

Bearing 1 Bearing 2 Bearing 3 life accum repair life accum repair life accum repair life delay life delay life delay

b) Bearings as a group

Bearing life hours to a failure repair 1 2 3 (min of bearing life) delay

step through 20,000 hours event to event

step through 20,000 hours event to event

IV. Bomb Dispersal : A squadron of bombers is attempting to destroy an ammunition depot shaped as follows: y 500

-500 500 x

The aiming point is (0,0), but a bomb which falls anywhere within the target is scored a hit. Assume that the bombs are normally distributed in the x direction with a standard deviation of 600 and are normally distributed in the y direction with a standard deviation of 300 (mean of the distribution is 0 in each case). Ten bombers are in a squadron, and each drops 1 bomb. How many of a squadron's bombs may we expect to hit the target in a bombing run (may also be handled analytically).

Simulation setup :

Bomber random normal x random normal y result (hit or miss) 1 2 . . . 10