ModelRisk Optimizer example · Agriculture and food
Vertical Farm: Crop Rack Allocation
How many grow-racks should each crop get to maximise expected profit within the light and water budgets?
The optimisation problem
Highest mean profit
- Decide
- Grow-racks for 4 crops
- Goal
- Highest mean profit
- Limit
- Light no more than 4,000 kWh and water no more than 2,600 L
- Engine
- Projected Gradient
What the Optimizer found
| Starting plan | Optimizer’s plan | |
|---|---|---|
| Micro-greens | 40 | 120 |
| Leafy salad | 50 | 139 |
| Culinary herbs | 20 | 59 |
| Vine tomato | 25 | 8 |
| Goal: Expected profit ($/cycle) | 15,501 | 37,355 |
| Limit: Lighting use (kWh), at most 4,000 | 1,730 met | 3,999 met |
| Limit: Water use (L), at most 2,600 | 1,135 met | 2,588 met |
ModelRisk Optimizer run on 13 Oct 2026: the Projected Gradient engine, with Turbo simulation, tried 309 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
An indoor vertical farm has a fixed stack of grow-racks and must split them among 4 crops each cycle. Each crop earns a known price per rack but its growing (energy + nutrient) cost per rack is uncertain (lognormal). Racks also draw lighting energy and irrigation water, both capped per cycle.
Decision, objective and constraint
- Decision variables
- 4 integer rack counts (Model!B11:B14), each within its Min/Max
- Objective
- Maximise the Mean profit = Σ racks × (price − uncertain cost), Model!C17
- Hard constraints
- lighting use ≤ 4,000 kWh (C18) and water use ≤ 2,600 L (C19)
The engine: why Projected Gradient
Expected profit is linear in the rack counts (the mean margin is a constant per crop) and both resource limits are linear. Every statistic is a point statistic (Mean / Value).
Method = Auto proves the model affine with its central-values probe and routes it to Projected Gradient — ModelRisk's equivalent of Excel Solver's GRG — which walks the binding resource constraints straight to the optimal rack mix.
The model
Choose how many grow-racks to devote to each crop to maximise expected profit within light and water budgets.
InputDecision (the Optimizer changes it)Calculated or uncertain (sampled each iteration)Objective
Facility resource budgets
| Lighting energy budget (kWh/cycle) | 4,000 |
|---|---|
| Irrigation water budget (L/cycle) | 2,600 |
Crops (decision = integer racks per crop)
| Crop | Racks (dec.) | Min | Max | Price/rack $ | Unit cost $ (uncertain) | Margin $ | Light kWh/rack | Water L/rack |
|---|---|---|---|---|---|---|---|---|
| Micro-greens | 40 | 10 | 120 | 190 | uncertain | calculated | 12.0 | 7.0 |
| Leafy salad | 50 | 20 | 140 | 150 | uncertain | calculated | 9.0 | 6.0 |
| Culinary herbs | 20 | 5 | 60 | 320 | uncertain | calculated | 20.0 | 14.0 |
| Vine tomato | 25 | 8 | 90 | 240 | uncertain | calculated | 16.0 | 11.0 |
Results
| Expected profit ($/cycle): objective | calculated |
|---|---|
| Lighting use (kWh): constraint | calculated |
| Water use (L): constraint | 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.
How to run it
- Optimizer opens the saved task.
- Start Optimization.
- Optimal rack counts in B11:B14.
- Simulation: 1000 Monte-Carlo iterations per trial (the objective is the Mean of an uncertain margin).
Glossary
- Grow-rack
- a vertically stacked shelf of hydroponic trays under LED lighting
- Margin
- price per rack minus the uncertain per-rack growing cost
- Point statistic
- a single-number summary (Mean or deterministic Value) — no tail/percentile
Find similar models
- Product
- Type
- Application
- Uses
Download the workbook and run the Optimizer. It opens in Excel with ModelRisk.
Related example models
- ModelChoice★★★★★Agricultural IrrigationShould a 640-acre farm install centre-pivot, drip or upgraded flood irrigation, or stay rain-fed?One decision and four chance events, driven by linked inputs. Best first decision: Center Pivot System, expected value $6.1m.
- 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.
- ModelRiskOptimizer★★★★★Vineyard Frost ProtectionHow many protection units per block keep every bud above the frost-damage line on a cold night?Places frost protection units across five vineyard blocks at the lowest mean cost, with at most a 10% chance of frost damage.
An illustrative example: the figures are invented for teaching. Last updated 9 October 2026.