Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2a97d9f
Introduce draft of NotchApproxBinner
johannes-mueller Dec 11, 2024
7ccf6ca
Adjust Rainflow HCM to NotchApproxBinner
johannes-mueller Dec 11, 2024
026cf35
Apply NotchApproxBinner to Seeger Beste
johannes-mueller Dec 12, 2024
ad4131b
Adjust other modules to NotchApproxBinner
johannes-mueller Dec 12, 2024
eabdbe0
Adjust HCM rainflow counting unit tests to NotchApproxBinner
johannes-mueller Dec 12, 2024
a5e22bb
Add docstrings to NotchApproxBinner
johannes-mueller Dec 13, 2024
4c648a0
Drop Binned class for notch approximation and adjust tests accordingly
johannes-mueller Dec 13, 2024
7eb2d95
Drop assertions that checked for the LUTs of former Binned
johannes-mueller Dec 13, 2024
2c8ee98
Add tests for secondary branch notch approximation
johannes-mueller Dec 13, 2024
737102f
Drop `load` argument of notch approximation strain methods
johannes-mueller Dec 13, 2024
dd6c18f
Let FKMNonLinearDetector initialize NotchApproxBinner
johannes-mueller Dec 13, 2024
bd04e54
Use automatic binning of FKMNonLinearDetector
johannes-mueller Dec 13, 2024
fc08bc0
Adjust jupyter notebook
johannes-mueller Dec 16, 2024
8983ff3
Don't regenerate the test signal while collecting benchmark tests
johannes-mueller Dec 16, 2024
8bd8763
Add docstrings for .primary() and .secondary()
johannes-mueller Dec 16, 2024
bd97d96
Add abstract base class methods to NotchApproximationLawBase
johannes-mueller Dec 17, 2024
fff5b23
Drop obsolete file
johannes-mueller Dec 17, 2024
a7105fd
Simplifications
johannes-mueller Jan 13, 2025
02dadf3
Handle an edge case in recording epslilon LF on open hysteresis
johannes-mueller Jan 16, 2025
0e7c15e
Cleanups in tests
johannes-mueller Jan 29, 2025
1867584
Improvements from review and some refactorings
johannes-mueller Feb 5, 2025
435217f
Drop maximum_absolute_load parameter for FKM NK rainflow counter
johannes-mueller Feb 6, 2025
b8e7006
Handle case when first mesh load point is zero
johannes-mueller Feb 6, 2025
b136190
Add a couple of docstrings to abstract methods
johannes-mueller Feb 6, 2025
a3d7452
Restore notch approximation law object in result output
johannes-mueller Feb 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions benchmarks/generate_time_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@
import numpy as np
import pylife.stress.timesignal as TS

np.random.seed(23424711)

load_signal = TS.TimeSignalGenerator(
10,
{
'number': 50_000,
'amplitude_median': 50.0,
'amplitude_std_dev': 0.5,
'frequency_median': 4,
'frequency_std_dev': 3,
'offset_median': 0,
'offset_std_dev': 0.4,
},
None,
None,
).query(1_000_000)
if __name__ == "__main__":
np.random.seed(23424711)

np.savetxt('load_signal.csv', load_signal)
load_signal = TS.TimeSignalGenerator(
10,
{
'number': 50_000,
'amplitude_median': 50.0,
'amplitude_std_dev': 0.5,
'frequency_median': 4,
'frequency_std_dev': 3,
'offset_median': 0,
'offset_std_dev': 0.4,
},
None,
None,
).query(1_000_000)

np.savetxt('load_signal.csv', load_signal)
20 changes: 5 additions & 15 deletions demos/fkm_nonlinear/fkm_nonlinear_full.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
"plt.rcParams.update({'font.size': 22})\n",
"plt.plot(range(len(scaled_load_sequence)), load_sequence, \"o-\", c=\"g\", lw=3)\n",
"plt.grid()\n",
"plt.ylabel(\"$\\sigma_V$ [MPa]\")"
"plt.ylabel(r\"$\\sigma_V$ [MPa]\")"
]
},
{
Expand Down Expand Up @@ -559,18 +559,13 @@
"load_sequence_list = scaled_load_sequence\n",
"print(load_sequence_list)\n",
"\n",
"# wrap the notch approximation law by a binning class, which precomputes the values\n",
"maximum_absolute_load = max(np.abs(load_sequence_list))\n",
"print(f\"maximum_absolute_load: {maximum_absolute_load}\")\n",
"extended_neuber_binned = pylife.materiallaws.notch_approximation_law.Binned(\n",
" extended_neuber, maximum_absolute_load, 100)\n",
"\n",
"# create recorder object\n",
"recorder = pylife.stress.rainflow.recorders.FKMNonlinearRecorder()\n",
"\n",
"# create detector object\n",
"detector = pylife.stress.rainflow.fkm_nonlinear.FKMNonlinearDetector(\n",
" recorder=recorder, notch_approximation_law=extended_neuber_binned)\n",
" recorder=recorder, notch_approximation_law=extended_neuber\n",
")\n",
"\n",
"# perform HCM algorithm, first run\n",
"detector.process(load_sequence_list, flush=False)\n",
Expand Down Expand Up @@ -759,18 +754,13 @@
"load_sequence_list = scaled_load_sequence\n",
"print(load_sequence_list)\n",
"\n",
"# wrap the notch approximation law by a binning class, which precomputes the values\n",
"maximum_absolute_load = max(np.abs(load_sequence_list))\n",
"print(f\"maximum_absolute_load: {maximum_absolute_load}\")\n",
"seeger_beste_binned = pylife.materiallaws.notch_approximation_law.Binned(\n",
" seeger_beste, maximum_absolute_load, 100)\n",
"\n",
"# create recorder object\n",
"recorder = pylife.stress.rainflow.recorders.FKMNonlinearRecorder()\n",
"\n",
"# create detector object\n",
"detector = pylife.stress.rainflow.fkm_nonlinear.FKMNonlinearDetector(\n",
" recorder=recorder, notch_approximation_law=seeger_beste_binned)\n",
" recorder=recorder, notch_approximation_law=seeger_beste\n",
")\n",
"\n",
"# perform HCM algorithm, first run\n",
"detector.process(load_sequence_list, flush=False)\n",
Expand Down
Loading
Loading