From 5c028f55a6932e6aa20654fbdb86741b26c1be54 Mon Sep 17 00:00:00 2001 From: Peter Powers <pmpowers@usgs.gov> Date: Fri, 20 Oct 2017 11:09:38 -0600 Subject: [PATCH] package expose campbell basin --- .../nshmp/gmm/CampbellBozorgnia_2014.java | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/gov/usgs/earthquake/nshmp/gmm/CampbellBozorgnia_2014.java b/src/gov/usgs/earthquake/nshmp/gmm/CampbellBozorgnia_2014.java index 8e7f1fed3..1ce22ee16 100644 --- a/src/gov/usgs/earthquake/nshmp/gmm/CampbellBozorgnia_2014.java +++ b/src/gov/usgs/earthquake/nshmp/gmm/CampbellBozorgnia_2014.java @@ -249,17 +249,7 @@ public final class CampbellBozorgnia_2014 implements GroundMotionModel { : (c.c11 + c.k2 * N) * log(vsk1); // Basin Response term -- Equation 20 - // update z2p5 with CA model if not supplied -- Equation 33 - double z2p5copy = z2p5; - if (Double.isNaN(z2p5)) { - z2p5copy = exp(7.089 - 1.144 * log(vs30)); - } - double Fsed = 0.0; - if (z2p5copy <= 1.0) { - Fsed = c.c14 * (z2p5copy - 1.0); - } else if (z2p5copy > 3.0) { - Fsed = c.c16 * c.k3 * exp(-0.75) * (1.0 - exp(-0.25 * (z2p5copy - 3.0))); - } + double Fsed = basinResponseTerm(c, vs30, z2p5); // Hypocentral Depth term -- Equations 21, 22, 23 double zHyp = in.zHyp; @@ -282,6 +272,21 @@ public final class CampbellBozorgnia_2014 implements GroundMotionModel { return Fmag + Fr + Fflt + Fhw + Fsite + Fsed + Fhyp + Fdip + Fatn; } + // Basin Response term -- Equation 20 + // update z2p5 with CA model if not supplied -- Equation 33 + static final double basinResponseTerm(Coefficients c, double vs30, double z2p5) { + if (Double.isNaN(z2p5)) { + z2p5 = exp(7.089 - 1.144 * log(vs30)); + } + if (z2p5 <= 1.0) { + return c.c14 * (z2p5 - 1.0); + } else if (z2p5 > 3.0) { + return c.c16 * c.k3 * exp(-0.75) * (1.0 - exp(-0.25 * (z2p5 - 3.0))); + } else { + return 0.0; + } + } + // Aleatory uncertainty model private static final double calcStdDev(final Coefficients c, final Coefficients cPGA, final double Mw, final double vs30, final double pgaRock) { -- GitLab