| Title: | Uncertainty Analysis in Dynamic Site and Slope Response |
|---|---|
| Description: | Implements a four-stage pipeline for probabilistic seismic performance analysis of slopes and embankments. The package takes a uniform-hazard spectrum at multiple return periods as input (any source) and produces: (1) synthetic soil profile generation and fundamental period estimation from USCS classification via Ishihara's small-strain shear-modulus model and the inhomogeneous truncated shear-beam theory of Gazetas and Dakoulas; (2) nonlinear site amplification using the NGA-East ergodic site-response models (Stewart et al. (2020) <doi:10.1177/8755293019878185> and Hashash et al. (2020) <doi:10.1177/8755293019878193>, with the 2017 PEER-report generation retained as an option), with inter-period correlation via Baker & Jayaram (2008) <doi:10.1193/1.2857544>; (3) Monte Carlo ensemble of six empirical Newmark sliding-block displacement models (Ambraseys & Menu (1988) <doi:10.1002/eqe.4290160704>, Jibson (2007) <doi:10.1016/j.enggeo.2007.01.013>, Saygili & Rathje (2008) <doi:10.1061/(ASCE)1090-0241(2008)134:6(790)>, Bray & Travasarou (2007) <doi:10.1061/(ASCE)1090-0241(2007)133:4(381)>, Bray & Macedo (2017) <doi:10.1016/j.soildyn.2017.05.024>, and the Bray and Macedo shallow-crustal update) with coherent correlated draws; (4) log-log inversion to the performance-based seismic coefficient kmax at user-specified displacement targets. All outputs are 'data.table' objects. |
| Authors: | Alejandro Verri Kozlowski [aut, cre, cph] |
| Maintainer: | Alejandro Verri Kozlowski <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.3.0 |
| Built: | 2026-07-16 17:27:08 UTC |
| Source: | https://github.com/cran/newmark |
Drop-in replacement for stats::approx.
Uses the Catmull-Rom spline (with the same smoothing
parameter as Highcharts type = "spline") instead of straight-line
segments. The call signature and return value are identical to
stats::approx, so it can be substituted transparently.
approx.spline( x, y = NULL, xout = NULL, n = 50, rule = 1, log = FALSE, smoothing = 1.5, ... )approx.spline( x, y = NULL, xout = NULL, n = 50, rule = 1, log = FALSE, smoothing = 1.5, ... )
x |
Numeric vector of abscissa values. |
y |
Numeric vector of ordinate values, same length as |
xout |
Optional numeric vector of points where the spline is
evaluated. If |
n |
Integer. Number of points to generate when |
rule |
Handling of points outside the range of |
log |
Logical. If |
smoothing |
Numeric tension parameter used in the Catmull-Rom to Bezier conversion. Default is 1.5 (Highcharts default). |
... |
Additional arguments ignored; present only for full signature
compatibility with |
A list with components x and y, just like
stats::approx.
x <- c(0.05, 0.10, 0.20, 0.30, 0.50, 1.0, 2.0, 3.0) y <- exp(-x) Td <- seq(0.05, 3.0, length.out = 100) approx.spline(x, y, xout = Td, log = TRUE)$yx <- c(0.05, 0.10, 0.20, 0.30, 0.50, 1.0, 2.0, 3.0) y <- exp(-x) Td <- seq(0.05, 3.0, length.out = 100) approx.spline(x, y, xout = Td, log = TRUE)$y
Assembles an annual-exceedance-probability (AEP) table, uniform-hazard-spectrum (UHS) table, and–where available–a magnitude-distance disaggregation table, using OpenQuake or user-supplied hazard files.
buildGMDP( path, IDo = "GEM", engine = "openquake", vref = 760, TRo = c(100, 200, 500, 1000, 2000, 2500, 5000, 10000) )buildGMDP( path, IDo = "GEM", engine = "openquake", vref = 760, TRo = c(100, 200, 500, 1000, 2000, 2500, 5000, 10000) )
path |
Character. Directory with hazard data files. |
IDo |
Character. Identifier for the GMDP. Default |
engine |
Character. |
vref |
Numeric. Reference Vs30 (m/s). Default 760. |
TRo |
Numeric vector. Target return periods (years). |
A named list with AEPTable, UHSTable, and RMwTable
(NULL if disaggregation is unavailable).
## Not run: # Requires an 'OpenQuake' Engine output directory containing classical # PSHA + disaggregation ZIPs; not bundled with the package. out <- buildGMDP(path = "path/to/openquake/output", vref = 760) ## End(Not run)## Not run: # Requires an 'OpenQuake' Engine output directory containing classical # PSHA + disaggregation ZIPs; not bundled with the package. out <- buildGMDP(path = "path/to/openquake/output", vref = 760) ## End(Not run)
Build a monotone quantile spline Q(u) for ln(Sa)
buildQSpline(SaTable)buildQSpline(SaTable)
SaTable |
data.table with probability column |
A closure Q(u) returning ln(Sa) for any u in[0,1].
tbl <- data.table::data.table(p = c(0.16, 0.50, 0.84), Sa = c(0.3, 0.5, 0.8)) Q <- buildQSpline(tbl) Q(0.5) # median ln(Sa)tbl <- data.table::data.table(p = c(0.16, 0.50, 0.84), Sa = c(0.3, 0.5, 0.8)) Q <- buildQSpline(tbl) Q(0.5) # median ln(Sa)
Ensures that, for every combination
TR, Vs30, Vref, ID, Tn, there is exactly
one row per probability p and that
Sa(p) is non-decreasing.
checkUHS(UHSTable, epsMonot = 1e-06)checkUHS(UHSTable, epsMonot = 1e-06)
UHSTable |
data.table with columns
|
epsMonot |
numeric tolerance (default 1e-6). |
invisibly TRUE; stops on error.
## Not run: # Requires a fully populated UHSTable produced by buildGMDP() or an # equivalent upstream pipeline (must include the ID column that # disaggregates per-quantile rows). Not bundled with the package. checkUHS(UHSTable) ## End(Not run)## Not run: # Requires a fully populated UHSTable produced by buildGMDP() or an # equivalent upstream pipeline (must include the ID column that # disaggregates per-quantile rows). Not bundled with the package. checkUHS(UHSTable) ## End(Not run)
This dataset contains cylinder roots.
data(CylinderRoots)data(CylinderRoots)
A data frame with 307128 rows and 4 variables:
Integer: Mode number (1-8)
Double: Inhomogeneity ratio (0-0.95)
Double: Aspect Ratio (0-0.5)
Double: Cylinder roots
Builds the two-period design/MCER spectrum shape of ASCE 7-22 Sec. 11.4.5.2 (Eqs. 11.4-3/-4/-5, DESIGN = 2/3 x MCER), with the spectral parameters derived from the input site-specific spectrum per ASCE 7-22 Sec. 21.4: at MCER level, SMS = 0.9 x max SaM(T) over T from 0.2 to 5 s, and SM1 = max(0.9 x max of T x SaM(T), SaM(1 s)) over T from 1 to 2 s when vs30 > 442 m/s, else 1 to 5 s (the 1.5 and 2/3 factors of Eqs. 21.4/11.4-1/-2 cancel at MCER level). Evaluation windows are clamped to the period range of the input. The Sec. 21.2.3 80-percent floor and the Sec. 21.2.2 deterministic cap are NOT applied (both require mapped/deterministic inputs this function does not receive). See NEWS.md for the audit summary.
designUHS(UHS, TL = 8, spectrum = c("MCER", "DESIGN"), vs30 = NULL)designUHS(UHS, TL = 8, spectrum = c("MCER", "DESIGN"), vs30 = NULL)
UHS |
data.table slice from UHSTable (single TR, p == "mean"). |
TL |
numeric, long-period transition (seconds). Default 8. |
spectrum |
character, "MCER" (default) or "DESIGN" (2/3 * MCER). |
vs30 |
numeric scalar or NULL. Site Vs30 (m/s) selecting the Sec. 21.4 SD1 window: 1 to 2 s when vs30 > 442 m/s, else 1 to 5 s. NULL (default) uses the conservative 1 to 5 s window. |
The input UHS slice must contain at least Tn and SaF.
Typical usage passes a single TR and p == "mean".
data.table with columns Tn, SaF.
uhs <- data.table::data.table(Tn = c(0, 0.2, 0.5, 1, 2), SaF = c(0.4, 1.0, 0.9, 0.6, 0.3)) designUHS(uhs)uhs <- data.table::data.table(Tn = c(0, 0.2, 0.5, 1, 2), SaF = c(0.4, 1.0, 0.9, 0.6, 0.3)) designUHS(uhs)
Ambraseys & Menu (1988) rigid sliding-block model
Dn_AM88(PGA, ky)Dn_AM88(PGA, ky)
PGA |
Peak ground acceleration (g). |
ky |
Yield acceleration (g). |
data.table(muLnD, sdLnD, ID = "AM88")
Dn_AM88(PGA = 0.5, ky = 0.1)Dn_AM88(PGA = 0.5, ky = 0.1)
Bray & Macedo (2017) - subduction/interface events
Dn_BM17(ky, Sa, Ts, Mw = 7.5)Dn_BM17(ky, Sa, Ts, Mw = 7.5)
ky |
Yield acceleration (g). |
Sa |
Spectral acceleration at 1.5 * Ts (g). |
Ts |
Fundamental period (s). |
Mw |
Moment magnitude (default 7.5). |
data.table(muLnD, sdLnD, ID = "BM17")
Dn_BM17(ky = 0.1, Sa = 0.8, Ts = 0.3, Mw = 8.0)Dn_BM17(ky = 0.1, Sa = 0.8, Ts = 0.3, Mw = 8.0)
Multi-equation structure per BM23 (Soil Dynamics and Earthquake Engineering
168, 107835, DOI 10.1016/j.soildyn.2023.107835):
Eq (10): ordinary motions (default; see pulse)
Eq (6): D100 max-component pulse equation
Eq (8): D50 median-component pulse equation
with a sub-regime split at PGV = 150 cm/s within Eqs (6) and (8).
Dn_BM19(ky, Ts, Sa, PGA, PGV, Mw = 6.5, NFC = "D100", pulse = FALSE)Dn_BM19(ky, Ts, Sa, PGA, PGV, Mw = 6.5, NFC = "D100", pulse = FALSE)
ky |
Yield acceleration (g). |
Ts |
Fundamental period (s). |
Sa |
Spectral acceleration at 1.3 * Ts (g). |
PGA |
Peak ground acceleration (g). |
PGV |
Peak ground velocity (cm/s). |
Mw |
Moment magnitude (default 6.5). |
NFC |
Near-fault component: "D100" (default; max-component, slope
within 45 deg of fault-normal) or "D50" (median-component, other
orientations). Used only when |
pulse |
logical. Near-fault forward-directivity pulse motion
(a property of the ground-motion record/scenario declared by the
analyst, per Bray & Macedo 2019/2023 and the authors' spreadsheet).
Default |
data.table(muLnD, sdLnD, ID = "BM19")
Dn_BM19(ky = 0.1, Ts = 0.3, Sa = 0.8, PGA = 0.5, PGV = 80, Mw = 7.0)Dn_BM19(ky = 0.1, Ts = 0.3, Sa = 0.8, PGA = 0.5, PGV = 80, Mw = 7.0)
Bray & Travasarou (2007) flexible sliding-block model
Dn_BT07(ky, Sa, Ts, Mw = 6.5)Dn_BT07(ky, Sa, Ts, Mw = 6.5)
ky |
Yield acceleration (g). |
Sa |
Spectral acceleration at 1.5 * Ts (g). |
Ts |
Fundamental period (s). |
Mw |
Moment magnitude. |
data.table(muLnD, sdLnD, ID = "BT07")
Dn_BT07(ky = 0.1, Sa = 0.8, Ts = 0.3, Mw = 7.0)Dn_BT07(ky = 0.1, Sa = 0.8, Ts = 0.3, Mw = 7.0)
Implements Jibson (2007) Eq. 10 (Arias intensity + critical acceleration ratio; sigma_log10 = 0.616), one of the four regressions published in that paper.
Dn_JB07(PGA, ky, AI = NULL)Dn_JB07(PGA, ky, AI = NULL)
PGA |
Peak ground acceleration (g). |
ky |
Yield acceleration (g). |
AI |
Arias Intensity (m/s); if NULL, back-calculated from PGA via an in-house rock-site regression (SeVyT 2023 dataset). |
data.table(muLnD, sdLnD, ID = "JB07")
Dn_JB07(PGA = 0.5, ky = 0.1)Dn_JB07(PGA = 0.5, ky = 0.1)
Implements the two-parameter (PGA, Arias intensity) vector model (Saygili & Rathje 2008 Eq. 6, Tables 1-2), including its amplitude-dependent sigma 0.46 + 0.56 (ky/PGA). Note the authors' recommended vector model was (PGA, PGV); the (PGA, Ia) variant is published and adopted here for consistency with the Arias-based rigid ensemble.
Dn_SR08(PGA, ky, AI = NULL)Dn_SR08(PGA, ky, AI = NULL)
PGA |
Peak ground acceleration (g). |
ky |
Yield acceleration (g). |
AI |
Arias Intensity (m/s); if NULL, back-calculated from PGA via an in-house rock-site regression (SeVyT 2023 dataset). |
data.table(muLnD, sdLnD, ID = "SR08")
Dn_SR08(PGA = 0.5, ky = 0.1)Dn_SR08(PGA = 0.5, ky = 0.1)
Implements the period-dependent, Vs30-dependent NGA-East site
amplification recommendations of the 2017 PEER-report generation
(nonlinear block transcribed from PEER Report 2017/05, Table 2.1;
the historical "ST17" id is kept for backward compatibility) for the
natural-log mean and standard deviation of the amplification factor
. The nonlinear sigma applies the
PGA-dependent multiplier of the source model,
(corrected 2026-07; earlier versions used bare ,
making sdLnF amplitude-independent). For the final 2020
model generation see F_ST20.
F_ST17(PGA, Tn, vs30, vref = 760, Vl = 200, Vu = 2000)F_ST17(PGA, Tn, vs30, vref = 760, Vl = 200, Vu = 2000)
PGA |
numeric vector - peak ground acceleration (in g). |
Tn |
numeric scalar - oscillator period (s). |
vs30 |
numeric scalar - time-averaged shear-wave velocity to 30 m (m/s). |
vref |
numeric scalar - reference velocity (760 m/s or 3000 m/s), default 760. |
Vl |
numeric scalar - lower Vs30 bound for NL sigma interpolation (default 200). |
Vu |
numeric scalar - upper Vs30 bound for NL sigma interpolation (default 2000). |
If vs30 == vref, the site factor equals 1 deterministically, so
the function returns muLnF = 0 and sdLnF = 0 (zero
dispersion; rnorm(n, 0, 0) returns zeros and ln F = 0).
A data.table with columns:
muLnFnatural-log mean of
sdLnFnatural-log standard deviation of
(set to 0 when vs30 == vref)
IDcharacter string "ST17"
Stewart, J.P., Parker, G.A., Harmon, J.A., Atkinson, G.M., Boore, D.M., Darragh, R.B., Silva, W.J. & Hashash, Y.M.A. (2017) "Expert Panel Recommendations for Ergodic Site Amplification in Central and Eastern North America." PEER Report 2017/04 (linear model and F760 tables, transcribed from its electronic supplement).
Hashash, Y.M.A., Harmon, J., Ilhan, O., Stewart, J.P., Rathje, E.M., Campbell, K.W., Silva, W.J. & Xu, B. (2017) "Recommendation for Ergodic Nonlinear Site Amplification in Central and Eastern North America." PEER Report 2017/05 (nonlinear model, Table 2.1).
Final-generation NGA-East ergodic site-amplification model: linear
component and F760 impedance/gradient weighting per Stewart et al.
(2020), nonlinear component per Hashash et al. (2020), with the
period-dependent nonlinear reference velocity (760 m/s for
Tn < 0.4 s, 3000 m/s above) and the PGA-dependent nonlinear sigma
.
Coefficients are the USGS nshmp-lib table (see
data-raw/SiteAmp2020.R for provenance); reference
implementation cross-checked function-by-function against OpenQuake
gsim/nga_east.py.
F_ST20(PGA, Tn, vs30, vref = 760)F_ST20(PGA, Tn, vs30, vref = 760)
PGA |
numeric vector - peak ground acceleration (g) at the
|
Tn |
numeric scalar - oscillator period (s). |
vs30 |
numeric scalar - target Vs30 (m/s). |
vref |
numeric scalar - reference velocity, 760 or 3000 m/s. |
Conventions:
The published model is referenced to 3000 m/s. For
vref = 760 the mean is the exact difference
of the composite model (including the
F760 weighting difference below 600 m/s and the small
term at Tn >= 0.4 s), and the input PGA
(at 760 m/s) is converted to the 3000 m/s anchor via
(PEER 2017/05 Eq. 2.4).
sdLnF is evaluated at the target vs30 only; for
vref = 760 no reference-side sigma is added (the rock
hazard carries its own dispersion). For vref = 3000 the
weighted F760 sigma enters the SRSS.
vs30 == vref returns muLnF = 0, sdLnF = 0
(deterministic unit factor, same contract as F_ST17).
Coefficients interpolate linearly in (OpenQuake
CoeffsTable rule); Tn = 0 uses the PGA row; Tn above
the published 10 s limit is clamped to 10 s with a warning.
A data.table with columns muLnF,
sdLnF, ID = "ST20".
Stewart, J.P. et al. (2020) "Ergodic site amplification model for central and eastern North America." Earthquake Spectra 36(1). Hashash, Y.M.A. et al. (2020) "Nonlinear site amplification model for ergodic seismic hazard analysis in central and eastern North America." Earthquake Spectra 36(1).
# soft-soil amplification of the 0.2 s ordinate, hazard at 760 m/s F_ST20(PGA = c(0.05, 0.2, 0.5), Tn = 0.2, vs30 = 300) # very-hard-rock reference (3000 m/s) F_ST20(PGA = 0.1, Tn = 1.0, vs30 = 760, vref = 3000)# soft-soil amplification of the 0.2 s ordinate, hazard at 760 m/s F_ST20(PGA = c(0.05, 0.2, 0.5), Tn = 0.2, vs30 = 300) # very-hard-rock reference (3000 m/s) F_ST20(PGA = 0.1, Tn = 1.0, vs30 = 760, vref = 3000)
Evaluates ensemble and per-submodel Dn over a vector of ky values. The scenario is sampled once and the same epsilon is reused across all ky so that each realisation s represents a coherent physical curve Dn_s(ky).
fitDnCurve( uhs, ky, Ts, Mw = 6.5, NS = 30L, weights, NFC = "D100", pulse = FALSE )fitDnCurve( uhs, ky, Ts, Mw = 6.5, NS = 30L, weights, NFC = "D100", pulse = FALSE )
uhs |
data.table with columns Tn, p, Sa (one scenario) |
ky |
numeric vector, yield accelerations (g) |
Ts |
numeric scalar, fundamental period (s) |
Mw |
numeric scalar, moment magnitude |
NS |
integer, Monte Carlo samples for curve quantiles and per-realisation draws. |
weights |
named numeric vector, ensemble weights by IDn |
NFC |
character, near-fault component selector for model BM19:
|
pulse |
logical, near-fault forward-directivity pulse motion
declared by the analyst (BM19 only; see |
list(curve, draws). curve = data.table(ky, p, Dn, IDn, w). draws = data.table(ky, s, Dn, IDn) - always populated (possibly empty when no model produces output). Dn in cm.
## Not run: uhs <- data.table::fread( system.file("extdata", "uhs.csv", package = "newmark")) out <- fitDnCurve(uhs, ky = getDnKy(uhs, Ts = 0.3), Ts = 0.3, Mw = 7.5, NS = 100, weights = c(AM88=1, BT07=1, SR08=1, BM17=1)) ## End(Not run)## Not run: uhs <- data.table::fread( system.file("extdata", "uhs.csv", package = "newmark")) out <- fitDnCurve(uhs, ky = getDnKy(uhs, Ts = 0.3), Ts = 0.3, Mw = 7.5, NS = 100, weights = c(AM88=1, BT07=1, SR08=1, BM17=1)) ## End(Not run)
Newmark displacement for a single submodel and scenario
fitDnModel(uhs, ky, Ts, Mw = 6.5, NS = 30L, IDn, NFC = "D100", pulse = FALSE)fitDnModel(uhs, ky, Ts, Mw = 6.5, NS = 30L, IDn, NFC = "D100", pulse = FALSE)
uhs |
data.table with columns Tn, p, Sa (one scenario) |
ky |
numeric scalar, yield acceleration (g) |
Ts |
numeric scalar, fundamental period (s) |
Mw |
numeric scalar, moment magnitude |
NS |
integer, Monte Carlo samples |
IDn |
character, submodel identifier |
NFC |
character, near-fault component selector for model BM19:
|
pulse |
logical, near-fault forward-directivity pulse motion
declared by the analyst (BM19 only; see |
data.table with columns p, Dn, IDn. Dn in cm.
## Not run: uhs <- data.table::fread( system.file("extdata", "uhs.csv", package = "newmark")) fitDnModel(uhs, ky = 0.1, Ts = 0.3, Mw = 7.5, NS = 100, IDn = "AM88") ## End(Not run)## Not run: uhs <- data.table::fread( system.file("extdata", "uhs.csv", package = "newmark")) fitDnModel(uhs, ky = 0.1, Ts = 0.3, Mw = 7.5, NS = 100, IDn = "AM88") ## End(Not run)
Fit Newmark displacement for one scenario row
fitDnScenario(row, weights)fitDnScenario(row, weights)
row |
one-row |
weights |
named numeric vector of active Newmark model weights by |
list with curve and draws data.tables. curve includes
individual model rows and aggregate IDn rows: ensemble, rigid, and
flexible. draws contains raw per-realisation model draws.
Fit Newmark displacement for multiple scenario rows
fitDnScenarios(records, weights, useParallel = FALSE, workers = 1L)fitDnScenarios(records, weights, useParallel = FALSE, workers = 1L)
records |
|
weights |
named numeric vector of active Newmark model weights by |
useParallel |
logical. Use fork parallelism when available. |
workers |
integer worker count when |
list with row-bound curve and draws data.tables.
Fit kmax for one scenario row
fitKmaxScenario(row, draws, weights, Da)fitKmaxScenario(row, draws, weights, Da)
row |
one-row |
draws |
|
weights |
named numeric vector of active Newmark model weights by |
Da |
numeric displacement targets in cm. |
data.table with Da, p, kmax, PGA, Kh, TR, IDg,
and IDn.
Fit kmax for multiple scenario rows
fitKmaxScenarios( records, draws, weights, Da, useParallel = FALSE, workers = 1L )fitKmaxScenarios( records, draws, weights, Da, useParallel = FALSE, workers = 1L )
records |
|
draws |
|
weights |
named numeric vector of active Newmark model weights by |
Da |
numeric displacement targets in cm. |
useParallel |
logical. Use fork parallelism when available. |
workers |
integer worker count when |
row-bound data.table of kmax results.
Fundamental period of a layered soil column (fixed base, free surface) by the classical Rayleigh quotient with the static- deflection trial shape (e.g., Dobry, Oweis & Urzua 1976): under a uniform horizontal body force the shear strain at depth z is z / Vs(z)^2 (uniform density), the mode shape is its integral from the base, and
with X_i the shape at each layer midpoint. For a uniform profile this yields 3.974 H/Vs (exact: 4 H/Vs, -0.7 percent); across layered test profiles the error against the exact transfer-matrix solution is a few percent on the low side. Layer order (top-down or bottom-up) is irrelevant: layers are sorted internally by depth.
fitModel.Ts(VSm, hs, zm)fitModel.Ts(VSm, hs, zm)
VSm |
Vector. Shear Wave Velocity profile in m/s (vector) |
hs |
Vector. Layer Thickness profile in m (vector) |
zm |
Vector. Layer mid-depth coordinates from the surface in m (vector) |
Double. Site's fundamental period Ts in seconds
Computes site-amplified spectral acceleration using two modes: (A) If the input UHS contains only p == "mean", rock Sa is treated as deterministic and the dispersion in SaF comes solely from the site-response model (sdLnF), sampled on the natural-log scale. (B) If the input UHS contains numeric quantiles (e.g., "0.10", "0.50", ...), ln Sa(Tn) is sampled from those quantiles using an empirical inverse quantile function (buildQSpline). Dependence between PGA and Sa(Tn) is represented by a per-period Gaussian "star" copula with the Baker & Jayaram (2008) correlation rhoBJ(Tn, T0 = 0), which has no distance dependence. For each Monte Carlo draw, the site-response model is evaluated with the paired PGA draw, and ln SaF = ln Sa + ln F with ln F ~ Normal(muLnF, sdLnF). Independence between ln Sa and ln F is assumed. Each sampled vector is re-centered to the tabulated mean of its marginal.
fitSaF( uhs, vs30, vref = 760, ns = 1000, models = "ST20", p_TARGET = c(0.05, 0.1, 0.16, 0.5, 0.84, 0.9, 0.95) )fitSaF( uhs, vs30, vref = 760, ns = 1000, models = "ST20", p_TARGET = c(0.05, 0.1, 0.16, 0.5, 0.84, 0.9, 0.95) )
uhs |
data.table with columns Tn, p, Sa. |
vs30 |
target Vs30 (m/s). |
vref |
reference Vs30 (m/s), default 760. |
ns |
Monte Carlo size (default 1000). |
models |
character. Site-response model id: |
p_TARGET |
probabilities to report when only 'mean' is provided, default c(0.05, 0.10, 0.16, 0.50, 0.84, 0.90, 0.95). |
For scenario (DSHA) tables with analytic mixture components available,
prefer fitSaFMixture (exact, sampling-free).
Requirements:
The input table must have columns Tn, p, Sa.
It must include exactly one row (Tn == 0, p == "mean") providing PGA on rock.
Output columns: Tn, p, Sa, SaF, AF, where AF = SaF / Sa. In mode (B), the same numeric p values found in the input are returned plus "mean". In mode (A), the set of p values is taken from p_TARGET plus "mean".
data.table with columns Tn, p, Sa, SaF, AF.
## Not run: uhs <- data.table::fread( system.file("extdata", "uhs.csv", package = "newmark")) fitSaF(uhs, vs30 = 360, vref = 760, ns = 500) ## End(Not run)## Not run: uhs <- data.table::fread( system.file("extdata", "uhs.csv", package = "newmark")) fitSaF(uhs, vs30 = 360, vref = 760, ns = 500) ## End(Not run)
Exact (sampling-free) composition of a scenario rock-hazard mixture
with the lognormal site-response dispersion. The rock demand per
period is a finite mixture of lognormal components indexed by
rupture-variant x GMPE-branch (the DSHA scenario engine output);
conditioning on the component and on its same-realization rock PGA,
is exactly normal:
so the pooled CDF is a mixture of one-dimensional Gaussian integrals
over the PGA channel, evaluated here by Gauss–Hermite quadrature
(nq nodes per component) and inverted monotonically. The same
inverter produces the rock quantiles Sa, so Sa and
SaF are quantiles of the same class of random object and
AF = SaF/Sa is the amplification of the p-quantile.
The within-component correlation is the
Baker–Jayaram (2008) within-event model (rhoBJ).
No random numbers are drawn: outputs are byte-stable.
fitSaFMixture( gmm, vs30, vref = 760, models = "ST20", p_TARGET = c(0.05, 0.1, 0.16, 0.5, 0.84, 0.9, 0.95), nq = 32 )fitSaFMixture( gmm, vs30, vref = 760, models = "ST20", p_TARGET = c(0.05, 0.1, 0.16, 0.5, 0.84, 0.9, 0.95), nq = 32 )
gmm |
data.table with one row per (period, mixture component):
columns |
vs30 |
numeric scalar - target Vs30 (m/s). |
vref |
numeric scalar - reference rock Vs30 (m/s), default 760. |
models |
character. Site-response model id: |
p_TARGET |
numeric probabilities reported alongside "mean". |
nq |
integer, Gauss–Hermite nodes per component (default 32). |
If vs30 == vref the site factor is deterministically 1 and
SaF = Sa exactly.
data.table with columns Tn, p, Sa, SaF, AF; one row
per (Tn, p) with p = p_TARGET plus "mean".
# 6-component scenario mixture (2 rupture variants x 3 GMPE branches) gmm <- data.table::CJ(Tn = c(0, 0.2, 1), k = 1:6) gmm[, `:=`(mu = log(0.2) + 0.1 * k - 0.6 * Tn, sigma = 0.6, w = 1)] fitSaFMixture(gmm, vs30 = 360, nq = 16)# 6-component scenario mixture (2 rupture variants x 3 GMPE branches) gmm <- data.table::CJ(Tn = c(0, 0.2, 1), k = 1:6) gmm[, `:=`(mu = log(0.2) + 0.1 * k - 0.6 * Tn, sigma = 0.6, w = 1)] fitSaFMixture(gmm, vs30 = 360, nq = 16)
Builds one Monte Carlo realisation of a layered soil column from a
total height Hs and a USCS classification, samples random
geotechnical properties (void ratio, unit weight, plasticity,
shear modulus parameters), computes the fundamental period
Ts via Rayleigh's method (fitModel.Ts) and the
Vs30-equivalent shear-wave velocity. getSiteProperties
calls this function repeatedly to assemble the Monte Carlo
ensemble; call directly when one realisation suffices.
geSiteTable( Hs, Water = 0, USCS, Group = NULL, h = 0.5, DrID = NULL, Vref = 760, UniformDistribution = TRUE, POP = 100, IgnoreModelIntervals = TRUE, getSiteLayers = FALSE )geSiteTable( Hs, Water = 0, USCS, Group = NULL, h = 0.5, DrID = NULL, Vref = 760, UniformDistribution = TRUE, POP = 100, IgnoreModelIntervals = TRUE, getSiteLayers = FALSE )
Hs |
Numeric scalar. Total height to hard ground (m). |
Water |
Numeric scalar. Water-table depth as fraction of
|
USCS |
Character vector. Unified Soil Classification System
codes (e.g. |
Group |
Character vector or |
h |
Numeric scalar. Layer thickness in the discretisation (m). Default 0.50. |
DrID |
Character or |
Vref |
Numeric. Reference shear-wave velocity (m/s) for the site-class assignment. Default 760. |
UniformDistribution |
Logical. If |
POP |
Numeric. Pre-consolidation pressure (kPa); enters the
over-consolidation ratio |
IgnoreModelIntervals |
Logical. If |
getSiteLayers |
Logical. If |
data.table with one row per (Hs, POP, Hw, sample) combination and columns Hs, Hw, NL, Z500, Z1000, SID, Go, mo, Ts, VSo, VS30, plus USCS-fraction columns.
Returns the eigenvalue an of mode no for a Gazetas &
Dakoulas (1985) inhomogeneous truncated shear beam parameterised by
inhomogeneity ratio mo and truncation ratio lo. The
value is interpolated from the precomputed CylinderRoots table
using the requested model (linear glm, non-linear glm, decision
tree, or random forest).
getCylinderRoots(mo, lo, no = 1, model = "nlm", extrapolate = TRUE, OSF = 0.1)getCylinderRoots(mo, lo, no = 1, model = "nlm", extrapolate = TRUE, OSF = 0.1)
mo |
Double. Inhomogeneity ratio of the shear-modulus profile.
|
lo |
Double. Truncation ratio (top-radius / bottom-radius);
|
no |
Integer. Mode number, 1..8. Default 1 (fundamental). |
model |
Character. Interpolation model: |
extrapolate |
Logical. If |
OSF |
Double. Outlier scale factor used by the random-forest model to shrink the training set around the query point. Default 0.10. |
Double. Characteristic root an for the requested
mode and parameters.
getCylinderRoots(mo = 0.45, lo = 0.20, no = 1, model = "nlm")getCylinderRoots(mo = 0.45, lo = 0.20, no = 1, model = "nlm")
Derives the effective intensities PGA, Sa(1.3Ts), Sa(1.5Ts) from the scenario UHS and constructs a log-spaced ky grid covering the calibrated range of the displacement models.
getDnKy(uhs, Ts, kyN = 30L, pRef = "mean")getDnKy(uhs, Ts, kyN = 30L, pRef = "mean")
uhs |
data.table with columns Tn, p, Sa (one scenario) |
Ts |
numeric scalar, fundamental period (s) |
kyN |
integer, number of grid points (default 30) |
pRef |
character, probability level for intensity anchor (default "mean") |
Default bounds come from the calibration ranges of the models in the ensemble:
lower: 0.01g (BM17 lowest calibration point)
upper: max(PGA, 0.80g). The physical limit is ky < PGA (no slip below the yield acceleration); the 0.80g floor extends the grid for low-PGA scenarios up to BM17's calibration ceiling.
numeric vector of ky values (log-spaced)
uhs <- data.table::data.table(Tn = 0, p = "mean", Sa = 0.5) getDnKy(uhs, Ts = 0.3)uhs <- data.table::data.table(Tn = 0, p = "mean", Sa = 0.5) getDnKy(uhs, Ts = 0.3)
Returns the ky bounds within which each model's regression is calibrated. For rigid models (AM88, SR08) the bounds are relative to PGA. For flexible models the bounds are absolute.
getKyLimits(PGA)getKyLimits(PGA)
PGA |
numeric scalar, peak ground acceleration (g). Required for rigid model limits. |
data.table with columns IDn, ky.lo, ky.hi
getKyLimits(PGA = 0.5)getKyLimits(PGA = 0.5)
Generates NR realisations of synthetic soil profiles for a given
total height Hs and USCS classification, then summarises the
resulting Ts, mo, Go, VSo and VS30 by user-requested quantile
levels (and/or the mean). Each realisation is built by
geSiteTable().
getSiteProperties( Hs, USCS, POP = 100, Water = 0, NR = 1, h = 1, levels = c(0.05, 0.5, "mean", 0.95), Vref = 760 )getSiteProperties( Hs, USCS, POP = 100, Water = 0, NR = 1, h = 1, levels = c(0.05, 0.5, "mean", 0.95), Vref = 760 )
Hs |
Numeric vector. Total height(s) to hard ground (m). |
USCS |
Character vector. USCS soil classification codes
(e.g. |
POP |
Numeric. Pre-consolidation pressure (kPa). Default 100. |
Water |
Numeric. Water-table depth as fraction of |
NR |
Integer. Number of Monte Carlo realisations. Default 1. |
h |
Numeric. Layer thickness (m) in the discretisation. Default 1.00. |
levels |
Vector. Quantile levels to report; entries can be
numeric in (0, 1) and/or the literal |
Vref |
Numeric. Reference shear-wave velocity (m/s) for site-class assignment. Default 760. |
data.table with one row per (Hs, POP, Hw, level) combination and columns USCS, Go, mo, Ts, VSo, VS30, Z500, Z1000, level. Numeric properties are rounded for readability.
getSiteProperties( Hs = 30, USCS = c("GC", "CL", "ML"), NR = 50, levels = c(0.16, "mean", 0.84) )getSiteProperties( Hs = 30, USCS = c("GC", "CL", "ML"), NR = 50, levels = c(0.16, "mean", 0.84) )
Interpolate Sa(p) at arbitrary period using log-log interpolation
interpolateSaTable(uhs, Tn)interpolateSaTable(uhs, Tn)
uhs |
data.table with columns Tn, p, Sa. |
Tn |
numeric scalar - target period for interpolation. |
data.table with interpolated Tn, p, Sa
uhs <- data.table::data.table( Tn = c(0.2, 0.5, 1.0, 0.2, 0.5, 1.0), p = c("0.16", "0.16", "0.16", "0.84", "0.84", "0.84"), Sa = c(0.8, 0.6, 0.3, 1.2, 0.9, 0.5) ) interpolateSaTable(uhs, Tn = 0.3)uhs <- data.table::data.table( Tn = c(0.2, 0.5, 1.0, 0.2, 0.5, 1.0), p = c("0.16", "0.16", "0.16", "0.84", "0.84", "0.84"), Sa = c(0.8, 0.6, 0.3, 1.2, 0.9, 0.5) ) interpolateSaTable(uhs, Tn = 0.3)
For each realisation s, inverts each model's Dn(ky) curve to kmax(Da), builds weighted ensemble mean, then averages over realisations.
invertDnDraws(draws, Da, weights, p = c(0.05, 0.1, 0.16, 0.84, 0.9, 0.95))invertDnDraws(draws, Da, weights, p = c(0.05, 0.1, 0.16, 0.84, 0.9, 0.95))
draws |
data.table(ky, s, Dn, IDn) - Dn in cm |
Da |
numeric vector - displacement targets in cm |
weights |
named numeric vector, ensemble weights by IDn |
p |
numeric quantiles in (0,1) to report alongside the mean. Default c(0.05, 0.10, 0.16, 0.84, 0.90, 0.95). The output always includes the ensemble mean as the first p row. |
Log-log linear extrapolation is used when Da falls outside the support of the computed Dn(ky) curve. No calibration-range clamping is applied - the natural support of the curve bounds the inversion.
All inputs must be in the same displacement units (cm).
data.table(Da, p, kmax). Column p is character: "mean" or the
numeric quantile formatted as "0.84", "0.90", etc.
## Not run: uhs <- data.table::fread( system.file("extdata", "uhs.csv", package = "newmark")) out <- fitDnCurve(uhs, ky = getDnKy(uhs, Ts = 0.3), Ts = 0.3, Mw = 7.5, NS = 100, weights = c(AM88=1, BT07=1, SR08=1, BM17=1)) invertDnDraws(out$draws, Da = c(2.5, 5, 10), weights = c(AM88=1, BT07=1, SR08=1, BM17=1)) ## End(Not run)## Not run: uhs <- data.table::fread( system.file("extdata", "uhs.csv", package = "newmark")) out <- fitDnCurve(uhs, ky = getDnKy(uhs, Ts = 0.3), Ts = 0.3, Mw = 7.5, NS = 100, weights = c(AM88=1, BT07=1, SR08=1, BM17=1)) invertDnDraws(out$draws, Da = c(2.5, 5, 10), weights = c(AM88=1, BT07=1, SR08=1, BM17=1)) ## End(Not run)
Computes the Pearson correlation coefficient between the residuals of ln(Sa) at two oscillator periods, using the canonical predictive equation of Baker and Jayaram (2008), Earthquake Spectra 24(1), 299-317 (DOI 10.1193/1.2857544), Eqs. 5 and 6 verbatim.
rhoBJ(Tn, T0 = 0.01)rhoBJ(Tn, T0 = 0.01)
Tn |
Numeric scalar. Target spectral period in seconds. |
T0 |
Numeric scalar. Reference period in seconds. Default 0.01 (used as a numerical proxy for PGA). Values <= 0 are silently converted to 0.01. |
The model has no dependence on rupture distance or magnitude. Periods of zero are treated as 0.01 s (standard PGA proxy in B&J 2008).
Form (Eqs. 5-6 of B&J 2008): C1 = 1 - cos(pi/2 - 0.366 * ln(Tmax / max(Tmin, 0.109))) C2 = (1 - 0.105 * (1 - 1/(1 + exp(100*Tmax - 5))) * (Tmax-Tmin)/(Tmax-0.0099)) if Tmax < 0.2; else 0 C3 = C2 if Tmax < 0.109; else C1 C4 = C1 + 0.5 * (sqrt(C3) - C3) * (1 + cos(pi * Tmin / 0.109))
rho = C2 if Tmax < 0.109 = C1 else if Tmin > 0.109 = min(C2, C4) else if Tmax < 0.2 = C4 otherwise
Validity: 0.01 <= T1, T2 <= 10 s.
Numeric scalar correlation coefficient rho(T0, Tn).
Baker, J. W. & Jayaram, N. (2008). Correlation of Spectral Acceleration Values from NGA Ground Motion Models. Earthquake Spectra, 24(1), 299-317. DOI: 10.1193/1.2857544.
rhoBJ(Tn = 0.3, T0 = 0.01) # rho(PGA, 0.3 s) rhoBJ(Tn = 1.0, T0 = 0.5)rhoBJ(Tn = 0.3, T0 = 0.01) # rho(PGA, 0.3 s) rhoBJ(Tn = 1.0, T0 = 0.5)
Computes site-amplified spectral acceleration Sa_F using the
2017-generation NGA-East non-linear site factor model (PEER Report
2017/05 lineage; see F_ST17). This wrapper calls the
underlying F_ST17() function.
SaF_ST17(Sa, pga, Tn, vs30, vref = 760)SaF_ST17(Sa, pga, Tn, vs30, vref = 760)
Sa |
numeric vector - rock spectral accelerations at period Tn (g) |
pga |
numeric vector - peak ground acceleration on rock (g), same length as Sa |
Tn |
numeric scalar - oscillator period (s) |
vs30 |
numeric scalar - time-averaged shear-wave velocity to 30 m (m/s) |
vref |
numeric scalar - reference velocity (m/s), default 760 |
A data.table with columns:
muLnSaFnatural-log mean of amplified Sa
sdLnSaFnatural-log standard deviation of amplified Sa
IDcharacter string "ST17"
Hashash, Y.M.A. et al. (2017) "Recommendation for Ergodic Nonlinear Site Amplification in Central and Eastern North America." PEER Report 2017/05, Pacific Earthquake Engineering Research Center.
F_ST17 for the underlying site factor model
fitSaF for Monte-Carlo site amplification analysis
library(data.table) # Site amplification for soft soil site Sa_rock <- c(0.1, 0.2, 0.3, 0.4) PGA_rock <- c(0.1, 0.1, 0.1, 0.1) result <- SaF_ST17( Sa = Sa_rock, pga = PGA_rock, Tn = 0.5, # 0.5s period vs30 = 300, # Soft soil vref = 760 # Rock reference ) print(result)library(data.table) # Site amplification for soft soil site Sa_rock <- c(0.1, 0.2, 0.3, 0.4) PGA_rock <- c(0.1, 0.1, 0.1, 0.1) result <- SaF_ST17( Sa = Sa_rock, pga = PGA_rock, Tn = 0.5, # 0.5s period vs30 = 300, # Soft soil vref = 760 # Rock reference ) print(result)
Draw a correlated sample of spectral accelerations
sampleSaCorr(uhs, Tn, rho, NS)sampleSaCorr(uhs, Tn, rho, NS)
uhs |
data.table with columns Tn, p, Sa (must include p == "mean"). |
Tn |
numeric vector; the first element is the reference period |
rho |
numeric vector of length |
NS |
integer, Monte Carlo sample size. |
matrix of dimension NS x length(Tn) with Sa draws (g).
## Not run: uhs <- data.table::data.table( Tn = c(0, 0, 0, 1, 1, 1), p = c("0.16", "mean", "0.84", "0.16", "mean", "0.84"), Sa = c(0.3, 0.5, 0.7, 0.1, 0.2, 0.3) ) rho <- rhoBJ(Tn = 1.0, T0 = 0.01) mat <- sampleSaCorr(uhs, Tn = c(0, 1), rho = rho, NS = 100) ## End(Not run)## Not run: uhs <- data.table::data.table( Tn = c(0, 0, 0, 1, 1, 1), p = c("0.16", "mean", "0.84", "0.16", "mean", "0.84"), Sa = c(0.3, 0.5, 0.7, 0.1, 0.2, 0.3) ) rho <- rhoBJ(Tn = 1.0, T0 = 0.01) mat <- sampleSaCorr(uhs, Tn = c(0, 1), rho = rho, NS = 100) ## End(Not run)
This dataset contains hear Model Parameters from Ishihara (1996)
data(ShearModelParameters)data(ShearModelParameters)
A data frame with 20 rows and 10 variables:
Character: Model ID
Character: Group ID
Character: NameID
Character: AuthorID
Double: Min Void Ratio
Double: Max Void Ratio
Double: A
Double: Ce
Double: Ce
Character: Go Units
Convert Site Class to Vs30 in m/s
SIDtoVs30(SID = NULL)SIDtoVs30(SID = NULL)
SID |
Site Class |
Vs30 in m/s
SIDtoVs30("A") SIDtoVs30("AB") SIDtoVs30(c("BC","C","CD","D"))SIDtoVs30("A") SIDtoVs30("AB") SIDtoVs30(c("BC","C","CD","D"))
This dataset contains Site Class data from ASCE 7-22
data(SiteClass)data(SiteClass)
A data frame with 9 rows and 4 variables:
Character: Site Class
Character: Category description
Character: Vs30 in m/s
Character: Vs30 in ft/s
This dataset contains simulations of different site conditions
data(SiteTable)data(SiteTable)
A data frame with 255614 rows and 38 variables:
Double: Height in m.
Double: Water Table in m.
Integer: Number of Layers
Double: Depth to 500 m/s in m.
Double: Depth to 1000 m/s in m.
String: Site ID
Double: Shear Modulus in kPa.
Double: Shear Modulus Exponent.
Double: Fundamental Period in s.
Double: Shear Wave Velocity in m/s.
Double: Shear Wave Velocity at 30 m in m/s.
String: USCS ID
Double: Percentage of Gravels.
Double: Percentage of Sands.
Double: Percentage of Fines.
Double: Percentage of Clays.
Double: Percentage of Silts.
Double: Percentage of Organic.
Double: Percentage of Water.
Double: GP Fraction.
Double: GM Fraction.
Double: GC Fraction.
Double: GW Fraction.
Double: SP Fraction.
Double: SM Fraction.
Double: SC Fraction.
Double: SW Fraction.
Double: CL Fraction.
Double: ML Fraction.
Double: OL Fraction.
Double: PT Fraction.
Double: OH Fraction.
Double: MH Fraction.
Double: CH Fraction.
Double: Overpressure in Kpa.
String: Overpressure Units.
String: Shear Modulus Units.
String: Shear Wave Velocity Units.
Given one or more Vs30 values (in m/s), returns a character vector of site
class designations ("A", "B", "BC", "C", "CD", "D", "DE", "E"). The
classification thresholds are:
A: Vs30 >= 1500
B: 900 <= Vs30 < 1500
BC: 640 <= Vs30 < 900
C: 440 <= Vs30 < 640
CD: 300 <= Vs30 < 440
D: 210 <= Vs30 < 300
DE: 150 <= Vs30 < 210
E: 0 <= Vs30 < 150
Vs30toSID(Vs30)Vs30toSID(Vs30)
Vs30 |
Numeric vector. One or more Vs30 values in m/s. |
A character vector of the same length as Vs30,
with site class designations.
Vs30toSID(1500) # returns "A" Vs30toSID(c(120, 790, 3000, 455))Vs30toSID(1500) # returns "A" Vs30toSID(c(120, 790, 3000, 455))