You are on page 1of 4

<< LinearAlgebra`MatrixManipulation`

<< Graphics`Legend`

(* Stabilirea generatorului *)

Nc = 5; Ns = 3;

g = ZeroMatrix[Nc]
{{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}}

{g[[1, 1]] = - λ1 - λ2, g[[1, 2]] = λ2, g[[1, 3]] = λ1, g[[2, 5]] = λ1, g[[2, 1]] = μ2,
g[[2, 2]] = - λ1 - μ2, g[[3, 3]] = - μ1 - λ2, g[[3, 1]] = μ1, g[[3, 4]] = λ2,
g[[3, 3]] = - λ2 - μ1, g[[4, 3]] = μ2, g[[4, 4]] = - μ2, g[[5, 2]] = μ1, g[[5, 5]] = - μ1}

λ1 = 0.01; μ1 = 0.1; λ2 = 0.01; μ2 = 0.1;

(* Stabilirea partitiilor *)

G11 = TakeMatrix[g, {1, 1}, {Ns, Ns}];

MatrixForm[G11]

G12 = TakeMatrix[g, {1, Ns + 1}, {Ns, Nc}];

MatrixForm[G12]

G21 = TakeMatrix[g, {Ns + 1, 1}, {Nc, Ns}];

MatrixForm[G21]

G22 = TakeMatrix[g, {Ns + 1, Ns + 1}, {Nc, Nc}];

MatrixForm[G22]

P0 = IdentityMatrix[Nc]
{{1, 0, 0, 0, 0}, {0, 1, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 0, 1, 0}, {0, 0, 0, 0, 1}}

MatrixForm[P0]
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1

α = TakeRows[P0, 1]
{{1, 0, 0, 0, 0}}

α1 = TakeColumns[α, Ns]
{{1, 0, 0}}
2 06012015.nb

α2 = TakeColumns[α, Nc - Ns]
{{1, 0}}

Un = ZeroMatrix[Nc, 1]
{{0}, {0}, {0}, {0}, {0}}

For[i = 1, i < Ns + 1, i ++, Un[[i, 1]] = 1]

Um = TakeRows[Un, Ns]
{{1}, {1}, {1}}

Unm = TakeRows[Un, Nc - Ns]


{{1}, {1}}

(* Calcularea probabilitatilor de stare *)

G1 = g; For[i = 1, i < Nc + 1, i ++, G1[[i, 1]] = 1]

P = α.Inverse[G1]
{{0.819672, 0.0819672, 0.0819672, 0.00819672, 0.00819672}}

P1 = TakeColumns[P, Ns]
{{0.819672, 0.0819672, 0.0819672}}

P2 = TakeColumns[P, - (Nc - Ns)]


{{0.00819672, 0.00819672}}

(* Calcul indicatori *)

M[t_] = 1 - α2.MatrixExp[G22 * t].Unm;

(* Mentenabilitatea *)
06012015.nb 3

Plot[M[t], {t, 0, 200}]

50 100 150 200

0.98

0.96

0.94

0.92

⁃ Graphics ⁃

(* Disponibilitatea *)

A[t_] = α.MatrixExp[g * t].Un;

(* Disponibilitatea stationara *)

As = Sum[P[[1, i]], {i, Ns}]


0.983607

Plot[{A[t], As}, {t, 0, 100},


PlotStyle -> {{RGBColor[0, 1, 0]}, {RGBColor[1, 0, 0]}}]

20 40 60 80 100

0.9975

0.995

0.9925

0.99

0.9875

0.985

⁃ Graphics ⁃
4 06012015.nb

(* Media timpului de functionare *)

MTTF = - α1.Inverse[G11].Um
{{650.}}

(* Media timpului de reparare *)

MTTR = - α2.Inverse[G22].Unm
{{10.}}

(* Media timpului de functionare pana la prima avarie *)

MUT = P1.Um / (P2.G21.Um)


{{600.}}

MDT = P2.Unm / (P1.G12.Unm)


{{10.}}

(* Intensitatea de defectare *)
IA[t_] = - α1.G11.MatrixExp[G11 * t].Um / (α1.MatrixExp[G11 * t].Um);

Plot[IA[t], {t, 0, 100}, PlotRange → {0, 0.000002}]

(* Intensitatea de reparare *)

IR[t_] = - α2.G22.MatrixExp[G22 * t].Unm / (α2.MatrixExp[G22 * t].Unm);

Plot[IR[t], {t, 0, 100}, PlotRange → {0, 0.04}]

You might also like