class_reliability_calculation.py
Go to the documentation of this file.
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 """
5 
6  PHM Gui Reliability Calculation Class
7 
8 """
9 
10 import math
11 
12 
14  """
15  Reliability Calculation Class
16  """
17  def reliability_calculate_func(self, usage_time, failure_rate, selected_reliability_model, selected_reliability_unit, shape_parameter):
18  """
19  Reliability Calculation Function
20 
21  Reliability Types = Exponential, Rayleigh, Weibull, Curve Distribution
22  """
23 
24  reliability = 1.0
25  unit = 1
26 
27  if selected_reliability_unit:
28  unit = 3600
29 
30  reliability_time = float(usage_time) / float(unit)
31 
32  if selected_reliability_model == "Exponential Distribution":
33  reliability = self.reliability_exponential_func(reliability_time, failure_rate)
34 
35  elif selected_reliability_model == "Rayleigh Distribution":
36  reliability = self.reliability_rayleigh_func(reliability_time, failure_rate)
37 
38  elif selected_reliability_model == "Weibull Distribution":
39  reliability = self.reliability_weibull_func(reliability_time, failure_rate, shape_parameter)
40 
41  elif selected_reliability_model == "Curve Distribution":
42  reliability = self.reliability_curve_func(reliability_time, failure_rate, shape_parameter)
43 
44  else:
45  reliability = 1.0
46 
47  return float(reliability)
48 
49  @classmethod
50  def reliability_exponential_func(cls, reliability_time, failure_rate):
51  """
52  Reliability Model = Exponential Distribution
53 
54  R = e ^ -(λt)
55  """
56  return float(math.exp(float(-1) * float(reliability_time) * float(failure_rate)))
57 
58  @classmethod
59  def reliability_rayleigh_func(cls, reliability_time, failure_rate):
60  """
61  Reliability Model = Rayleigh Distribution
62 
63  R = e ^ -( (t/λ) ^ 2 )
64  """
65  return float(math.exp(float(-1) * pow((float(reliability_time) / float(failure_rate)), 2)))
66 
67  @classmethod
68  def reliability_weibull_func(cls, reliability_time, failure_rate, shape_parameter):
69  """
70  Reliability Model = Weibull Distribution
71 
72  R = e ^ -( (t/λ) ^ c )
73  """
74  return float(math.exp(float(-1) * pow((float(reliability_time) / float(failure_rate)), shape_parameter)))
75 
76  @classmethod
77  def reliability_curve_func(cls, reliability_time, failure_rate, shape_parameter):
78  """
79  Reliability Model = Curve Distribution
80 
81  R = e ^ -( e ^ ( (λt) ^ c ) - 1 )
82  """
83  mini_formula = float(math.exp(pow((float(reliability_time) * float(failure_rate)), shape_parameter))) - float(1)
84  return float(math.exp(float(-1) * mini_formula))
def reliability_calculate_func(self, usage_time, failure_rate, selected_reliability_model, selected_reliability_unit, shape_parameter)
def reliability_weibull_func(cls, reliability_time, failure_rate, shape_parameter)
def reliability_curve_func(cls, reliability_time, failure_rate, shape_parameter)


phm_reliability_calculation
Author(s):
autogenerated on Thu Aug 13 2020 16:41:48