The next time train rolls into the station, try to sneak a quick peek at its large metal wheels. You'll notice that instead of being perfect cylinders, they're actually angled. It's a deliberate and clever design choice that allows your train to roll around corners without flying off the tracks.
In this latest video from Numberphile, a YouTube channel dedicated to mathematics and science, Tadashi Tokieda, Director of Studies in Mathematics at Trinity Hall, Cambridge, explains how two sets of plastic cups, taped together on opposite ends, demonstrate the difference between stability and instability.
When the tops of the cups are taped together, the cups are able to roll all the way down down a set of parallel tracks without falling off. But when the cups are taped together at the bottom, they will always veer to the left of right, and eventually roll right off.
The results have nothing to do with how perfectly the cups are centred at the top of the track before they roll. As they veer to the right or left, the diameter of the cups on either side changes, resulting in what is essentially a pair of connected wheels that are each a different size. Because a larger wheel rolls farther than a smaller one in the same amount of time, the taped cups never roll perfectly straight. However, the version where the cups are taped together at the top is able to continuously self correct itself as it rolls, allowing it to make its way all the way down the tracks without falling off.
As Tokieda explains, it's that unique self-steering behaviour that allows a train to stay on the tracks as it goes around corners. A track's outer rail is actually physically longer than the inner one, which would require two perfectly cylindrical wheels to turn at two different speeds on either side.
To solve that problem, engineers designed train wheels with an angle so that as the train navigates a corner, the wheels can shift from side-to-side, essentially changing their sizes in real-time. The wheels on one side end up with a larger diameter, covering more distance to handle the longer outer track, while the wheels on the other side get smaller to handle the shorter distance on the inner track. It all happens automatically thanks to centrifugal forces pushing the train outwards as it rounds a corner, which means no one has to do anything to ensure the train doesn't derail.