The FKMNonlinearDetector class#

class pylife.stress.rainflow.fkm_nonlinear.FKMNonlinearDetector(recorder, notch_approximation_law, binner=<class 'pylife.materiallaws.notch_approximation_law.NotchApproxBinner'>)[source]#

Count nonlinear FKM HCM cycles with local stress-strain states.

Use this detector for assessments according to the FKM nonlinear guideline. It applies the HCM algorithm to a load signal, evaluates local stress and strain at each turning point with a notch approximation law, and reports the closed hysteresis data required by pylife.stress.rainflow.recorders.FKMNonlinearRecorder. The recorder collective contains load extrema in MPa, stress extrema in MPa, strain extrema, load follower strain limits, and flags for closed or memory-three hysteresis loops. For classic nominal-load FKM counting without local stress-strain states, use pylife.stress.rainflow.FKMDetector.

Parameters:

See also

pylife.stress.rainflow.FKMDetector

Count cycles by the classic FKM procedure.

pylife.stress.rainflow.FourPointDetector

Count cycles with the general four-point criterion.

pylife.stress.rainflow.recorders.FKMNonlinearRecorder

Store nonlinear hysteresis results.

pylife.materiallaws.notch_approximation_law.ExtendedNeuber

Evaluate local stress and strain with the extended Neuber rule.

Notes

The detector implements the HCM procedure used by the FKM nonlinear guideline [FKM-Nonlinear-HCM] and based on the Clormann-Seeger rainflow concept [Clormann-Seeger-Nonlinear]. The algorithm first reduces the load sequence to turning points. It then tracks open hysteresis memories and distinguishes primary branches from secondary branches. A hysteresis closes when the current load excursion covers the previous residual excursion,

\[|L_i - L_{i-1}| \ge |L_{i-1} - L_{i-2}|,\]

subject to the FKM memory rules. Memory-one and memory-two loops keep their local stress-strain extrema. Memory-three loops are mirrored about zero mean stress and strain as required by the nonlinear guideline.

The recommended nonlinear workflow processes the load sequence twice with process_hcm_first() and process_hcm_second(). The first run starts at zero load and establishes the residual memory; the second run closes the hysteresis loops used for assessment. All processing methods return self so calls can be chained. Plain process() is also available for tests and advanced workflows; it continues the detector state across chunks.

References

[FKM-Nonlinear-HCM]

Forschungskuratorium Maschinenbau, “Rechnerischer Festigkeitsnachweis unter expliziter Erfassung nichtlinearen Werkstoff-Verformungsverhaltens”, FKM-Richtlinie Nichtlinear, 2019.

[Clormann-Seeger-Nonlinear]

U. Clormann and T. Seeger, “Rainflow-HCM. Ein Zaehlverfahren fuer Betriebsfestigkeitsnachweise auf werkstoffmechanischer Grundlage”, Stahlbau, 1985.

Examples

>>> import pylife.materiallaws.notch_approximation_law as NAL
>>> from pylife.stress.rainflow.recorders import FKMNonlinearRecorder
>>> from pylife.stress.rainflow.fkm_nonlinear import FKMNonlinearDetector
>>> law = NAL.ExtendedNeuber(E=206e3, K=2650.0, n=0.187, K_p=3.5)
>>> detector = FKMNonlinearDetector(FKMNonlinearRecorder(), law, binner=None)
>>> signal = [100.0, 0.0, 80.0, 20.0, 60.0, 40.0]
>>> detector.process_hcm_first(signal).process_hcm_second(signal) is detector
True
>>> len(detector.recorder.collective)
3
>>> round(float(detector.recorder.collective.S_a.iloc[-1]), 6)
49.999938
__init__(recorder, notch_approximation_law, binner=<class 'pylife.materiallaws.notch_approximation_law.NotchApproxBinner'>)[source]#

Instantiate a detector base.

Parameters:

recorder (AbstractRecorder, optional) – Recorder that receives detected rainflow loops. If None (the default), a new pylife.stress.rainflow.LoopValueRecorder is created for this detector.

history()[source]#

Compile the stress-strain history of noteworthy points.

Returns:

History with the columns load in MPa, stress in MPa, strain, and secondary_branch. The boolean secondary_branch column marks points on secondary load branches. The index levels are load_segment, load_step, run_index, turning_point, hyst_from, hyst_to, and hyst_close.

Return type:

pandas.DataFrame

Notes

The history contains all turning points and two injected point types: primary hysteresis openings from FKM memory three and hysteresis closing points. The load_step index of injected points is always -1; do not use it to map those injected points back to samples of the original load signal.

interpolated_stress_strain_data(*, load_segment=None, hysteresis_index=None, n_points_per_branch=100)[source]#

Calculate interpolated stress-strain data.

Parameters:
  • load_segment (int, optional) – Load segment for which stress-strain data are interpolated. Default is None, which interpolates all load segments unless hysteresis_index is given.

  • hysteresis_index (int, optional) – Hysteresis for which stress-strain data are interpolated. Default is None.

  • n_points_per_branch (int, optional) – Number of interpolation points per load segment or hysteresis branch. Default is 100.

Returns:

Interpolated stress in MPa, strain, secondary-branch flag, hysteresis index, load segment, and run index.

Return type:

pandas.DataFrame

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

Process a chunk of load samples with the HCM algorithm.

Parameters:
  • samples (array_like) – Load samples in MPa. Pass representative scalar loads for one assessment point, or pass a flat array derived from a multi-point load series.

  • flush (bool, optional) – Force processing of the last value as a turning point. Default is False. Use True for the final chunk when the last sample shall be considered a turning point.

Returns:

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

Return type:

FKMNonlinearDetector

process_hcm_first(samples)[source]#

Process the first HCM run for a load sequence.

The first run prepends a zero load, removes consecutive duplicate values, and uses only turning points. It initializes the residual memory required by the FKM nonlinear procedure.

Parameters:

samples (array_like or pandas.Series) – Load samples in MPa. A pandas.Series with a load_step index level may contain several assessment points per load step.

Returns:

The detector itself, so that the second run can be chained with process_hcm_second().

Return type:

FKMNonlinearDetector

process_hcm_second(samples)[source]#

Process the second HCM run for a load sequence.

Run this method after process_hcm_first() with the same load history. It keeps the chunk boundary consistent with the first run and flushes the last value so that the assessment cycles are recorded.

Parameters:

samples (array_like or pandas.Series) – Load samples in MPa. A pandas.Series with a load_step index level may contain several assessment points per load step.

Returns:

The detector itself, so that calls can be chained.

Return type:

FKMNonlinearDetector

property strain_values#

Return strain values of all recorded turning points.

Returns:

Strain values visited during all HCM runs, excluding injected history points with negative load_step.

Return type:

numpy.ndarray

property strain_values_first_run#

Return strain values of the first HCM run.

Returns:

Strain values visited during the first HCM run, excluding injected history points with negative load_step.

Return type:

numpy.ndarray

property strain_values_second_run#

Return strain values of the second HCM run.

Returns:

Strain values visited during the second HCM run, excluding injected history points with negative load_step.

Return type:

numpy.ndarray