Open CrepeGoat opened 2 years ago
It looks like damping is always set as named parameter (not sure if that's the right term, but you need to call endaq.calc.shock.shock_spectrum(accel, damp=0.05)
. So it seems safe if you can add a named parameter for quality
, have it override damp
if it is explicitly set. Not sure if you can check if the user explicitly sets damp
, but it would be great to have a deprecation warning if they do.
The coefficient generation functions are written to perform the verbatim calculations described in ISO 18431-4. These formulas are written in terms of the quality factor Q, which is related to the damping coefficient: ζ = 1 / (2Q) -> Q = 1 / (2ζ) Notably, the damping coefficient can take any value in the range ζ ∈ [0, 1], which means the quality factor lies in the infinite range Q ∈ [1/2, ∞], which can exhibit numerical instabilities in the higher value range, i.e., when ζ -> 0.
However, because these formulas exclusively use Q as an inverted factor (1 / Q), the equations could be equivalently expressed in terms of the damping coefficient (1 / Q) = 2ζ, which would remove the numerical instabilities from computations involving near-infinite-valued Q. This would make our
shock_spectrum
calculations more resilient to numerical errors in the (admittedly uncommon) use case where ζ -> 0.