Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

This appendix is the book’s quick-reference card, in two parts. Part 1 collects every symbol we use, its meaning, and its units in Chopra-consistent tables. Part 2 documents the shared sdtools engine, one function at a time, each with a tiny runnable example you can copy straight into your own notebook. Keep this page open in a second tab while you work through the chapters.

1Part 1: Notation and units

The whole book runs on one consistent SI set: forces in kilonewtons (kN), lengths in meters (m), masses in tonnes (t), and time in seconds (s). The point of a consistent set is that no conversion factors ever appear in the equations or the code: you type the numbers in these units and read the answers back in these units.

1.1System properties

SymbolMyST / codeMeaningUnits
mmmmass (lumped inertia of the SDOF)t
cccviscous damping coefficientkN·s/m
kkklateral (elastic) stiffnesskN/m
ccrc_\text{cr}c_crcritical damping, ccr=2mωnc_\text{cr} = 2m\omega_nkN·s/m

1.2Response quantities

SymbolMyST / codeMeaningUnits
u(t)u(t)udisplacement (drift) of the mass, relative to the basem
u˙(t)\dot u(t)vvelocity, u˙=du/dt\dot u = \mathrm{d}u/\mathrm{d}tm/s
u¨(t)\ddot u(t)aacceleration, u¨=d2u/dt2\ddot u = \mathrm{d}^2u/\mathrm{d}t^2m/s²
u0, u˙0u_0,\ \dot u_0u0, v0initial displacement and velocitym, m/s
ttttimes

1.3Loading

SymbolMyST / codeMeaningUnits
p(t)p(t)papplied external force on the masskN
ug(t)u_g(t)(none)ground (base) displacementm
u¨g(t)\ddot u_g(t)agground acceleration (an earthquake record)m/s²
peff(t)p_\text{eff}(t)-m*ageffective earthquake force, peff=−m u¨gp_\text{eff} = -m\,\ddot u_gkN

1.4Natural / modal properties

SymbolMyST / codeMeaningUnits
ωn\omega_nwnnatural circular frequency, ωn=k/m\omega_n = \sqrt{k/m}rad/s
fnf_nfnnatural frequency, fn=ωn/2πf_n = \omega_n/2\piHz
TnT_nTnnatural period, Tn=2π/ωnT_n = 2\pi/\omega_ns
ζ\zetazetadamping ratio, ζ=c/(2mωn)=c/ccr\zeta = c/(2m\omega_n) = c/c_\text{cr}none
ωd\omega_dwddamped circular frequency, ωd=ωn1−ζ2\omega_d = \omega_n\sqrt{1-\zeta^2}rad/s

1.5Forced-response and design quantities

SymbolMyST / codeMeaningUnits
β\betabetafrequency ratio of a harmonic load, β=ω/ωn\beta = \omega/\omega_nnone
RdR_dRddeformation (dynamic amplification) factor, Rd=umax/ustR_d = u_\text{max}/u_\text{st}none
ustu_\text{st}u_ststatic deflection, ust=p0/ku_\text{st} = p_0/km
TRTRTRtransmissibility (transmitted / applied amplitude)none
Sd, Sv, SaS_d,\ S_v,\ S_aSd, Sv, Saspectral deformation / pseudo-velocity / pseudo-accelerationm, m/s, m/s²
μ\mumudisplacement ductility, μ=umax/uy\mu = u_\text{max}/u_ynone
uyu_yuyyield displacementm
RyR_yRyyield-strength reduction factor, Ry=fel/fyR_y = f_\text{el}/f_ynone

1.6Multi-degree-of-freedom and modal quantities

SymbolMyST / codeMeaningUnits
M, C, K\mathbf{M},\ \mathbf{C},\ \mathbf{K}M, C, Kmass, damping, and stiffness matricest, kN·s/m, kN/m
u(t)\mathbf{u}(t)U_modal, U_tfloor displacements relative to the ground, one column per floorm
ϕr\boldsymbol{\phi}_rPhi[:, r]shape of mode rr, scaled to unit roof displacementnone
ωr, Tr\omega_r,\ T_rwn[r], Tn[r]natural frequency and period of mode rrrad/s, s
qr(t)q_r(t)Q[:, r]modal coordinate, u=∑rϕr qr\mathbf{u} = \sum_r \boldsymbol{\phi}_r\,q_rm
1\boldsymbol{1}onesinfluence vector: every floor is driven by the ground motionnone
MrM_rMrmodal mass, Mr=ϕrTMϕrM_r = \boldsymbol{\phi}_r^\mathsf{T}\mathbf{M}\boldsymbol{\phi}_rt
LrL_rLmodal excitation factor, Lr=ϕrTM1L_r = \boldsymbol{\phi}_r^\mathsf{T}\mathbf{M}\boldsymbol{1}t
Γr\Gamma_rGammaparticipation factor, Γr=Lr/Mr\Gamma_r = L_r/M_rnone
Mr⋆M_r^\starMeffeffective modal mass, Mr⋆=Γr2MrM_r^\star = \Gamma_r^2 M_rt
Vr, VV_r,\ VV_modal, V_srssmodal and combined base shearkN

1.7Code-based design (ASCE 7)

SymbolMyST / codeMeaningUnits
SDS, SD1S_{DS},\ S_{D1}SDS, SD1design spectral accelerations at short periods and at 1 sgg
T0, TS, TLT_0,\ T_S,\ T_LT0, TS, TLcorner periods of the design spectrums
TaT_aTaapproximate fundamental period, Ta=CthnxT_a = C_t h_n^{x}s
CsC_sCsseismic response coefficient, V=CsWV = C_s Wnone
WWWseismic weightkN
Fx, CvxF_x,\ C_{vx}Fx, Cvxlateral force at level xx and its share of VVkN, none
RRRresponse modification factornone
CdC_dCddeflection amplification factornone
IeI_eIeimportance factornone

2Part 2: The sdtools API reference

Every chapter imports the same small engine, built up in Chapter 3. The contract is deliberately tiny: cast the equation of motion m u¨+c u˙+k u=p(t)m\,\ddot u + c\,\dot u + k\,u = p(t) into state space, solve it, and hand back (t, u, v, a). The setup cell at the top of every chapter does

import numpy as np
import sdtools as sd
sd.plot_style()

What follows documents each public function, its signature, what it returns, and a minimal example you can run as-is. The examples below are executed live, so the printed numbers are real.

2.1natural(m, c, k)

Natural dynamic properties of the oscillator, returned as a dict with keys wn (rad/s), fn (Hz), Tn (s), zeta (dimensionless), wd (rad/s), and c_cr (critical damping). This is the first thing you compute for any system.

Tn = 1.257 s   fn = 0.796 Hz   wn = 5.00 rad/s
zeta = 0.050   wd = 4.994 rad/s   c_cr = 20.00 kN*s/m

2.2state_space(m, c, k)

The continuous-time state-space matrices AA and BB for the state z=[ u, u˙ ]T\mathbf z = [\,u,\ \dot u\,]^\mathsf{T}, so that z˙=Az+B p(t)\dot{\mathbf z} = A\mathbf z + B\,p(t). This is the form the exact solver integrates; you rarely call it directly, but it is the heart of the engine (built up in Chapter 3).

A =
 [[  0.    1. ]
 [-25.   -0.5]]
B =
 [0.  0.5]

2.3sdof_response(m, c, k, p, dt, u0=0.0, v0=0.0, method="exp")

This is the workhorse: it solves the equation of motion for a force history p sampled at spacing dt, with optional initial conditions u0 and v0, and returns (t, u, v, a). The function offers two integration methods, chosen with the method argument:

For base excitation, pass the effective force p = -m * ag and read the relative response.

peak drift = 20.0 mm at t = 0.000 s
<Figure size 936x364 with 1 Axes>
<Figure size 936x364 with 1 Axes>

Figure 1:A single call to sd.sdof_response produces the full free-vibration drift history.

2.4newmark(m, c, k, p, dt, u0=0.0, v0=0.0, gamma=0.5, beta=0.25)

Newmark-β\beta time integration, returning (t, u, v, a). The defaults γ=12\gamma = \tfrac12, β=14\beta = \tfrac14 give the average-acceleration rule, which is unconditionally stable. It is also the routine that sdof_response(..., method="newmark") calls internally. The exact "exp" solver and Newmark agree to within a few hundredths of a percent at the dt used here, and the gap grows like (Δt/Tn)2(\Delta t/T_n)^2 as the step coarsens, to about 1 % at Δt=Tn/50\Delta t = T_n/50 over the same 6 s. They differ not because of how the force is held, since in this free-vibration example both integrators see the same zero force. They differ because the average-acceleration rule assumes a constant average acceleration within each step, a piecewise-quadratic displacement that is not exact even for a zero or constant force, whereas "exp" integrates the linear dynamics exactly for any piecewise-constant load.

max |exp - newmark| = 7.67 micron
dt = Tn/100:  max |exp - newmark| = 0.24% of u0
dt = Tn/50:  max |exp - newmark| = 0.97% of u0

2.5central_difference(m, c, k, p, dt, u0=0.0, v0=0.0)

Explicit central-difference integration, returning (t, u, v, a). Shown in Chapter 3 for contrast: it is conditionally stable, requiring Δt<Tn/π\Delta t < T_n/\pi, so it blows up for large steps. Useful for understanding why the implicit methods are the practical default.

stability limit dt < Tn/pi = 0.400 s   (here dt = 0.005 s, fine)
max |exp - central| = 0.004 mm

2.6response_spectrum(ag, dt, periods, zeta=0.05)

Builds the elastic response spectra of a ground-acceleration record ag (sampled at dt). For each period in periods it solves a unit-mass SDOF and records the peak relative deformation. Returns (Sd, Sv, Sa), where SdS_d is the spectral deformation, Sv=ωnSdS_v = \omega_n S_d the pseudo-velocity, and Sa=ωn2SdS_a = \omega_n^2 S_d the pseudo-acceleration. This is the function at the spine of Chapter 6.

peak Sa = 6.62 m/s^2 at T = 0.20 s
<Figure size 936x364 with 1 Axes>
<Figure size 936x364 with 1 Axes>

Figure 2:Pseudo-acceleration spectrum Sa(Tn)S_a(T_n) from sd.response_spectrum, built by looping the engine over a range of natural periods.

2.7demo_record(dt=0.02, duration=30.0, pga=0.30*9.81, seed=7)

A reproducible synthetic strong-motion record: Kanai-Tajimi-filtered white noise shaped by a Saragoni-Hart intensity envelope, scaled to a target peak ground acceleration pga. Returns (t, ag) with ag in m/s². It is seeded, so the same call always gives the same record, handy for examples that must be deterministic. Swap in a real record via load_record when you have one.

samples = 1500   PGA = 2.943 m/s^2 = 0.30 g

2.8load_record(path, dt, scale=1.0, skiprows=0)

Loads a ground-acceleration record from a plain one-column text file whose values are uniformly spaced in time at dt, and returns (t, ag*scale). Use scale to convert units (e.g. from gg to m/s²) and skiprows to skip a header. The example writes a tiny file and reads it back so it runs anywhere.

t  = [0.   0.02 0.04 0.06 0.08]
ag = [ 0.      0.981  -1.962   0.4905  0.    ] m/s^2

2.9plot_style(scale=1.0) and PLT

plot_style() applies the book’s publication-quality matplotlib rcParams for result/data plots (axes on, clean grid, sensible fonts); it is idempotent and is called once in every chapter’s hidden setup cell. PLT is the colorblind-aware line-color list: index it (sd.PLT[0], sd.PLT[1], …) so every figure in the book shares the same palette. Schematic diagrams use a different system, figstyle, described below.

palette: ['#0072B2', '#D55E00', '#009E73'] ...
<Figure size 936x312 with 1 Axes>

3Two companion modules

Beyond the NumPy engine, the book ships two small helpers, kept deliberately separate from sdtools. The first, figstyle, draws the book’s diagrams, and the second, osdof, runs its OpenSees cross-checks. Neither is needed to run the engine itself, which depends only on NumPy, SciPy, and Matplotlib.

3.1figstyle, the schematic design system

Everything in sdtools.plot_style is for data plots; figstyle is for concept diagrams (mass-spring-dashpot sketches, free-body diagrams, modal-building cartoons). It provides a palette P, a blank new_fig canvas (axis off, equal aspect), straight and curved arrows (arrow, moment_arrow, whose curved head stays tangent), label/node annotations, the structural glyphs spring, dashpot, mass_block, ground, and save (SVG). A chapter’s make_figures.py imports it, draws, and saves SVGs that the prose references with a {figure} directive. Note its mathtext limits: no \bm, \text, or bmatrix inside figure labels.

3.2osdof, the OpenSeesPy cross-check helpers

The workhorse is opensees_sdof(m, c, k, p, dt, u0=0.0, v0=0.0). It builds a one-node SDOF, a zeroLength Elastic spring with Rayleigh mass-proportional damping tuned to the target c, integrates it with Newmark, and returns the same (t, u, v, a) tuple as sd.sdof_response. Three companions build on the same skeleton: opensees_sdof_ground(m, c, k, ag, dt) drives the base directly with a UniformExcitation pattern (Chapter 6), while opensees_mdof_eigen(masses, ks) and opensees_mdof_ground(masses, ks, zeta, ag, dt) extend it to the multi-story building of Chapter 8. Use them for independent finite-element checks of the NumPy engine; Appendix A walks through the SDOF model line by line.

from osdof import opensees_sdof
t, u, v, a = opensees_sdof(m, c, k, np.zeros(1200), dt=0.005, u0=0.020)

The exact sd.sdof_response (method "exp") and the OpenSees Newmark run agree to a few hundredths of a percent at this dt, the same small O((Δt/Tn)2)O((\Delta t/T_n)^2) gap explained under newmark above. OpenSees also uses average-acceleration Newmark, and opensees_sdof commits the consistent initial acceleration, so the residual stays at that period-elongation floor. Tighten dt and the two curves become indistinguishable.