ModelRisk Optimizer example · Energy and utilities
Micro-Grid: Single-Period Economic Dispatch
How much power to draw from each source to maximise expected margin within the feeder and emissions limits?
The optimisation problem
Highest mean margin
- Decide
- Power drawn from 4 sources
- Goal
- Highest mean margin
- Limit
- Grid import no more than 18 MW and emissions no more than 9 t
- Engine
- Projected Gradient
What the Optimizer found
| Starting plan | Optimizer’s plan | |
|---|---|---|
| Solar+batt | 3 | 8 |
| Chp engine | 3 | 1 |
| Grid import | 3 | 13.5 |
| Demand flex | 3 | 5 |
| Goal: Expected margin ($/h) | 507 | 1,172 |
| Limit: Feeder import (MW), at most 18 | 3 met | 13.5 met |
| Limit: Emissions (t), at most 9 | 4.50 met | 9 met |
ModelRisk Optimizer run on 13 Oct 2026: the Projected Gradient engine, with Turbo simulation, tried 34 plans, each simulated with 10,000 samples, in 2 seconds. Both plans above were then simulated again with the same 10,000 samples.
What the workbook models
A campus micro-grid dispatches four sources (solar+battery, CHP engine, grid import, demand flex) for one period. Each source sells at a known price but its fuel cost per MWh is uncertain (lognormal).
Decision, objective and constraint
- Decision
- 4 continuous MW dispatches, each within Min/Max
- Objective
- Maximise the Mean margin = Σ MW × (price − uncertain fuel cost)
- Hard constraints
- grid import ≤ 18 MW and emissions ≤ 9 t
The engine: Projected Gradient
Expected margin is linear in the dispatches (mean margin is constant per source) and both limits are linear; all statistics are point (Mean/Value). Method=Auto proves the model affine and routes it to Projected Gradient — the Excel-Solver-equivalent engine — which walks the binding limits to the optimum.
The model
Dispatch continuous MW from each source to maximise expected margin within the feeder import and emissions limits.
InputDecision (the Optimizer changes it)Calculated or uncertain (sampled each iteration)Objective
Grid limits
| Feeder import limit (MW) | 18.00 |
|---|---|
| Emissions cap (t) | 9.00 |
Sources (decision = continuous MW)
| Source | MW (dec) | Min | Max | $/MWh price | Fuel $/MWh (unc.) | Margin $ | Emit t/MW |
|---|---|---|---|---|---|---|---|
| Solar+batt | 3.00 | 0.00 | 8.00 | 60 | uncertain | calculated | 0.00 |
| CHP engine | 3.00 | 1.00 | 10.00 | 72 | uncertain | calculated | 0.90 |
| Grid import | 3.00 | 0.00 | 18.00 | 95 | uncertain | calculated | 0.60 |
| Demand flex | 3.00 | 0.00 | 5.00 | 40 | uncertain | calculated | 0.00 |
Results
| Expected margin ($/h): objective | calculated |
|---|---|
| Feeder import (MW): constraint | calculated |
| Emissions (t): 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.
Glossary
- Economic dispatch
- choosing source outputs to meet load at least cost / best margin
Find similar models
- Product
- Type
- Application
- Uses
Download the workbook and run the Optimizer. It opens in Excel with ModelRisk.
Related example models
- ModelRiskOptimizer★★★★★Desalination Plant: Antiscalant DosingHow much antiscalant should each reverse-osmosis train receive when feed salinity is uncertain?Sets antiscalant doses for six reverse-osmosis trains at the lowest mean daily cost, with 95th-percentile brine toxicity within the permit.
- ModelRiskOptimizer★★★★★Wastewater Aeration: Blower StagingHow many blower steps per basin minimise the worst-case energy bill while keeping oxygen safe 95% of the time?Stages the blowers in four basins to cut the worst 10% of energy bills, keeping oxygen above 2.0 mg/L with 95% assurance.
- ModelChoice★★★★★Renewable Energy Project SelectionA 50 MW solar farm, a 30 MW wind farm, solar with storage, or no project?One decision and 12 chance events. Best first decision: Hybrid Solar+Storage, expected value $4.9m.
An illustrative example: the figures are invented for teaching. Last updated 9 October 2026.