Professional Documents
Culture Documents
Markov Process PDF
Markov Process PDF
Applications
AJAY KUMAR
Assistant Professor
Atal Bihari VajpayeeIndian Institute of Information Technology & Management, Gwalior
Morena Link Road, Gwalior-474010
MP, India
1 / 111
2 / 111
3 / 111
4 / 111
5 / 111
P= .
..
..
..
..
.
.
.
pm1 pm2
pmm
6 / 111
Properties of TPM:
I
P is a square matrix
0 pij1 , i, j
m
P
j=1
pij = 1
7 / 111
8 / 111
..
.
called as TPM, along with P[sj (0)], completely defines the DTMC.
9 / 111
p11 p12
p21 p22
..
.
p1m
p2m
..
.
pm1 pm2
pmm
10 / 111
11 / 111
12 / 111
lim P(n + 1) =
lim P(n) P
= P
Where, is a 1 m vector.
13 / 111
Transient State: If the system can leave the state but never
return to it, e.g., s1
s1
s2
0.75
1
14 / 111
m
X
aji 4t
i6=j
16 / 111
Substituting,
m
X
aji 4t +
m
X
i6=j
P[si (t)]aij 4t
i6=j
j = 1, 2, 3, , m
Now define the diagonal elements of the transition rate matrix A
by:
m
X
ajj =
aji
i6=j
m
X
P[si (t)]aij 4t
i6=j
or
P[sj (t + 4t)] P[sj (t)] =
m
X
P[si (t)]aij 4t
i=1
17 / 111
X
d
P[sj (t)] =
P[si (t)]aij ; j = 1, 2, , m
dt
i=1
Next, define:
P(t) = [P[s1 (t)], P[s2 (t)], , P[sm (t)]]
Which results in:
d
P(t) = P(t) A
dt
18 / 111
19 / 111
Component-1
operating
failed
operating
failed
Component-2
operating
operating
failed
failed
Assumptions:
I
21 / 111
dP1 (t)
+ (1 + 2 )P1 (t)
dt
dP2 (t)
+ 2 P2 (t)
dt
dP3 (t)
+ 1 P3 (t)
dt
dP4 (t)
dt
= 0
= 1 P1 (t)
= 2 P1 (t)
= 1 P3 (t) + 2 P2 (t)
22 / 111
24 / 111
dP1 (t)
+ (1 + 2 )P1 (t) = 0
dt
dP2 (t)
+ +
2 P2 (t) = 1 P1 (t)
dt
dP3 (t)
+ +
1 P3 (t) = 2 P1 (t)
dt
25 / 111
h
i
+
( + )t
e 2 te 1 2
h
i
+
(1 +2 )t
e 1 te
R(t)dt
0
26 / 111
27 / 111
dP1 (t)
+ (1 +
2 )P1 (t) = 0
dt
dP2 (t)
+ 2 P2 (t) = 1 P1 (t)
dt
dP3 (t)
+ 1 P3 (t) =
2 P1 (t)
dt
28 / 111
P1 (t) = e (1 +2 )t
1
2 te (1 +2 )t
P2 (t) =
e
1 +
2 2
P3 (t) = e 1 t e (1 +2 )t
The reliability is given by:
R(t) = P1 (t) + P2 (t) + P3 (t)
1
1 t
2 te (1 +2 )t
= e
+
e
1 +
2 2
and
MTTF =
1
1
+
1 2 (1 +
2)
29 / 111
30 / 111
1
2
1
1
+
1 + 2 1 + 2 3 3 1 + 2
31 / 111
uptime
uptime+downtime
MTBF
MTBF+MTTR
32 / 111
33 / 111
0
s
2
f
Find out the ODEs for the above transition diagram and find out:
I
34 / 111
rs
fs
pr
, 1 =
, 2 =
pr + rs + fs
pr + rs + fs
pr + rs + fs
35 / 111
no repair facility
36 / 111
The system can be modeled using CTMC with four states given
by:
I
Solution:
I
f
3
0
f
f
2
37 / 111
For one repair facility, assume that in state 3, where both the
machines are down, the repair facility will spend its time
equally between M1 and M2 .
r
1
f
r/2
f
3
0
f
f
2
r
r/2
r2
+ 2fr + 2f 2
fr
2
r + 2fr + 2f 2
2f 2
r 2 + 2fr + 2f 2
r2
38 / 111
r2
r 2 + 2fr + f 2
fr
2
r + 2fr + f 2
2f 2
r 2 + 2fr + f 2
39 / 111
Solution of A = 0
40 / 111
Power method
SOR
Gaussian elimination Method
Gauss-Seidel Method
41 / 111
42 / 111
A
= I+
a
43 / 111
2 2c 0 2(1 c)
0
c (1 c)
A=
0
0
0
0
0
0
0
0
Choose a = 2, we get:
0 c
0 21
A =
0 0
0 0
0 1c
c
2
1
0
1c
2
0
1
44 / 111
45 / 111
(k)
(k)
(k)
(k+1)
aij
= aij
(k)
aik
(k)
a
(k) kj
akk
i = k + 1, k + 2, , n
j = k + 1, k + 2, , n, n + 1
(1)
46 / 111
2 1
4 0
3 2
1 3
system of equations:
x1
10
1 2
2 1
x2 = 8
x3
7
2 0
x4
5
2 1
2
4
[A|b] =
3
1
4
2
=
3
1
1
0
2
3
0
1
2
3
1 2 10
2 1
8
R R1
2 0
7 2
2 1 5
2 1
8
1 2 10
R 1R , R 3R , R 1R
2 0
7 2 2 1 3 4 1 4 4 1
2 1 5
47 / 111
4
0
=
0
0
4
0
=
0
0
4
0
=
0
0
0 2
1
8
1 0 5/2 14
R R2
2 1/2 3/4
1 4
3 3/2 5/4 7
0 2
1
8
3 3/2 5/4 7
R3 2 R2 , R4 1 R2
2 1/2 3/4
1
3
3
1 0 5/2 14
0
2
1
8
3 3/2
5/4
7
R R3
0 1/2
1/12
17/3 4
0 1/2 25/12 35/3
48 / 111
4
0
=
0
0
0
2
1
8
3 3/2
5/4
7
R R3
0 1/2 1/12
17/3 4
0
0
13/6 52/3
Finally, we get:
4 0
2
1
0 3 3/2
5/4
0 0 1/2 1/12
0 0
0
13/6
x1
8
x2 7
x3 = 17/3
52/3
x4
49 / 111
50 / 111
P(s)
= P(0)(sI A)1
51 / 111
Input matrix A
I
I
Y = expm(A), or
[V,D] = EIG(A);
EXPM(A) = V*diag(exp(diag(D)))/V
52 / 111
53 / 111
54 / 111
1
ui+1 = ui + [k1 + 2k2 + 2k3 + k4 ]
6
Where:
k1 = hf (ti , ui )
h
k1
k2 = hf ti + , ui +
2
2
h
k2
k3 = hf ti + , ui +
2
2
k4 = hf (ti + h, ui + k3 )
55 / 111
56 / 111
Uj+1 =
u1,j+1
u2,j+1
..
.
un,j+1
Ki =
k1i
k2i
..
.
kni
and:
ki1 = hfi (tj , u1,j , u2,j , , un,j )
1
1
1
h
ki2 = hfi (tj + , u1,j + k11 , u2,j + k21 , , un,j + kn1 )
2
2
2
2
h
1
1
1
ki3 = hfi (tj + , u1,j + k12 , u2,j + k22 , , un,j + kn2 )
2
2
2
2
ki4 = hfi (tj , u1,j + k13 , u2,j + k23 , , un,j + kn3 )
57 / 111
58 / 111
59 / 111
1a
a
; 0 a, b 1, |1 a b| < 1
P=
b
1b
then matrix P n is given by:
Pn =
b+a(1ab)n
a+b
bb(1ab)n
a+b
aa(1ab)n
a+b
a+b(1ab)n
a+b
60 / 111
Assignments
1. Make a computer program to solve a given DTMC having
2-states.
Inputs: TPM, P and initial probability, P(0)
Output: nstep transition probabilities, P(n)
2. Extend the program to m m TPM, using
P(n + 1) = P(0) P n or P(n + 1) = P(n) P
61 / 111
Pulping System: The four major actions carried out in the system
are, (i) cooking of chips, (ii) separation of knots, (iii) washing of
pulp, and (iv) opening of fibers. The pulping system consists of for
subsystems, namely:
I
Digester (A): One unit, used for cooking the chips whose
failure causes the complete failure of the cooking system.
62 / 111
Opener (D): Two units, one working and other standby, used
to separate the fibers. Whose complete failure occurs only if
both the units fail.
A
Digester
D1
B2
Knotter
C2
C3
Deckers
D2
Opener
63 / 111
Assignments (Contd...)
Make computer programmes to find out steady state probabilities
using:
3. Power Method
4. SOR/Gauss-Seidel Method
5. Gauss Elimination Method
65 / 111
Assignments (Contd...)
Make computer programmes to find out transient probabilities
using:
6. Matrix Method
7. Eulers Method
8. RK4 Method
Also, simulate the system behavior for t = 100 hours.
66 / 111
= 0, for |i j| > 1
67 / 111
In steady-state,we get:
0 0 = 1 1
(k + k )k
= k1 k1 + k+1 k+1 , k 1
Now,
k k k+1 k+1 = k1 k1 k k
= k2 k2 k1 k1
= k3 k3 k2 k2
=
= 0 0 1 1
= 0
68 / 111
Thus, we have:
k k = k+1 k+1
or
k+1 =
k
k1
k = k =
k1 , for k 1
k+1
k
or
k1
k =
Y i
0 1 k1
0 =
1 2 k
i+1
i=0
69 / 111
P
j
j = 1, we get:
0 +
k1
k1
Y
i=0
i.e.,
i
=1
i+1
0 =
1+
P k1
Q
k1 i=0
i
i+1
converges.
70 / 111
71 / 111
72 / 111
D: queue/service discipline
F: Population size
73 / 111
Sj = service time of Cj
74 / 111
75 / 111
nA (t)
t
1
n
n
P
j=1
Sj , where is called
76 / 111
Zt
N(u)du
(1)
Zt
Ns (u)du
(3)
77 / 111
B
m
(4)
1X
Wj
n n
W = lim
(5)
j=1
1X
D = lim
Dj
n n
(6)
j=1
Littles Result: The result states that, given a queue, if the limits:
nA (t)
t t
= lim
n
1 P
Wj
n n j=1
and W = lim
Zt
N(u)du
0
(7)
80 / 111
= (1 )
(8)
k0
Thus we have,
L = E [N] =
kk = (1 )
k=0
But, we have,
kk
(10)
k=0
(1 )2
(11)
=
1
(12)
kk =
k=0
82 / 111
(k 1)k =
k=1
kk
k=1
= L (1 0 ) = L
2
2
=
=
1
( )
k=1
(13)
where,
(15)
Using (15), we obtain the expressions for W and D for the M/M/1
queue. From (12) and (15), we have,
W =
L
1
1
=
=
(1 )
(16)
D=
1
1
=
( )
(17)
84 / 111
85 / 111
k0
We can solve this equation for 0 if and only if the series in the
numerator is convergent. The series will be convergent if and only
if < 1. When 1, the series diverges, which means that the
queue grows without bound and the values of L, Q, W and D
would go to infinity. We say that the queue is stable if < 1 and it
is unstable if 1. The stability condition physically means that
the arrival rate must be strictly less than the service rate.
When is close to 1, queues become very long and as 1, the
number in the system grows without bound. Transient analysis
reveals system behavior as 1 or short term behavior when
> 1.
86 / 111
Fw (t) =
1X
P{Wj t}
n n
lim
j=1
Fd (t) =
lim
n
1X
P{Dj t}
j=1
87 / 111
(18)
88 / 111
Now we will find Fd (t) for t > 0. If there are k customers in the
system upon arrival, for the customer to get into the system
between 0 and t, all k units must be served by the time t. Since
the service time distribution is memoryless, the distribution of the
time required for k service times is independent of the time of the
current arrival, and is the convolution of k exponential random
variables, which is an Erlang-k distribution. The probability density
function of the Erlang distribution is:
f (x; k, ) =
(x)k1 e x
(k 1)!
for x, 0
89 / 111
X
= Fd (0) +
P(0 < d t|k units in the system)k
k=1
90 / 111
X
k=1
Zt
k
(x)k1 e x
dx
(k 1)!
Zt
e x
= (1 ) + (1 )
0
k=1
(x)k1
dx
(k 1)!
Zt
e x(1) dx
= (1 ) + (1 )
(19)
91 / 111
(20)
From (20), we can compute the mean waiting time in queue as:
D = E [D] =
( )
(21)
92 / 111
X
P(w t|k units in the system)k
k=0
k=0
Z
X
(x)k e x
=
dx k (1 )
k!
t
k=0
93 / 111
Zt
e x
Fw (t) = (1 )
X
(x)k
k=0
k!
dx
Zt
= (1 )
= 1e
e x(1) dx
0
(1)t
= 1 e ()t
94 / 111
Thus we have:
(
0,
for t < 0
Fw (t) =
()t
1e
, for t 0.
(22)
95 / 111
96 / 111
(1 )k
, k = 0, 1, 2, . . . , N
1 N+1
= 0, k > N
=
(23)
Note that a system with finite population such as above will always
be stable for all values of .
The performance measures can be verified to be given by:
U = 1 0 =
(1 N )
1 N+1
(24)
97 / 111
Q=
2 [1 N NN1 (1 )]
(1 )(1 N+1 )
(25)
[1 N NN (1 )]
(1 )(1 N+1 )
(26)
1 N NN (1 )
(1 )(1 N )
(27)
[1 N NN1 (1 )]
(1 )(1 N )
(28)
L=
W =
D=
98 / 111
99 / 111
(N N )
q C
N+1 N+1
The service rate that maximizes the profit can now be obtained
in the usual way.
100 / 111
101 / 111
(29)
= k, k = 0, 1, . . . , m
= m, k > m
(30)
102 / 111
=
=
0 (m)k
; k = 0, 1, 2, . . . , m
k!
0 mm k
; k>m
m!
(31)
(32)
103 / 111
The expression for 0 can now be obtained using (31) and the fact
that the steady state probabilities sum up to 1. Thus:
m1
X (m)k 1
(m)m
0 =
+
m!(1 )
k!
(33)
k=0
X
j
=
k = 0, 1, . . . , m 1
k=m
j=m
104 / 111
m
X
kP(Ns = k) =
k=0
(34)
=
m
(35)
105 / 111
X
(m)m 0
Q=
(k m)k =
(36)
m!(1 )2
k=m
(m)m 0
+
m!(1 )2
(37)
106 / 111
L
(m)m 0
1
=
+
2
m!(1 )
(38)
1
(m)m 0
=
m!(1 )2
(39)
107 / 111
k1
Y
i=0
= 0
(i + 1)
k!
(40)
108 / 111
1
k
P
k=1
and finally:
k
k =
=e
(41)
1
k!
(42)
k!
This is the Poisson pmf, and the expected number of jobs in the
system is:
L=
(43)
109 / 111
110 / 111
Thank You
111 / 111