The FKMDetector class#

class pylife.stress.rainflow.FKMDetector(recorder=None)[source]#

Count rainflow cycles by the FKM recommended procedure.

Use this detector for classic FKM assessments that need closed loops from a nominal load signal. The detector reports the loop start and end load values to a recorder, usually pylife.stress.rainflow.LoopValueRecorder, and the recorder converts them into a load collective for downstream fatigue assessment. For the FKM nonlinear guideline with local stress and strain histories, use pylife.stress.rainflow.fkm_nonlinear.FKMNonlinearDetector instead.

Parameters:

recorder (pylife.stress.rainflow.AbstractRecorder, optional) – Recorder receiving the detected loop start and end load values in MPa. Use pylife.stress.rainflow.LoopValueRecorder for a load collective and a recorder histogram, or a compatible recorder implementing record_values(). If not given, a new pylife.stress.rainflow.LoopValueRecorder is created.

See also

pylife.stress.rainflow.fkm_nonlinear.FKMNonlinearDetector

Count cycles for the FKM nonlinear HCM assessment.

pylife.stress.rainflow.FourPointDetector

Count cycles with the general four-point criterion.

pylife.stress.rainflow.ThreePointDetector

Count cycles with the classic three-point criterion.

pylife.stress.rainflow.LoopValueRecorder

Store loop start and end load values.

Notes

The detector implements the FKM recommended rainflow procedure published by Clormann and Seeger [FKM-Classic-Rainflow]. It keeps residual turning points and closes a loop when the current load excursion covers the previous excursion, i.e. for three successive turning points \(x_{i-2}\), \(x_{i-1}\), and the current point \(x_i\) when

\[|x_i - x_{i-1}| \ge |x_{i-1} - x_{i-2}|.\]

The resulting loop is recorded by its two reversal loads. A recorder or downstream collective can convert these loads to load range \(L_R = |L_\mathrm{to} - L_\mathrm{from}|\), load amplitude \(L_a = L_R / 2\), mean load \(L_m = (L_\mathrm{to} + L_\mathrm{from}) / 2\), and number of cycles.

The detector supports chunked processing. Repeated calls to process() continue the count across chunk boundaries and keep residual turning points open until later chunks close them. This detector does not report sample indices; use pylife.stress.rainflow.FourPointDetector or pylife.stress.rainflow.ThreePointDetector with pylife.stress.rainflow.FullRecorder when indices are required.

References

[FKM-Classic-Rainflow]

U. Clormann and T. Seeger, “Rainflow-HCM. Rainflow counting for operational fatigue assessments on werkstoffmechanischer Grundlage”, Stahlbau, 1985.

Examples

>>> from pylife.stress.rainflow import FKMDetector
>>> detector = FKMDetector()
>>> detector.process([0.0, 3.0, -1.0, 2.0, -2.0, 0.0], flush=True) is detector
True
>>> detector.recorder.collective
   from   to
0  -1.0  2.0
__init__(recorder=None)[source]#

Instantiate an FKM detector.

Parameters:

recorder (pylife.stress.rainflow.AbstractRecorder, optional) – Recorder receiving the detected loop start and end load values in MPa. The recorder must implement record_values(). If not given, a new pylife.stress.rainflow.LoopValueRecorder is created.

process(samples, flush=False)[source]#

Process a chunk of load samples.

Parameters:
  • samples (array_like) – Load samples in MPa. The values are scanned for turning points; residual turning points are kept for subsequent chunks.

  • flush (bool, optional) – Force processing of the last value as a turning point. Default is False. Leave this disabled for streaming data and enable it for the final chunk if the last value shall close possible loops.

Returns:

The detector itself, so that repeated process() calls can be chained.

Return type:

FKMDetector