Clear Sky Science · en
A preliminary model to establish a digital twin for coffee roasting
From Roasting Room to Virtual Roast
Coffee lovers may judge a cup by its aroma and crema, but behind every sip lies a complex roast that is still guided largely by craft and experience. This study explores how mathematics and chemistry can be combined to build a “digital twin” of coffee roasting, a virtual version of the process that could help roasters fine tune flavour and nutrition without endless trial and error.

Why Roasting Matters for Your Cup
Roasting is where green coffee beans are turned into the fragrant, brown beans we know. As beans are heated through drying, roasting and cooling, they lose water, puff up, crack and darken. Inside, hundreds of chemical reactions unfold, creating the compounds that shape bitterness, acidity, sweetness, body and aroma. Time and temperature are crucial: slight changes can shift a coffee from bright and fruity to dark and smoky. Because roasting is so influential and the global coffee market is enormous, even small improvements in control can matter for both taste and industry.
Turning Beans and Molecules into a Simple Map
The authors set out to translate this complicated chemistry into a streamlined mathematical model. They focused on key groups of substances known to drive flavour and health related properties: caffeine, chlorogenic acids, trigonelline, several organic acids, lipids (oils), sugars such as sucrose, glucose and fructose, and free amino acids. Drawing on prior chemical knowledge, they outlined how these compounds typically behave during roasting: some mainly break down, others transform into new molecules, and some are relatively stable. Because not every reaction product can be measured, they added a catch all “other substances” pool to represent the many additional molecules that give roasted coffee its depth.
How the Virtual Roast Works
To capture these changes, the team wrote a set of linked equations that describe how the concentration of each substance rises or falls over roasting time. Each equation follows standard rules of chemical kinetics and depends on rate constants that speed up as the bean gets hotter, according to the classic Arrhenius law. In practice, this means the model reads in a measured temperature curve from an industrial drum roaster and then computes how the compounds in a bean are expected to change second by second. The structure of the model also enforces mass conservation: what is lost from one group of compounds must appear somewhere else in the network.
Feeding Real Coffee into the Model
To anchor the virtual roast in reality, the authors analysed four single origin coffees, two Arabica (from Mexico and Rwanda) and two Robusta (from Nicaragua and Indonesia). For each roasted sample they measured caffeine, trigonelline, selected chlorogenic acids, ferulic acid, citric, tartaric and acetic acids, and total lipids, using established laboratory methods. Typical species differences appeared: Robusta had more caffeine and chlorogenic acids, Arabica more lipids. They then used these end of roast measurements, together with typical green bean compositions from the literature and the recorded temperature profiles, to “teach” the model. A numerical optimisation procedure adjusted the unknown rate constants until the simulated final concentrations matched the laboratory values as closely as possible, while respecting realistic bounds from food chemistry.
What the Virtual Roast Reveals
Once calibrated, the model reproduced the final measured composition of the coffees with small relative errors for most compounds, especially acids and alkaloids. The simulated curves over time also followed expected trends: caffeine and several acids steadily decreased, acetic acid built up, and ferulic acid showed a rise and fall pattern reflecting its formation from chlorogenic acids and its own breakdown. Lipids were harder to match perfectly, likely because their experimental measurement is more variable. Although intermediate time points were not yet measured in the roaster, the results suggest that this compact network of equations can capture the main chemical story of roasting under realistic temperature histories.

From Model to Custom Cups
For non specialists, the key message is that a virtual roasting model like this could, in time, let roasters predict how changing temperature or roast time will alter the inner chemistry of beans and, by extension, the sensory profile in the cup. This first version is still a preliminary step and needs more data during roasting and for additional flavour compounds. However, it already points toward a future where a digital twin helps design roasts tailored to specific tastes or nutritional targets, reducing waste and experimentation while keeping your favourite coffee both consistent and personal.
Citation: Bruno, M.J., Egidi, N., Fatone, L. et al. A preliminary model to establish a digital twin for coffee roasting. Sci Rep 16, 15857 (2026). https://doi.org/10.1038/s41598-026-43923-9
Keywords: coffee roasting, digital twin, food chemistry, kinetic modeling, coffee flavor