On Wednesday evening, a train travelling from Madrid to Ferrol, in northwestern Spain, derailed just as it was about to enter the Santiago de Compostela station. At least seventy-eight people were killed, and dozens were injured. Video of the accident shows the train entering the curve at what seems to be a high speed; the passenger cars detach from the engine and derail, while the engine stays on the tracks for a few more seconds before it, too, leaves the rails and hits a wall. Unofficial reports claim that the train was going as fast as a hundred and twenty miles per hour on track rated for only fifty m.p.h.

Unlike Japan’s Shinkansen or France’s T.G.V., which run on dedicated tracks, the Madrid-Ferrol route is a hybrid line, much like Amtrak’s Acela Express. Only part of the track is configured for high-speed travel; the rest is shared with slower trains, and can handle only their more restricted speeds.

High-speed rail is a catchall term with several definitions. The Federal Railroad Administration says it starts at a hundred and ten m.p.h., while the International Union of Railways says a hundred and fifty-five. But whichever definition one favors, the rails themselves must be carefully designed to handle the physical forces imposed upon them by multi-ton trains moving at high velocity.

One of those forces is centrifugal (“to flee from the center”) force, the inertia that makes a body on a curved path want to continue outward in a straight line. It’s what keeps passengers in their seats on a looping roller coaster and throws unsecured kids off carousels. Centrifugal force is a function of the square of the train’s velocity divided by the radius of the curve; the smaller and tighter the curve, or the faster the train, the greater the centrifugal force. As it increases, more and more of the weight of the train is transferred to the wheels on the outermost edge of the track, something even the best-built trains have trouble coping with. That’s where the concepts of minimum curve radius and super-elevation, or banking, come in.

Banked curves, in which the outer edge of the track is higher than the inner edge, balance the load on the train’s suspension. Since gravity pulls a train downward and centrifugal force pulls it outward, a track banked at just the right angle can spread the forces more evenly between a train’s inner and outer wheels, and help to keep it on the track.

But banking the tracks isn’t a cure-all—a passenger train can tilt only so far before people fall out of their seats. So the minimum curve radius comes into play. Imagine that a curved portion of track is actually running along the outer edge of a large circle. How big must that circle be to insure that a train’s centrifugal force can be managed with only a reasonable amount of banking?

It’s relatively easy to calculate these forces and the ways to counteract them, so it’s relatively easy to set a safe maximum speed for a certain kind of track. Yes, badly maintained tracks, trains, or signals can sometimes contribute to a derailment. Historically, however, many of the world’s worst train accidents on sharp curves—the 1918 Malbone Street wreck in the New York City subway system, which killed at least ninety-three people (figures vary), or the Metro derailment in Valencia, Spain, in 2006, which killed forty-three—were simply caused by the trains going too fast.

That seems to be the case in the Santiago de Compostela accident: tracks rated for fifty miles per hour need almost no banking and can have a curve radius of fifteen hundred feet, while a train traveling at a hundred and twenty miles per hour needs a track with significant banking, and a minimum curve radius of more than a mile and a half. The laws of physics all but insured that in this particular battle between gravity and centrifugal force, the latter would win.