Skip to contents

Compatibility route that reproduces, value for value, the displacement products that the dn step of newmark 1.7.1 writes for one site (DnDraws and DnTable), so that the installed library can serve as comparison oracle while the calculations migrate. The third product of that step, PGATable, belongs to the site-response family and is rebuilt by buildPGATable() from the same inputs. For every return period of the probabilistic demand and for the MCE, and for every geometry and material pair of the shear table, it amplifies the rock demand to the VS30 of the pair, samples the scenario intensities with sampleIntensities(), evaluates the active models with evaluateDisplacements() and summarizes them with summarizeDisplacements() and, for the families ensemble, rigid and flexible, the weighted summary of summarizeEnsemble() with the quantile of newmark 1.7.1 (see below).

Usage

buildDnTables(
  rock,
  MCE,
  shear,
  modelID,
  siteID,
  TR,
  Vref,
  Mw,
  NS,
  weights,
  zTrunc,
  workers
)

Arguments

rock

The UHSRock table of the site: one lognormal distribution at each oscillator period per return period at Vs30 = Vref = 760 m/s (ID, siteID, TR, Tn, Sa, Vs30, Vref, SaF, AF, k, muLn, sigmaLn, w, fitErr).

MCE

The MCETable: rock quantiles and mean of the MCE (ID, siteID, Tn, p, Sa, Vs30, Vref), without TR.

shear

The ShearTable, of which the mean rows are used.

modelID

Identifier of the probabilistic demand model.

siteID

Identifier of the site.

TR

Return periods of the probabilistic demand, in years.

Vref

Reference rock velocity in m/s; the product contract admits only 760.

Mw

Moment magnitude of the scenarios.

NS

Realizations per geometry, material and demand.

weights

Named positive weights of the active models, for example from selectDisplacementModels().

zTrunc

Truncation level of the probabilistic rock demand, in standard deviations.

workers

Number of forked processes that evaluate the pairs of a demand after their draws; 1 evaluates them in this process. The products do not depend on it.

Value

A list with the keyed data.tables DnDraws (one row per demand, pair, model, realization and yield acceleration, with the sampled PGA PGA.s) and DnTable (quantiles and mean of every model and family). The rows of the flexible models (BT07, BM17, BM19) are conditional on a nonzero displacement, as evaluateFlexibleDisplacement() documents; the probability of zero displacement is not represented. The inputs are not modified.

Semantics reproduced from newmark 1.7.1

Only the mean rows of the shear table enter, ordered by IDg and IDm; their Ts supplies the fundamental period used by the sliding-mass models, and their VS30 supplies the site velocity. The probabilistic demands sample the analytic mixture of the amplified spectrum, truncated at zTrunc like the hazard calculation; the MCE samples its amplified quantile spectrum untruncated. The yield grid is buildKyGrid() with 30 points on the mean PGA of the amplified spectrum. Each demand reseeds the generator with a fixed seed of the site, the demand and the return period (a base-31 hash of "<siteID>/<demand>/<TR>" modulo \(2^{31} - 1\)), after the deterministic site response and before its draws, so a site's products do not depend on the sites or demands run with it (the session's random stream is replaced, as the dn step of 1.7.1 replaced it); within a demand the pairs draw in order, each its NS intensity realizations and then its NS model deviates. Quantile levels are 0.05, 0.10, 0.16, 0.50, 0.84, 0.90 and 0.95 plus the mean, labelled "%.2f"; BM19 takes ordinary motions (NFC = "D100", pulse = FALSE). The MCE rows carry ID = "MCE" and TR = NA; PGA and ky are in g, Dn in cm. The family quantiles are those of Hmisc::wtd.quantile() as 1.7.1 called it: once the pool of one yield acceleration holds a tie, every pooled value is read back from its 15-significant-digit text before the quantile, while the mean uses the exact values; summarizeEnsemble(), the general summary, merges ties at full precision. Nothing else is rounded.

Examples

# \donttest{
# The inputs of the product test of newmark 1.7.1: one rock lognormal per
# period, its MCE quantiles and two geometry-material pairs.
Rock <- data.table::data.table(ID = "TEST", siteID = "TST", TR = 100, Tn = c(0, 0.2, 1),
                               Sa = c(0.3, 0.45, 0.24), Vs30 = 760, Vref = 760)
Rock[, `:=`(SaF = Sa, AF = NA_real_, k = "oq", muLn = log(Sa) - 0.4^2 / 2, sigmaLn = 0.4,
            w = 1, fitErr = 0)]
#>        ID siteID    TR    Tn    Sa  Vs30  Vref   SaF    AF      k       muLn
#>    <char> <char> <num> <num> <num> <num> <num> <num> <num> <char>      <num>
#> 1:   TEST    TST   100   0.0  0.30   760   760  0.30    NA     oq -1.2839728
#> 2:   TEST    TST   100   0.2  0.45   760   760  0.45    NA     oq -0.8785077
#> 3:   TEST    TST   100   1.0  0.24   760   760  0.24    NA     oq -1.5071164
#>    sigmaLn     w fitErr
#>      <num> <num>  <num>
#> 1:     0.4     1      0
#> 2:     0.4     1      0
#> 3:     0.4     1      0
Levels <- c(0.05, 0.10, 0.16, 0.50, 0.84, 0.90, 0.95)
MCE <- Rock[, .(p = c(sprintf("%.2f", Levels), "mean"),
                Sa = c(exp(muLn + 0.4 * qnorm(Levels)), Sa)), by = Tn]
MCE[, `:=`(ID = "MCE", siteID = "TST", Vs30 = 760, Vref = 760)]
#>        Tn      p        Sa     ID siteID  Vs30  Vref
#>     <num> <char>     <num> <char> <char> <num> <num>
#>  1:   0.0   0.05 0.1434291    MCE    TST   760   760
#>  2:   0.0   0.10 0.1658630    MCE    TST   760   760
#>  3:   0.0   0.16 0.1860470    MCE    TST   760   760
#>  4:   0.0   0.50 0.2769349    MCE    TST   760   760
#>  5:   0.0   0.84 0.4122235    MCE    TST   760   760
#>  6:   0.0   0.90 0.4623874    MCE    TST   760   760
#>  7:   0.0   0.95 0.5347097    MCE    TST   760   760
#>  8:   0.0   mean 0.3000000    MCE    TST   760   760
#>  9:   0.2   0.05 0.2151437    MCE    TST   760   760
#> 10:   0.2   0.10 0.2487944    MCE    TST   760   760
#> 11:   0.2   0.16 0.2790705    MCE    TST   760   760
#> 12:   0.2   0.50 0.4154024    MCE    TST   760   760
#> 13:   0.2   0.84 0.6183352    MCE    TST   760   760
#> 14:   0.2   0.90 0.6935811    MCE    TST   760   760
#> 15:   0.2   0.95 0.8020645    MCE    TST   760   760
#> 16:   0.2   mean 0.4500000    MCE    TST   760   760
#> 17:   1.0   0.05 0.1147433    MCE    TST   760   760
#> 18:   1.0   0.10 0.1326904    MCE    TST   760   760
#> 19:   1.0   0.16 0.1488376    MCE    TST   760   760
#> 20:   1.0   0.50 0.2215479    MCE    TST   760   760
#> 21:   1.0   0.84 0.3297788    MCE    TST   760   760
#> 22:   1.0   0.90 0.3699099    MCE    TST   760   760
#> 23:   1.0   0.95 0.4277677    MCE    TST   760   760
#> 24:   1.0   mean 0.2400000    MCE    TST   760   760
#>        Tn      p        Sa     ID siteID  Vs30  Vref
#>     <num> <char>     <num> <char> <char> <num> <num>
Shear <- data.table::data.table(IDg = c("G1", "G2"), IDm = c("U1", "U2"), VS30 = c(360, 560),
                                Ts = 0.3, Vref = 760, level = "mean")
Site <- buildDnTables(Rock, MCE, Shear, modelID = "TEST", siteID = "TST", TR = 100, Vref = 760,
                      Mw = 7, NS = 2, weights = c(AM88 = 1, BM19 = 1), zTrunc = 3, workers = 1)
Site$DnTable[IDn == "ensemble" & p == "0.50" & ky < 0.02]
#> Key: <siteID, ID, TR, IDg, IDm, IDn, p, ky>
#>        IDg    IDm      p     ID    TR         ky       Dn    Ts  Vs30      IDn
#>     <char> <char> <char> <char> <num>      <num>    <num> <num> <num>   <char>
#>  1:     G1     U1   0.50    MCE    NA 0.01000000 249.1768   0.3   360 ensemble
#>  2:     G1     U1   0.50    MCE    NA 0.01163118 208.5426   0.3   360 ensemble
#>  3:     G1     U1   0.50    MCE    NA 0.01352844 174.1409   0.3   360 ensemble
#>  4:     G1     U1   0.50    MCE    NA 0.01573517 145.0278   0.3   360 ensemble
#>  5:     G1     U1   0.50    MCE    NA 0.01830186 120.4032   0.3   360 ensemble
#>  6:     G2     U2   0.50    MCE    NA 0.01000000 459.3753   0.3   560 ensemble
#>  7:     G2     U2   0.50    MCE    NA 0.01163118 389.1024   0.3   560 ensemble
#>  8:     G2     U2   0.50    MCE    NA 0.01352844 328.5285   0.3   560 ensemble
#>  9:     G2     U2   0.50    MCE    NA 0.01573517 276.3383   0.3   560 ensemble
#> 10:     G2     U2   0.50    MCE    NA 0.01830186 231.4176   0.3   560 ensemble
#> 11:     G1     U1   0.50   TEST   100 0.01000000 341.6734   0.3   360 ensemble
#> 12:     G1     U1   0.50   TEST   100 0.01163118 286.6449   0.3   360 ensemble
#> 13:     G1     U1   0.50   TEST   100 0.01352844 240.0414   0.3   360 ensemble
#> 14:     G1     U1   0.50   TEST   100 0.01573517 200.5861   0.3   360 ensemble
#> 15:     G1     U1   0.50   TEST   100 0.01830186 167.1968   0.3   360 ensemble
#> 16:     G2     U2   0.50   TEST   100 0.01000000 653.3682   0.3   560 ensemble
#> 17:     G2     U2   0.50   TEST   100 0.01163118 556.2040   0.3   560 ensemble
#> 18:     G2     U2   0.50   TEST   100 0.01352844 464.3809   0.3   560 ensemble
#> 19:     G2     U2   0.50   TEST   100 0.01573517 386.6757   0.3   560 ensemble
#> 20:     G2     U2   0.50   TEST   100 0.01830186 320.9527   0.3   560 ensemble
#>        IDg    IDm      p     ID    TR         ky       Dn    Ts  Vs30      IDn
#>     <char> <char> <char> <char> <num>      <num>    <num> <num> <num>   <char>
#>     siteID units.Dn
#>     <char>   <char>
#>  1:    TST       cm
#>  2:    TST       cm
#>  3:    TST       cm
#>  4:    TST       cm
#>  5:    TST       cm
#>  6:    TST       cm
#>  7:    TST       cm
#>  8:    TST       cm
#>  9:    TST       cm
#> 10:    TST       cm
#> 11:    TST       cm
#> 12:    TST       cm
#> 13:    TST       cm
#> 14:    TST       cm
#> 15:    TST       cm
#> 16:    TST       cm
#> 17:    TST       cm
#> 18:    TST       cm
#> 19:    TST       cm
#> 20:    TST       cm
#>     siteID units.Dn
#>     <char>   <char>
# }