Package 'ftaproxim'

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

Help Index


Age Intensity Function

Description

This function returns a numeric value indicating the pending time (in terms of time steps, delta) for a given state change of a proxel.

Usage

calageInt(state, proxel, delta)

Arguments

state

a string value

proxel

a data frame containing a state, age intensity and the probability.

delta

a numeric value as time step

Value

a numeric value as the age intensity

Examples

proxel <- data.frame(State = "OK", ageInt = 0, Prob = 1)
state <- "OK"
delta <- 0.2
calageInt(state, proxel,delta)

Transition Probability Function

Description

This function returns the transition probability for a given basic event and a proxel.

Usage

calProb(BE, state, proxel, delta)

Arguments

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

Value

a numeric value between 0 and 1 as the transition probability

Examples

## 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)

Fault Tree Unavailability

Description

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

Usage

FTUna(belist, mcs, totaltime, delta, tol)

Arguments

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

Value

A list of unavailabilities for the basic events as well as the system, and their plots againts time steps

Examples

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

Hazard Rate Function

Description

For a given vector of times and a probability distribution function, this function calculates the hazard rate values.

Usage

hazard(t, D, P, ...)

Arguments

t

a numeric value as time

D

a density function

P

a cumulative density function

...

More parameters

Details

Hazard rate functions defined as the ratio of the density function and the survival function. That is:

Value

A numeric vector of hazard rate values.

Examples

## 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)

Proxels of the next time step

Description

For a given basic event and a proxel, this function calculates all the possible proxels for the next time step.

Usage

nextLevel(BE, proxel, delta)

Arguments

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

Value

a data frame where each row is a proxel

Examples

#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)

Instantaneous Unavailability Vector

Description

This function calculates the isntantaneous unavailablity/reliabality values of a basic event.

Usage

ProxelBE(BE, state, totaltime, delta, tol)

Arguments

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

Details

For a multistate event, if the state is IS this function returns a vector of instantaneous probabilities of being in the intermediate state

Value

a numeric vector of instantaneous unavailabilities when the state is F

Examples

#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")

Transition Probability Matrix

Description

This function returns a matrix of transition probabilities at a time point for a given basic event with specified transition distribution functions.

Usage

TM(G, dist, param, t, delta, states)

Arguments

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

Value

A numeric matrix of transition probabilities.

Examples

## 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)