Skip to content

Commit

Permalink
fix: reverting back to cropping fault function outside bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlangrose committed Mar 5, 2024
1 parent 8fa0608 commit 66a4ccd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions LoopStructural/modelling/features/fault/_fault_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,21 @@ def solve(self):
def __call__(self, v):
self.solve()
eva = self.w[0] * v**3 + self.w[1] * v**2 + self.w[2] * v + self.w[3]
eva[v > self.lim[1]] = (
self.w[0] * self.lim[1] ** 3
+ self.w[1] * self.lim[1] ** 2
+ self.w[2] * self.lim[1]
+ self.w[3]
)
eva[v < self.lim[0]] = (
self.w[0] * self.lim[0] ** 3
+ self.w[1] * self.lim[0] ** 2
+ self.w[2] * self.lim[0]
+ self.w[3]
)
eva[eva > self.max_v] = self.max_v
eva[eva < self.min_v] = self.min_v

return eva

def to_dict(self) -> dict:
Expand Down

0 comments on commit 66a4ccd

Please sign in to comment.