Академический Документы
Профессиональный Документы
Культура Документы
1. Introduction to simulation
2. Examples of aplication
1. Introduction to simulation
1. Introduction to simulation
© Kleber Barcia V. 3
Chapter 1
© Kleber Barcia V. 4
Chapter 1
© Kleber Barcia V. 5
Chapter 1
© Kleber Barcia V. 6
Chapter 1
© Kleber Barcia V. 7
Chapter 1
Advantages of simulation …
© Kleber Barcia V. 8
Chapter 1
Advantages of simulation …
© Kleber Barcia V. 9
Chapter 1
Disadvantages of simulation …
© Kleber Barcia V. 10
Chapter 1
Manufacturing Applications
Semiconductor Fabrication
Construction Engineering and Project Management
Logistics Transport, and Distribution
Military Applications
Health Care simulation
Business process simulation
© Kleber Barcia V. 11
Chapter 1
© Kleber Barcia V. 12
Chapter 1
Components of a system
© Kleber Barcia V. 13
Chapter 1
A continuous system is
one in which the state
variable changes
continuously over time.
© Kleber Barcia V. 14
Chapter 1
Model of a system
© Kleber Barcia V. 15
Chapter 1
Types of models
DEFINE
MEASURE
ANALYSIS
IMPROVE
IMPLEMENT
CONTROL
2. Examples of application
Important concepts:
Workflow diagrams
© Kleber Barcia V. 20
Chapter 1
© Kleber Barcia V. 21
Chapter 1
Time between arrivals generated by throwing a Service time randomly generated in a range
dice five times from 1 to 4
© Kleber Barcia V. 22
Chapter 1
Simulation table
© Kleber Barcia V. 23
Chapter 1
© Kleber Barcia V. 25
Rev. 1
Chapter 1
77 51 30 38 20 86 83 42 99 01 68 41 48 27 74 51 90 81 39 80 72 89 35 79 07
19 50 23 71 74 69 97 92 02 88 55 21 02 97 73 74 28 77 52 51 65 34 46 84 15
21 81 85 93 13 93 27 88 17 57 05 68 67 31 56 07 08 28 50 46 31 85 33 52 52
51 47 46 64 99 68 10 72 36 21 94 04 99 13 45 42 83 60 91 91 08 00 74 55 49
99 55 96 83 31 62 53 52 41 70 69 77 71 28 30 74 81 97 81 42 43 86 07 30 34
33 71 34 80 07 93 58 47 28 69 51 92 66 47 21 58 30 32 98 22 93 17 49 50 72
85 27 48 08 93 11 30 32 92 70 28 83 43 41 37 73 51 59 04 00 71 14 84 30 43
84 13 38 96 40 44 03 55 21 66 73 85 27 00 91 61 22 26 05 61 62 32 10 84 23
56 73 21 62 34 17 39 59 61 31 10 12 39 16 22 85 49 65 75 60 81 60 74 88 80
65 18 85 68 06 87 64 88 52 61 34 31 36 58 61 45 87 52 10 69 85 64 53 72 77
38 00 10 21 76 81 71 91 17 11 71 60 29 29 37 74 21 96 40 49 65 58 17 96 98
37 40 29 63 97 01 30 47 75 86 56 27 11 00 86 47 32 46 26 05 40 03 79 74 38
97 12 54 03 48 87 08 33 14 17 21 81 53 92 50 75 23 76 20 47 15 50 91 95 78
21 82 04 11 34 47 14 33 40 72 64 63 88 59 02 49 13 90 64 41 03 85 67 12 52
73 13 54 27 42 95 71 90 90 35 85 79 47 42 96 08 78 98 81 56 64 69 89 92 02
07 63 87 79 29 03 06 11 80 72 96 20 74 41 56 23 82 19 95 38 04 71 38 69 94
60 52 88 34 41 07 95 41 98 14 59 17 52 06 95 05 53 35 21 39 61 21 32 64 55
83 59 63 56 55 06 95 89 29 83 05 12 80 97 19 77 43 35 37 83 92 30 94 04 98
10 85 06 27 46 99 59 91 05 07 13 49 90 63 19 53 07 57 18 39 06 41 70 93 62
39 82 09 89 52 43 62 26 31 47 64 42 18 08 14 43 80 00 93 51 31 02 05 31 67
© Kleber Barcia V. 26
Chapter 1
Custo random Interarriv Custo random Interarriv Custo random Service Custo random Service
mer number al time mer number al time mer number time mer number time
2 913 8 12 093 1 2 10 1 12 94 5
3 727 6 13 607 5 3 74 4 13 79 4
4 015 1 14 738 6 4 53 3 14 05 1
5 948 8 15 359 3 5 17 2 15 79 5
6 309 3 16 888 8 6 79 4 16 84 4
7 922 8 17 106 1 7 91 5 17 52 3
8 753 7 18 212 2 8 67 4 18 55 3
9 235 2 19 493 4 9 89 5 19 30 2
10 302 3 20 535 5 10 38 3 20 50 3
© Kleber Barcia V. 27
Table of simulation. Exercise 1
Time
Time Waiting
Custome Interarriva Service Time service customer Idle time of
Arrival time service time in
r l time time ends spends in server
begins queue
the system
1 --- 0 4 0 0 4 4 0
2 8 8 1 8 0 9 1 4
3 6 14 4 14 0 18 4 5
4 1 15 3 18 3 21 6 0
5 8 23 2 23 0 25 2 2
6 3 26 4 26 0 30 4 1
7 8 34 5 34 0 39 5 4
8 7 41 4 41 0 45 4 2
9 2 43 5 45 2 50 7 0
10 3 46 3 50 4 53 7 0
11 1 47 3 53 6 56 9 0
12 1 48 5 56 8 61 13 0
13 5 53 4 61 8 65 12 0
14 6 59 1 65 6 66 7 0
15 3 62 5 66 4 71 9 0
16 8 70 4 71 1 75 5 0
17 1 71 3 75 4 78 7 0
18 2 73 3 78 5 81 8 0
19 4 77 2 81 4 83 6 0
20 5 82 3 83 1 86 4 0
68 56 124 18
Chapter 1
Example 1: Results
1 - 0.21 = 0.79
© Kleber Barcia V. 29
Chapter 1
Example 1: Results
a b 1 8
E ( A) 4.5 min
2 2
© Kleber Barcia V. 30
Chapter 1
Example 1: Results
© Kleber Barcia V. 31
Chapter 1
Example 1: Conclusions
© Kleber Barcia V. 32
Example 2: Queue system with two servers
A computer technical support center is staffed by two people, Abel and
Baker, who take calls and try to answer questions and solve computer
problems. The time between calls ranges from 1 to 4 min. Service time
varies depending on the employee between 2 to 6 min. Abel is more
experienced and can provide service faster than Baker. Abel has
priority to serving customers.
Analyze the system. Simulate an hour of work.
Baker. Service time distribution
Service Cumulative Random
Probability
time probability digits
3 0.35 0.35 01-35
Interarrival distribution of calls
4 0.25 0.6 36-60
Interarrival Cumulative Random
Probability 5 0.20 0.8 61-80
time probability digits
1 0.25 0.25 01-25 6 0.20 1.00 81-00
1 ---- ---- 0 95 0 5 5 0
2 26 2 2 21 2 3 5 0
3 98 4 6 51 6 3 9 0
4 90 4 10 92 10 5 15 0
5 26 2 12 89 12 6 18 0
6 42 2 14 38 15 3 18 1
7 74 3 17 13 18 2 20 1
8 80 3 20 61 20 4 24 0
9 68 3 23 50 23 4 27 0
10 22 1 24 49 24 3 27 0
11 48 2 26 39 27 3 30 1
12 34 2 28 53 28 4 32 0
13 45 2 30 88 30 5 35 0
14 24 1 31 01 32 3 35 1
15 34 2 33 81 35 4 39 2
16 63 2 35 53 35 4 39 0
17 38 2 37 81 39 4 43 2
18 80 3 40 64 40 5 45 0
19 42 2 42 01 43 2 45 1
20 56 2 44 67 45 4 49 1
21 89 4 48 01 48 3 51 0
22 18 1 49 47 49 3 52 0
23 51 2 51 75 51 5 56 0
24 71 3 54 57 54 3 57 0
25 16 1 55 87 56 6 62 1
26 92 4 59 47 59 3. 62 ------ 0.
56 43 11
Chapter 1
Example 2: Conclusions
© Kleber Barcia V. 35
Chapter 1
The newspaper seller buys newspapers for 33 cents each and sells
them for 50 cents each
Newspapers not sold at the end of the day are returned for 5 cents each
Newspapers are purchased in packs of 10
There is 3 types of probability:
Good day = 35 %
Fair days = 45 %
Poor days = 20 %
What is the optimum amount of newspapers that the seller must buy?
Run a simulation for 20 days and calculate profits
© Kleber Barcia V. 37
Rev. 1
Chapter 1
© Kleber Barcia V. 38
Table of simulation of purchase and sale of 70 newspapers
Salvage from
Random # Type of Random # Revenue Lost profit from Daily
Day Demand sale returned
Days days Demand from sales excess demand gain
papers
1 94 Poor 80 60 30.00 --- 0.50 7.40
2 77 Fair 20 50 25.00 --- 1.00 2.90
3 49 Fair 15 50 25.00 --- 1.00 2.90
4 45 Fair 88 70 35.00 --- --- 11.90
5 43 Fair 98 90 35.00 3.40 --- 8.50
6 32 Good 65 80 35.00 1.70 --- 10.20
7 49 Fair 86 70 35.00 --- --- 11.90
8 00 Poor 73 60 30.00 --- 0.50 7.40
9 16 Good 24 70 35.00 --- --- 11.90
10 24 Good 60 80 35.00 1.70 --- 10.20
11 31 Good 60 80 35.00 1.70 --- 10.20
12 14 Good 29 70 35.00 --- --- 11.90
13 41 Fair 18 50 25.00 --- 1.00 2.90
14 61 Fair 90 80 35.00 1.70 --- 10.20
15 85 Poor 93 70 35.00 --- --- 11.90
16 08 Good 73 80 35.00 1.70 --- 10.20
17 15 Good 21 60 30.00 --- 0.50 7.40
18 97 Poor 45 50 25.00 --- 1.00 2.90
19 52 Fair 76 70 35.00 --- --- 11.90
20 78 Fair 96 80 35.00 1.70 --- . 10.20
$645.00 $13.56 $5.50 $174.90
Chapter 1
M = 11 units
N = 5 days
Initial inventory = 3 units
An order of 8 units of inventory is about
to arrive in two days
Simulate 25 days and calculate the average
ending inventory and the number of days
that there is no inventory for production
(shortage)
Random digits for daily demand
Random digits for lead time
Cumulative Random
Demand Probability Lead time Cumulative Random
probability digits Probability
(days) probability digits
0 0.10 0.10 01-10
1 0.6 0.6 1-6
1 0.25 0.35 11-35
2 0.35 0.70 36-70 2 0.3 0.9 7-9
© Kleber Barcia V. 40
Table: The inventory system simulation
Beginning Random digits Ending Shortage Pending Random digits Days until order
Cycle Day Demand
inventory Demand inventory quantity order Lead time arrives
1 1 3 24 1 2 0 --- --- 1
2 2 35 1 1 0 --- --- 0
3 9 65 2 7 0 --- --- ---
4 7 81 3 4 0 --- --- ---
5 4 54 2 2 0 9 5 1
2 1 2 03 0 2 0 --- --- 0
2 11 87 3 8 0 --- --- ---
3 8 27 1 7 0 --- --- ---
4 7 73 3 4 0 --- --- ---
5 4 70 2 2 0 9 0 3
3 1 2 47 2 0 0 --- --- 2
2 0 45 2 0 2 --- --- 1
3 0 48 2 0 4 --- --- 0
4 9 17 1 4 0 --- --- ---
5 4 09 0 4 0 7 3 1
4 1 4 42 2 2 0 --- --- 0
2 9 87 3 6 0 --- --- ---
3 6 26 1 5 0 --- --- ---
4 5 36 2 3 0 --- --- ---
5 3 40 2 1 0 10 4 1
5 1 1 07 0 1 0 --- --- 0
2 11 63 2 9 0 --- --- ---
3 9 19 1 8 0 --- --- ---
4 8 88 3 5 0 --- --- ---
5 5 94 4 1. 0 10 8 2
88
Chapter 1
Example 4: Results
© Kleber Barcia V. 42
Rev. 1
Chapter 1
Hours of life
Hours of life
Hours of life
Cumulative
Cumulative
Cumulative
Hours of life
Hours of life
Hours of life
delay time
delay time
delay time
Random #
Random #
Random #
Random #
Random #
Random #
(min.)
(min.)
(min.)
1 67 1,400 1,400 2 5 70 1,500 1,500 0 15 76 1,500 1,500 0 15
2 08 1,000 2,400 3 5 43 1,200 2,700 7 10 65 1,400 2,900 2 5
3 49 1,300 3,700 1 5 86 1,700 4,400 3 5 61 1,400 4,300 7 10
4 84 1,600 5,300 7 10 93 1,800 6,200 1 5 96 1,900 6,200 1 5
5 44 1,200 6,500 8 10 81 1,600 7,800 2 5 65 1,400 7,600 3 5
6 30 1,200 7,700 1 5 44 1,200 9,000 8 10 56 1,300 8,900 3 5
7 10 1,000 8,700 2 5 19 1,100 10,100 1 5 11 1,100 10,000 6 5
8 63 1,400 10,100 8 10 51 1,300 11,400 1 5 86 1,700 11,700 3 5
9 02 1,000 11,100 3 5 45 1,300 12,700 7 10 57 1,300 13,000 1 5
10 02 1,000 12,100 8 10 12 1,100 13,800 8 5 49 1,300 14,300 4 5
11 77 1,500 13,600 7 10 48 1,300 15,100 0 15 36 1,200 15,500 8 10
12 59 1,300 14,900 5 5 09 1,000 16,100 8 10 44 1,200 16,700 2 5
13 23 1,100 16,000 5 5 44 1,200 17,300 1 5 4 1,800 18,500 1 5
14 53 1,300 17,300 9 10 46 1,200 18,500 2 5 78 1,500 20,000 7 10
15 85 1,700 19,000 6 5 40 1,200 19,700 8 10
16 75 1,500 20,500 4 5. 52 1,300 21,000 5 5. ---
110 125 95
Chapter 1
© Kleber Barcia V. 45
Change of bearing using the proposed method
© Kleber Barcia V. 47
Chapter 1
10 bombers try to destroy a Military Fort which has the form shown in
the figure.
The heart of the Fort is the black dot in the figure. The point of impact
is assumed to be normally distributed with a standard deviation of
600 meters in the horizontal direction and 300 meters in the vertical
direction.
Simulate the operation and identify the impacts that would cause
destruction of the Military Fort in 10 runs
(-504,198)
(552,18)
950 m
400 m
500 m
1250 m
© Kleber Barcia V. 48
Chapter 1
x Z x y Z y
Where (x, y) are the coordinates of the site where the bomb falls.
σx = 600 and σy = 300
© Kleber Barcia V. 49
Chapter 1
x Z x
Normal Normal
Bomber random x random y Result
number number
x 600Z i 1 -0.84 -504 0.66 198 Miss
y 300Z j
5 -0.16 -96 0.23 69 Hit