Skip to content
GeoIgnite

Projects

Seismic Wave Simulator

Set off an earthquake and watch the P-waves spread through a real cross-section of the Earth, bending and bouncing off every layer they meet — including the one that hides half the planet from view.

  • TypeScript
  • Canvas
  • PREM

Live demo

Click anywhere inside the Earth to move the earthquake. Drag the depth slider for a precise hypocentre, and turn off "Layers" to see the raw wavefield.

This is a live seismic wave simulation. Not a recording, not an animation of pre-computed frames — the wave equation is being solved in your browser, about fifty thousand grid cells at a time, while you watch.

The Earth it travels through is real. Every velocity and density in the model comes from PREM, the Preliminary Reference Earth Model, which is the standard seismologists have used to describe the planet’s interior since 1981. It is a table of numbers: how fast sound goes at each depth, how heavy the rock is, how much energy it loses on the way.

What you’re looking at

Colour is wave energy on a logarithmic scale — by the time a wave has reached the core it is millions of times weaker than when it left, so a linear scale would show you the earthquake and nothing else. Bright means loud.

The wave starts as a clean circle. It does not stay one.

Watch it bend. In the mantle, seismic speed rises steadily with depth: about 8 km/s under the crust, nearly 14 km/s at the bottom. A wave travelling downward therefore has its deeper edge always running faster than its shallower edge, so it continually tips back upward. That is refraction, and it is why almost everything that leaves an earthquake eventually returns to the surface instead of sinking to the middle.

Watch it split. Look at 410 km and 660 km. At each of these depths the mineral olivine collapses into a denser crystal structure, and the speed jumps. Every jump is a partial mirror: some of the wave carries on through, and a faint copy peels off and heads back to the surface. Nothing in the code puts those echoes there. They emerge from the contrast in the table.

Watch it stop. The core–mantle boundary at 2891 km is the most violent interface in the planet. Rock gives way to liquid iron, and P-wave speed collapses from 13.7 km/s to 8.1 km/s. A large part of the wave reflects straight off it. The part that gets through is bent sharply downward — and that sharp bend is why there is a ring around the far side of the Earth, roughly 103° to 142° away from any large earthquake, where almost no direct P-waves arrive at all. It is called the shadow zone, and it is the single best piece of evidence that the Earth has a liquid core. Nobody has ever seen the core. We inferred it, in 1913, from waves that failed to show up where they should have.

Then at 5150 km the liquid gives way to solid iron again, the speed jumps back up, and the wave refracts once more on its way through the inner core.

How it works

The solver integrates the variable-density acoustic wave equation on a regular grid, second-order accurate in space and time:

  • Interfaces are handled by taking the harmonic mean of density on the faces between cells rather than at their centres. This is the detail that makes the reflected and transmitted amplitudes come out at the correct strength instead of merely looking plausible.
  • Attenuation uses PREM’s quality factor Q, so the wave loses energy at a realistic, depth-dependent rate. The outer core is nearly lossless; the inner core is not.
  • The edges of the box are wrapped in a perfectly matched layer, an absorbing boundary that swallows outgoing waves. Without it the sides of the simulation would act as mirrors and the whole section would fill with echoes that exist only because the computer had to stop somewhere.
  • The top is a free surface, where pressure must vanish. Waves reflect off the underside of the ground exactly as they do in the real Earth.

Try this

Drag the earthquake deep — 600 km, a subduction-zone event — and watch how much less energy reaches the surface directly overhead compared with a shallow quake at 10 km. Then put it back at the surface and follow a single wavefront all the way down to the core and back. The round trip takes about twenty minutes in real life. Here it takes a few seconds.

This started as a Wolfram notebook for an AP Environmental Science project, where it rendered a fixed animation over a couple of minutes. The grid was small enough that it turned out to be perfectly capable of running in real time — so now you can move the earthquake yourself.