What science can tell us about the perfect cup of coffee


1 Oct 2020

Image: © Nomad_Soul/Stock.adobe.com

Jamie Foster and Christopher Hendon write about how baristas can make the ‘perfect cup of coffee’ – with a little help from maths and chemistry.

The Conversation logo

A version of this article was originally published by The Conversation (CC BY-ND 4.0)

Have you ever wondered why the coffee you make at home tastes different from the drinks you buy in cafes? Or why coffee from the same place can taste different throughout the week? You may be quick to blame the barista for changing the recipe, but our study, published in Matter earlier this year, suggests that this variation is down to an inherent inconsistency of common brewing methods.

Luckily, we believe to have discovered a path to making a great espresso – to your taste – every time.

The quality of a cup of coffee depends on the coffee’s variety and origin, its roast and the water chemistry. The brewing method also plays a critical role in determining the overall flavour. Espresso is certainly the most complicated brewing method because it requires precise measurements. However, espresso also happens to underpin all coffee menus, as it is the basis for lattes and cappuccinos.

To make espresso, hot water is forced through a finely ground bed of coffee. The barista makes decisions about how much coffee and water to use, and how finely the coffee is ground. The machine’s water pressure, temperature and brew volume are also crucial when it comes to taste. Together, these parameters control the relative proportion of around 2,000 different chemicals – a delicate balancing act.

Yet, even if the barista does everything perfectly, there remain large variations between espresso shots made following the same recipe. One shot may taste like raspberries and dark chocolate, and the next like motor oil. And while everyone has different flavour preferences, we believe we have derived a procedure to help the barista out, and achieve the flavour profile they intended, every single time.

Image: © Mariusz Blach/Stock.adobe.com

Mathematics to the rescue

Our research team – which involved mathematicians, chemists, materials scientists and baristas – formulated a mathematical model to simulate the brewing of an espresso in realistic cafe conditions. We used this to make predictions of how much of the solid coffee ultimately ends up dissolved in the cup. This percentage – known as the extraction yield – is the key metric used by the coffee industry to assess different coffee recipes.

Solving a series of equations, we found that our model accurately predicts extraction yields that we see in real life, except when the coffee is ground very finely. This is because water flow through the espresso bed is quite unpredictable, resulting in sections of the bed becoming clogged. In other words, parts of the coffee are under-extracted (low extraction yield), while others are over-extracted (high extraction yield).

But the objective of a barista isn’t just to produce shots that taste great, they also have to be reproducible. Consistency can be monitored by examining the extraction yields of different shots. Contrary to our expectation, we discovered that to make consistently tasty brews, the barista should use less coffee and grind the coffee marginally coarser. By doing so, they are able to achieve very reproducible, high-yielding shots.

The mathematical theory tells us that this is because reducing coffee mass means that the water flows faster through the shallower coffee bed. The coarse grind results in a relatively permeable bed, such that water flow and extraction are uniform and predictable. This method leads to fast, bright, sweet and acidic shots that taste the same each time.

Of course, not everyone will enjoy the same flavour profile – and we account for this by presenting a series of procedures that a barista can use to help navigate the various flavours available within their coffee. Complex flavours – a result of tasting a mixture of both over and under-extracted coffee – can still be emulated by running and then mixing two shots with different extractions. More importantly, consumers could also simply select a different roast that features flavour profiles more suited to their palate.

One of our key findings, however, is that baristas are able to reduce their coffee waste by up to 25pc per espresso shot, dramatically increasing their annual profits with no sacrifice in quality. Using our protocol we estimate that, in the US coffee market alone, the total savings would amount to $1.1bn in America’s cafes per year.

What’s more, it has been estimated that 60pc of wild coffee species are under threat of extinction due to the climate crisis. So ultimately, using less coffee is not only better for making a consistently tasty espresso, it is also better for the environment.

The Conversation
By Jamie Foster and Christopher H Hendon

Jamie Foster is a senior lecturer in mathematics at the University of Portsmouth. Christopher Hendon is assistant professor of computational materials chemistry at the University of Oregon