Skip to content

Commit

Permalink
Fixed bug in TriEnduranceCurve.get_stress, endurance limit now included.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gunnstein committed Dec 19, 2018
1 parent 5dc8277 commit b3d1c04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fatpack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from .rainflow import *
from .endurance import *

__version__ = "0.5.7"
__version__ = "0.5.8"
10 changes: 5 additions & 5 deletions fatpack/endurance.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,18 +253,18 @@ class TriLinearEnduranceCurve(BiLinearEnduranceCurve):
def get_endurance(self, S):
Sd, Sl = self.Sd, self.Sl
c1, c2 = self.curve1, self.curve2
N = np.ones_like(S) * self.Ninf
N = np.zeros_like(S)
N[S > Sd] = c1.get_endurance(S[S > Sd])
cond2 = (Sl <= S) & (S <= Sd)
N[cond2] = c2.get_endurance(S[cond2])
N[S<=Sd] = c2.get_endurance(S[S<=Sd])
N[S<Sl] = self.Ninf
return N

@ensure_array
def get_stress(self, N):
S = np.zeros_like(N)
cond1 = (N > 0.) & (N <= self.Nd)
S[cond1] = self.curve1.get_stress(N[cond1])
S[N <= self.Nd] = self.curve1.get_stress(N[N<=self.Nd])
S[N > self.Nd] = self.curve2.get_stress(N[N > self.Nd])
S[N > self.Nl] = self.curve2.get_stress(self.Nl)
return S

@property
Expand Down

0 comments on commit b3d1c04

Please sign in to comment.