ModelRisk Optimizer example · Agriculture and food
Specialty Coffee: Espresso Extraction Time
What single shot time gives the best expected cup score?
The optimisation problem
Best mean cup score
- Decide
- One shot time, 18 to 40 seconds
- Goal
- Best mean cup score
- Limit
- None
- Engine
- Brent
What the Optimizer found
| Starting plan | Optimizer’s plan | |
|---|---|---|
| Shot time (s) | 22 | 27 |
| Goal: Mean sensory score (0-100) | 89.2 | 90.0 |
ModelRisk Optimizer run on 13 Oct 2026: the Brent engine, with Turbo simulation, tried 234 plans, each simulated with 10,000 samples, in 3 seconds. Both plans above were then simulated again with the same 10,000 samples.
What the workbook models
A café dials in one espresso recipe. The sensory score peaks at an ideal shot time and falls off either side (a smooth concave curve) with cup-to-cup tasting noise (normal).
Decision, objective and constraint
- Decision
- 1 continuous shot time, 18 to 40 s
- Objective
- Maximise the Mean sensory score
- Constraints
- none
The engine: Brent
A single continuous variable with a smooth Max objective and no constraints then Method=Auto routes to Brent's 1-D bracket search (≈5 evaluations).
The model
Tune the single shot time to maximise the expected sensory score (a smooth 1-D peak).
InputDecision (the Optimizer changes it)Calculated or uncertain (sampled each iteration)Objective
| Shot time (s): decision | 22.00 |
|---|---|
| Ideal time (s) | 27.00 |
| Sensitivity | 0.03 |
| Sensory score (0-100): objective | calculated |
Decision cells hold starting values: the workbook opens at the starting plan above, and the Optimizer finds its plan when you run it. The figures are illustrative.
Run it yourself. Open the workbook with ModelRisk, open the Optimizer from the ribbon (the saved task opens with it) and press Start.
Glossary
- Extraction time
- seconds the pump runs to pull the shot
Find similar models
- Product
- Type
- Application
- Uses
Download the workbook and run the Optimizer. It opens in Excel with ModelRisk.
Related example models
- ModelRiskOptimizer★★★★★Craft Bakery: Sourdough HydrationWhat hydration percentage yields the target crumb structure?Finds the dough hydration, between 60% and 90%, that puts the crumb index on its target of 3.2.
- ModelRiskOptimizer★★★★★Greenhouse: CO₂ Enrichment vs CostWhat CO₂ set-point maximises yield without breaching the daily enrichment budget?Finds the CO₂ set-point with the highest mean yield, with enrichment costing no more than $150 a day.
- ModelRiskOptimizer★★★★★Aquaculture: Daily Feed PulsesHow many feed pulses per pen give a robust harvest weight without risking an oxygen crash?Sets feed pulses for five fish pens to raise the 25th-percentile harvest, with at most a 5% chance of an oxygen crash.
An illustrative example: the figures are invented for teaching. Last updated 9 October 2026.