The FKMNonlinearDetector class
- class pylife.stress.rainflow.fkm_nonlinear.FKMNonlinearDetector(recorder, notch_approximation_law, binner=<class 'pylife.materiallaws.notch_approximation_law.NotchApproxBinner'>)[source]
HCM-Algorithm detector as described in FKM nonlinear.
- __init__(recorder, notch_approximation_law, binner=<class 'pylife.materiallaws.notch_approximation_law.NotchApproxBinner'>)[source]
Instantiate an AbstractDetector.
- Parameters:
recorder (subclass of
AbstractRecorder) – The recorder that the detector will report to.
- history()[source]
Compile the history of noteworthy points.
- Returns:
history – The history containing of
load,stress,strainandsecondary_branch. Thesecondary_branchcolumn isbooland indicates if the point is on secondary load branch.- The index consists of the following levels:
load_segment: the number of the pointload_step: the index of the point in the actual samplesrun_index: the index of the run (usually 1 or 2)turning_point: the number of the turning point (-1 if it is not a turning point)hyst_from: the number of the hysteresis starting at the point (-1 if there isn’t one)hyst_to: the number of the hysteresis opened at the point (-1 if there isn’t one)hyst_close: the number hof the hysteresis closed at the point (-1 if there isn’t one)
- Return type:
pd.DataFrame
Notes
- The history contains all the turning points with two other kinds of points injected:
The primary hysteresis opening (Memory 3 of the guidline)
The closing points of a hysteresis
Note that the
load_stepindex of the injected points is always -1, so you can’t use it to determine the index of a hysteresis closing in the original signal.
- interpolated_stress_strain_data(*, load_segment=None, hysteresis_index=None, n_points_per_branch=100)[source]
Caclulate interpolated stress and strain data.
- Parameters:
load_segment (int, Optional) – The number of the load segment for which the stress strain data is to be interpolated.
hysteresis_index (int, Optional) – The number of the hysteresis for which the stress strain data is to be interpolated.
n_points_per_branch (int, Optional) – The number of points to be interpolated to of each load segment
- Returns:
stress_strain_data –
The resulting
DataFramewill contain the following columns:stress,strain– the stress strain datasecondary_branch– aboolcolumn indicating if the point is on a secondary load branchhyst_index– the number of the hysteresis the load segment is part of (-1 if there isn’t one)load_segmentthe number of the load segmentrun_indexthe number of the run
- Return type:
pd.DataFrame
- process(samples, flush=False)[source]
Process a sample chunk. This method implements the actual HCM algorithm.
- Parameters:
- Returns:
self – The
selfobject so that processing can be chained- Return type:
- process_hcm_first(samples)[source]
Perform the HCM algorithm for the first time. This processes the given samples accordingly, only considering “turning points”, neglecting consecutive duplicate values, making sure that the beginning starts with 0.
- process_hcm_second(samples)[source]
Perform the HCM algorithm for the second time, after it has been executed with
process_hcm_first. This processes the given samples accordingly, only considering “turning points”, neglecting consecutive duplicate values, making sure that the beginning of the sequence is properly fitted to the samples of the first run, such that no samples are lost and no non-turning points are introducted between the two runs.
- property strain_values
Get the strain values of the turning points in the stress-strain diagram. They are needed in the FKM nonlinear roughness & surface layer algorithm, which adds residual stresses in another pass of the HCM algorithm.
- property strain_values_first_run
Get the strain values of the turning points in the stress-strain diagram, for the first run of the HCM algorithm. They are needed in the FKM nonlinear roughness & surface layer algorithm, which adds residual stresses in another pass of the HCM algorithm.
- property strain_values_second_run
Get the strain values of the turning points in the stress-strain diagram, for the second and any further run of the HCM algorithm. They are needed in the FKM nonlinear roughness & surface layer algorithm, which adds residual stresses in another pass of the HCM algorithm.