Mathematicians are a step closer to answering what, for some, is one of life’s most pressing questions – how to make the perfect cup of coffee.

Advanced mathematical analysis of a “hideously complicated” set of variables reveals that the size of the coffee grain is critical, followed by a long list of other factors.

The answers are expected to be of particular interest to industrial manufacturers of coffee machines.

One of the co-authors, Dr William Lee, who leads the industrial mathematics group at the University of Portsmouth, co-wrote the research when he was at the University of Limerick.

He said: “There are about 2,000 chemicals in coffee, making it as complex as wine.”

Coffee brewing is, the researchers say, also poorly understood, and a better understanding of the physics and chemistry of coffee brewing is likely to lead to better designed coffee machines.

They used a combination of experimental and mathematical methods to reveal grain size is one of the most important elements in brewing coffee, but a host of other factors also play an important role.

What makes the best coffee is hideously complicated – from the shape of the filter, to the scale of a single grain, to the flow rate of water and which machine or tool is used, there are an enormous number of variables.

Dr William Lee, Department of Mathematics and Physics

Dr Lee said: “What makes the best coffee is hideously complicated – from the shape of the filter, to the scale of a single grain, to the flow rate of water and which machine or tool is used, there are an enormous number of variables.

“But maths is a way of revealing hidden simplicity. By using mathematical analysis, we can begin to tell the story of which elements and in what order lead to the best coffee – we are now one step closer to the perfect cup of coffee.”

Dr Lee co-authored the research examining filter coffee with lead author Kevin Moroney and Stephen O’Brien from the University of Limerick, and Johann Marra and Freek Suijver of Philips Research, Eindhoven.

The research is published today in SIAM Journal on Applied Mathematics.

The team hope to develop a complete theory of coffee brewing that could be used to inform the design of filter coffee machines in the same way that industry uses the theories of fluid and solid mechanics to design aeroplanes and racing cars.

Dr Lee said: “One of the many challenges that have to be overcome to develop such a theory is to understand the effect the grind size has on the extraction of coffee.

“Our model shows that this can be understood in terms of the grind size controlling the balance between rapid extraction of coffee from the surface of grains and slow extraction from the interior of coffee grains.

“This not only explains qualitatively why grind size plays such an important role in determining the taste of coffee but also quantifies that relationship through formulas. These formulas could allow fine tuning the design of a coffee machine for a particular grind size.”