Professional Documents
Culture Documents
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
In the land-vehicle industry, cumulative damage fatigue Several algorithms are available to perform the counting,
analysis procedures are usually employed to estimate endur- however, they all require that the entire load history be
ance.1-3 They allow the engineer to relate the endurance known before the counting process starts. 5-7 As a result,
of actual components to simple laboratory specimens. they are not suitable for 'on-board' data processing since
Fatigue lives of specimens are determined from constant the entire load history isn't known until the end of the test.
amplitude tests. Real structures seldom, if ever, experience The first algorithm described in this paper has this same
constant amplitude loading. Therefore, some type of cycle limitation;that is, the load history must be rearranged to
counting scheme must be employed to reduce a complex begin and end with the maximum peak (or minimum
irregular loading history into a series of constant amplitude valley). It is presented because of its simplicity and because
events. The most accurate fatigue life estimates are obtained it is useful as a control program for determining stress/
using an analysis based on the strain at the most highly strain response under variable amplitude loading. The 'one-
stressed/strained location. Rainflow counting 4 is an essential pass' rainflow counting algorithm described later overcomes
part of these procedures. This method defines cycles as this hmitation and identifies the same cycles as the first
closed stress/strain hysteresis loops as illustrated in Fig. 1. algorithm. Thus, it can operate in 'real-time' and has been
Four cycles (bc, ed, fg, ad) are identified by the method. successfully implemented in a histogram recorder. 8
Strain
,o
.ts
,o"
B D
i B D
C
Time
07-
E
A
0142-1123/82/010031-10 $03.00 © 1982 Butterworth & Co (Publishers) Ltd INT. J. FATIGUE January 1982 31
PREVIOUS WORK b. If X = Y and Y contains S, go to Step 1
c. If X > Y a n d Y containsS, go to Step 4
Most practical rainflow counting algorithms are based on d. If X ~> Y and Y does not contain S, go to Step 5
either the 'availability matrix' or the 'vector' mathematical 4 - Move S to the next point in the vector
concepts. The 'availability matrix' algorithm developed by Go to Step 1
Wetzel 9 requires that the input signal be divided into a 5 - Count range Y
finite number of bands which are used to define the Discard the peak and valley of Y
numerical value of the range and mean of each reversal. Go to Step 2
Corresponding to each band is an element in the availability 6 Read the next peak or valley from the beginning
matrix. Simply speaking, this matrix is used to determine of the vector E(n)
when a rainflow counted cycle is formed. (if the starting point, S, has already been
'Vector' based rainflow counting algorithms use a
reread, STOP)
one dimensional array to keep track of those peaks and
7 -- Form ranges X and Y
valleys which have not formed a closed loop. In other
(if the vector contains less than 2 points past
words, once a closed loop has been determined, the peak
the starting point, go to Step 6)
and valley associated with it can be eliminated from the
8 - Compare ranges X and Y
vector. This technique was first demonstrated by Downing
a. I f X < Y , g o t o S t e p 6
et al 2 and was modified by Okamura et al IO to account
b. I f X l > Y , g o t o S t e p 9
for half cycles. Both algorithms described in this paper use
9 - Count range Y
the 'vector' concept.
Discard the peak and valley of Y
Go to Step 7
RULES FOR BOTH ALGORITHMS
Let the range of each peak and valley be identified as EXAMPLES
follows:
Both algorithms will be illustrated by rainflow counting the
X = range under consideration strain/time history shown in Fig. 2. Fig. S shows the same
Y ; previous range adjacent to X history after it has been rearranged to begin and end with
the maximum peak, point C. Also given is the resulting
As each peak or valley is encountered, it is put in a vector stress/strain response which shows a number of closed
E(n). In addition, the starting peak or valley is designated S. hysteresis loops. Rainflow counting should identify the
ranges of strain which correspond to these closed hysteresis
loops.
RAINFLOW ALGORITHM I
Rainflow Algorithm I is illustrated in conjunction
This algorithm rainflow counts a history of peaks and valleys with Figs 4 - 1 6 . In each figure, the strain/time history shown
in sequence which has been rearranged to begin and end corresponds to the contents of the vector E(n). Also shown
with the maximum peak (or minimum valley). Rainflow is the stress/strain plot, the values of ranges X and Y, and
counting then proceeds according to the following steps: the decisions which correspond to Step 3 of the rules for
this algorithm. The history to be rainflow counted is
I -- Read the next peak or valley
given in Fig. S. In Fig 4, the first peak has been read into
(if out of data, STOP)
the vector. This establishes the origin of the stress/strain
2 - Form ranges X and Y
plot since either the maximum peak or the minimum valley
(if the vector contains less than
lies on the cyclic stress/strain curve. Since there are less
S points, go to Step i )
than 3 points in the vector, ranges X and Y are undeter-
3 - Compare ranges X and Y
mined and the next peak or valley must be read. In Fig. 5,
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 m
8 C
RAINFLOW A L G O R I T H M II (ONE-PASS)
D E
This algorithm rainflow counts a history of peaks and
valleys in sequence as they occur. It calculates the same T -
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 N - H
then proceeds according to the foUowing steps: E -
I - Read the next peak or valley
(if out of data, go to Step 6)
2 - F o r m ranges X and Y
m
the same cycles (DC, GF, BA, HE) have been identified
I i C as in the previous algorithm. Again, the reader should care-
I fully follow Figs 17-31 to fully understand this algorithm.
T m
FORTRAN PROGRAM LISTINGS
I A Fortran listing for Rainflow Algorithm I is contained in
B I
Appendix I. The reader needs to write his own version of
£ Subroutine Data (P, K) compatible with his data files. The
variable, P, is the value of the data point. The variable, K,
m should be defined as follows:
[ 1 i I I I I I I I K = 0 when the data is valid;
K = 1 when the history is finished.
The data returned from this subroutine must be peaks
and valleys in sequence and must begin and end with the
maximum peak (or minimum valley). The maximum size
of the vector, E(n), is equal to the number of counting
ranges.
Appendix II gives the Fortran listing for Rainflow
Algorithm II (One-Pass). This program checks for data
sequence so that the variable, P, in Subroutine Data (P, K )
may be timed data samples. The meaning of variable, K,
remains the same as above. For this algorithm the maximum
size of the vector E(n) is equal to twice the number of
counting ranges.
"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 I
read. In Fig. 6, point E has been read and the stress increases m
C i i i i I I 1 1 1 E i i i i I I I I I [ i n i i I I I I I
......... .....
o .'°""/
J i l l I l J l I I I I I I I I I l l / Ill!
STP.A.~ STRAIN STRAIN
CYCLES = DC
X = ABS@--C) X = ABS(E--D) X = UNDETE~
Y : LN)E'TER~I}I~ Y -- AB~(1)--O Y = UN)EI'ERItINED
REAP NEXT PEAKOR VALLEY X=Y,COUNTY AND DISCLRI)IT'S POINTS REAl) NEXTPEAKOR VALLEY
FIG. 5 FIG. 6 FIG. 7
J E I E
Fj FG ~~ E
T - H~
I -
M 2
E -
I- L I I I I l l l [ t i i i l i l l l [ I l I L l i l l
....y :y
/
J
J i l l l l l l I I I I l l i l I I I I 1 I 1 I
STRAIN STRAIN STI~L~
CYCLES = DC CYCLES = PC CYCLES = DC
X : ABS(F-D X = AB~(G--F) X =/~(l+-G)
Y = UNDE-IE~ Y = ABS(F-E) Y =/85(64-)
READNEXTPEAKOR VALLEY X<Y,READNEXTPEAKOR VALLEY # f , CSl~ Y AND DISO~ .FI"S R)]]~I'S
FIG. 8 FIG. 9 FIG. 18
- II/
~ A ~ A
C i i i i I I I I I r i I 1 I I I I I I [ n I I I I I I I I
J
J
I I I I l I I I I I I I I I I I I I I I I I I l
. . ~ E ~ E
H
E - E
[ I I I I I I I I I i" I I I I I I I I I [ I I I I I I I I I
.......°"
. ,.."
Y
I 1 I I I I I I I I I I I I I I 1 I I I I 1 I l
"A~ B~k--'S
~ C
L I I I I I I I I L I I I I I I 1 L I I 1 I I I 1 I
D2 c ~~-~C
I I I I I I I I I I I I I I I I I 1 I
CYCLES= DC
B_-s A
F.~IG ~E
T
H
I
M
E
L I I I I I I I I L I I 1 I I I I I L I 1 I i I 1 I I I
B "A B A
~ E "~~E=S
J
~ A ~ A
I I i I I I | L I I I I I I I I I L I 1 I I I I 1 I I
I N T . J. F A T I G U E January 1982 37
~DATA ACTI"I/FIYT ~ DATA
m
B A
m
m
m m
m E
m
L I I I I i I I 1 I
CYCLES= DC,GF L I I I I I I I I I
X = ABSCE-B)
Y = ABS(B--A) X = kBS(E--D)
bY AND Y DOES NOT CONTAIN S
COUNT Y AND DISCARD IT'S POINTS Y = ABS(D-C)
X=Y AND Y DOESNOT CONTAIN S
FIG. 29 COLITT Y AND DISCARDIT'S POINTS
FIG. 31
OF DATA
SUMMA R Y
Two simple rainflow counting algorithms for processing
field data have been presented. The first is useful as a
control program for following stress/response under irregular
B A loading. The second algorithm gives identical results as the
first and has the advantage that the counting can begin
before the entire history is known.
REFERENCES
T
1. Dabell, B. J., Hill, S. J., Eaton, D. E. and Watson, P. 'Fatigue
I life predictions for notched components' J Soc Environmental
Engrs (December 1977)
M ~ E
2. Downing, S., Galliart, D. and Bereyni, T. 'A Neubers rule
E fatigue analysis procedure for use with a mobile computer'
SAE Paper 760317 presented at: SAE Automotove Engineer-
ing Congress (Detroit, Michigan, 1976)
3. Fatigue Under Complex Loading: Analysis and Experiment
Edited by: R. M. Wetzel (SAE Inc, Warrendale, Pennsylvania,
1977)
38 I N T . J. F A T I G U E January 1982
7. Socie, D. F. 'Fatigue-life prediction using local stress/strain A UTHORS
concept' Experimental Mech 17 No 2 (1977) pp 5 0 - 5 6
6. Socie, D. F., Shifflet, G. and Berns, H. 'A field recording Stephen Downing is with Deere and Company's Engineer-
system with applications to fatigue analysis' Int d Fatigue 1 ing Mechanics Group in Moline and Darrell Socie is with the
No 2 (April 1979) pp 103-111 Department of Mechanical and Industrial Engineering in the
9. Wetzel, R. M. 'A method of fatigue damage analysis' PhD University of Illinois at Urbana-Champaign. In the first
Thesis (Department of Civil Engineering, University of instance inquiries should be addressed to: Mr S. D. Downing,
Waterloo, Ontario, Canada, 1971 ) Engineering Mechanics, Deere and Company, 3300 River
10. Okamura, H., Sakai, S. and Susuki, I. 'Cumulative fatigue Drive, Moline, Illinois 61265, USA.
damage under random loads' Fatigue Engng Mater and Struct
1 (1979) pp 4 0 9 - 4 1 9
Appendix 1
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
|)1M~NS] ON E(~.OB ~
N:='./
J =e~
CRI_L. D R I R ( F ( . ~ ) , K )
CRI_L. D ~ I R ( E ( ; : ) , K )
IF(E(1). E&I. E ( 2 ' > ) GO 1 0 ~ e ~
SLOPE= "1.
] F ( E ( ~ > . G1 E ( 2 ) ) SI.C~k=-I.
{;ALl_ [ J ~ l l R ( f ~, K )
} F ( K F.(~ 1 ) GU ILI 6
N=:N*~.
.St O P F . = S I _ O P E * ( - J )
E (N).'=P
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 :I
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 :I
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 . ~-.(~ N-P) {wU l O .1
I F ( X . (;1. Y. FW~[). I.~TF4W1 F~. N-2) (jo~ l 0 4
I F ( X . GE. Y. FIN[) } S I H W 1 Ni- N-~) fj(1 Ttl
4 } 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 ) 6
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 e~
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