Acceleration response spectrum calculations implemented in Python.
Simple Python functions for calculating pseudo-spectral acceleration and rotated pseudo-spectral acceleration. The response of the single-degree-of-freedom oscillator is computed in the frequency domain, with frequency-domain interpolation to accurately capture the high-frequency characteristics.
The response spectrum is computed with frequency-domain transfer functions. The motion is interpolated in the frequency domain to ensure that the frequency content extends to at least five times the natural frequency of the oscillator, and it is zero-padded in time so that the free vibration of the oscillator does not wrap around the end of the record. Two perpendicular ground motions can be rotated to compute the response at various percentiles. For example, the minimum, median, and maximum are computed with percentiles of 0, 50, and 100. The orientations of the minimum and maximum are provided, but not those of other percentiles because the rotated spectral acceleration is not monotonically increasing.
pyRotd requires Python 3.13 or later and is available from the Python Package Index:
python -m pip install pyrotdSpectral accelerations may be computed for a single time series:
import numpy as np
import pyrotd
osc_damping = 0.05
osc_freqs = np.logspace(-1, 2, 91)
spec_accels = pyrotd.calc_spec_accels(time_step, accels, osc_freqs, osc_damping)Rotated spectral accelerations may be computed for a pair of time series:
rot_osc_resps = pyrotd.calc_rotated_spec_accels(
time_step, accels_a, accels_b, osc_freqs, osc_damping
)A more detailed example is in this Jupyter notebook.
pyRotd is developed together with:
- pyRVT: random vibration theory
- pyGMM: ground motion, Fourier amplitude spectrum and soil curve models
- pyStrata: site response analysis
Please cite this software using the DOI.
pyRotd is made available under the MIT License. See LICENSE.