Structural Dynamics and Earthquakes
What happens when loads move: natural frequency, resonance and damping, the Ljubljana earthquake and the bridges that taught us, the response spectrum and the new Slovenian hazard map, and why ductility matters more than strength – with a frame by hand, three storeys in Python and a footbridge that bounces.
Open in the interactive Digital Garden
| What You Need |
|---|
| The basics from Structural Statics and the idea of the stiffness matrix from How the Finite Element Method Works |
For Example 2: Python 3 with NumPy (pip install numpy) |
| To play with the numbers: my Earthquake Spectrum tool |
| Maps, earthquake records and programs: my Structural Dynamics & Earthquakes and Structural Analysis resources |
Statics assumes that loads stand still. Wind, traffic, machines, people jumping at a concert – and earthquakes – don't. When a load moves, a structure does not just carry it; it starts to swing, and the swinging can be much bigger (or much smaller) than the load alone would suggest. Slovenia is an earthquake country, so this is a part of structural engineering nobody here can skip.
The good news: the main ideas fit on one page. A structure is a mass on a spring. It has its own rhythm. If something pushes it in that rhythm, it gets into trouble. Everything else – response spectra, modes, behaviour factors – is built on these three sentences.
Earthquakes and Bridges That Taught Us
On Easter Sunday, 14 April 1895, at 23:17, a magnitude 6.1 earthquake hit Ljubljana. 21 people died and about a tenth of the city's 1400 buildings were destroyed or badly damaged. Mayor Ivan Hribar used the disaster to rebuild the city, and much of the Art Nouveau Ljubljana we walk through today was built in the fifteen years after the earthquake. The closest strong earthquakes in living memory were in Posočje: on Easter Sunday, 12 April 1998, a magnitude 5.6 earthquake under Krn damaged more than 4000 buildings, and in 2004 another one hit the same valley, some of the houses just repaired. In 2020 Zagreb and Petrinja reminded the whole region again.
Seismic design codes were born from disasters. After the Great Kantō earthquake of 1923 Japan introduced one of the first rules: design every building for a horizontal force equal to a part of its weight. Yugoslavia got its first seismic code in 1964, right after the Skopje earthquake of 1963 killed more than a thousand people. And the 1985 Mexico City earthquake showed how much soil matters: the soft lake clay under the city amplified waves with a period of about two seconds, and the buildings that collapsed were mostly the ones with a similar period of their own.
Bridges taught the other lessons. The Tacoma Narrows Bridge fell into the water on 7 November 1940, four months after opening, in a steady wind of about 60 km/h. It is often shown as an example of resonance, but that is not the full story: the wind did not push at the bridge's rhythm. The twisting deck itself changed the airflow so that the wind fed energy into the movement – aeroelastic flutter. Since then every long bridge is tested in a wind tunnel. The Millennium Bridge in London opened on 10 June 2000 and was closed two days later: when the deck swayed a little sideways, people started to walk in step with it without noticing, which made it sway more. It was fixed with dampers and reopened in 2002.
A Mass on a Spring
Push a structure sideways and let go: it swings back and forth by itself. The simplest model is one mass m on a spring with stiffness k – a one-storey building with a heavy roof and columns as the spring is almost exactly that.
ω = √(k / m) circular frequency [rad/s]
f = ω / (2π) natural frequency [Hz] - swings per second
T = 1 / f = 2π·√(m / k) natural period [s] - seconds per swing
A stiffer structure swings faster, a heavier one slower. Typical numbers: a one-storey concrete building about 0.1–0.3 s, a ten-storey building about 1 s (the old rule of thumb is 0.1 s per storey), a tall tower 5 s or more, a footbridge 1–5 Hz, a guitar string a few hundred Hz.
A building with several floors has several ways to swing – modes. In the first mode all floors move to the same side, more at the top. In the second the top goes one way and the bottom the other. Usually the first mode is by far the most important (Example 2 shows how much).
Resonance and Damping
Now push the mass back and forth with a force that changes in a rhythm. How much bigger is the movement than if the same force just stood still? That ratio is the dynamic amplification, and it depends only on how close the rhythm of the force is to the natural frequency, and on damping:
| Load frequency / natural frequency | Damping 2 % | Damping 5 % | What it means |
|---|---|---|---|
| 0 (a static load) | 1.0 | 1.0 | statics |
| 0.5 | 1.3 | 1.3 | slow load: a bit more than static |
| 0.9 | 5.2 | 4.8 | getting dangerous |
| 1.0 | 25 | 10 | resonance – only damping limits it |
| 1.2 | 2.3 | 2.2 | past the peak |
| 2.0 | 0.33 | 0.33 | fast load: the mass can't follow |
Two lessons hide in this table. In resonance, the movement grows to about 1 / (2·ξ) times the static one, where ξ is the damping ratio – so damping, which is irrelevant in statics, suddenly decides everything. And far away from resonance damping hardly matters; what helps there is moving the natural frequency away from the load. Concrete and masonry buildings have about 5 % damping, welded steel and modern footbridges much less, often below 1 %. That is why light, elegant structures are the ones that vibrate.
What an Earthquake Does to a Building
An earthquake does not push a building with a force. It moves the ground, and the building, because of its mass, wants to stay where it is. The columns bend, and the force in them is the mass times the acceleration of the floors. That is why heavy buildings get bigger earthquake forces, and why a light timber house is in a good position from the start.
The ground shakes with a mix of all frequencies, but not evenly. Engineers took real earthquake records and asked: how strongly would a mass on a spring with period T shake during this earthquake? Repeat that for all periods, draw the answers, and you get a response spectrum. Eurocode 8 gives a smooth, standard version of it:
- Very stiff structures (T close to 0) move with the ground and feel the ground acceleration
ag. - Between TB and TC – about 0.15 to 0.6 s, where most houses and low buildings are – there is a plateau with about 2.5 times the ground acceleration. That is resonance with the strongest part of the shaking.
- Long periods – tall, flexible buildings – feel less acceleration but move more.
- Soft soil raises the plateau (the soil factor S) and makes it longer – the Mexico City effect.
The input is the ground acceleration from the national map. Slovenia got a new seismic hazard map in 2021; since May 2024 it is the only valid one for design. It gives the peak ground acceleration on rock that has a 10 % chance of being exceeded in 50 years (on average once in 475 years): from 0.100 g in the north-east and on the coast, to 0.275 g around Ljubljana and 0.325 g west of Bovec. In plain words: in Ljubljana a design earthquake can shake the ground with more than a quarter of the acceleration of gravity.
Bend, Don't Break: Ductility
If you calculate a normal building for the full elastic earthquake force, you get a horizontal force of 50–80 % of its weight – enormous, and expensive. Eurocode 8 lets you divide it by the behaviour factor q (1.5 for unreinforced masonry, around 3 to 4 for a well-detailed concrete frame, up to 6 and more for some steel systems). That is not a discount. It is a deal: the structure is allowed to yield and crack in a big earthquake, as long as it does so in a ductile way – bending like a paper clip, not snapping like a pencil.
Ductility has to be designed on purpose, and this is where most of the earthquake chapters of the code are:
- Strong columns, weak beams. If the beams yield first, the building sways but stands. If the columns of one storey yield, that storey collapses and everything above falls down.
- No soft storey. A ground floor with shops and big windows under stiff floors with walls is the classic collapse shape in every earthquake report.
- Capacity design. Make the brittle parts (shear, joints, foundations) stronger than what the ductile parts can ever deliver, so they never fail first.
- Details. Closely spaced stirrups with 135° hooks in concrete columns, ring beams and tie columns in masonry. Small things that decide whether a building is damaged or flattened.
- Regularity and symmetry. A building whose stiffness is all on one side twists during an earthquake.
Examples
Example 1: A One-Storey Frame by Hand
A small one-storey concrete building: a roof slab with a mass of 20 t on four columns 30 × 30 cm, 3 m high, concrete C25/30 (E = 31 000 MPa). The slab is much stiffer than the columns, so each column is fixed at both ends. For earthquakes Eurocode 8 lets you use half of the stiffness, because concrete cracks.
I = 0.30 · 0.30³ / 12 = 6.75·10⁻⁴ m⁴
EI = 31 000 000 kN/m² · 6.75·10⁻⁴ m⁴ · 0.5 = 10 463 kNm² (cracked)
k = 4 columns · 12·EI / h³ = 4 · 12 · 10 463 / 3³ = 18 600 kN/m
ω = √(k / m) = √(18 600 / 20) = 30.5 rad/s (kN/m / t = 1/s²)
T = 2π / ω = 0.21 s, f = 4.9 Hz
Now the earthquake. Ljubljana (agR = 0.275 g), ordinary building (γI = 1.0), ground type C (S = 1.15, plateau from 0.2 to 0.6 s). T = 0.21 s is on the plateau:
elastic: Se = ag · S · 2.5 = 0.275 · 1.15 · 2.5 = 0.79 g
force = 0.79 · 9.81 · 20 t = 155 kN - 79 % of the weight!
design: q = 3 (a ductile concrete frame)
Sd = ag · S · 2.5 / q = 0.26 g
base shear Fb = 0.26 · 9.81 · 20 t = 52 kN - 26 % of the weight, 13 kN per column
So the four columns must carry about 52 kN sideways – a quarter of the weight of the roof – and be detailed so that they can survive bending three times further than that without breaking. The same numbers come out of my Earthquake Spectrum tool (choose "From stiffness and mass").
Example 2: Three Storeys and Their Modes, in Python
Stack three of those floors on top of each other and we have a model with three masses and three springs – a "shear building". The stiffness matrix is built exactly like in the FEM note, and instead of solving K·u = F we look for the movements where the springs and the masses are in balance by themselves: the modes.
import numpy as np
# A three-storey frame as a "shear building": one mass and one spring per storey
m = 20.0 # mass of one floor [t]
k = 18600.0 # stiffness of one storey [kN/m] (the frame from Example 1)
M = np.diag([m, m, m])
K = np.array([[2 * k, -k, 0],
[-k, 2 * k, -k],
[0, -k, k]]) # row 1 = first floor, row 3 = roof
# 1. natural frequencies and mode shapes: K x = w^2 M x
Ms = np.diag(1 / np.sqrt(np.diag(M))) # small trick so that numpy can use eigh
w2, v = np.linalg.eigh(Ms @ K @ Ms) # sorted from the slowest mode up
w, modes = np.sqrt(w2), Ms @ v
T = 2 * np.pi / w
# 2. design spectrum from Eurocode 8 (type 1, ground C, q = 3)
ag, S, TB, TC, TD, q = 0.275 * 9.81, 1.15, 0.2, 0.6, 2.0, 3.0
def Sd(T):
if T < TB: return ag * S * (2 / 3 + T / TB * (2.5 / q - 2 / 3))
if T < TC: return ag * S * 2.5 / q
if T < TD: return max(ag * S * 2.5 / q * TC / T, 0.2 * ag)
return max(ag * S * 2.5 / q * TC * TD / T**2, 0.2 * ag)
# 3. how much of the mass each mode moves, and its base shear
ones = np.ones(3)
total = 0.0
for i in range(3):
phi = modes[:, i] / modes[2, i] # roof = 1
gamma = phi @ M @ ones / (phi @ M @ phi) # participation factor
m_eff = gamma * (phi @ M @ ones) # effective modal mass
F = Sd(T[i]) * m_eff # base shear of this mode [kN]
total += F**2
print(f"mode {i + 1}: T = {T[i]:.3f} s, shape {np.round(phi, 2)}, "
f"mass {m_eff / (3 * m) * 100:4.1f} %, base shear {F:5.1f} kN")
print(f"total base shear (SRSS): {np.sqrt(total):.1f} kN, "
f"that is {np.sqrt(total) / (3 * m * 9.81) * 100:.0f} % of the weight")
print(f"Eurocode estimate T1 = 0.075 * H^0.75 = {0.075 * 9.0**0.75:.2f} s")
Output:
mode 1: T = 0.463 s, shape [0.45 0.8 1. ], mass 91.4 %, base shear 141.8 kN
mode 2: T = 0.165 s, shape [-1.25 -0.55 1. ], mass 7.5 %, base shear 11.2 kN
mode 3: T = 0.114 s, shape [ 1.8 -2.25 1. ], mass 1.1 %, base shear 1.6 kN
total base shear (SRSS): 142.2 kN, that is 24 % of the weight
Eurocode estimate T1 = 0.075 * H^0.75 = 0.39 s
What the numbers say:
- The first mode does almost all the work. It moves 91 % of the mass and gives 141.8 of the 142.2 kN. That is why Eurocode allows the simple "lateral force method" for regular buildings – one mode, one force:
Fb = Sd(T1) · m · λ = 2.59 · 60 · 0.85 = 132 kN, close to the full result. - The mode shapes make sense: in the first one all floors move the same way, the roof the most (0.45, 0.80, 1.0); the second has one change of direction, the third two.
- The quick Eurocode formula
T1 = 0.075 · H3/4gives 0.39 s, the model 0.46 s. Not bad for a formula that knows only the height – and a reminder that a real model is worth making. - Three storeys, three times the mass, but only 2.7 times the base shear of Example 1 – 24 % of the weight instead of 26 %, because part of the mass moves in modes with less participation. Taller and more flexible buildings drop further down the spectrum.
In a real program the matrices have thousands of rows and the modes are found the same way. The next step is OpenSeesPy, which can do the same with real frames and non-linear materials, and then a time-history analysis with real records from the ESM database.
Example 3: Will the Footbridge Bounce?
People walk at about 1.6 to 2.4 steps per second, and when running or jumping at a concert up to about 3 Hz. Sideways, every second step pushes the same way, so 0.5 to 1.2 Hz. A structure with a natural frequency in these ranges can be excited by people – the Millennium Bridge problem. Eurocode (EN 1990, Annex A2) asks for a comfort check for footbridges with a vertical frequency below 5 Hz or a horizontal one below 2.5 Hz.
A steel footbridge, 20 m span, simply supported, two HEB 400 girders and a deck of 375 kg/m. For a simply supported beam the first natural frequency is:
f1 = π / (2·L²) · √(EI / m)
EI = 210 000 000 kN/m² · 2 · 57 680·10⁻⁸ m⁴ = 242 256 kNm²
m = (2 · 155 + 375) kg/m = 0.685 t/m
f1 = π / (2 · 20²) · √(242 256 / 0.685) = 2.3 Hz - right in the walking range!
With HEB 600 girders (Iy = 171 000 cm⁴, 212 kg/m):
f1 = π / (2 · 20²) · √(718 200 / 0.799) = 3.7 Hz
Three times stiffer girders moved the frequency only from 2.3 to 3.7 Hz, because the frequency grows with the square root of stiffness, and the heavier girders added mass too. Still below 5 Hz, so the comfort check stays. That is the reason so many modern footbridges have tuned mass dampers: a small mass on a spring tuned to the bridge's frequency, which swings against it and eats the energy. It is much cheaper than steel.
What I Look At First
- Where is the mass? Earthquake forces come from mass. A heavy roof or a water tank at the top is the worst place.
- The period. On the plateau or past it? Does the model's period agree, roughly, with a hand estimate?
- The first mode. Does it move the way you would expect, without twisting? Does it activate most of the mass?
- The load path sideways. Can I follow the horizontal force from every floor down to the foundation, through walls, frames or braces – in both directions?
- Soft storeys and short columns. Big openings in one storey, columns half-hidden by a low wall – both are classic causes of collapse.
- For anything people walk on – floors, stairs, footbridges, grandstands – the natural frequency, not just the deflection.
A Few More Thoughts
What I find beautiful about dynamics is how much follows from one mass on one spring. The same equation explains why a guitar string sings, why a bridge bounces under joggers, why a tall building in Ljubljana feels a distant earthquake as a slow sway while a small house shakes hard, and why a tuned mass damper the size of a car can calm a skyscraper. The rest is bookkeeping.
And the lesson of every earthquake report is the same: buildings rarely collapse because somebody made a small mistake in the calculation. They collapse because of a soft storey, a missing stirrup, a column that was never meant to be cut for a shop window. In earthquake engineering, good shape and good details beat precise numbers.