Beruflich Dokumente
Kultur Dokumente
RAINFLOW
COUNTING
ALGORITHM
version 6.2
Worksheet Information
This worksheet performs a rainflow count on a given time history. This produces a histogram of the number
of cycles of a given mean and range, counted into appropriate user-specified 'bins'. Note that the value
allocated to each bin is the value at the middle of the mean/range interval associate with the bin. The
rainflow function requires two inputs. The first is a vector which is the time history to be counted; the
second is the number of bins to be used in the rainflow histogram. The method used for the rainflow count
is taken from Amzallag et. al. (1994).
First read in the time history upon which the rainflow count is to be performed:
stress
-28.90204058
-29.21270246
-29.96892961
-30.59155933
i 1 length stress
100
50
stressi
0
50
100
150
0
1 10
2 10
i
R i fl
3 10
4 10
The rainflow function defined below makes use of the 'trim' function (which trims
out the rows specified in the index vector from the original data vector). This
function is included as part of the Data Analysis Extension Pack but, in case this is not
available, it is included in the rainflow function.
rainflow v bins
data data
trimcount 1
for i 1 cols data
on error match i index
return newdata
N length v
i 1
inter if v
i
i 1
v v v
i
i 1
vi1 vi vi vi1 1 0
max v min v
j 1
bins
bins
Mlim min v
j
max v min v
j 1
bins
max v min v
1
j
bins
2
Mbinval min v
j
max v min v
bins
"set the initial rainflow count (initial and residual) for each bin to zero"
Rcount
bins bins
Rcountres
bins bins
"now pass through the time history, counting and removing any cycles that are found"
"repeat this until no more complete cycles can be counted and all that is left is a 'residual' '"
for count 1 10000
0
check 0
0
"loop to find the cycles to be counted"
for i 4 N
stack check1 i 2 i 1
vi 2 vi 1
check if v
v v
v v v v
v v
v v v
check
i 2
i 3
i 1
i 3
i
i 2
i 2
i 3
i 1
i 3
i
i 2
2
v v
i 2 i 1
for j 1 bins
Rcount
i j
Rcount
i j
check
2 1
Mlim check
i
2 1
Mlim
i 1
"remove the data points for the cycle that has been counte d"
v trim v check
N length v
vres1 v
"the next step is to rainflow count the 'residual' "
"first add the residual to itself"
for i 1 N
v
i N
N length v
"trim out any adjacent points that have identical values"
for i 1 N 1
diffres v
i
i 1
interres if v
i
i 1
v v v
i
i 1
vi1 vi vi vi1 1 0
"now pass through the time history, counting and removing any cycles that are found"
"repeat this until no more complete cycles can be counted and all that is left is the 'residual' again '"
for countres 1 10000
check 0
0
stack check1 i 2 i 1
vi 2 vi 1
check if v
v v
v v v v
v v
v v v
check
i 2
i 3
i 1
i 3
i
i 2
i 2
i 3
i 1
i 3
i
i 2
2
v v
i 2 i 1
i j
Rcountres
i j
check
2 1
"remove the data points for the cycle that has been counted"
v trim v check
N length v
vres2 v
"Overall rainflow matrix"
Rain Rcount Rcountres
"Range count"
for i 1 bins
Range
i
Rain i
Mlim check
Mlim check
Rlim check
Rlim
i
2 1
i 1
2 2
j
2 2
j1
Rain
Range
Rbinval
Mbinval
count
Rcount
countres
Rcountres
vres1
vres2
bins 50
Results
MeanRange Result
Range count
Rangecount Result
Rangeval Result
Meanval Result
1
2
300
200
Rangecount
100
0
50
100
Rangeval
150
200