Micro-Grid Dispatch: Optimizer Example | Vose Software

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?

  • Complexity: ★★★★★
  • Free Excel workbook
  • Needs ModelRisk with the Optimizer

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 planOptimizer’s plan
Solar+batt38
Chp engine31
Grid import313.5
Demand flex35
Goal: Expected margin ($/h)5071,172
Limit: Feeder import (MW), at most 183 met13.5 met
Limit: Emissions (t), at most 94.50 met9 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)

SourceMW (dec)MinMax$/MWh priceFuel $/MWh (unc.)Margin $Emit t/MW
Solar+batt3.000.008.0060uncertaincalculated0.00
CHP engine3.001.0010.0072uncertaincalculated0.90
Grid import3.000.0018.0095uncertaincalculated0.60
Demand flex3.000.005.0040uncertaincalculated0.00

Results

Expected margin ($/h): objectivecalculated
Feeder import (MW): constraintcalculated
Emissions (t): constraintcalculated

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