Gunnstein / fatpack

fatpack provides functions and classes for fatigue analysis of data series.
ISC License
113 stars 23 forks source link

Recalculating the Wikipedia example with fatpack #21

Closed demogorgi closed 10 months ago

demogorgi commented 1 year ago

Hey, I used the values from https://en.wikipedia.org/wiki/Rainflow-counting_algorithm as reversals in example.py: reversals = np.array([2,-14,10,0,13,-9,11,-8,8,-9,15,-4,10,0,13,0]) And I am wondering, why the fatpack results (cycles and half-cycles) are slightly different from those in the table in the wiki-article:

Stress (MPa) | Whole cycles | Half cycles -- | -- | -- 10 | 2 | 0 13 | 0 | 1 16 | 1 | 1 17 | 0 | 1 19 | 0 | 1 20 | 1 | 0 22 | 1 | 0 29 | 0 | 1

fatpack total cycles: [[ 10 0] [ -8 8] [ -9 11] [ 13 -9] [ 10 0] [ 0 2] [ -4 13] [ 15 -14]]

I would appreciate your comment on this. Do you compute sth. like "averaged full cycles" from the half cycles? Where does the [0, 2]-cycle come from? Why do you asses [15, -14] as a full cycle? Thank you very much!

Gunnstein commented 10 months ago

Hey @demogorgi,

Sorry for the very late reply.

The four-point algorithm does not count half-cycles, it only counts full-cycles and leaves the half cycles in the processed signal, this processed signal is refered to as the residual. There are several ways to handle the cycles left in the residual, e.g. by carrying the residual from one signal to the next, where it will be matched with other half-cycles to a full-cycle. Another approach that is implemented in fatpack find_rainflow_ranges (and is recommended by the underlying ISO standard ISO 12110-2) is to concatenate the residual with itself and perform rainflow cycle counting to extract those cycles left in the residual. All these cycles are considered full cycles.

In a normal/long signal, the difference between any of the rainflow cycle counting algorithms (e.g. 3-point, 4-point, pagoda) is negligible. For short time sequences such as the one you have posed, there will be "boundary" effects that are significant between the methods.

Best regards, Gunnstein

demogorgi commented 10 months ago

Hi @Gunnstein, many thanks for the good explanation! Best regards uwe