Skip to content

Commit

Permalink
Squashed 'pCrunch/' changes from 6ef3159a6..f1965c088
Browse files Browse the repository at this point in the history
f1965c088 check on load2stress should allow for negative numbers

git-subtree-dir: pCrunch
git-subtree-split: f1965c08804e79077680dcc1001b2b1a30d8d66f
  • Loading branch information
gbarter committed Aug 4, 2021
1 parent f114f24 commit 5d84bab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pCrunch/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ def get_DELs(self, output, **kwargs):
for chan, fatparams in self._fc.items():

try:

DELs[chan], D[chan] = self._compute_del(
output[chan], output.elapsed_time,
fatparams.lifetime,
Expand Down Expand Up @@ -436,8 +437,8 @@ def _compute_del(ts, elapsed, lifetime, load2stress, slope, Sult, Sc=0.0, **kwar
F, Fmean = fatpack.find_rainflow_ranges(ts, return_means=True)
except:
F = Fmean = np.zeros(1)
if goodman and load2stress > 0.0:
F = fatpack.find_goodman_equivalent_stress(F, Fmean, Sult/load2stress)
if goodman and np.abs(load2stress) > 0.0:
F = fatpack.find_goodman_equivalent_stress(F, Fmean, Sult/np.abs(load2stress))
Nrf, Frf = fatpack.find_range_count(F, bins)
DELs = Frf ** slope * Nrf / elapsed
DEL = DELs.sum() ** (1.0 / slope)
Expand All @@ -449,7 +450,7 @@ def _compute_del(ts, elapsed, lifetime, load2stress, slope, Sult, Sc=0.0, **kwar

# Compute Palmgren/Miner damage using stress
D = np.nan # default return value
if return_damage and load2stress > 0.0:
if return_damage and np.abs(load2stress) > 0.0:
try:
S, Mrf = fatpack.find_rainflow_ranges(ts*load2stress, return_means=True)
except:
Expand Down

0 comments on commit 5d84bab

Please sign in to comment.