Earthquake City - 2D
A skyline of oscillators: each building has its own natural frequency from its height.
Trigger quake
Stop
Reset city
Ground calm. Trigger a quake to shake the skyline.
- Ground accel. now / peak
- Peak ground accel. (PGA) for this Mw
- Resonant height at this frequency
- Collapsed
- Selected building
- Natural period T = 0.1 N
- Dynamic amplification D
- Damping ratio zeta
- Roof displacement now
- Peak drift ratio / collapse limit
- Damage state
- Elapsed
City damage: 0 %
Independent checks
The science
Each building is modelled as one mass on a spring, a single-degree-of-freedom oscillator. With roof displacement u relative to the ground it obeys u'' + 2 zeta w_n u' + w_n^2 u = -a_g(t), where a_g is the ground acceleration and w_n = 2 pi / T. An engineering rule of thumb gives the natural period T = 0.1 N seconds for N storeys, so tall buildings sway slowly and low ones quickly.
For harmonic shaking at frequency f the steady response is u = (A / w_n^2) D with the dynamic amplification D = 1 / sqrt((1 - r^2)^2 + (2 zeta r)^2), r = f / f_n. At resonance D = 1/(2 zeta), so a lightly damped building of the matching height is far more vulnerable than its neighbours. Peak ground acceleration follows an illustrative law that doubles per magnitude unit, PGA = 0.006 g * 2^(Mw - 3), capped at 1.6 g. A building collapses when its drift ratio |u| / H exceeds a limit that rises with code strength (0.35 % to 2.15 %); the damage state is read from that ratio.
Honest simplifications: one horizontal direction; a linear mode shape; no soil amplification, torsion, real accelerograms or distance attenuation; real structures yield and soften, here damage is read from the peak elastic drift. Sway on screen is multiplied by the exaggeration slider (all readouts are the true values). The collapse animation is a stylised pancake of the storeys above the second storey. Educational model on inanimate buildings, not a seismic design or risk tool.
What to try
Choose Resonance trap and click the tallest tower: its period matches the 0.5 Hz shaking, so it amplifies most. Compare with the short blocks, which barely move. Raise code strength and watch the collapse limit line rise in the drift chart; the dots mark where each building of the skyline sits.