DASAR-DASAR SIMULASI
Dasar Dasar Simulasi
1 Tipe Simulasi
2 Perilaku Acak
Static or dynamic
Stochastic or deterministic
Discrete or continuous
A static simulation is one that is not based
on time. It often involves drawing random
samples to generate a statistical outcome,
so it is sometimes called Monte Carlo
simulation.
- In finance, Monte Carlo simulation is used
to select a portfolio of stocks and bonds.
- In material handling system, a static
simulation model to calculate the expected
time to travel from one rack location in a
storage system to any other rack location.
Dynamic simulation includes
the passage of time. It looks
at state changes as they occur
over time. A clock mechanism
moves forward in time and
state variables are updated as
time advances. Dynamic
simulation is well suited for
analyzing manufacturing and
service systems since they
operate over time.
Simulations in which one or more input
variables are random are referred to as
stochastic or probabilistic simulations. A
stochastic simulation produced output that
is itself random.
Simulation having no input components that
are random are said to be deterministic.
Deterministic simulation models are built the
same ways as stochastic models except
that they contain no randomness.
Simulasi Statik vs dinamik
Dinamik
Statik Mencakup lintasan waktu
Simulasi tidak Sebuah mekanisme
berdasarkan waktu waktu, menggerak waktu
Mencakup sampel acak sehingga variabel status
yang diambil untuk berubah saat waktu
membangkitkan hasil
berubah
statik Simulasi
montecarlo Contoh sistem
Contoh : Dalam sistem manufaktur & jasa
material handling, utk
menghitung waktu
tunggu berjalan satu
rack di sistem gudang
ke lokasi rak lain
Simulasi Stokastik vs Determenistik
Stokastik/probabilistik Determinsitik
Satu atau lebih variabel Tidak memiliki komponen
input merupakan acak yang bersifat acak
Menghasilkan output Tidak memiliki keacakan
yang acak dengan (randomness)
sendirinya Seluruh status yang akan
Memberikan hanya satu datang hanya ditentukan
titik data utk sekali oleh data input &
mengetahui bagaimana status awal (initial state)
sistem berperilaku sudah ditentukan
Simulasi Stokastik vs Determenistik
106
5
(a) (b)
30
25
20
15
10
0
1st 3rd
Qtr Qtr
i 21Zi-1+3 Zi Ui=Zi/16
0 13
1 276 4 0,25
2 87 7 0,4375
3 150 6 0,375
4 129 1 0,0625
5 24 8 0,5
6 171 11 0,6875
7 234 10 0,625
8 213 5 0,3125
9 108 12 0,75
10 255 15 0,9375
11 318 14 0,875
12 297 9 0,5625
13 192 0 0
14 3 3 0,1875
15 66 2 0,125
16 45 13 0,8125
17 276 4 0,25
18 87 7 0,4375
19 150 6 0,375
20 129 1 0,0625
LCG (lanjut)
Stream :
Panjang rentetan bilangan acak dapat dibagi dalam segmen
yang lebih kecil, yang disebut stream.
Contoh stream 1, adalah pola kedatangan mobil ke jendela
restoran siap saji, stream 2 waktu yang diperlukan oleh
pengemudi untuk memesan
Bagaimana penerapan :
Memutuskan berapa banyak bilangan acak yang ditempatkan
dalam masing-masing stream
Bagilah urutan pembangkit dari bilangan acak dalam
beberapa stream
Bangkitkan keseluruhan urutan bilangan acak (cycle length)
Catat nilai Zi yang menandai permulaan masing-masing
strean.
Masing-masing stream memiliki nilai awal sendiri atau atau
disebut sebagai seed value.
LCG (lanjut)
Distribusi Kontinu
Contoh : waktu antara kedatangan mobil ke restoran siap
saji terdistribusi eksponensial, waktu yang dibutuhlan oleh
pengemudi untuk memesan makan mengikuti distribusi
lognormal
Distribusi Kontinyu
Suatu contoh dari distribusi ekpoensial dengan : mean
1 x /
e for x 0 F(x)
f ( x)
0 elsewhere 1.00 U=1 - exp(-x/beta)
1 ex / for x 0
F ( x) U2
0 elsewhere
U 1 e x / 0.50
x ln( 1 U )
U1
dimana :
Xi = nilai ke-i dari exponential distribution
dg mean ,
Ui = random ke-I tergambar distribusi x1 x2
uniform(0,1) i = 1,2,…,25
Graphical explanation of
inverse transformation method
3 observasi variabel acak for continuous variates
yang terdisitribusi
eksponensial adalah U1=0,27,
U2=0,89, U3=13
Ui akan menghasilkan persamaan :
Z1 = ( 21Z 1 + 3) mod(128)
i i -1
U1 = Z 1 / 128 i = 1, 2 ,..., 25
i 2
Z1 =3
0
X1 = - 3.0 ln(1 - U 1 )
i i
Z2 = ( 21 Z 2 + 3) mod( 128 )
i i -1
U2 = Z 2 / 128 i = 1, 2 ,..., 25
i 2
Z2 = 122
0
X2 = - 2 . 4 ln(1 - U 2 )
i i
Changing the seed values Z10 and Z20
causes the spreadsheet program to
recompute all values in the spreadsheet.
When we change the seed values Z10 and
Z20 appropriately, we produce another
replication of the simulation.
The heart of simulation is the generation
of the random variates that drive the
stochastic events in the simulation.
Generating Random Variates
Distribusi Diskrit
♠ Aplikasi dari methoda inverse transformation untuk
membangkitkan variates dari distribusi deskrit pada
dasarnya sama dengan kasus kontinyu
♠Contoh : simulasi mewakili jumlah komponen yang rusak
dari serbuah circuit board, jumlah minimum yang dipesan
dari jendela drive through
F(x)
1,00
U2=0,89
U1=0,27
0,01
U3=0,05
x2=1 x1=2 x3=3
24
Simulasi Spreadsheet Sederhana (contoh)
8 7 6 5 4 3 2 1
Interarrival
time 4.8
minutes Diskripasi gambar dari sistem ATM
7tcustomer
h 6tcustomer
h
arrives at arrives at
21.0 min. 16.2 min.
Sistem : ATM
Entitas : nasabah tiba di ATM untuk melakukan transaksi
Resource : ATM untuk melayani nasabah dengan kapasitas
melayani satu nasabah pada satu waktu
Kontrol sistem, yang mengatur bagaimana, kapan, dan dimana
aktivitas transaksi di ATM
Review Questions