Gunnstein / fatpack

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

help with half cycle counting #16

Closed kmacolini closed 1 year ago

kmacolini commented 1 year ago

Hi there! This is not an issue--can you please explain how half cycles are accounted for in your rainflow script? I have read through some of the cited articles, but I only have a beginner level understanding of rainflow counting. Does it have to do with reversal concatenation?

The only place I see it mentioned explicitly in the code is in find_range_count using the optional "weight" argument.

Thank you!

Gunnstein commented 1 year ago

Hey,

The four-point cycle counting algorithm only counts full cycles, any half-cycles are left in the so called residual that remain after rainflow cycle counting. According to the cited ISO standard, the half cycles may be accounted for by concatenating the residual with itself (residual after one pass of rainflow cycle counting of the original signal) and then the full-cycles contained within the concatenated residual signal is included in the final count by performing rainflow cycle counting on the concatenated signal one time.

There are edge cases (in particular for short signals), where there may be a significant difference between the 4-point algorithm in fatpack (and the way of handling the residual/half cycles mentioned above) and the 3-point algorithm that includes half cycles, but for the majority of practical cases the result is the same.

The rainflow package implements the 3-point algorithm, it is easy to use and perhaps what you are looking for. You could also use it together with fatpack and get an understanding of the differences between the two rainflow cycle counting algorithms or just check it for your particular use case.

Best regards, Gunnstein

kmacolini commented 1 year ago

Thank you so much for your thoughtful response. I have much clearer understanding now of how the two methods work. I have been comparing the two code packages side by side; I haven't decided yet which one I will use, but I feel better informed in making a decision.

Gunnstein commented 1 year ago

Happy to help. Since you are satsified with the answer, I will close this issue.