Skip to content

Exact pSA solving - #253

Merged
lispandfound merged 4 commits into
masterfrom
nigam-jennings-psa
Oct 5, 2026
Merged

lispandfound merged 4 commits into
masterfrom
nigam-jennings-psa

Conversation

@lispandfound

Copy link
Copy Markdown
Contributor

Closes #249

Motivated by an issue in the pSA calculation that introduces an error proportional to xi * dt / T. this PR swaps out the Newmark solver for an exact Nigam-Jennings solver. Unlike Newmark, Nigam-Jennings is a solver specifically for SDOF oscillators that model pSA, and it solves it exactly under the assumption that acceleration is linear between sampled points (which is the same assumption that Newmark makes in its linear configuration). The algorithm is simple,

  1. Initialise a state vector [u, u', p, p'] = [0, 0, -a(0), -a'(0)] where a is the acceleration timeseries,
  2. At each timestep i, calculate the exact solution for u(i + 1) according to standard ODE theory. The original 1969 paper calculates the solution explicitly and lists the coefficients, but its cheaper and more accurate to use the matrix exponential form in the linked article. The matrix exponentiation is achieved using scipy.
  3. Update the state vector [u, u', p, p'] = [u(i + 1), u'(i + 1), -a(i + 1), a'(i + 1)].

The algorithm is not only theoretically simpler (relying only on an introductory course to ODEs), but faster and considerably more accurate than Newmark at short periods.

I had Claude survey the solvers used by various toolkits. The exact Nigam-Jennings solver is used overwhelmingly through the codebases of peer groups (including notably NGA-West). So this change addresses the issue, aligns us internationally, is faster, easier to interpret and more accurate than a correctly implement Newmark method.

I've adopted Nigam-Jennings with the 10 PPW rule that NGA-West3 appears to apply. This resamples the waveform if there are fewer than 10 points per period T.

Solver benchmark

Who Solver Short-period handling Confidence
NGA-West3 Nigam–Jennings (via gmprocess) Sinc upsampling to ≥10 samples/period Medium (processing not fully published)
NGA-West2 Nigam–Jennings (Boore's programs) Not stated Program verified, method inferred
NGA-East Nigam–Jennings (Boore; Boore & Goulet 2014) Sinc upsampling Partial
USGS gmprocess / ShakeMap Nigam–Jennings (C port of Boore's icmpmx) Sinc upsampling to ≥10 samples/period Verified (code)
Boore TSPP / SMSIM Nigam–Jennings (rdrvaa, icmpmx) Linear subdivision; sinc upsampling since 2018 Verified (code)
RCTC (UCLA/PEER 2017/09) Exact recurrence (Chopra §5.2) Sinc upsampling ×8 Verified (code)
USGS PRISM Nigam–Jennings per report (code appears to use constant-input hold, inferred) FFT resample to 200 samples/s Verified (report)
K-NET/KiK-net flatfile (GFZ, 2026) Nigam–Jennings Sinc upsampling to 400 Hz Verified
GEM SMT (OpenQuake toolkit) Nigam–Jennings (default) None Verified (code)
eqsig Nigam–Jennings Linear interpolation in one method only; SA = PGA for T < 6·dt Verified (code)
PySeismoSoil Exact recurrence (Chopra §5.2) None Verified (code)
Chile flatfile (Bastías & Montalva 2016) Nigam–Jennings Unknown Low (search snippet)
CSMIP / CESMD Likely Nigam–Jennings (Caltech heritage) Unknown Not verified
pyrotd (Kottke) Frequency domain Spectral zero-padding to ≥10 samples/period Verified (code)
Strata (Kottke) Frequency domain Spectral zero-padding to 5× oscillator frequency Verified (code)
pystrata (Kottke) Frequency domain None Verified (code)
SeisComP scwfparam Newmark, average acceleration (β = ¼) None Verified (code)
OpenSees sdfResponse Newmark β = ¼ (nonlinear SDOF) User-chosen step Verified (code)
GEM SMT "NewmarkBeta" (non-default) Central difference (β = 0) None Verified (code)
NZGMDB (IM_calculation v2025.12.1) Newmark with c2 bug None Verified
NZ Strong Motion Database (Van Houtte 2017) "Duhamel's integral", scheme not stated Not stated Ambiguous
GeoNet operational products "Linear SDOF oscillators", algorithm not stated Not stated Not verified
ObsPy Basic SDOF via seismometer simulation (FFT), not a response spectrum None Verified (code)
NGA-Sub, ESM/ITACA, JMA, Taiwan, China, Turkey, Mexico Unknown Unknown Not found

@lispandfound
lispandfound merged commit 778f999 into master Oct 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Newmark-beta solver uses the wrong coefficient in the acceleration update, biasing pSA by several percent when beta = 1/

2 participants