Skip to content

Commit

Permalink
Add upper limit on the damping in complex shear modulus calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
arkottke committed Jan 24, 2025
1 parent de26cf1 commit 020a5c3
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/pystrata/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class NonlinearProperty:

PARAMS = ["mod_reduc", "damping"]

def __init__(self, name="", strains=None, values=None, param=None):
def __init__(self, name="", strains=None, values=None, param=None, limits=None):
self.name = name
self._strains = np.asarray(strains).astype(float)
self._values = np.asarray(values).astype(float)
Expand All @@ -103,6 +103,12 @@ def __init__(self, name="", strains=None, values=None, param=None):
self._param = None
self.param = param

if limits is None:
if param == "mod_reduc":
self._limits = 0.001, 1
else:
self._limits = 0, 0.49

self._update()

@classmethod
Expand Down Expand Up @@ -147,7 +153,8 @@ def __call__(self, strains):
else:
ln_strains = np.atleast_1d(ln_strains)
values = np.array([i(ln_strains[0]) for i in self._interpolater])
return values

return np.clip(values, *self._limits)

@property
def strains(self):
Expand Down Expand Up @@ -1575,7 +1582,10 @@ def initial_shear_vel(self, value: float):
@property
def comp_shear_mod(self) -> complex:
"""Strain-compatible complex shear modulus [kN/m²]."""
damping = self.damping

# Maximum damping value of less than 0.5
damping = np.clip(self.damping, 0, 0.49)

if COMP_MODULUS_MODEL == "seed":
# Frequency independent model (Seed et al., 1970)
# Correct dissipated energy
Expand Down Expand Up @@ -1677,9 +1687,6 @@ def strain(self, strain):
# Add the layer-specific minimum damping
damping += self.damping_min

# Maximum damping value of less than 0.5
damping = np.minimum(damping, 0.49)

self._damping.value = damping

@property
Expand Down

0 comments on commit 020a5c3

Please sign in to comment.