(* ::Package:: *)
(*:Mathematica Version: 3.0 and later *)
(*:Package Version: 0.2 *)
(*:Name: Dependability`BlockDiagrams` *)
(*:Context: Dependability`BlockDiagrams` *)
(*:Title: *)
(*:Author: Bjarne E. Helvik *)
(*:Date: 20 Oct. 200 *)
(*:History:
First version, 0.1, "released" 5 March 2001.
The current version, 0.2, is a revision based on comments from Laurent Paquereau
*)
(*:Copyright:
All rights reserved Bjarne E. Helvik.
*)
(*:Reference: Usage messages.
The notebook Analyse-BlockDiagrams.v0.nb
*)
(*:Summary:
This package evaluates dependability models based on
block diagrams. Inherent in these models is the
assumption of independence between all system elements.
The current version is preliminary and has no check of
input or exception handling.
*)
(*:Keywords: Dependability, Availability, Reliability,
MTBF, MUT, MDT, MTFF *)
(*:Requirements: No special system requirements. *)
(*:Sources:
*)
BeginPackage["Dependability`BlockDiagrams`"]
MDTb::usage=
"MDT[E] returns the mean down time of element or (sub)system E, where E is characterised by its availability and mean up time, i.e. E={AE, MUTE}"
MTBFb::usage=
"MTBFb[E] returns the mean time between failures of element or (sub)system E, where E is characterised by its availability and mean up time, i.e. E={AE, MUTE}"
MUTb::usage=
"MUTb[E] returns the mean up time of element or (sub)system E, where E is characterised by its availability and mean up time, i.e. E={AE, MUTE} and MUTb[E] = MUTE"
A::usage=
"A[E] returns the asymptotic availability of element or (sub)system E, where E is characterised by its availability and mean up time, i.e. E={AE, MUTE} and A[E] = AE"
U::usage=
"U[E] returns the asymptotic unavailability of element or (sub)system E, where E is characterised by its availability and mean up time, i.e. E={AE, MUTE} and U[E] = 1-AE"
SquareIntersection::usage=
"SquareIntersection[Ei, Ej, Ek,..] = SeriesSystem[Ei, Ej, Ek,..] returns the availability and mean up time {A,MUT} of a series system with two or more elements or subsystems Ex characterised by their availability and mean up time, i.e. Ex={AEx, MUTEx}. May also be written with the infix operator Ei \[SquareIntersection] Ej \[SquareIntersection] Ej"
SeriesSystem::usage=
"SeriesSystem[Ei, Ej, Ek,..] = SquareIntersection[Ei, Ej, Ek,..] returns the availability and mean up time {A,MUT} of a series system with two or more elements or subsystems Ex characterised by their availability and mean up time, i.e. Ex={AEx, MUTEx}. May also be written with the infix operator Ei \[SquareIntersection] Ej \[SquareIntersection] Ej"
Coproduct::usage=
"Coproduct[a,b,c,...] = 1 - (1-a)(1-b)(1-c)... The coproduct between two or more elements. May also be written with the infix operator a \[Coproduct] b \[Coproduct] c"
ParallelSystem::usage=
"ParallelSystem[Ei, Ej, Ek,..] = SquareUnion[Ei, Ej, Ek,..] returns the availability and mean up time {A,MUT} of a parallel system with two or more elements or subsystems Ex characterised by their availability and mean up time, i.e. Ex={AEx, MUTEx}. May also be written with the infix operator Ei \[SquareUnion] Ej \[SquareUnion] Ej"
SquareUnion::usage=
"SquareUnion[Ei, Ej, Ek,..] = ParallelSystem[Ei, Ej, Ek,..] returns the availability and mean up time {A,MUT} of a parallel system with two or more elements or subsystems Ex characterised by their availability and mean up time, i.e. Ex={AEx, MUTEx}. May also be written with the infix operator Ei \[SquareUnion] Ej \[SquareUnion] Ej"
KoutofNb::usage=
"KoutofNb[E, k, n] returns the availability and mean up time {A,MUT} of a system where k out of a total of n identical elements (or subsystems) must be working to have a working system. The elements (or subsystems) E are characterised by their availability and mean up time, i.e. E={AE, MUTE}. "
BridgeStruct::usage=
"BridgeStruct[S1, S2, E] returns the availability and mean up time {A,MUT} of a non series paralell system which can be transformed into two series paralell systems S1 and S2 by pivoting on the 'bridge element' E. S1 is the system when E is always working, S2 is the system when E is never working. Elements or systems S1, S2 and E are all characterised by their availability and mean up time, i.e. X={Ax, MUTX}. "
(* *)
Begin["`Private`"]
(* *** Propertiesrelatons *** *)
MDTb[{aa_, mut_}] := mut/aa - mut
MDTb[aa_, mut_] := MDTb[{aa, mut}]
MTBFb[{aa_, mut_}] := mut/aa
A[{aa_, mut_}] := aa
U[{aa_, mut_}] := ScientificForm[1 - aa]
MUTb[{aa_, mut_}] := mut
(* *** Series system *** *)
SeriesSystem[x__List] :=SquareIntersection[x];
SquareIntersection[x_,y_,z__] :=
SquareIntersection[x, SquareIntersection[y,z]];
SquareIntersection[{xAvail_,xMut_},{yAvail_,yMut_}] :=
{xAvail * yAvail, 1/(1/xMut + 1/yMut)}
(* ***Parallel system *** *)
(* Coproduct *)
Coproduct[x_,y_,z__] := Coproduct[x, Coproduct[y,z]];
Coproduct[x_,y_] := 1-(1-x)(1-y);
(* Parallel operator *)
ParallelSystem[x__List] := SquareUnion[x];
SquareUnion[x_,y_,z__] := SquareUnion[x, SquareUnion[y,z]];
SquareUnion[{xAvail_,xMut_},{yAvail_,yMut_}] := Module[{Avail,Mut},
Avail = xAvail \[Coproduct] yAvail;
RepairRate=(1/ MDTb[{xAvail, xMut}]+ 1/MDTb[{yAvail, yMut}] );
Mut = Avail/((1-Avail)RepairRate);
{Avail, Mut}]
(* K out of N system*)
KoutofNb[{xAvail_,xMut_},k_, n_]:= Module[{bb, pp,aa, av},
bb =Table[ Binomial[n,i],{i,n,k,-1}] ;
pp = Table[xAvail^i * (1- xAvail)^(n-i),{i,n,k,-1}] ;
aa = bb pp;
av = aa . Table[1,{i,n,k,-1}] ;
{av,1/( Last[bb pp] (1/xMut) * k/av)}]
(* Bridge structure *)
BridgeStruct[{A1_, M1_}, {A2_, M2_}, {Ae_, Me_}] :=
{A1*Ae + A2*(1 - Ae), ((A2*(-1 + Ae) - A1*Ae)*M1*M2*Me)/
(-A1*Ae*M2*(M1 + Me) + A2*M1*(-Me + Ae*(M2 + Me)))}
End[ ]
EndPackage[ ]