Drag to orbit, wheel / pinch to zoom. Everything you see is computed: change a slider and the seismograph, the damage forecast and the graphs update at once.
Ground acceleration (g, red) and ground-storey drift of the hero building (blue)
5%-damped response spectrum (elastic) with the building and soil periods
Hysteresis loop of the most damaged storey (force / yield force vs drift ratio)
Peak inter-storey drift ratio by storey (dashed = damage-state thresholds)
Experiment 1 - which soil/building pair is worst? Runs 4 soils x 4 building types at the current magnitude, distance and depth, then compares the full nonlinear result with the prediction from the elastic response spectrum.
Experiment 2 - magnitude sweep. Finds the magnitude at which the selected building (on the selected soil) first reaches each damage state.
You choose the quake (magnitude, focal depth, distance), the ground under the city and the type of the hero building. The program generates a ground-motion record, runs six structures through it (the hero building, a brick house, an office tower, an apartment block, a bridge, parked cars) and plays the result back in 3D. Waves leave the glowing focus at real crustal speeds: P about 6 km/s, S about 3.5 km/s; the picture is a cut-away diorama (1 m = 1.8 km).
Peak ground acceleration on hard rock follows an attenuation law of the Campbell type (typical coefficients, simplified):
ln PGA[g] = -3.512 + 0.904 M - 1.328 ln sqrt(R^2 + (0.149 e^(0.647 M))^2)
R is the distance from the focus: R = sqrt(epicentral distance^2 + depth^2), so a deeper focus lowers shaking right above it. Radiated energy: log10 E[J] = 4.8 + 1.5 M (one magnitude unit = 31.6 times more energy). Felt intensity uses MMI = 3.66 log10(PGA[cm/s^2]) - 1.66.
A soil layer of thickness H and shear-wave speed Vs resonates at Ts = 4H/Vs. The accelerogram is made by summing 96 random-phase sinusoids with a Brune omega-squared source spectrum, multiplied by a soil transfer function that peaks at 1/Ts (hard rock 1x, stiff soil 1.8x, soft soil 2.8x, wet sand 2.3x) and then scaled to PGA = PGA_rock x Fa, where Fa = 1 + (Fa0 - 1) / (1 + (PGA_rock/0.45)^2) falls as shaking gets stronger (soil nonlinearity).
Each building is a stack of N lumped floor masses joined by inter-storey springs. With u the floor displacements relative to the ground:
M u'' + C u' + f(u) = -M 1 a_g(t)
The spring of each storey is bilinear (elastic, then yielding with a small post-yield stiffness ratio alpha; brittle masonry has negative alpha). Stiffness comes from the period rule of thumb T1 = (0.06...0.11 s) x N through the exact modal formula w1 = 2 sqrt(k/m) sin(pi/(2(2N+1))). Damping is stiffness-proportional, zeta = 3...8%. Integration is explicit with a 2.5 ms step.
Damage uses the peak inter-storey drift ratio: Slight at 0.6 x yield drift, Moderate / Extensive at 25% / 60% of the way from yield to collapse drift, Complete at the collapse drift. Typical mean damage ratios (illustrative, HAZUS-style): 2%, 10%, 50%, 100% of replacement value. When a storey exceeds its collapse drift the floors above fall on the storey below; the collapse continues down only while the kinetic energy of the falling mass exceeds the crushing energy of the next storey:
M_f g h_fall > eta (M_f + m) g h_crush
with h_fall = 0.9 h, h_crush = 0.35 h and a column over-strength eta that is largest for steel (3.0) and smallest for wood (1.3). Cascade times use free-fall time sqrt(2 h_fall / g).
For loose saturated sand the simplified procedure compares cyclic stress ratio and resistance: CSR = 0.65 (PGA/g)(sigma_v/sigma'_v) r_d, CRR = 1/(34-N) + N/135 + 50/(10N+45)^2 - 1/200 (N = 10 blows, magnitude scaling factor MSF = 10^2.24 / M^2.56), FS = CRR x MSF / CSR. FS below 1 means liquefaction: the model then cuts the surface shaking and sinks and tilts the buildings. A base-isolated building has a long first period (2.6 s) so the ground shakes underneath it while the building itself barely deforms, at the price of a large isolator displacement.
Made with Three.js and Blender (models and baked textures). Cracks are drawn procedurally at run time.