# Why does coffee spill when you’re walking?

We’ve all been there - walking back to your table in Starbucks, hot mug of coffee in hand, trying to catch the eye of the cute girl by the window when, whoops! Coffee everywhere! Given the (probably) millions of hipsters afflicted by this scenario on a yearly basis, it seems surprising that very little research has been done into the dynamics of why the coffee ends up on on your skinny jeans instead of staying in the cup where it belongs. Never fear though, because a graduate student from the University of California at Santa Barbara has recently published a study examining the mathematics and fluid dynamics behind the spilled cup of coffee.

Hans Mayer and his advisor, Prof. Rouslan Krechetnikov published an article in Physical Review E, where they examined the dynamics of human motion, and how they relate to the liquid level in a typical coffee mug. The results reveal a surprisingly interesting complexity to what initially seems like a relatively simple problem. First, the authors video taped a subject walking with a mug of coffee in hand; they attached a light emitting diode to the cup to determine the instant of spill, and processed the images on a computer to analyze the motion of the cup. These experiments showed that the motion of the cup could be split into two parts - forward and back motion, and up and down motion. The cup tended to move 1-2 cm in each direction with each step, and for a variety of walking speeds, the frequency of steps varied over only a small range, from 1-2.5 Hz (1-2.5 steps per second).

The next step in the analysis requires a short mathematical detour. When an object is being forced in an oscillatory manner (repeated force applied over and over again, like pushing a swing), there is a certain frequency of forcing that can cause the object to shatter or break (think of a wine glass being shattered by a voice).

What happens is that, at this special frequency, pushing the object again and again causes the amplitude (or size) of the vibration to increase every time it is forced. Eventually, the object cannot hold itself together when the amplitude grows a sufficient amount, and it falls apart or shatters. Although the example in the video is for a solid glass beaker, liquids also have natural frequencies that describe how much the surface of the water is moving.

Now, back to coffee. The authors performed some mathematical analysis of the coffee in the mug, and found that its natural frequency closely matches the typical frequency of the motions of the mug when someone is walking. This means that as the cup naturally moves in your hand with each step, the oscillation of the fluid in the mug is getting bigger and bigger, until it spills over the edge of the mug and onto your pants. Interestingly, the number of steps you take before you spill is mostly determined by how quickly you start to walk, but its less important how fast you’re going when you get up to speed. That is, if you have to walk fast to get to your meeting, start slowly. And, not surprisingly, the authors found that if you focused on the mug while you were walking, you could walk farther before you spill it. So the next time you’re trying to find a love connection at the local coffee shop, try sitting down first. She’ll probably be more impressed with your MacBook Air and Bon Iver sticker anyways.

{% include doi.md doi=”10.1103/PhysRevE.85.046117” %}