Earthquake Shake Table Simulator, Explained
After reading this you can predict whether a given building will resonate or ride out a given quake, read drift and roof displacement charts the way an engineer does, and judge what base isolation and a tuned mass damper actually buy you.
What the simulator does, with one quick example
The tool shakes a multi-story building side to side with a ground motion and solves the equation of motion floor by floor. Each floor gets a color: green while drift is small, amber as it nears a damage limit, red as it nears collapse.
Here is the hook. Take a 10-story building. The rough rule in the footnotes gives its fundamental period as 0.1 seconds per story, so about T_1 \approx 1.0 second. Shake it with a crustal quake whose energy sits near 0.3 seconds, and the roof barely moves beyond the ground. Now shake the same building with a soft-soil basin record whose energy sits near 1.0 second. The roof swings hard, drift goes red on the middle floors, and the building fails. Same building, same peak ground acceleration, opposite outcome. The difference is resonance, and resonance is the whole story.
When to use it, and when not to
Use the simulator to build intuition: to see why a short stiff building and a tall flexible one react differently to the same quake, why a soft ground floor concentrates damage, and how much period shift base isolation gives you. It is a teaching model, and it is honest about that.
Do not use it to certify a real structure. The model is a planar shear frame with one lumped mass per floor. Real buildings twist, their floors flex, their columns yield in complicated ways, and soil pushes back on the foundation. None of that is here. Treat every number as a clean illustration of a principle, not a design value.
A green result in this tool does not mean a building is safe. It means a simplified linear model stayed under a drift threshold for one synthetic record. Real design uses dozens of records, nonlinear elements and code-mandated factors.
The equation behind every floor
The building is a stack of masses joined by springs. When the ground accelerates, each floor feels an inertial push. Written for the whole structure at once, the motion obeys this:
Here u is the vector of floor displacements relative to the ground, and \dot{u} and \ddot{u} are the floor velocities and accelerations. M is the mass matrix (the floor masses on the diagonal). K is the stiffness matrix built from the story springs. C is Rayleigh damping, a blend of M and K. The term \ddot{u}_g(t) is the ground acceleration from your chosen record, and \mathbf{1} is a column of ones, meaning every floor gets the same base shaking.
For a single-story building this collapses to the one equation you may already know:
where \omega_n = \sqrt{k/m} is the natural frequency in radians per second, \zeta is the damping ratio (typically 0.02 to 0.05 for buildings), and the natural period is T_n = 2\pi/\omega_n. The dangerous case is when the quake pours energy at frequency \omega_n. Then the drive stays in step with the swing and amplitude grows.
The tool integrates the full system with the Newmark average-acceleration method, which is unconditionally stable and conserves energy well. You do not need to run it by hand, but the worked example below shows the first step so the numbers feel real.
A worked example you can reproduce
One floor, one resonant push
Take a single floor with mass m = 1 and stiffness k = 100 in consistent units, damping \zeta = 0.05. Compute the key numbers:
- Natural frequency: \omega_n = \sqrt{100/1} = 10 rad/s.
- Natural period: T_n = 2\pi/10 \approx 0.6283 s.
- Drive it with a sine at resonance, \ddot{u}_g = a_0 \sin(\omega_n t), with a_0 = 1.
- Steady-state amplitude of a resonant forced oscillator: u_{max} = a_0/(2\zeta\omega_n^2).
- Plug in: u_{max} = 1/(2 \cdot 0.05 \cdot 100) = 0.1.
So at resonance the displacement settles near 0.1. The factor that blew a unit push up to 0.1 is 1/(2\zeta) = 10, the dynamic amplification. Halve the damping to \zeta = 0.025 and the amplitude doubles to 0.2. Double the damping to 0.1 and it drops to 0.05. Damping is the one knob that fights resonance directly.
Now detune. Drive the same floor at \omega = 20 rad/s, twice its natural frequency. The amplitude of a forced oscillator is:
With \omega_n = 10, \omega = 20: the denominator is \sqrt{(100-400)^2 + (2\cdot0.05\cdot10\cdot20)^2} = \sqrt{90000 + 400} \approx 300.7, so u_{max} \approx 0.003326. Off resonance the same push produces about 1/30 of the motion. That gap is why base isolation works: push the period away from the quake's energy and the response collapses.
The response spectrum and why it rules everything
A response spectrum answers one question: if a single oscillator with period T feels this quake, how far does it swing? You sweep T from short to long, solve the one-floor equation for each, and plot the peak response. The tool overlays your building's fundamental period as a vertical marker.
The marker position tells the whole tale. Land on a peak of the spectrum and the building resonates. Land in a valley and it rides out the shaking. The chart below is a schematic spectrum for a soft-soil basin record, which pushes its hump out toward long periods.
This is the exact reason the footnote warns that soft basins hurt tall buildings most. Deep soft soil filters the shaking so its energy arrives at long periods, and long periods belong to tall flexible towers.
Reading drift, roof displacement and the color bands
The single most useful output is inter-story drift ratio: the sway of one floor relative to the one below, divided by the story height.
Here u_i and u_{i-1} are the displacements of floor i and the floor below, and h_i is the story height. Drift matters more than total roof sway, because a column cracks when its two ends move too far apart, not when the whole building leans.
Rough bands used in the tool, consistent with common performance targets:
| Drift ratio | Color | Meaning |
|---|---|---|
| under 0.005 | green | elastic, little or no damage |
| 0.005 to 0.02 | amber | cracking, repairable damage |
| over 0.02 | red | near collapse |
A worked check: with a story height h = 3.0 m, a green ceiling of 0.005 means the relative sway must stay under 0.005 \times 3.0 = 0.015 m, or 15 mm. The red line of 0.02 is 60 mm of relative movement across a single story. Watch where the red first appears: in a soft-story building it jumps to the weak floor, because that floor carries almost all the drift while the stiff floors above ride along nearly rigid.
What base isolation and a tuned mass damper change
Base isolation puts flexible bearings under the building. That lengthens the fundamental period, often from around 1 second to 2.5 or 3 seconds. Look back at the spectrum: moving from 1.0 s to 3.0 s drops spectral acceleration from about 1.38 g to 0.27 g, roughly a fifth. The superstructure then moves almost as a rigid block while the bearings absorb the drift.
A tuned mass damper is different. It does not change the period. It adds a heavy mass on a spring, tuned to the building's first mode, that swings out of phase and drains energy, as in Taipei 101. It shines against a narrow-band resonant input (the sine record) and against wind. Against a short sharp near-fault pulse it has less time to get moving, so it helps less.
Run the identical quake twice, once fixed-base and once with your device, and compare the roof displacement charts side by side. The absolute numbers are model-dependent, but the ratio between the two runs is the honest lesson.
Common mistakes when reading the results
The first mistake is judging a building by peak ground acceleration alone. A 0.4 g crustal quake can leave a tall tower untouched while a 0.2 g basin record destroys it. Frequency content, not peak amplitude, decides resonance.
The second is ignoring the soft-story trap. Weakening the ground floor does not spread damage, it concentrates it. The drift that would have shared across ten floors piles into one. Many real collapses, where upper floors stay intact and the ground floor pancakes, are exactly this.
The third is trusting one record. Two quakes with the same magnitude can have peaks at different periods. Always try several records against the same building before you conclude anything.
The fourth is assuming more damping is always free. Damping fights resonance, but a real damper adds cost, weight and maintenance, and a tuned mass damper only helps near the frequency it is tuned to. Mistune it and it does little.
Related tools
If dynamic response under load interests you, the Bridge Builder & Truss Simulator shows the static cousin of this problem: members straining and buckling under a moving truck. For the control-theory side of fighting oscillation, the PID Controller Simulator lets you watch a feedback loop settle or ring. The Topology Optimizer grows the stiffest structure for a given set of loads, the opposite of the soft-story weakness studied here. And for resonance in a completely different medium, the Room Acoustics Simulator shows standing waves bouncing in a room.
Frequently asked questions
Why does a taller building sometimes survive better than a short one?
Because its period is longer. A 20-story building sits near 2 seconds, well past the hump of a typical crustal quake near 0.3 seconds, so it sees low spectral acceleration. The same quake hits a stiff 3-story building, period 0.3 seconds, right on the peak.
What is the 0.1 second per story rule?
It is a rough estimate of a building's fundamental period: multiply the number of stories by 0.1 second. A 10-story building is near 1.0 second. It is only a starting guess, good to maybe plus or minus 30 percent, but it is enough to locate the building on a response spectrum.
Does base isolation work for every building?
No. It works best for stiff, short-period buildings sitting on firm ground, where lengthening the period moves them off the energetic part of the spectrum. On very soft soil where the quake's energy is already at long periods, isolation can push the building toward resonance instead of away from it.
Why use relative displacement instead of absolute?
Damage comes from deformation, not travel. If the whole building and ground move together, no column strains. The simulator reports floor motion relative to the ground, and drift relative to the floor below, because those are what crack concrete.
Can I feed in a real earthquake recording?
Yes. Upload an accelerogram as a CSV of time and ground acceleration. The solver runs the same Newmark integration on your record. Keep the time step small and the units consistent, since the whole response scales with the acceleration values you provide.