Title: | Fault Tree Analysis Based on Proxel Simulation |
---|---|
Description: | Calculation and plotting of instantaneous unavailabilities of basic events along with the top event of fault trees are issues important in reliability analysis of complex systems. Here, a fault tree is provided in terms of its minimal cut sets, along with reliability and maintainability distribution functions of the basic events. All the methods are derived from Horton (2002, ISBN: 3-936150-21-4), Niloofar and Lazarova-Molnar (2022). |
Authors: | Parisa Niloofar [aut] , Sanja Lazarova-Molnar [aut], Hossein Haghbin [aut, cre] |
Maintainer: | Hossein Haghbin <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.0.1 |
Built: | 2024-11-09 02:51:31 UTC |
Source: | https://github.com/cran/ftaproxim |
This function returns a numeric value indicating the pending time (in terms of time steps, delta) for a given state change of a proxel.
calageInt(state, proxel, delta)
calageInt(state, proxel, delta)
state |
a string value |
proxel |
a data frame containing a state, age intensity and the probability. |
delta |
a numeric value as time step |
a numeric value as the age intensity
proxel <- data.frame(State = "OK", ageInt = 0, Prob = 1) state <- "OK" delta <- 0.2 calageInt(state, proxel,delta)
proxel <- data.frame(State = "OK", ageInt = 0, Prob = 1) state <- "OK" delta <- 0.2 calageInt(state, proxel,delta)
This function returns the transition probability for a given basic event and a proxel.
calProb(BE, state, proxel, delta)
calProb(BE, state, proxel, delta)
BE |
a list containing states, transition matrix, distributions and their parameters for a basic event |
state |
a string value |
proxel |
a data frame containing a state, age intensity and a probability. |
delta |
a numeric value as time step |
a numeric value between 0 and 1 as the transition probability
## A repairable basic event with Uniform(2, 2.5) failure distribution function ## and a fixed repair time of 0.3. delta <- 0.2 BE <- list( states = c("OK", "F"), G = rbind( c(NA, 1), c(1, NA) ), dist = c("unif", "unif"), param = list(c(2, 2.5), c(0.3 - delta, 0.3 + delta)) ) state <- "OK" proxel <- data.frame(State = "OK", ageInt = 0, Prob = 1) calProb(BE, state, proxel, delta)
## A repairable basic event with Uniform(2, 2.5) failure distribution function ## and a fixed repair time of 0.3. delta <- 0.2 BE <- list( states = c("OK", "F"), G = rbind( c(NA, 1), c(1, NA) ), dist = c("unif", "unif"), param = list(c(2, 2.5), c(0.3 - delta, 0.3 + delta)) ) state <- "OK" proxel <- data.frame(State = "OK", ageInt = 0, Prob = 1) calProb(BE, state, proxel, delta)
This function returns a list where the first element is a data frame of unavailabilities and the second element is the plot of the unavailabilities
FTUna(belist, mcs, totaltime, delta, tol)
FTUna(belist, mcs, totaltime, delta, tol)
belist |
a list containing all the basic components of a fault tree |
mcs |
a list of minimal cuts sets |
totaltime |
an integer value for the total time |
delta |
a numeric value as time step |
tol |
a numeric value for the tolerance level |
A list of unavailabilities for the basic events as well as the system, and their plots againts time steps
A<-list( states=c("OK","F"), G=rbind(c(NA,1), c(1,NA)), dist=c("exp", "exp"), param=list(c(0.1), c(1)) ) B<-list( states=c("OK","F"), G=rbind(c(NA,1), c(1,NA)), dist=c("exp", "exp"), param=list(c(0.01), c(2)) ) C<-list( states=c("OK","F"), G=rbind(c(NA,1), c(1,NA)), dist=c("exp", "weibull"), param=list(c(0.1), c(5,2)) ) D<-list( states=c("OK", "F"), G=rbind(c(NA, 1), c(1,NA)), dist=c("lnorm", "exp"), param=list(c(2, 0.1), 2) ) BElist<-list(A,B,C,D) names(BElist)<-c("A","B","C","D") MCS<-list(c("A", "C", "D"), c("B", "C", "D")) x<-FTUna(BElist, MCS, 5, 0.2, 1e-07) # Unavailabilities x$Unavailability #Plots x$Plot
A<-list( states=c("OK","F"), G=rbind(c(NA,1), c(1,NA)), dist=c("exp", "exp"), param=list(c(0.1), c(1)) ) B<-list( states=c("OK","F"), G=rbind(c(NA,1), c(1,NA)), dist=c("exp", "exp"), param=list(c(0.01), c(2)) ) C<-list( states=c("OK","F"), G=rbind(c(NA,1), c(1,NA)), dist=c("exp", "weibull"), param=list(c(0.1), c(5,2)) ) D<-list( states=c("OK", "F"), G=rbind(c(NA, 1), c(1,NA)), dist=c("lnorm", "exp"), param=list(c(2, 0.1), 2) ) BElist<-list(A,B,C,D) names(BElist)<-c("A","B","C","D") MCS<-list(c("A", "C", "D"), c("B", "C", "D")) x<-FTUna(BElist, MCS, 5, 0.2, 1e-07) # Unavailabilities x$Unavailability #Plots x$Plot
For a given vector of times and a probability distribution function, this function calculates the hazard rate values.
hazard(t, D, P, ...)
hazard(t, D, P, ...)
t |
a numeric value as time |
D |
a density function |
P |
a cumulative density function |
... |
More parameters |
Hazard rate functions defined as the ratio of the density function and the survival function. That is:
A numeric vector of hazard rate values.
## Standard normal distribution t <- c(0.1, 0.01) P <- pnorm D <- dnorm hazard(t, D, P) ## Uniform distribution with min=2.0 and max=2.5 t <- 2.2 P <- punif D <- dunif hazard(t, D, P, 2.0, 2.5)
## Standard normal distribution t <- c(0.1, 0.01) P <- pnorm D <- dnorm hazard(t, D, P) ## Uniform distribution with min=2.0 and max=2.5 t <- 2.2 P <- punif D <- dunif hazard(t, D, P, 2.0, 2.5)
For a given basic event and a proxel, this function calculates all the possible proxels for the next time step.
nextLevel(BE, proxel, delta)
nextLevel(BE, proxel, delta)
BE |
a list containing states, transition matrix, distributions and their parameters for a basic event |
proxel |
a data frame containing a state, age intensity and a probability. |
delta |
a numeric value as time step |
a data frame where each row is a proxel
#A multi-state basic event with Weibull(2, 3) transition distribution function #from working (OK) to an Intermediate State (IS), a fixed time of 0.5 transtion #from IS to failure (F), and a fixed repair time of 0.1 (transition from state F to state OK). delta <- 0.1 BE <- list( states = c("OK", "IS", "F"), G = rbind( c(NA, 1, 0), c(0, NA, 1), c(1, 0, NA) ), dist = c("weibull", "unif", "unif"), param = list(c(2, 3), c(0.5 - delta, 0.5 + delta), c(0.1 - delta, 0.1 + delta)) ) proxel <- data.frame(State = "IS", ageInt = 0.1, Prob = 0.9) delta <- 0.1 nextLevel(BE, proxel, delta)
#A multi-state basic event with Weibull(2, 3) transition distribution function #from working (OK) to an Intermediate State (IS), a fixed time of 0.5 transtion #from IS to failure (F), and a fixed repair time of 0.1 (transition from state F to state OK). delta <- 0.1 BE <- list( states = c("OK", "IS", "F"), G = rbind( c(NA, 1, 0), c(0, NA, 1), c(1, 0, NA) ), dist = c("weibull", "unif", "unif"), param = list(c(2, 3), c(0.5 - delta, 0.5 + delta), c(0.1 - delta, 0.1 + delta)) ) proxel <- data.frame(State = "IS", ageInt = 0.1, Prob = 0.9) delta <- 0.1 nextLevel(BE, proxel, delta)
This function calculates the isntantaneous unavailablity/reliabality values of a basic event.
ProxelBE(BE, state, totaltime, delta, tol)
ProxelBE(BE, state, totaltime, delta, tol)
BE |
a list containing states, transition matrix, distributions and their parameters for a basic event |
state |
a string value for the state |
totaltime |
an integer value for the total time |
delta |
a numeric value as time step |
tol |
a numeric value for the tolerance level |
For a multistate event, if the state is IS this function returns a vector of instantaneous probabilities of being in the intermediate state
a numeric vector of instantaneous unavailabilities when the state is F
#A multi-state basic event with Weibull(2, 3) transition distribution function #from working (OK) to an Intermediate State (IS), a fixed time of 0.5 transtion #from IS to failure (F), and a fixed repair time of 0.1 (transition from state F to state OK). delta <- 0.1 BE <- list( states = c("OK", "IS", "F"), G = rbind( c(NA, 1, 0), c(0, NA, 1), c(1, 0, NA) ), dist = c("weibull", "unif", "unif"), param = list(c(2, 3), c(0.5 - delta, 0.5 + delta), c(0.1 - delta, 0.1 + delta)) ) probIS <- ProxelBE(BE, state = "IS", totaltime = 5, delta = 0.2, tol = 0.000000001) plot(probIS, type = "l")
#A multi-state basic event with Weibull(2, 3) transition distribution function #from working (OK) to an Intermediate State (IS), a fixed time of 0.5 transtion #from IS to failure (F), and a fixed repair time of 0.1 (transition from state F to state OK). delta <- 0.1 BE <- list( states = c("OK", "IS", "F"), G = rbind( c(NA, 1, 0), c(0, NA, 1), c(1, 0, NA) ), dist = c("weibull", "unif", "unif"), param = list(c(2, 3), c(0.5 - delta, 0.5 + delta), c(0.1 - delta, 0.1 + delta)) ) probIS <- ProxelBE(BE, state = "IS", totaltime = 5, delta = 0.2, tol = 0.000000001) plot(probIS, type = "l")
This function returns a matrix of transition probabilities at a time point for a given basic event with specified transition distribution functions.
TM(G, dist, param, t, delta, states)
TM(G, dist, param, t, delta, states)
G |
a matrix of 1's, 0's and NA's. 1 and NA: transition is possible, 0: transition is not possible |
dist |
a string vector of transition distribution functions |
param |
a list of parameters of the transition distribution functions |
t |
a numeric value as time |
delta |
a numeric value as time step |
states |
a string vector of states' labels for the basic event |
A numeric matrix of transition probabilities.
## failure distribution function Uniform(2, 2.5) ## and a fixed repair time of 0.3 t <- 0.1 delta <- 0.2 states <- c("OK", "F") G <- rbind(c(NA, 1), c(1, NA)) dist <- c("unif", "unif") param <- list(c(2, 2.5), c(0.3 - delta, 0.3 + delta)) TM(G, dist, param, t, delta, states) ## failure distribution function exp(0.001) ## and not repairable t <- 0.1 delta <- 0.2 states <- c("OK", "F") G <- rbind(c(NA, 1), c(0, 1)) dist <- c("exp") param <- list(c(0.001)) TM(G, dist, param, t, delta, states)
## failure distribution function Uniform(2, 2.5) ## and a fixed repair time of 0.3 t <- 0.1 delta <- 0.2 states <- c("OK", "F") G <- rbind(c(NA, 1), c(1, NA)) dist <- c("unif", "unif") param <- list(c(2, 2.5), c(0.3 - delta, 0.3 + delta)) TM(G, dist, param, t, delta, states) ## failure distribution function exp(0.001) ## and not repairable t <- 0.1 delta <- 0.2 states <- c("OK", "F") G <- rbind(c(NA, 1), c(0, 1)) dist <- c("exp") param <- list(c(0.001)) TM(G, dist, param, t, delta, states)