Rainflow Counting Methods
Rainflow Counting Methods
counting algorithms
S. D. Downing and D. F. Socie
Two simple algorithms for performing rainflow counting are presented in this paper. The second
algorithm is suitable for microcomputer devices that are placed in vehicles to record field data.
Key words: fatigue tests; rainflow counting; algorithms; load monitoring; ground vehicles
Strain
,o
.ts
,o"
C
Time
07-
E
A
Fig. 1 Stress/strain response and rainflow counting
PREVIOUS WORK
Most practical rainflow counting algorithms are based on
either the 'availability matrix' or the 'vector' mathematical
concepts. The 'availability matrix' algorithm developed by
Wetzel 9 requires that the input signal be divided into a
finite number of bands which are used to define the
numerical value of the range and mean of each reversal.
Corresponding to each band is an element in the availability
matrix. Simply speaking, this matrix is used to determine
when a rainflow counted cycle is formed.
'Vector' based rainflow counting algorithms use a
one dimensional array to keep track of those peaks and
valleys which have not formed a closed loop. In other
words, once a closed loop has been determined, the peak
and valley associated with it can be eliminated from the
vector. This technique was first demonstrated by Downing
et al 2 and was modified by Okamura et al IO to account
for half cycles. Both algorithms described in this paper use
the 'vector' concept.
4
5
RAINFLOW ALGORITHM I
This algorithm rainflow counts a history of peaks and valleys
in sequence which has been rearranged to begin and end
with the maximum peak (or minimum valley). Rainflow
counting then proceeds according to the following steps:
I -- Read the next peak or valley
(if out of data, STOP)
2 - Form ranges X and Y
(if the vector contains less than
S points, go to Step i )
3 - Compare ranges X and Y
a. I f X < Y , g o t o S t e p l
b. I f X > / Y , g o t o S t e p 4
4 - Count range Y
Discard the peak and valley of Y
Go to Step 2
EXAMPLES
Both algorithms will be illustrated by rainflow counting the
strain/time history shown in Fig. 2. Fig. S shows the same
history after it has been rearranged to begin and end with
the maximum peak, point C. Also given is the resulting
stress/strain response which shows a number of closed
hysteresis loops. Rainflow counting should identify the
ranges of strain which correspond to these closed hysteresis
loops.
Rainflow Algorithm I is illustrated in conjunction
with Figs 4 - 1 6 . In each figure, the strain/time history shown
corresponds to the contents of the vector E(n). Also shown
is the stress/strain plot, the values of ranges X and Y, and
the decisions which correspond to Step 3 of the rules for
this algorithm. The history to be rainflow counted is
given in Fig. S. In Fig 4, the first peak has been read into
the vector. This establishes the origin of the stress/strain
plot since either the maximum peak or the minimum valley
lies on the cyclic stress/strain curve. Since there are less
than 3 points in the vector, ranges X and Y are undetermined and the next peak or valley must be read. In Fig. 5,
RAINFLOW A L G O R I T H M II (ONE-PASS)
This algorithm rainflow counts a history of peaks and
valleys in sequence as they occur. It calculates the same
ranges and means as Rainflow Algorithm I which required
that the history be rearranged to begin and end with the
maximum peak (or minimum valley). Rainflow counting
then proceeds according to the foUowing steps:
I - Read the next peak or valley
(if out of data, go to Step 6)
2 - F o r m ranges X and Y
(if the vector contains less than 2 points
past the starting point, go to Step I )
S - Compare ranges X and Y
a. If X ' ( Y , go to Step I
32
D
T
:]:
N
E
L
I
I
I
I
Fig. 2 Variable amplitude history
the same cycles (DC, GF, BA, HE) have been identified
as in the previous algorithm. Again, the reader should carefully follow Figs 17-31 to fully understand this algorithm.
I
B
"C
smJu]
Fig. 3 Stress/strain response
point D has been read into the vector and the stress is
unloaded from C to D along the outer loop curve. Range Y
is still undetermined so the next peak or valley must be
read. In Fig. 6, point E has been read and the stress increases
from D to E along the outer loop curve. A closed hysteresis
loop has been formed and, according to the counting rules,
range Y should be counted and its points discarded since
they have no bearing on future events. The counting
algorithm identified the same cycle, DC, as was determined
from the stress/strain response. In Fig. 7, points D and C
have been eliminated from the contents of the vector.
It is left to the reader to follow Figs 7 - 1 6 along with the
counting rules to see that the algorithm identifies the same
cycles (DC, GF, BA, HE) as were determined from the
stress/strain response.
Rainflow Algorithm II (One-Pass) will be used to
count the strain/time history given in Fig. 2. It should
identify the same cycles as the previous algorithm without
the restriction that history be rearranged to begin and end
with the maximum peak. Figs 17-31 show the contents of
the vector E(n) and the counting decisions for each step
in the counting process. It should be noted that the starting point, S, is always the first occurrence of either the
maximum peak or the minimum valley at that point in the
history. When all the peaks and valleys of the history have
been read, we begin reading points from the beginning of
the vector as seen in Fig. 17. The counting procedure continues until all the points up to and including the starting
point have been reread. When we try to read a point
beyond the starting point, the counting procedure stops
and all the cycles have been determined. Fig. 31 shows that
I
m
00QQ000IB0000010
S
T
R
E
S
S
I
X = tleET
Y = LICET
REAl) NEXT PEAKOR VALLEY
FIB. 4
INT. J. FATIGUE January 1982
33
"E
D J C
C i
I I 1 1 1
I I I I I
I I I I I
......... .....
o .'""/
STP.A.~
STRAIN
CYCLES = DC
X = ABS@--C)
X = ABS(E--D)
Y : LN)E'TER~I}I~
REAP NEXT PEAKOR VALLEY
FIG. 5
X = UNDETE~
Y -- AB~(1)--O
I l l l
Y = UN)EI'ERItINED
I E
J E
FG ~~ E
H~
l i l l l
....y
l l l l
STRAIN
CYCLES = DC
X : ABS(F-D
Y = UNDE-IE~
READNEXTPEAKOR VALLEY
FIG. 8
34
I I I I
l l i l
1 I 1 I
I I I I
STI~L~
STRAIN
CYCLES = PC
X = AB~(G--F)
Y = ABS(F-E)
X<Y,READNEXTPEAKOR VALLEY
FIG. 9
l i l l
:y
J
J i l l
Ill!
I l l /
STRAIN
Fj
I-
CYCLES = DC
X =/~(l+-G)
Y =/85(64-)
# f , CSl~ Y AND DISO~ .FI"S R)]]~I'S
FIG.
18
I E
I E
II/
~ A
~ A
C i
J
I
STI~
STRAIN
STR~
CYCLES = DC,GF
CYCLES= DC,GF
CYCLES = I~,GF
X = ~OFE)
X =/~S(I}-A)
X =/~CA~)
Y = ~(1~)
X<Y,RF_~ NEXT~
FIG. 12
. . ~ E
Y = ABSCA-H)
~ V~J/-Y
Xq,RE~) IIEXT ~
FIG. 13
OR VALLEY
H
E
[
i"
......."
. ,.."
Y
I
S/RAIN
CYCLES = DC,GF
X =/8S(C-8)
Y = AI~(B-A)
X>Y,COLNT Y ~ DISCJLRI)I"r'S POINTS
FIG. 14
STRAZH
STP,/~I
CYCLES = ~,~,E~
X =/~(C-tt)
Y = Jl~(lt-)
X=Y,COLIfT Y All) DIrNdl) IT'S POINTS
FIG. 15
CYCLES = DC,GF,~,IE
lie ARE FIKISlEI)
FI6 16
INT. J FATIGUE
January
1982
35
Rainflow
Algorithm
II is illustrated
in conjunction
with
Figs 17--31
AC'TIYE1YTAIC]]4GDATA
ACT~FIy TA~(.INGDATA
"A~
B~k--'S
~
X -- I.II)~'T~
X = AB~CI}.-A)
Y = LII)ETE]~It]]E])
Y = Lal)ETEIWd)O
REAPNEXTPE.q(ORVALLE'Y
FIG. 18
FIG. 19
A~I]/F'IY TAJC]]IGDATA
ACTIVELY TAY,.INGDATA
ACT]]/E].YTAI(]]4GDATA
X = ASS(C.-B)
Y = ABS(B--A)
bY AND Y CONTAINSS
HOVEUP ST~RIIHGPOINT
F][G. 17
~~-~C
D2 c
I I I I
CYCLES= DC
X = ABS(D-C)
Y =/~CC.-6)
X(Y
I E ~ llg(T PEAl( OR V/CJ.L~
FIG. 29
3G
X = ABSCE--P)
Y = ABS(P-C)
X:Y AND Y BeES NOT CONTAINS
COUNT Y ~ DISrJ~ IT'S PO]]iTS
~6. 21
X = AliCE--B)
Y = BNDETE1~
READNE](TPEAKOR V~LL~
FIG. 22
ACl'lIIFl
Y TAKINGDATA
ACTIVELYTAE,]]WGDATA
B_-s
A~IVEI.YTAI(.I)O
DATA
F.~IG ~E
T
I
M
CYCLES = DC
CYCLES= DC
CYCLES = PC
X = ABS(F-E)
Y = ABS(E-B)
X=Y AND Y CONTAINSS
X = ABS(G--F)
Y = ABS(F-E)
XCY
X = ADS(H-G)
Y = ABe(G-F)
X>Y AND Y DOESNOT CONTAINS
COUNTY AND DISCARDIT'S POINTS
READNEXTPEAKOR VALLEY
FIG.
FIG.
ACTr/E].YTAI(])CGDATA
24
FIG. 25
OUI'OFDATA
OUl" OF DATA
"A
"~~E=S
J
~
L I
CYCLES = DC,GF
CYCLES= DC,GF
CYCLES =
X = ABS(H--E)
Y = ABe(E--B)
X>Y AND Y CONTAINSS
HOVEUP STARTINGPO11q
READNEXTPEAKOR VALLEY
X = AB~(A.-H)
Y = ABS(II-E)
XCY
X -- ABS(B--A)
Y = ABS(A--H)
X<Y
READNEXTPEAKOR VALLEY
FIG. 26
FIG. 21
DC, GF
FIG. 28
I N T . J. F A T I G U E
January 1982
37
~DATA
DATA
ACTI"I/FIYT ~
m
m
m
m
m
m
CYCLES= DC,GF
X = ABSCE-B)
Y = ABS(B--A)
bY AND Y DOES NOT CONTAIN S
COUNT Y AND DISCARD IT'S POINTS
X = kBS(E--D)
Y = ABS(D-C)
X=Y AND Y DOESNOT CONTAIN S
COLITT Y AND DISCARDIT'S POINTS
FIG. 29
FIG. 31
OF DATA
SUMMA R Y
REFERENCES
T
I
M
E
F[G. 38
38
X = ABS(E--H)
Y = ABS(I-F-E)
X-"f AND Y CONTAINS S
Y AND DISCARDl"l"S PO.T.NTS
I N T . J. F A T I G U E January 1982
1.
2.
3.
4.
5.
6.
A UTHORS
Stephen Downing is with Deere and Company's Engineering Mechanics Group in Moline and Darrell Socie is with the
Department of Mechanical and Industrial Engineering in the
University of Illinois at Urbana-Champaign. In the first
instance inquiries should be addressed to: Mr S. D. Downing,
Engineering Mechanics, Deere and Company, 3300 River
Drive, Moline, Illinois 61265, USA.
Appendix 1
RFI ) NI-LOH lql_(l(~ I 1 ~
THIS P R t K ~
f~INI-'LDW COtlNI.~ Fl HI%IOI,~Y uF I-'ERKS
RNI) VALLEYS IN .SEQUENCE WHICH Hf-IS I~FEN RF_HI,~kHNGED
10 BEG]N fIND ENI> WllH ]HI-_ MRXIMUM PI~HK (OR MINIM~IM
VRLI.FV>. SIRIEMF_NI I_R~I-_I.S CI~,tRI-__~-~ONI> 1 u 1H~ SIE.P5 IN
IHF_ RRINFL.OW C O I ~ N l l N G RULES.
D I M~ N . ~ I O N E ( 5 @ )
N=O
N=-:N+~.
CRI.L I ~ R I H ( E ( N ) , K )
I F ( K E-Q. : ! ) .t-,lOP
2 IF(N l.l..') ((I 1(: l
X=RfYS ( E ( N ) - - E ( N - l . ) )
V---HBS(E ( N - ~ ) - - ~ ( N - 2 ) )
3 ] F ( X L I . Y) GI) I u 'I
4 RHNGE= V
XM~_FIN= ( E ( N - 1 ) + E ( N - z ) ) / 2
N=,N-;,
E(N)=F.(N+2)
G~) T{) 2
END
Appendix 2
llf-ll~L{~l,l
f-ILGOf~ITI-~M
]I
(,C~NF-PH~ '~,)
I N T . J. F A T I G U E January 1982
39
Appendix ?, (ctd)
~' I F ( N . L.1. I S I R R I + ~ > [~0 1 0
X=SI OPI-:~,(I-_(N)-E ( N - I ) )
] F ( X LE.. i}. ) {iO TO ~'_~
} F ( N 1.1. ]Slf-ff, C l 2 ) GO 1 0
Y: SI.(IPEW,(E(N-2)-E (.N-~) )
:~ ] F ( X . I_l. Y ) G(I l(i
I F ( X . [-.(,L Y. FINi) l . % . l R W l . ~-.(~
I F ( X . (;1. Y. FW~[). I.~TF4W1 F~.
I F ( X . GE. Y. FIN[) } S I H W 1 Ni4 } S l Mr,c1 := ] S l f-~Rl +d
0 0 1 0 :t
5 RRNKiE=Y
XMEFIN= ( E ( N - i ) ~_ ( N - ~ - ) ) / ; t
N=N-2
E (N):--~ ( N + 2 ~
GO I 0 2
6 J:=J+l
I F ( J . [~I. ) S I F I R I ) STOP
N='-N+3
.SL O~F=~I. C ~ ' . * ( - : I . )
F_(N)=:E(J )
7 ] F ( N LT. I S I R I ~ I + . 1 ) OtJ I t )
X=.~LOPE,~ (I: ( N ) - h ~N-~.) )
I F ( X . LE. e. ) Or; l~J 3e~4
] F ( . N I.T I S T F W I ~ ) (iO l(J
Y=:SL.( IPE,k ( E ( N.-~. ) - f f ~N - ~ ) )
B I F ( X . L1. Y) OO I O (I F ( X . GE. Y> (30 l O .~
.9 f<f-INGh=:Y
XMERN= ( E ( N - - ~ ) + ~ ( N - 2 ) ) 7;::.
N=-.N-;.~
E ( N ) =-'IE( N + 2 )
GO l O Y
2e(,, N=N-:I
E (N)==E ( N + : I )
SL.( IPE'--.Si.LIPE, r,-.1.. )
00 l O 2
:(ele N=I4-1
E(N)=E(N+I)
SI. C'PE =:SL( IPE'=' ( -.1.. )
GO 1 0 ~
EN[)
40
I N T . J. F A T I G U E January 1982
:I
:I
N-P)
N-2)
N-~)
e~
{wU l O .1
(jo~ l 0 4
fj(1 Ttl