PyPFD 2026.0.0.2
PFDavg calculation
Requires Python: >=3.8
Keywords: SIS, SIF, IEC61508, IEC61511, PFD, reliability, functional safety, 1oo1, 1oo2, 2oo3, 2oo2, 1oo3, N2595

Introduction

PyPFD is a Python library designed to calculate the Probability of Failure on Demand (PFD) in accordance with the international safety standards IEC 61508 and IEC 61511. It provides a way to estimate the reliability of Safety Devices, making it easier for engineers and safety professionals to perform consistent SIS assessments.

It allows you to evaluate PFDavg for various architectures (1oo1, 1oo2, 2oo2, 2oo3, 1oo3, and KooN using a general formula).

The library provides the following formulas:

PyPFDRBDAvg:

pfd_RBD_avg_1oo1(λ_du, λ_dd, T1_month, MTTR)

pfd_RBD_avg_1oo1_pt(λ_du, λ_dd, T1_month, T2_month, PDC, MTTR)

pfd_RBD_avg_1oo2(λ_du, λ_dd, β, βd, T1_month, MTTR)

pfd_RBD_avg_1oo2_pt(λ_du, λ_dd, β, βd, T1_month, T2_month, PDC, MTTR)

pfd_RBD_avg_1oo3(λ_du, λ_dd, β, βd, T1_month, MTTR)

pfd_RBD_avg_2oo2(λ_du, λ_dd, T1_month, MTTR)

pfd_RBD_avg_2oo2_pt(λ_du, λ_dd, T1_month, T2_month, PDC, MTTR)

pfd_RBD_avg_2oo3(λ_du, λ_dd, β, βd, T1_month, MTTR)

pfd_RBD_avg_KooN(K, N, λ_du, λ_dd, β, βd, T1_month, MTTR)



PyPFDMarkov:

pfd_Mkv_avg_1oo1_2pt(λ_du: float,λ_dd: float,λ_s: float,T_pt1_month: float,T_pt2_month: float,T1_month: float,PDC1: float,PDC2: float,MTTR: float)

pfd_Mkv_avg_1oo2(λ_du: float,λ_dd: float,λ_su: float,λ_sd: float,β:float, βd:float,T1_month: float,MTTR:float)

pfd_plot_Mkv_avg_1oo1_2pt(λ_du: float,λ_dd: float,λ_s: float,T_pt1_month: float,T_pt2_month: float,T1_month: float,PDC1: float,PDC2: float,MTTR: float,interval:int)

pfd_plot_Mkv_avg_1oo2(λ_du: float,λ_dd: float,λ_su: float,λ_sd: float,β:float, βd:float,T1_month: float,MTTR:float,interval:int)


PyPFDN2595:

pfd_N2595_avg_MooN(M:int,N:int,λ_du:float,λ_dd:float,β:float,T1_month:float,MTTR:float) -> float:

pfd_N2595_avg_1oo1_1pt(λ_du:float,λ_dd:float,PTC:float,TI_month:float,MT_month:float,MTTR:float) -> float:

pfd_N2595_avg_1oo2_1pt(λ_du:float,λ_dd:float,β:float,TI_month:float,MT_month:float,PTC:float,MTTR:float) -> float:

pfd_N2595_avg_2oo2_1pt(λ_du:float,λ_dd:float,PTC:float,TI_month:float,MT_month:float,MTTR:float) -> float:

pfd_N2595_avg_2oo3_1pt(λ_du:float,λ_dd:float,β:float,TI_month:float,MT_month:float,PTC:float,MTTR:float) -> float:



Parameters:

λ_du = dangerous undetected failure rate per hour

λ_dd = dangerous detected failure rate per hour

β = common cause for safe failure in %

βd = common cause for unsafe failure in %

T1_month = test interval in months (with PDC effectiveness)

T2_month or MT_month = test interval in months for "as good as new" condition

PDC = partial diagnostic coverage of the test (% capable of revealing dangerous undetected failures)

MTTR = mean time to repair

All formulas assume identical devices. For combinations of different devices or different test intervals, see the formulas below (currently in development and not validated yet):

def pfhKooN(K, N, λ_d, β, T1_month):
def pfd_avg_1oo2_dif(λ_du1, λ_dd1, T1_month1, MTTR1, β1, βd1,
                      λ_du2, λ_dd2, T1_month2, MTTR2, β2, βd2):

def pfd_avg_2oo3_dif(λ_du1, λ_dd1, T1_month1, MTTR1, β1, βd1,
                      λ_du2, λ_dd2, T1_month2, MTTR2, β2, βd2,
                      λ_du3, λ_dd3, T1_month3, MTTR3, β3, βd3):

def pfd_avg_1oo3_dif(λ_du1, λ_dd1, T1_month1, MTTR1, β1, βd1,
                      λ_du2, λ_dd2, T1_month2, MTTR2, β2, βd2,
                      λ_du3, λ_dd3, T1_month3, MTTR3, β3, βd3):

Roadmap

-Test and validate all existing formulas.

-Create a GitHub repository explaining the logic behind the formulas.

-Develop default reliability data for common devices (Analog Transmitters, Valves, and Logic Solvers).


Highlights

-These formulas, combined with xlwings Lite in Excel, provide an efficient and user-friendly way to perform SIS assessments.

-If you need a specific architecture not present in the library, feel free to contact me for assistance.