Time Series Rainflow Analysis For Fatigue Life
Calculation
1st Leonardo Francisco Garrafa Pacheco
2nd Orlando Miramontes
3nd Francisco Javier Cantú Ortiz
School of Engineering and Sciences
Tecnológico de Monterrey
Estado de México, México
a01222528@itesm.mx
School of Engineering and Sciences
Tecnológico de Monterrey
Monterrey, México
A01185687@itesm.mx
School of Engineering and Sciences
Tecnológico de Monterrey
Monterrey, México
fcantu@tec.com
Abstract—To have a proper mechanical design, the dynamic
behavior of the structure needs to be accounted for. Depending on
the application, the components are subjected to time dependent
stress levels, which lead the structure to crack and fail after
certain usage time. This article aims to calculate structure’s
expected life by proposing a tool to analyze, by Rainflow Counting
methodology, time series measurements from a strain gauge, to
calculate life using the stress-life approach. The tool is coded
in Python, and it uses time series measurement and material
properties as input parameters. Out of these inputs, the tool
calculates life in seconds and hours, which can be directly
compared with the design goal and gives the designer guidance
before launching the product to the market. The tool developed
was used to calculate fatigue life on a structural part as per
strain measurements obtained from testing.
Index Terms—Fatigue, SN, Stress Life, Time Series, Strain,
Strain Gauge, Testing, Python, Rainflow, Design Life.
I. I NTRODUCTION
Rainflow methodology in combination with a fatigue theory
is the most widely used method in the industry to calculate
fatigue life of a component that has been tested and strain
measured through a strain gauge. This is applied in all types
of industries, such automotive [3] [4], aerospace [5] [6],
semiconductors [7], and in general any industry that designs
structural components. When designing structural components,
the main goal is for the component to endure certain time
without cracking or failing, this time is usually an amount of
hours which the companies use as warranty for the product. In
order to determine if a design idea or prototype will meet the
goal, some samples are tested with sensors on them to measure
mainly loads and strain levels. Those strain levels, in combination with rainflow and fatigue theories, can approximate
the time the component will last before it cracks. Companies
usually buy software packages licences with the capability of
doing this calculations, such as nCode DesignLife, however
they tend to be expensive. The purpose of this work is to create
a code that from a strain time series measurement and material
fatigue properties, it can calculate the expected lifespan before
a crack appears in the measurement location.
II. M ETHOD AND DATA
The task of calculating fatigue life from a strain time series
can be divided in two main parts, first applying the Rainflow
Counting Method and then applying a Fatigue theory to end
up with life in seconds, hours, etcetera. Lets discuss these two
parts, which are performed consecutively as follows:
1) Rainflow Counting Method
This method delivers the number of fatigue cycles during
the load-time history of a material [1]. That is done by
doing the next four steps:
a) Hysteresis Filtering
The intention of this step is to remove cycles which
contribution to the total damage is very small. This
is done by defining a gate that is projected from
left to right from each point in the time series, and
removing each point that is smaller than the gate.
b) Peak-Valley Filtering
This step aims to preserve only the maximum and
minimum value of the cycles by removing the
points in between, because only maximum and
minimum values are relevant for fatigue calculation.
c) Discretization (Binning)
The stress range of the complete signal is divided
into discrete parts called ”bins”. Then, each data
point is mapped to the center of its bin, which
allows the counting procedure.
d) Four Point Counting Method
In this step is where the counting process is done
by following the next steps:
i) Select the first four consecutive data points
P 1, P 2, P 3 and P 4.
ii) Define outer points = {P 1, P 4} and
inner points = {P 2, P 3}.
iii) A cycle is counted if the inner points are
bounded by the outer points. If that is the
case, it is added to the rainflow matrix, which is
an nxn matrix where n is the number of bins.
When a cycle is detected, the value in position
(P 2,P 3) is incremented by one. A cycle is said
to be from P 2 to P 3 in the rainflow matrix, as
shown in the next Fig. 1 below.
Fig. 1. Detected cycle in a rainflow matrix (taken from [1]).
Then, after the cycle is added to the matrix,
P 2 and P 3 values are removed from the loadtime history, and the process is started again
from point 1(d)i until completing all the loadtime history. However, if the inner points are
not bounded by the outer points, the cycle is
not counted, P 2, P 3, P 4 values are assigned to
P 1, P 2, P 3 respectively, and the next value in
the series is assigned to P 4. After that, start the
process again from point 1(d)ii.
Not all the data points are included in the
matrix because there are points that do not
satisfy the rainflow algorithm. These points
are called the Residue. The Residue contains
half-cycles that can be excluded or included
in the matrix; however, for this work, it was
decided to exclude from them from the matrix
because there are not univariate collectives to
be processed [2].
2) Fatigue Theory - Stress Life Approach
For some applications, failure, that may or may not
visually seen due to excessive deformation, is caused
by varying stress fluctuating between different levels.
Structural components that fail under this condition do
not necessarily exceed yield stress or UTS. This type
of failure is known as fatigue failure. An example of
fatigue failure is represented in figure 2.
According to Budynas and Nisbett [8], Stress-Life (SN)
consists in correlating the stress level with an amount
of cycles that it takes to cause a failure. This is usually
done through extensive testing, when a rotating probe
is loaded with a constant bending load. An important
clarification is that due to the test setup, the number
of cycles is fully-reversed, which means that one cycle
is defined as going from stress σ = 0 to σ = σmax to
σ = −σmax and back to σ = 0 again. Several probes are
tested with different bending loads up until a plot such as
figure 4 can be generated. This is called a S-N curve.
As seen in figure 4, the S-N curve is made by linear
segments in the log-log scale. The main segment goes
from 1e3 to 1e6, which is the most used for engineering
applications.
Fig. 2. Fatigue fracture surface of a forged connecting rod of AISI 8640 steel.
The fatigue crack origin is at the left edge, at the flash line of the forging,
but no unusual roughness of the flash trim was indicated. The fatigue crack
progressed halfway around the oil hole at the left, indicated by the beach
marks, before final fast fracture occurred.
Source: Budynas, Richard, and Keith Nisbett. Shigley’s Mechanical
Engineering Design. 10th ed., McGraw-Hill Education, 2014. p.278
Fig. 3. An S-N diagram plotted from the results of completely reversed axial
fatigue tests. Material: UNS G41300 steel, normalized; Sut = 116 kpsi;
maximum Sut = 125 kpsi.
Source: Budynas, Richard, and Keith Nisbett. Shigley’s Mechanical
Engineering Design. 10th ed., McGraw-Hill Education, 2014. p.282
Fig. 4. Test-specimen geometry for the R. R. Moore rotating-beam machine.
The bending moment is uniform, M = F a, over the curved length and at
the highest-stressed section at the mid-point of the beam.
Source: Budynas, Richard, and Keith Nisbett. Shigley’s Mechanical
Engineering Design. 10th ed., McGraw-Hill Education, 2014. p.282
TABLE I
6082 T6 Aluminum SN fatigue properties (for equation 1).
Property
a (N < 103 )
b (N < 103 )
a (103 < N < 5 · 108 )
b (103 < N < 5 · 108 )
a (N > 5 · 108 )
b (N > 5 · 108 )
Value
350
-0.0516
414.3371
-0.0761
199.3426
-0.0395
Any point in the main segment of the S-N curve can be
represented by equation 1:
σ = aN b
(1)
Where a and b are known from testing or literature
if using a common material. Be reminded that σ is a
completely reversed stress, since the way the probes are
tested, a cycle is always fully-reversed.
A plot such as figure 4 is made of at least two segments
(both represented by same equation 1, but with different
a and b values), and sometimes a third segment from
1e3 to a higher amount of cycles can be added if data
is available.
From this plot, calculating fatigue life is pretty simple,
what is needed is the maximum stress present in the
component or part and simply solving for N .
The data to be analyzed is a series of strain gauge time series
measurements that were obtained from different locations on
a single part. For confidentiality reasons with the company
that shared the information, it is not possible to print pictures
of the part. The part in question was instrumented with 8
strain gauges in different locations and subjected to an test,
which is a 2 min load time history representative of the whole
usage of the component. In the test, this 2 min ”load cycle”
is repeated until achieving the desired amount of time to get
enough reliability on the part. The results to be shared in the
results section III are life approximations based in time series
measurements from one of the 2 min load cycles.
The part is made of 6082 T6 Aluminum, whose fatigue
properties as per the stress life fatigue theory can be found in
table I and graphically in figure 5.
Fig. 5. Estimated SN curve for 6082 T6 Aluminum as per material properties
listed in table I.
a minimum of 64 bins [1], then the hysteresis gate should
be a fraction of the bin. The minimum and maximum measured values in the data are -95.0175 MPa and 206.23 MPa
respectively. Then, the bin can be obtained as:
max − min
64
206.23 − (−95.0175)
=
64
301.2475
=
64
= 4.70
maximum bin =
Selecting a bin value lower than 4.70 provides more accuracy
in the results. Therefore, a bin = 0.5 and a hysteresis gate =
0.1 were decided to be used for the calculation.
1) Hysteresis Filtering: After the hysteresis filtering, the
number of data points was reduced from 65894 to 63442. It
means 2452 small cycles were removed from the load-time
history. For illustration purposes, Fig. 6 shows a small range
of the load-time history before and after the filtering.
III. R ESULTS
The development of this section is divided in two parts:
1) first, the data is processed under the Rainflow Counting
Method to get the number of fatigue cycles in the data
provided; then, 2) this information is used to calculate the
lifetime and accumulated damage of the piece. For illustrative
purposes, the results displayed here correspond to the measurements from strain gauge 6.
A. Rainflow Counting Method
First, values for the bin amplitude and the hysteresis gate
should be determined for this process. Typical bin values can
be obtained dividing the complete range of stress values by
Fig. 6. Stress after hysteresis filtering from 320 to 345 timestamp.
2) Peak-Valley Filtering: After the peak-valley filtering, the
number of data points was reduced from 63442 to 16888. It
means 46554 cycles, which are not relevant for the fatigue
calculation, were removed from the load-time history. For
illustration purposes, Fig. 7 shows a small range of the loadtime history before and after the filtering.
Fig. 10. Rainflow Matrix.
Fig. 7. Stress after peak-valley filtering from 320 to 345 timestamp.
3) Discretization (Binning): A total of 5164 data points
were mapped to 403 discrete 0.5 MPa bins. For illustration
purposes, Fig. 8 shows a small range of the load-time history
before and after the filtering.
Finally, the cycle values that are needed for the fatigue
analysis are obtained from the matrix in Fig. 10 as follows:
• # of cycles = count
• average = (from + to)/2
• amplitud = |from − to|
Then, this information is used by the stress-life algorithm,
mentioned in the Appendix, getting a expected life of 5768
hours for the strain gauge 6.
This same process was performed for the data in the other
locations getting the results listed in Table II.
TABLE II
Fatigue life at the 8 different measurement locations of the tested part.
Strain Gauge
1
2
3
4
5
6
7
8
Expected Life (Hours)
233320
166562
54069
64 × 109
7 × 109
5768
225 × 109
38392
Fig. 8. Stress after discretization from 320 to 345 timestamp.
IV. D ISCUSSION
4) Four Point Counting Method: A total of 5164 discretized
data points were processed under the Four Point Counting
Method. The Residue obtained, shown in Fig. 9, consist of 22
half-cycles, which are excluded from the rainflow matrix.
Fig. 9. Residue.
The obtained rainflow matrix is shown in Fig. 10
The tested part design life goal is 10,000 hours, which
means the part should withstand the applied load for that time.
As per the table II, which contains the expected life in hours
for the 8 different locations where strain was measured in the
tested part, there is only 1 location where the design life goal
is not met, which is in the location of gauge number 6. The
conclusion that can be drawn from this analysis is the part
needs a redesign in the location 6 so it is more robust and
can withstand the load better. If the part is not redesigned,
then it will not meet the design life goal and it will crack
before the 10,000 hours. Fatigue theories are not exact, given
there are many factors affecting the calculation, but it is a
fair approximation, so the part should crack at location 6 at
somewhere around 5,768 hours.
When it comes to the rest of the locations, it can be
concluded that the part will not fail in those locations under
that loading, or at least not within 10,000 hours. If a more
lean and optimized design is desired, this analysis concludes
as well that in locations 1-5 and 7-8 some material can be
removed -if possible- to reduce weight (hence cost) from the
part, specially at locations 4,5 and 7, where the expected life
is clearly much higher than the design goal.
V. C ONCLUSION
A fatigue life calculator was successfully developed in
Python, which takes material properties and strain time series
as input, and gives fatigue life in hours as output. This type
of tool is very useful for structural design engineers, who, in
their everyday work, take decisions on the shape and geometry
of parts, and by having this tool, they can easily convert from
strain gauge time series data measured in any test to fatigue
life, that can be read as ”hours before a crack appears”, which
can be directly compared against the design life goal and take
design decisions based on the results.
R EFERENCES
[1] Siemens. 2021. Rainflow Counting. [ONLINE] Available at:
https://community.sw.siemens.com/s/article/rainflow-counting.
[Accessed 5 November 2021].
[2] Weisang. 2021. Count Matrix Analysis Object (Counting
Procedures
Option).
[ONLINE]
Available
at:
https://www.weisang.com/en/documentation/countmatrixanalysis en.
[Accessed 12 November 2021].
[3] E. A. A. E. Mohamed, M. A. Yusuff & A. P. D. D. A. Wahab
(2009). Application of rainflow cycle counting in the reliability prediction of automotive front corner module system. 16th International
Conference on Industrial Engineering and Engineering Management.
https://doi.org/10.1109/ICIEEM.2009.5344498.
[4] Baek, S.H., Cho, S.S. & Joo, W.S (2008). Fatigue life prediction based
on the rainflow cycle counting method for the end beam of a freight car
bogie. https://doi.org/10.1007/s12239-008-0012-y
[5] Sunder, R (1991) Rainflow Applications in Accelerated Cumulative13;
Fatigue Analysis. Technical Report. National Aerospace Laboratories,
Bangalore, India.
[6] Russell J.H. Wanhill (2018). Chapter Two - Fatigue Requirements for Aircraft Structures; Aircraft Sustainment and Repair.
https://doi.org/10.1016/B978-0-08-100540-8.00002-9.
[7] GopiReddy, Lakshmi Reddy, Tolbert, Leon M., Ozpineci, Burak, & Pinto, Joao O. P. (2015). Rainflow Algorithm-Based Lifetime Estimation of Power Semiconductors in Utility Applications.
https://doi.org/10.1109/TIA.2015.2407055.
[8] Budynas, Richard, and Keith Nisbett. Shigley’s Mechanical Engineering
Design. 10th ed., McGraw-Hill Education, 2014.
.
A PPENDIX
Available at:
https://github.com/a01222528/rainflow-fatigue-lifecalculation.git
1
# %%
import pandas
4 import numpy
2
3
print("Range:", stress_serie.max()[0]-stress_serie.
min()[0])
62 print("Maximum bin value:", (stress_serie.max()[0]stress_serie.min()[0])/64)
61
63
stress_serie.plot( title = "Complete Series", **dict
(item for item in plot_parameters.items() if
item[0] in ["xlabel","ylabel"]) )
65 stress_serie[320:345].plot( title = "Head Series",
**dict(item for item in plot_parameters.items()
if item[0] in ["xlabel","ylabel"]) )
64
66
5
# %%
# Hysteresis Filtering
69 def hysteresis_filtering( data, gate ):
8 def compare_plots(base,modified,params):
70
ftr = data.copy(deep=True)
9
plot = pandas.merge(
71
i = 0
10
base,
72
to_drop = list()
11
modified,
73
while i < len(data):
12
how="outer",
74
j = 1
13
left_index=True,
75
try:
14
right_index=True
while abs(ftr["stress"][i+j] - ftr["
15
).interpolate(method="linear").plot(**params 76
stress"][i]) < gate:
,grid=True,zorder=2)
to_drop.append(i+j)
16
plot.get_figure().savefig("rf_"+modified.keys() 77
78
j += 1
[0]+".png")
79
i = i+j
17
80
except:
18 def get_number_of_decimals( flt ):
81
break
19
for i in range(10):
82
ftr.drop(to_drop,inplace=True)
20
if flt*(10**i) == round(flt*(10**i)):
83
21
break
84
print("Input length: {}\nOutput length: {}\
22
else:
nRemoved: {}".format(
23
raise Exception(flt, "is too long to get
85
len(data),
number of decimals.")
86
len(ftr),
24
return i
87
len(data)-len(ftr)
25
88
))
26 plot_parameters = {
89
27
"xlabel" : "timestamp",
90
return ftr
28
"ylabel" : "MPa",
91
29
"xlim" : (320,345), #(275,350)
92 stress_hysteresis_filtered = hysteresis_filtering(
30
"ylim" : (1,8)
stress_serie, algorithm_parameters["
31 }
hysteresis_gate"] )
32
93 compare_plots(stress_serie,
33 algorithm_parameters = {
stress_hysteresis_filtered.rename(columns = {"
34
"hysteresis_gate"
: 0.1, # 0.5
stress":"hysteresis_filtered"}),{"title":"
35
"binning" : {
Hysteresis Filtering",**plot_parameters})
36
"value"
: 0.5, # 1.0
94
37
"decimals"
: None
95 # %%
38
}
96 # Peak-Valley Filtering
39 }
97 def peak_valley_filtering( data ):
40 algorithm_parameters["binning"]["decimals"] =
98
ftr = data.copy(deep=True)
get_number_of_decimals( algorithm_parameters["
99
i = 1
binning"]["value"] )
100
idx = data["stress"].keys()
41
101
to_drop = list()
42
102
orientation_prev = "down" if ftr["stress"][idx
43 # %%
[1]] < ftr["stress"][idx[0]] else "up"
44 # Data Preprocessing
103
while i < len(data)-1:
45 df = pandas.read_csv(filename+".csv")[7:]
104
orientation = "down" if ftr["stress"][idx[i
46
+1]] < ftr["stress"][idx[i]] else "up"
47 df.columns="ts,time,stress".split(",")
105
if orientation_prev == orientation:
48 df[["time","stress"]] = df[["time","stress"]].apply(
106
to_drop.append(idx[i])
pandas.to_numeric)
107
else:
49
108
orientation_prev = orientation
50 df["stress"] = df["stress"]*205000/1000000
109
i=i+1
51
110
52 stress = df["stress"].values.tolist()
111
ftr.drop(to_drop,inplace=True)
53 stress_serie = pandas.DataFrame(stress,columns=["
112
stress"])
113
print("Input length: {}\nOutput length: {}\
54
nRemoved: {}".format(
55 total_time = df["time"].max()-df["time"].min()
114
len(data),
56
115
len(ftr),
57 print("Min stress:", stress_serie.min()[0])
116
len(data)-len(ftr)
58 print("Max stress:", stress_serie.max()[0])
117
))
59 print("Measurements:", len(stress_serie))
6
filename = "Test6"
60
67
68
7
print("Total time (sec):", total_time)
118
119
return ftr
120
176
stress_peak_valley_filtering = peak_valley_filtering 178
( stress_hysteresis_filtered )
179
122 compare_plots(stress_serie,
180
stress_peak_valley_filtering.rename(columns = {" 181
stress":"peak_valley_filtered"}),{"title":"Peak- 182
Valley Filtering",**plot_parameters})
183
121
123
idx = idx.drop(idx[s[2]])
177
184
s = [0, 1, 2, 3]
else:
# Incomplete Cycle
s[0] = s[1]
s[1] = s[2]
s[2] = s[3]
s[3] = s[3] + 1
# %%
185
125 # Binning
186
126 def binning( data, bin ):
187
ftr.drop(set(data["stress"].keys())-set(idx),
127
ftr = data.copy(deep=True)
inplace=True)
128
i = 0
188
129
idx = data["stress"].keys()
189
return matrix_dict,ftr
130
while i < len(data):
190
131
ftr["stress"][idx[i]] = (ftr["stress"][idx[i 191 matrix_dict,residue = four_point_counting_method(
]]//bin["value"])*bin["value"]+bin["value"]/2
stress_bin )
132
i=i+1
192
133
193 residue_plot_parameters = {
134
return ftr
194
"title":"Residue",
135
195
"xlabel" : "timestamp",
136 stress_bin = binning( stress_peak_valley_filtering, 196
"ylabel" : "MPa"
algorithm_parameters["binning"] )
197 }
137 compare_plots(stress_serie,stress_bin.rename(columns 198 compare_plots(stress_serie,residue.rename(columns =
= {"stress":"binned"}),{"title":"Binning",**
{"stress":"residue"}),residue_plot_parameters)
plot_parameters})
199 print("Number of residue elements",len(residue))
124
138
200
input_len = len(set(i[0] for i in
stress_peak_valley_filtering.values))
140 output_len = len(set([i[0] for i in stress_bin.
values]))
201
# %%
def plot_rainflow_matrix(matrix_dict, title, outname
):
203
lims = (-30,30)
141
204
rainflow_matrix = list()
142 print("Input length: {}\nOutput length: {}\nRemoved: 205
for f in matrix_dict:
{}".format(
206
for t in matrix_dict[f]:
143
input_len,
207
rainflow_matrix.append( [f,t,matrix_dict
144
output_len,
[f][t]] )
145
input_len-output_len
208
146
))
209
last_df = pandas.DataFrame(rainflow_matrix,
147
columns=["from","to","count"])
148 # %%
210
plot = last_df.plot.scatter(title=title,x="to",y
149 # Four Point Counting Method
="from",c="count",xlabel="to (MPa)",ylabel="from
150 def four_point_counting_method( data ):
(MPa)",grid=True,colormap="YlOrRd",sharex=False
151
,xlim=lims,ylim=lims,zorder=2)
152
matrix_len = numpy.arange(data.min()[0],data.max 211
plot.get_figure().savefig(filename+"/"+outname)
()[0]+algorithm_parameters["binning"]["value"], 212
return rainflow_matrix
algorithm_parameters["binning"]["value"]).round 213
(5)
214 rainflow_matrix = plot_rainflow_matrix( matrix_dict,
153
print("Matrix size: ", len(matrix_len))
"Rainflow Matrix", "rf_rainflow_matrix.png")
154
215 print("Rainflow matrix size:", len(rainflow_matrix))
155
matrix_dict = dict()
216
156
for f in matrix_len:
217 # %%
157
matrix_dict[f] = dict()
218 # Rainflow information
158
for t in matrix_len:
219 rainflow_info_table = list()
159
matrix_dict[f][t] = 0
220 for f,t,c in rainflow_matrix:
160
221
rainflow_info_table.append([c, (f+t)/2, abs(t-f)
161
ftr = data.copy(deep=True)
])
162
idx = data["stress"].keys()
222 rainflow_info_table = numpy.array([info for info in
163
rainflow_info_table if info[0] != 0])
164
s = [0, 1, 2, 3]
223
165
224 n, S_m, S_a = rainflow_info_table[:,0],
166
while s[3] < len(idx):
rainflow_info_table[:,1],rainflow_info_table
167
Z = [ ftr["stress"][idx[i]].round(5) for i
[:,2]
in s ]
225
168
226 # %%
169
if (Z[0] <= Z[1] and Z[0] <= Z[2] and Z[1] 227 # Stress-life methodology
<= Z[3] and Z[2] <= Z[3]) or \
228 import numpy as np
170
(Z[3] <= Z[1] and Z[3] <= Z[2] and Z[1] 229 import math
<= Z[0] and Z[2] <= Z[0]):
230
171
231 # Material Properties
172
# Complete Cycle
232 SRI1 = 828.674176498713
173
matrix_dict[Z[1]][Z[2]] += 1
233 b1 = -0.0760625751181736
174
234 b2 = -0.0395348487609183
175
idx = idx.drop(idx[s[1]])
235 Nc1 = 5e8
139
202
236
237
UTS = 350
El = 0
238
239
240
S = (S_a)/(1-S_m/UTS)
sorted_counts_and_stress = sorted([[i,s] for i,s in
zip(n,S)],key=lambda x: x[1])
241
242
243
a_df = pandas.DataFrame(sorted_counts_and_stress)
a_array = a_df[a_df[1] != 0].values
244
245
n,S = a_array[:,0],a_array[:,1]
246
kf = 1
N1e6 = 1e6**b1*SRI1/2
249 b1 = (math.log10(N1e6/kf)-math.log10(SRI1/2))/(math.
log10(1e6)-math.log10(1))
247
248
250
251
252
k = (1/(SRI1/2))**(1/b1)
m = 1/b1
253
254
N = k*(S)**m
255
256
257
Nm1e3 = len(N[np.where(N<1000)[0]])
Nm1e3 = len(N) - Nm1e3 + 1
258
SRI10 = 2*UTS
N1e3 = 1e3**b1*SRI1/2
261 b0 = (math.log10(N1e3)-math.log10(SRI10/2))/(math.
log10(1e3)-math.log10(1))
262 m00 = 1/b0
263 k0 = (1/(SRI10/2))**(1/b0)
259
260
264
265
eS_UTS = len(S[np.where(S<math.ceil(UTS))[0]])+1
266
267
268
N[Nm1e3:eS_UTS] = k0*(S[Nm1e3:eS_UTS])**m00
N[eS_UTS:] = 1
269
if(b2 != 0):
m22 = 1/b2
272
SNc1 = (Nc1/k)**(1/m)
273
k2 = Nc1/SNc1**m22
274
NmNc1 = len(N[np.where(N>Nc1)[0]])
275
N[:NmNc1] = k2*(S[:NmNc1])**m22
270
271
276
# %%
# Calculate Damage
279 total_damage = n/N
280 print("Total damage (%): ", total_damage.sum())
277
278
281
# %%
# Expected Life
284 damage_per_second = i_damage.sum() / total_time
285 expected_life_seconds = 1 / damage_per_second
282
283
286
print("Expected life in seconds: {}".format(
expected_life_seconds.round(2)))
288 print("Expected life in hours:
{}".format((
expected_life_seconds/3600).round(2)))
289 print("Expected life in years:
{}".format((
expected_life_seconds/31536000).round(5)))
287
Listing 1. Python code
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )