iamlikeme / rainflow

Implementation of the rainflow-counting algorythm in Python
MIT License
105 stars 34 forks source link

Question on : Conversion of i_start - i_end to duration and Tp and Frequency #50

Closed jondo89 closed 3 years ago

jondo89 commented 3 years ago

for rng, mean, count, i_start, i_end in rainflow.extract_cycles(signal): print(rng, mean, count, i_start, i_end) Using the provided example above, can you confirm the following assumption : Tp = i_end - i_start Frequency = 1/Tp

i.e the damage count can be returned to a time series graph using these i_end and i_start values.

iamlikeme commented 3 years ago

Hi, I don't think converting i_end and i_start to period and frequency is the right way to go. The main problem I see is that i_end and i_start don't tell you whether the load cycle occurs periodically. I think a better way to calculate frequencies is to use a reasonably long time series and then do something like:

# T - total duration of the time series
frequencies = [(rng, count / T) for rng, count in rainflow.count_cycles(signal)]
jondo89 commented 3 years ago

Ok, I think there is some misunderstanding on our question, to restate

if there are 100 points in a time series of data points, does i_end - i_start reflect the duration of time between the two points?

From a practical perspective. In a damaging cycle on a piece of steel, does the i_start reflect the starting time on the damage cycle , and i_end reflect the end time of the cycle of damage/stress range. image

iamlikeme commented 3 years ago

Oh, I see. i_start and i_end are the indices of the low and the high of the load cycle, such that rng = abs(signal[i_end] - signal[i_start]). So the interpretation you show in the figure is not correct - i_end should correspond to point E.

iamlikeme commented 3 years ago

Closing due to no activity.