Coffee problems

Patrick Hedfeld has bean there, modelled that

post

Coffee is not only an elixir of life for tired students and overworked mathematicians, but also a fascinating object of scientific consideration. From the optimal brewing temperature to the perfect milk foam geometry—behind every cup of coffee is a world full of formulae, functions and fascinating physical phenomena.

So put the kettle on and join us as we dive into the maths of coffee and discover why a cup of coffee sometimes requires more variables than a partial differential equation.

A question of thermodynamics

The ideal brewing temperature for coffee is 92°C to 96°C. This temperature range maximises the extraction rate of the coffee particles without releasing bitter tannins. This can be described by the Arrhenius equation,
\begin{equation*} k=A\mathrm{e}^{-E_\text{a}/RT}, \end{equation*}
with $k$ the speed constant of the extraction, $A$ a constant factor that is determined by experiment, $E_\text{a}$ the activation energy, $R$ the universal gas constant, and $T$ the temperature in Kelvin.

Studies have shown that at temperatures above 96°C, the extraction of undesirable bitter compounds increases significantly, while at temperatures below 92°C, the extraction of the desired flavouring compounds remains incomplete. So make sure to have your thermometer handy when making a pot.

Voronoi diagrams

A Voronoi diagram divides an area into regions based on a set of points. Each region contains all the points that are closer to a certain point than to any other. These regions are called Voronoi cells. Voronoi diagrams are used in many fields such as geography, biology, robotics and telecommunications. For example, they help in determining catchment areas, modelling cell structures, path planning and optimising the placement of cell towers or even in milk foam over coffee.

Coffee cups

The perfect milk foam geometry

Milk foam is a complex colloidal system consisting of gas bubbles in a liquid matrix. The bubbles in the milk foam form a Voronoi diagram-like structure, in which each bubble optimally fills the space allocated to it. The mathematical description of this structure is complex, but we can represent it—very simplified—as a sum over spheres and sum it up as
\begin{equation*} V=\sum_{i=1}^{n}\frac{4}{3}\pi r_{i}^{3}, \end{equation*}
with $V$ the total volume of milk foam and $r_{i}$ the radius of the $i$th bubble.

Research shows that the stability and texture of milk foam depends heavily on the size distribution of the bubbles. An even distribution of small bubbles results in a creamier and more stable foam.

The coffee break: a time optimisation problem

How long should a coffee break last? Mathematically, this is an optimisation problem that aims to maximise the benefits of the break without affecting productivity too much. The optimal duration of breaks, $t$, can be described as
\begin{equation*} t=\frac{T_{W}}{2}\ln\left(\frac{P_{\text{max}}}{P_{\text{min}}}\right), \end{equation*}
where $T_{W}$ is the total working time, $P_{\text{max}}$ is the maximum productivity, and $P_{\text{min}}$ is the minimum productivity, or the absolute minimum of your cognitive function.

A coffee cup

The art of taking a break

Studies have shown that short, regular breaks can increase productivity and even creativity. However, taking too long a break can interrupt the flow of work and reduce efficiency. Finding the right time is an optimisation problem with multiple critical points and a strong dependence on coffee quality. For instance if our maximum productivity is twice our minimum, then we should take a three-hour break for every eight hours that we work. This gives plenty of time for working out the mathematics of coffee!

The coffee cup: a problem of geometry

The shape of a coffee cup has a significant influence on the taste experience. Surface area is the one of the main factors for both the release of volatile compounds and temperature retention, though this also depends on the material the cup is made of. A cylindrical mug with a diameter of 7cm and a height of 9cm offers the optimal surface for the aroma development. The volume $V$ of such a mug is given by $V=\pi r^{2} h$, where $r$ is the radius of the mug and $h$ is its height.

Alternatively for a hemispherical cup, as is popular in many high-street coffee shops, the volume is $V=2\pi r^{3}/3$. Both the mug and the cup have an opening with area $2\pi r^2$.

Research suggests that the shape of the cup affects the perception of flavours, as it affects the release of volatile compounds and temperature retention—at least until the drinking process begins.

A coffee cup

Coffee dosage: a question of statistics

The optimal amount of coffee per cup is 7–9g per 150ml of water.

This can be described by a normal distribution,
\begin{equation*} P(x)=\frac{1}{\sqrt{2\pi} \sigma}\exp\left[-\frac{(x-\mu)^{2}}{2\sigma^{2}}\right], \end{equation*}
where $\mu= \text{8g}$ is the mean value of coffee per 150ml of water, $\sigma=\text{0.5g}$ is the standard deviation, $x$ is the variable amount of coffee per 150ml of water, and $P(x)$ is the probability density of the amount of coffee being $x$ per 150ml.

Empirical studies have shown that a dosage of 8g provides the best balance between strength and aroma, though that depends on the type of coffee. Deviations from this amount will result in either too weak or too bitter a taste. The barista must have developed ‘the right touch’ or—much easier—must know and use the normal distribution.

Patrick Hedfeld is a private lecturer at the FOM University of Applied Sciences and Goethe University in Frankfurt am Main. He is a coffee addict and has no friends. On the left you see he is thinking about the cup for at least two hours.

More from Chalkdust