Real earthquakes radiate two body waves from the rupture (hypocenter). Primary (P) waves are compressional and travel fastest; secondary (S) waves are shear and slower but carry most of the destructive shaking. Both travel outward at roughly constant speed, so the time each needs to cover a distance d is:
t_P(d) = d / V_p (V_p ≈ 5–8 km/s in crustal rock)
t_S(d) = d / V_s (V_s ≈ 2.5–4.5 km/s, always < V_p)
An earthquake early-warning (EEW) network — like ShakeAlert or Japan's JMA system — exploits the speed gap. A station near the epicenter feels the weak P-wave first, at t_P(dstation). The network needs a short processing delay tproc to confirm a real event and broadcast an alert. A distant city only feels the damaging S-wave later, at t_S(dcity). The seconds of warning it gets are:
lead time = t_S(d_city) − [ t_P(d_station) + t_proc ]
- Distance slider — how far the city sits from the epicenter; farther means more lead time, because the S-wave has longer to travel.
- Vp / Vs sliders — set by local rock stiffness and density; a bigger speed gap between them widens the warning window.
- Processing delay — real networks need ~1–10 s (here scaled up for a visible race) to confirm a detection isn't noise before issuing an alert; a slower network eats directly into the lead time.
- If the computed lead time goes negative, the city is too close to the epicenter — the S-wave outruns the alert, the classic EEW "blind zone."