Earthquake Lab
Pick a fault, set the size, and set it off. Watch the rupture tear along the fault, the seismic waves race out, the ground roll, wet sand turn to liquid, and the ocean heave into a tsunami.
001What you can try
Four kinds of fault
Strike-slip, normal, reverse and subduction megathrust, each with its own dip, slip direction and size limit. Start the rupture deep or shallow and let it spread both ways or just one.
Waves you can see
Every dot is a chunk of rock, coloured by the wave shaking it: P, S, Rayleigh or Love. Three seismographs record the same quake at a harbor, a ridge town and a far station.
Liquefaction
Loose wet sand under the harbor builds up water pressure with every cycle of shaking until it gives way. Buildings sink and tilt and sand boils erupt.
Tsunamis
Put the fault under the sea and the seafloor heaves the water above it. Change the ocean depth, the continental shelf and the shape of the coast; a narrow inlet piles the wave up highest.
Map view
Look down from above at live waves, peak shaking, ground uplift and the highest the sea rose, with tsunami arrival-time contours and tide-gauge records.
True scale
Switch off the exaggeration and zoom from the whole fault down to single buildings. At 1:1 you can see how small a few meters of slip really is against hundreds of kilometers of crust.
002How it works
- The fault
- Rupture length, width, slip and duration come from standard magnitude scaling. The fault is split into patches that break in turn as the rupture front moves outward at about 2.8 km/s.
- Seismic waves
- Each patch radiates P, S and surface waves with a double-couple pattern, using real wave speeds: 6.2 km/s for P, 3.6 for S, and about 3.3 for the surface waves.
- Ground offset
- The permanent uplift and drop around the fault is worked out from the slip on each patch.
- Tsunami
- The shallow-water equations on a grid, pushed by the seafloor moving under them, with bottom friction and absorbing edges.
- Built with
- Plain JavaScript and the Canvas 2D API in a single HTML file. No libraries.
It's a teaching model, not a hazard forecast. Depth, ground offsets and wave motion are exaggerated so you can see them; the scale is printed under the picture.