Академический Документы
Профессиональный Документы
Культура Документы
GE-501
Page 2 of 34
Page 3 of 34
System
A system is a collection of objects (people, machine etc) joined in some regular
interaction or interdependence in order to serve a common goal.
State
The state of a system is the collection of variables necessary to describe a
system at a particular time, relative to the objectives of the study.
Discrete system
The state variables change instantaneously at separate points in time (e.g. bank).
Continuous system
The state variables change continuously with respect to time.
Physical models
Physical models are based on some analogy between such systems as
mechanical and electrical or electrical and hydraulic. In such models, the system
attributes can be voltage, shaft position etc.
Mathematical models
Mathematical models are based on symbolic notation and mathematical
equations (e.g. differential equations)
Static model
It shows only the values of the attributes when the system is in balance.
Dynamic model
It follows the changes over time.
Page 4 of 34
Analytical model
It uses the deductive reasoning of mathematics to solve a model (only certain
forms of equations can be solved).
Numerical methods
It applies computational procedures to solve equations.
Page 5 of 34
NO
describe the problem
define model
reasonable
?
simulate?
YES
plan the study
write a program
validate model
run model
reasonable
YES
more
runs?
NO
verify results
reasonable
?
Page 6 of 34
NO
YES
redefine model
stop
system
actual
model
physical
mathematical
dynamic
analytical
numerical
simulation
Advantages of simulation
Useful in absence of analytical models
Allows for estimating results for long time frame (projections).
Allows the change of operating conditions.
Disadvantages of simulation
If the model is not valid the results of simulation are useless.
Simulation models are usually expensive and time consuming.
For stochastic cases, many runs may be required to get good estimate.
Page 7 of 34
System simulation
System simulation is the technique of solving problems by the observation of
performance over time of a dynamic model or system.
To solve the integral using Monte Carlo method, we consider the rectangle
containing the function. The sides of the rectangle are c and b-a. We randomly
pick N points uniformly distributed within the rectangle and determine whether
these points are below or above the curve. If we find that n points are on or
below the curve, then we can say that n/N is equal to the area under the curve
divided by area of the rectangle.
Or
Page 8 of 34
Figure. Monte Carlo Method of finding the area under the curve.
Page 9 of 34
System Dynamics
System dynamics is a major concern in many fields. Understanding how the
response of a system can be changed is the key point to keep system under
control.
Studies of this nature with industrial systems used to be called industrial
dynamic studies. Urban studies led to urban dynamics and more recently, the
study of social and environmental problems led to what is called world
dynamics.
Since there is no major difference in the techniques used in these different areas,
the general name SYSTEM DYNAMICS is now being used.
Using Laplace,
This growth model with growth rate k is a first order differential equation
whose solution is an exponential function.
Page 10 of 34
Let
If at point A x(t)=a and at B, x(t)=2a, we will notice that the slope at B is twice
the slope at A. this is the nature of exponential growth. The growth rate is
directly proportional to current level.
If we take the logarithm of the variable or plot it in a semi-log paper, we should
obtain a straight line whose slope is the growth rate. Sometimes k is expressed
as,
Page 11 of 34
Page 12 of 34
Logistic Curves
The modified exponential curve still has an unrealistic feature. The maximum
slope occurs at the beginning. In the practice, the market starts with a small
slope and then increases as exponential growth and eventually the slope begins
to decline as in the case of the modified exponential growth. The result is an Sshaped curve.
Page 13 of 34
If we have some initial data of the market, we can find the best values of the
constants that fit the data to the model.
Home Phones
year
Time Delays
If a variable has a D time units of delay, it should include the following decay
equation,
Page 14 of 34
Page 15 of 34
Example 1
Suppose we collect data for the number of problems being solved correctly for a
small sample of a class of 30 students.
Number of
problems xi
1
2
3
4
5
Number of
students ni
6
5
3
10
6
Total students=30
Probability p(xi)
0.2
0.167
0.1
0.333
0.2
Cumulative
distribution P(xi)
0.2
0.367
0.467
0.8
1
Page 16 of 34
And by definition,
The cumulative distribution function is the probability that the random variable
is less than or equal to x and it is denoted by F(x).
Note: in discrete case, the mean (m) can be a number that cannot actually occur
as in the above example. For this case use the nearest feasible number to mean
value.
2- The mode
The mode is defined as the most frequently occurring value of a random
variable. When the probability density function has a peak, the value of x at
which the peak occurs is called the mode. If the function has more than one
peaks, then the mode is where the highest peak occurs.
In the previous discrete example mode is 4. In previous continuous example.
F(x)=0.5
For discrete example median =3 and for continuous example.
x=1.68
Example number
1
2
Mean
3.166
2
Mode
4
1
Median
3
1.68
Page 19 of 34
Exponential distribution
The CDF of exponential distribution is given by.
Since y is the CDF then it has the values between 0 and 1. If we use uniformly
distributed random numbers for y, then (1-y) will also be uniformly distributed.
. For
Normal Distribution
The CDF cannot be expressed in terms of a closed form function. However,
many different approximations can be used.
Generate U1 and U2
Let V1=2U1 -1 and V2=2U2 -1 and w= V12+ V22
If w>1 for to the step 1, otherwise Y=(-2ln(w))/w)1/2
X1=V1Y and X2=V2Y
Both Xs are normal random numbers
Page 21 of 34
Chi-Square Tests
It is the oldest goodness of fit hypothesis test.
Divide the entire range of fitted distribution into k adjacent intervals
Let Nj is the number of random variables in jth interval
Let mPj be the expected number of n random variables that would fall in
the jth interval.
59
26
24
18
12
5
4
3
3
2
N=156
Interval
Nj
mPj
1
2
3
0
1,2
3,4,5,6,7,9,11
59
50
47
53.96
58.38
43.66
0.471
1.203
0.256
1.93
From the table of chi square distribution for (n-1)=2 we get test value=4.6 for
10% confidence level. The value of our result is less so it passes the test.
Page 22 of 34
0.250
0.10153
0.57536
1.21253
1.92256
2.67460
3.45460
4.25485
5.07064
5.89883
6.73720
7.58414
8.43842
9.29907
10.16531
11.03654
11.91222
12.79193
13.67529
14.56200
15.45177
16.34438
17.23962
18.13730
19.03725
19.93934
20.84343
21.74940
22.65716
23.56659
24.47761
.500
0.45494
1.38629
2.36597
3.35669
4.35146
5.34812
6.34581
7.34412
8.34283
9.34182
10.34100
11.34032
12.33976
13.33927
14.33886
15.33850
16.33818
17.33790
18.33765
19.33743
20.33723
21.33704
22.33688
23.33673
24.33659
25.33646
26.33634
27.33623
28.33613
29.33603
0.750
1.32330
2.77259
4.10834
5.38527
6.62568
7.84080
9.03715
10.21885
11.38875
12.54886
13.70069
14.84540
15.98391
17.11693
18.24509
19.36886
20.48868
21.60489
22.71781
23.82769
24.93478
26.03927
27.14134
28.24115
29.33885
30.43457
31.52841
32.62049
33.71091
34.79974
0.900
2.70554
4.60517
6.25139
7.77944
9.23636
10.64464
12.01704
13.36157
14.68366
15.98718
17.27501
18.54935
19.81193
21.06414
22.30713
23.54183
24.76904
25.98942
27.20357
28.41198
29.61509
30.81328
32.00690
33.19624
34.38159
35.56317
36.74122
37.91592
39.08747
40.25602
0.950
3.84146
5.99146
7.81473
9.48773
11.07050
12.59159
14.06714
15.50731
16.91898
18.30704
19.67514
21.02607
22.36203
23.68479
24.99579
26.29623
27.58711
28.86930
30.14353
31.41043
32.67057
33.92444
35.17246
36.41503
37.65248
38.88514
40.11327
41.33714
42.55697
43.77297
Page 23 of 34
0.975
5.02389
7.37776
9.34840
11.14329
12.83250
14.44938
16.01276
17.53455
19.02277
20.48318
21.92005
23.33666
24.73560
26.11895
27.48839
28.84535
30.19101
31.52638
32.85233
34.16961
35.47888
36.78071
38.07563
39.36408
40.64647
41.92317
43.19451
44.46079
45.72229
46.97924
0.990
6.63490
9.21034
11.34487
13.27670
15.08627
16.81189
18.47531
20.09024
21.66599
23.20925
24.72497
26.21697
27.68825
29.14124
30.57791
31.99993
33.40866
34.80531
36.19087
37.56623
38.93217
40.28936
41.63840
42.97982
44.31410
45.64168
46.96294
48.27824
49.58788
50.89218
0.995
7.87944
10.59663
12.83816
14.86026
16.74960
18.54758
20.27774
21.95495
23.58935
25.18818
26.75685
28.29952
29.81947
31.31935
32.80132
34.26719
35.71847
37.15645
38.58226
39.99685
41.40106
42.79565
44.18128
45.55851
46.92789
48.28988
49.64492
50.99338
52.33562
53.67196
Arrival patterns
The common way of describing arrivals is in terms of inter-arrival time (the
interval between the two successive arrivals). If the arrival pattern is not
variable, then the inter-arrival time is constant. If the arrival pattern is
stochastic, then it is necessary to define the probability function of the interarrival times.
If n arrivals are simultaneous, then n-1 of them will have zero inter-arrival
times.
Let Ta= mean inter-arrival time
Page 24 of 34
Page 25 of 34
Example
Consider the following measurements of e-mail messages arrival.
Arrival number
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Inter-arrival time
12.5
2.6
29.0
18.5
2.7
2.3
3.4
21.5
14.0
8.5
21.4
6.3
8.5
11.3
4.7
5.7
6.9
1.8
3.4
9.9
1. Is it an exponential growth?
To test this, we arrange the inter-arrival time and plot it on a semilog paper. If
the resulting plot is linear, it is an exponential growth function and exponential
distribution.
2. Mean inter-arrival time
Page 26 of 34
Figure. Semilog graph of the above data showing that the above distribution is
exponential.
3. It is the Poisson distribution: t [0 , 200] minutes. Let us take 10
intervals 20 minutes each.
Time period
0-20
20-40
40-60
60-80
80-100
100-120
120-140
140-160
160-180
180-200
Number of arrivals
2
0
1
4
1
2
1
2
4
3
Page 27 of 34
Using the above formula and computing the probabilities for n=0,1,2,3,
Number of
arrivals in 20
min
0
1
2
3
4
5
A
Actual from
previous table
p(n)
Expected
arrivals
1
3
3
1
2
0
0.128
0.266
0.272
0.187
0.096
0.04
1.3
2.7
2.7
1.9
1.0
0.4
If we compare columns B and D, we notice that they are close. It means that
Poisson distribution is practical in representing arrivals.
Page 28 of 34
Page 29 of 34
System state
Simulation clock
Event list
Initialization
Timing routine
Event routine
Report generation
Main program
Problem Statement
Consider a single server queuing system for which the inter-arrival times are
independent, identically distributed (IID) random variables (A1, A2, A3).
The service times S1, S2, S3 are IID and independent of A1, A2, A3
Customers are chosen as FIFO (First In First Out). The simulation will end
when the nth customer enters service.
Definitions
d(n)= average delay in the queue of n customers completing their delays
q(n)= average number of customers in the queue but not being served=
continuous.
Q(t)=number of customers in the queue at the time t.
Ti= Total time in the queue of length i.
T(n)= T0+ T1+ T2
U(n)= Expected utilization (how much server is busy) of the server (0<U(n)<1)
B(t)= 1; if server is busy at time t
0; if server is idle at time t
Page 30 of 34
Simulation
Number Finish
served
(time)
Average
Delay (min)
Average
queue
length
1
2
3
4
5
6
7
8
9
10
484
475
484
483
455
461
451
486
502
475
1.53
1.66
1.24
2.34
2.00
1.69
2.69
2.86
1.70
2.60
1.52
1.62
1.23
2.34
1.89
1.56
2.50
2.83
1.74
2.50
8.12
8.14
8.19
8.03
8.03
8.32
8.09
8.19
8.15
8.24
Proportion of
customers
delayed <
5min
0.917
0.916
0.952
0.822
0.840
0.866
0.783
0.782
0.873
0.779
If the only one simulation run is used to draw conclusion, the results may be too
far from the reality due to the random nature of the output. One must know how
to correctly analyze the simulation results.
Example
Consider the simulation results for the bank queuing system. We would like to
find the approximate 90% confidence interval for the expected average delay of
a customer over a day.
Example
We would like to obtain a point estimate and an approximate 90% confidence
interval for the expected proportion of customers with a delay less than 5min.
Page 32 of 34
0.600
0.324920
0.288675
0.276671
0.270722
0.267181
0.264835
0.263167
0.261921
0.260955
0.260185
0.259556
0.259033
0.258591
0.258213
0.257885
0.257599
0.257347
0.257123
0.256923
0.256743
0.256580
0.256432
0.256297
0.256173
0.256060
0.255955
0.255858
0.255768
0.255684
0.255605
0.253347
0.750
1.000000
0.816497
0.764892
0.740697
0.726687
0.717558
0.711142
0.706387
0.702722
0.699812
0.697445
0.695483
0.693829
0.692417
0.691197
0.690132
0.689195
0.688364
0.687621
0.686954
0.686352
0.685805
0.685306
0.684850
0.684430
0.684043
0.683685
0.683353
0.683044
0.682756
0.674490
0.900
3.077684
1.885618
1.637744
1.533206
1.475884
1.439756
1.414924
1.396815
1.383029
1.372184
1.363430
1.356217
1.350171
1.345030
1.340606
1.336757
1.333379
1.330391
1.327728
1.325341
1.323188
1.321237
1.319460
1.317836
1.316345
1.314972
1.313703
1.312527
1.311434
1.310415
1.281552
0.950
6.313752
2.919986
2.353363
2.131847
2.015048
1.943180
1.894579
1.859548
1.833113
1.812461
1.795885
1.782288
1.770933
1.761310
1.753050
1.745884
1.739607
1.734064
1.729133
1.724718
1.720743
1.717144
1.713872
1.710882
1.708141
1.705618
1.703288
1.701131
1.699127
1.697261
1.644854
Page 33 of 34
0.975
12.70620
4.30265
3.18245
2.77645
2.57058
2.44691
2.36462
2.30600
2.26216
2.22814
2.20099
2.17881
2.16037
2.14479
2.13145
2.11991
2.10982
2.10092
2.09302
2.08596
2.07961
2.07387
2.06866
2.06390
2.05954
2.05553
2.05183
2.04841
2.04523
2.04227
1.95996
0.990
31.82052
6.96456
4.54070
3.74695
3.36493
3.14267
2.99795
2.89646
2.82144
2.76377
2.71808
2.68100
2.65031
2.62449
2.60248
2.58349
2.56693
2.55238
2.53948
2.52798
2.51765
2.50832
2.49987
2.49216
2.48511
2.47863
2.47266
2.46714
2.46202
2.45726
2.32635