Professional Documents
Culture Documents
ENTREGA - ESTOCASTICA Entrega 3
ENTREGA - ESTOCASTICA Entrega 3
TERCERA ENTREGA
Diseño de un sistema de protección hidráulico para un pozo petrolero
This workbook has a series of macros that can be used to analyze medium size Markov
Chain Problems. Its accuracy for large model has not been tested, and anyway Excel
cannot handle more than 256 columns
For really large models use:
jMarkov
Reference Manual
Reference
For steady state probabilities we mark the destination range and write
""=DTMCSteadyState(theP)" and then hit ctrl-shft-enter at the same time.
Attention: For all functions you have to hit Ctrl shift y enter at the same time.
Reducible Chains
1 2 3 4 5 6
1 0.1 0.2 0.1 0.2 0.2 0.2
2 0.2 0.3 0.1 0.3 0.1 0
3 0.1 0.3 0.2 0.2 0.1 0.1
4 0 0 0 0.2 0.8 0
5 0 0 0 0.8 0.2 0
6 0 0 0 0 0 1
Absortion Probabilities
Find R y Q, that correspond to transitions among transient and from transient the the closed comunicating class
1 2 3
1 0.1 0.2 0.1
A= 2 0.2 0.3 0.1 R=
3 0.1 0.3 0.2
Limit probability exists, since there are no periodic states, and is given by
1 2 3 4 5 6
1 0 0 0 #VALUE! #VALUE! #VALUE!
2 0 0 0 #VALUE! #VALUE! #VALUE!
3 0 0 0 #VALUE! #VALUE! #VALUE!
4 0 0 0 #VALUE! #VALUE! 0
5 0 0 0 #VALUE! #VALUE! 0
6 0 0 0 0 0 1
1 2 3 4 5 6
1 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
2 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
3 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
4 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
5 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
6 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
It works!
he closed comunicating classes
C1 C2
1 0.4 0.2
2 0.4 0
3 0.3 0.1
Check
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
1
Check
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
Continuous Time Markov Chains
Go back to Main Menu
Define generator matrix Q y and call it "Generateor", via Insert/Name/Define
-9 4 5
Q= 10 -17 7
7 7 -14
Reducible Chains
Assume Q is given as
1 2 3 4 5 6
1 -9 2 1 2 2 2
2 12 -17 1 3 1 0
3 1 3 -8 2 1 1
4 0 0 0 -8 8 0
5 0 0 0 8 -8 0
6 0 0 0 0 0 0
T = {1,2,3}
C1 ={4,5}
C2 = {6}
Absortion Probabilities:
Absortion Probabilities:
DTMCAbsor(A,R)
C1 C2
1 #VALUE! #VALUE!
F= 2 #VALUE! #VALUE!
3 #VALUE! #VALUE!
1 2 3 4 5 6
1 0 0 0 #VALUE! #VALUE! #VALUE!
2 0 0 0 #VALUE! #VALUE! #VALUE!
3 0 0 0 #VALUE! #VALUE! #VALUE!
4 0 0 0 #VALUE! #VALUE! 0
5 0 0 0 #VALUE! #VALUE! 0
6 0 0 0 0 0 1
1 2 3 4 5 6
1 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
2 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
3 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
4 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
5 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
6 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
and it works!
C1 C2
1 4 2
2 4 0
3 3 1
Check
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
1
Check
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
Reference Manual Go back to Main Menu
The following functions are defined in the Macros.
To use this functions in another worksheet save this workboos as an add-in (menu: File/Save
as, choose the last option)
If you plan to use the functions frequenlt you can install the add-in permanently (menu:
Tools/Addins)
General Matrix Functions
MatPower(A, n As Integer)
Computes the n-th power of the given matrix
λ=max (−q ii )
Function UniformProb(Q, Optional EnsureGenerator As Boolean = True,
Optional lda = -1#)
Assuming Q is a generator matrix, computes the associated uniformized DTMC transition
matrix. If lda is not given it is internally computed. If EnsureGenerator is true then Q is
converted to a generator rather than a rates matrix
Q
P= +I
λ
DTMC Functions
MatExpo(A, t)
Computes exp(A x t)
DTMCMatOccup(A, n As Integer)
Computes the occupancy matrix for a Discrete Markov Chain
Function DTMCSteadyState(P)
Computes the steady state probability for DTMC with matix P. If P is not irreducible (or
unichain) this returns an error.
Function DTMCAbsor(A, R)
This computes the absorving probabilities for a markov chain with transient to transient
probabilities Q, and transient to absorving probabilities R, through the formula
( (I I )−1 RA ) −1 R
−Q−
Function DTMCExpected(A)
Computes the expected number of steps before absorption, starting from each transient state,
through the formula
−1−1
( II −Q
− A) ) R1
1
CTMC Functions
Function CTMCSteadyState(Q)
Computes the steady state probabilities for the given generator matrix
Function CTMCMatOccup(Q, t)
Computed teh occupancy matrix
t
M (t )=∫0 P( s)ds
Function CTMCAbsor(A, R)
Computes teh absortion probabilities where A is the generator rates matrix from transient to
transient states, and R from transient to the absorving classes
Function CTMCExpected(A)
Computes the expected value of the time to absortion starting from each of the given states.
MarkovExcel Module
por Germán Riaño
Grupo COPA
griano@uniandes.edu.co
Esta herramienta de Excel tiene una serie de macros para el análisis de Cadenas de
Markov de tamaño intermedio. Su precisión para modelos muy grandes no has sido
probada y, en todo caso, Excel no maneja más de 256 columnas.
Para nodelos grandes use:
jMarkov
Manual de Referencia.
Referencia
Cadenas Reducibles
1 2 3 4 5 6
1 0.1 0.2 0.1 0.2 0.2 0.2
2 0.2 0.3 0.1 0.3 0.1 0
3 0.1 0.3 0.2 0.2 0.1 0.1
4 0 0 0 0.2 0.8 0
5 0 0 0 0.8 0.2 0
6 0 0 0 0 0 1
Probabilidades de Absorción:
Calculamos A y R
1 2 3
1 0.1 0.2 0.1
A= 2 0.2 0.3 0.1 R=
3 0.1 0.3 0.2
1 2 3 4 5 6
1 0 0 0 #VALUE! #VALUE! #VALUE!
2 0 0 0 #VALUE! #VALUE! #VALUE!
3 0 0 0 #VALUE! #VALUE! #VALUE!
4 0 0 0 #VALUE! #VALUE! 0
5 0 0 0 #VALUE! #VALUE! 0
6 0 0 0 0 0 1
1 2 3 4 5 6
1 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
2 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
3 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
4 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
5 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
6 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
y si lo es!
C1 C2
1 0.4 0.2
2 0.4 0
3 0.3 0.1
Check
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
1
Check
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
Cadenas de Markov de Tiempo Continuo
Regresar al Menu Principal
Definimos la matriz generadora Q y le damos el nombre "Generateor", via Inserter/Nombre/Definir
-9 4 5
Q= 10 -17 7
7 7 -14
Cadenas Reducibles
Suponga que Q viene dada por
1 2 3 4 5 6
1 -9 2 1 2 2 2
2 12 -17 1 3 1 0
3 1 3 -8 2 1 1
4 0 0 0 -8 8 0
5 0 0 0 8 -8 0
6 0 0 0 0 0 0
T = {1,2,3}
C1 ={4,5}
C2 = {6}
Probabilidades de Absorción:
Calculamos A y R
1 2 3
1 -9 2 1
A= 2 12 -17 1 R=
3 1 3 -8
1 2 3 4 5 6
1 0 0 0 #VALUE! #VALUE! #VALUE!
2 0 0 0 #VALUE! #VALUE! #VALUE!
3 0 0 0 #VALUE! #VALUE! #VALUE!
4 0 0 0 #VALUE! #VALUE! 0
5 0 0 0 #VALUE! #VALUE! 0
6 0 0 0 0 0 1
1 2 3 4 5 6
1 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
2 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
3 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
4 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
5 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
6 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
y si lo es!
Nombre/Definir
C1 C2
1 4 2
2 4 0
3 3 1
Check
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
1
Check
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
Manual de Referencia Regresar al Menu Principal
(Lo siento, no tengo traducción.. Quizás Ud. quiera ayudarme..)
The following functions are defined in the Macros.
To use this functions in another worksheet save this workboos as an add-in (menu: File/Save
as, choose the last option)
If you plan to use the functions frequenlt you can install the add-in permanently (menu:
Tools/Addins)
General Matrix Functions
MatPower(A, n As Integer)
Computes the n-th power of the given matrix
λ=max (−q ii )
Function UniformProb(Q, Optional EnsureGenerator As Boolean = True,
Optional lda = -1#)
Assuming Q is a generator matrix, computes the associated uniformized DTMC transition
matrix. If lda is not given it is internally computed. If EnsureGenerator is true then Q is
converted to a generator rather than a rates matrix
Q
P= +I
λ
DTMC Functions
MatExpo(A, t)
Computes exp(A x t)
DTMCMatOccup(A, n As Integer)
Computes the occupancy matrix for a Discrete Markov Chain
Function DTMCSteadyState(P)
Computes the steady state probability for DTMC with matix P. If P is not irreducible (or
unichain) this returns an error.
Function DTMCAbsor(A, R)
This computes the absorving probabilities for a markov chain with transient to transient
probabilities Q, and transient to absorving probabilities R, through the formula
( I − A )−1 R
Function DTMCExpected(A)
Computes the expected number of steps before absorption, starting from each transient state,
through the formula
−1
(I − A) 1
CTMC Functions
Function CTMCSteadyState(Q)
Computes the steady state probabilities for the given generator matrix
Function CTMCMatOccup(Q, t)
Computed teh occupancy matrix
t
M (t )=∫0 P( s)ds
Function CTMCAbsor(A, R)
Computes teh absortion probabilities where A is the generator rates matrix from transient to
transient states, and R from transient to the absorving classes
Function CTMCExpected(A)
Computes the expected value of the time to absortion starting from each of the given states.
Principal
Revisión falla Condiciones del sistem
1 182.479 121.653
2 91.240 121.653 Solo hay un estado de derrame
3 91.240 182.479 Se ignoran las válvulas 8,9 y 10 teniend
4 91.240 91.240 Teniendo en cuenta que la válvula 4, 5
5 91.240 91.240 Se realiza esto para simplificar el sistem
6 91.240 91.240 1 -- Válvula funcionando
7 91.240 182.479 0 -- Válvula dañada
8 182.479 72.992
9 182.479 60.826
10 182.479 72.992
rt 96.318
1 2 3 4 7
s1 1 1 1 1 1
s2 1 0 1 1 1
s3 1 1 0 1 1
s4 1 1 1 0 1
s5 1 1 1 1 0
s6 1 0 0 1 1
s7 1 0 1 0 1
s8 1 0 1 1 0
s9 1 1 0 0 1
s10 1 1 0 1 0
s11 1 1 1 0 0
s12 1 0 0 0 1
s13 1 0 0 1 0
S14(Derrame) 0 0 0 0 0
s1 s2 s3 s4 s5
s1 0.00000 121.65290 182.47934 273.71902 182.47934
s2 91.23967 0.00000 0.00000 0.00000 0.00000
s3 91.23967 0.00000 0.00000 0.00000 0.00000
s4 91.23967 0.00000 0.00000 0.00000 0.00000
s5 91.23967 0.00000 0.00000 0.00000 0.00000
R
s6 0.00000 91.23967 91.23967 0.00000 0.00000
R s7
s8
s9
0.00000
0.00000
0.00000
91.23967
91.23967
0.00000
0.00000
0.00000
91.23967
91.23967
0.00000
91.23967
0.00000
91.23967
0.00000
s10 0.00000 0.00000 91.23967 0.00000 91.23967
s11 0.00000 0.00000 0.00000 91.23967 91.23967
s12 0.00000 0.00000 0.00000 0.00000 0.00000
s13 0.00000 0.00000 0.00000 0.00000 0.00000
S14(Derrame) 96.31803 0.00000 0.00000 0.00000 0.00000
Q s1 s2 s3 s4 s5
s1 -881.98350 121.65290 182.47934 273.71902 182.47934
s2 91.23967 -851.57028 0.00000 0.00000 0.00000
s3 91.23967 0.00000 -790.74383 0.00000 0.00000
s4 91.23967 0.00000 0.00000 -699.50415 0.00000
s5 91.23967 0.00000 0.00000 0.00000 -790.74383
Q s6
s7
s8
s9
0.00000
0.00000
0.00000
0.00000
91.23967
91.23967
91.23967
0.00000
91.23967
0.00000
0.00000
91.23967
0.00000
91.23967
0.00000
91.23967
0.00000
0.00000
91.23967
0.00000
s10 0.00000 0.00000 91.23967 0.00000 91.23967
s11 0.00000 0.00000 0.00000 91.23967 91.23967
s12 0.00000 0.00000 0.00000 0.00000 0.00000
s13 0.00000 0.00000 0.00000 0.00000 0.00000
S14(Derrame) 96.31803 0.00000 0.00000 0.00000 0.00000
Condiciones del sistema
Falla
122
122
182
274
182
S14(Derrame) suma
121.65290 881.983
121.65290 851.570
121.65290 790.744
121.65290 699.504
121.65290 790.744
121.65290 760.331
304.13224 669.091
395.37191 760.331
304.13224 760.331
395.37191 699.504
425.78514 608.264
304.13224 577.851
395.37191 669.091
0.00000 96.318
S14(Derrame)
121.65290
121.65290
121.65290
121.65290
121.65290
121.65290
304.13224
395.37191
304.13224
395.37191
425.78514
304.13224
395.37191
-96.31803
Q s1 s2 s3 s4 s5
s1 -881.98350 121.65290 182.47934 273.71902 182.47934
s2 91.23967 -851.57028 0.00000 0.00000 0.00000
s3 91.23967 0.00000 -790.74383 0.00000 0.00000
s4 91.23967 0.00000 0.00000 -699.50415 0.00000
s5 91.23967 0.00000 0.00000 0.00000 -790.74383
s6 0.00000 91.23967 91.23967 0.00000 0.00000
s7 0.00000 91.23967 0.00000 91.23967 0.00000
s8 0.00000 91.23967 0.00000 0.00000 91.23967
s9 0.00000 0.00000 91.23967 91.23967 0.00000
s10 0.00000 0.00000 91.23967 0.00000 91.23967
s11 0.00000 0.00000 0.00000 91.23967 91.23967
s12 0.00000 0.00000 0.00000 0.00000 0.00000
s13 0.00000 0.00000 0.00000 0.00000 0.00000
S14(Derrame) 96.31803 0.00000 0.00000 0.00000 0.00000
x= 90 0.009
Q s1 s2 s3 s4 s5
s1 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s2 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s3 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s4 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s5 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s6 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s7 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s8 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s9 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s10 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s11 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s12 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s13 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
S14(Derrame) #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
Q s1 s2 s3 s4 s5
s1 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s2 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s3 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s4 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s5 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s6 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s7 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s8 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s9 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s10 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s11 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s12 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s13 #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
S14(Derrame) #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
π1 π2 π3 π4 π5
#VALUE! #VALUE! #VALUE! #VALUE! #VALUE!
s6 s7 s8 s9 s10 s11 s12 s13
0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
182.47934 273.71902 182.47934 0.00000 0.00000 0.00000 0.00000 0.00000
121.65290 0.00000 0.00000 273.71902 182.47934 0.00000 0.00000 0.00000
0.00000 121.65290 0.00000 182.47934 0.00000 182.47934 0.00000 0.00000
0.00000 0.00000 121.65290 0.00000 182.47934 273.71902 0.00000 0.00000
-760.33060 0.00000 0.00000 0.00000 0.00000 0.00000 273.71902 182.47934
0.00000 -669.09093 0.00000 0.00000 0.00000 0.00000 182.47934 0.00000
0.00000 0.00000 -760.33060 0.00000 0.00000 0.00000 0.00000 182.47934
0.00000 0.00000 0.00000 -760.33060 0.00000 0.00000 273.71902 0.00000
0.00000 0.00000 0.00000 0.00000 -699.50415 0.00000 0.00000 121.65290
0.00000 0.00000 0.00000 0.00000 0.00000 -608.26448 0.00000 0.00000
91.23967 91.23967 0.00000 91.23967 0.00000 0.00000 -577.85126 0.00000
91.23967 0.00000 91.23967 0.00000 91.23967 0.00000 0.00000 -669.09093
0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
S14(Derrame)
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
S14(Derrame)
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
π14
#VALUE!
1. Adicionalmente, el director de mantenimiento operacional instalará el sistema de protección hidráulico
a. La probabilidad de que en la primera auditoría el sistema esté funcionando como nuevo.
R: #VALUE!
b. La probabilidad de que en la segunda auditoría el sistema esté funcionando como nuevo.
R: #VALUE!
c. El número de días, en promedio, que se habrán utilizado para el proceso de revisión total justo antes de
R: 90 días #VALUE!
180 días #VALUE!
d. El número de días, en promedio, que transcurrirán hasta el próximo derrame de crudo.
R: #VALUE!
1. Un análisis económico de largo plazo, que muestre el valor esperado de los ingresos diarios para una tor
Día Sin derrame $ 40,000.00
Día con derrame $ 60,000.00 R: #VALUE!
2. Las conclusiones generales y las principales recomendaciones de parte de su compañía al director de ma
R: Se aproxima que el 68% de los días tiene derrame de crudo, el pozo no es viable
Se debe realizar revisión constante a la válvula 1, pero también se debe garantizar mantenimiento preventivo
Se generan perdidas -28038, por lo que se recomienda no seguir con la operación hasta que se deteremine u
tema de protección hidráulico en un nuevo pozo que acaba de presentar un derrame de crudo (por fortuna, sin consecuencias mayores pa
do como nuevo.
do como nuevo.
ame de crudo.
os ingresos diarios para una torre de extracción que cuente con el sistema de protección hidráulico. (Asuma que la única causa para que la
tizar mantenimiento preventivo a diario, hasta que el número de días hasta el próximo derrame disminuya, allí se hará revisión cuando el d
ue la única causa para que la torre no funcione es la falla del sistema de protección hidráulico).