Repository navigation
Exact pSA solving - #253
Merged
Merged
Conversation
joelridden
approved these changes
Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,[u, u', p, p'] = [0, 0, -a(0), -a'(0)]whereais the acceleration timeseries,i, calculate the exact solution foru(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.[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
icmpmx)rdrvaa,icmpmx)scwfparamsdfResponsec2bug