Write it down: what are the decisions, the goal and the rules?
Sort a model into its parts, then find the best plan on a graph
19:00 on 3 September 2025: every plan for the two gas plants, and the best one
With JavaScript on, you sort the model's parts, then move the rules and the cost line yourself.
Data: 19:00 of lesson 0's day. Demand, wind and solar follow the real Southwest Power Pool shapes of 3 September 2025 (EIA-930), scaled to the town.
Illustrative: Prairie Town, its plants, running costs, CO₂ rates and the CO₂ cap.
What you just did, as diagrams
- Decisions
- What the model chooses: here the two gas plants' outputs, spilled wind and sun, and unserved demand.
- Goal
- What it makes as small as possible: the running cost.
- Rules
- What every plan must obey: balance, plant sizes, the ramp limit, a CO₂ cap.
- Given
- Data the model takes as it is: demand, weather, costs.
- Four outcomes
- One best corner, a tie along an edge, infeasible (no plan meets every rule) or unbounded (a rule is missing).
Go deeper · AnalystWhy the best plan sits at a corner
- The cost line \(40x + 100y = C\) keeps its slope as \(C\) changes: lowering \(C\) slides it in parallel.
- The last point it touches in the shaded feasible region is a corner, or a whole edge that lies along the line (a tie).
- So for this two-plant model, where neither output can go below zero, whenever a best plan exists at least one best plan sits at a corner.
| Case | Best corner | Gas cost for the hour |
|---|---|---|
| 19:00 as given (145 MW of gas) | \(x = 145\), \(y = 0\) (53.65 t of CO₂) | $5,800 |
| 200 MW of gas | \(x = 150\), \(y = 50\) | $11,000 |
The fixed-output plant adds a constant $1,000 for the hour (100 MW × $10/MWh), so 19:00 costs $6,800 in all. A constant cannot move the best plan, so the chart leaves it out.
Lesson 11’s solver walks from corner to corner in the same way (the simplex method).
Go deeper · ModelerThe hour as a solver reads it
A solver reads the same four parts, written as numbers. For 19:00, in one line:
\[ \min\ 40x + 100y \quad \text{subject to} \quad x + y \ge 145,\ \ x \le 150,\ \ y \le 100,\ \ 0.37x + 0.55y \le 100,\ \ x, y \ge 0. \]
- Decisions: \(x\) and \(y\), in MW for the hour.
- Goal: the gas cost in dollars, one coefficient per decision.
- Rules: one row each, with a limit on the right.
Where it goes next:
Go deeperWhat one hour leaves out
- The ramp limit: it couples neighbouring hours. This chart leaves out the previous hour's output; lesson 11 solves all 24 hours together.
- Extra gas above 145 MW would be spilled as wind and sun; at 19:00 only 86 MW of them can be, a limit the chart leaves out.
- Real costs are rarely exactly equal, but near-ties are common: then small data changes swing the plan between the tied plants.
Check yourself
Myth or fact? “If two different plans are both best, there are exactly two best plans.”
- Myth
- Fact
Answer
Myth. Every plan on the line between them is just as good: any split between two plants with equal costs is best.
Myth or fact? “Demand is one of the decisions in a dispatch model.”
- Myth
- Fact
Answer
Myth. Demand is given; the model decides how the plants meet it.
Myth or fact? “When this lesson's two-plant model has a best plan, at least one best plan sits at a corner of the region.”
- Myth
- Fact
Answer
Fact, for this model: with both outputs at least zero, its region has corners. The cost line slides in parallel and last touches a corner, or a whole edge that ends at one.
Myth or fact? “‘Infeasible’ means the solver failed.”
- Myth
- Fact
Answer
Myth. It means the rules contradict each other. Fix the model or its data, not the solver.
Which is a decision variable in Prairie Town's dispatch model?
- Demand at 19:00
- The peaker's output at 19:00
- The price of gas
- The peaker's CO₂ per MWh
Answer
The peaker's output: the operator chooses it. The other three are given.
Gas must supply 200 MW: the combined-cycle costs $40/MWh up to 150 MW, the peaker $100/MWh. What does the cheapest gas plan cost for the hour?
- $8,000
- $11,000
- $20,000
- $6,000
Answer
$11,000: 150 MW × $40 + 50 MW × $100. The best corner sits where the combined-cycle's size meets the demand line.
Numbers, sources and what’s next
Numbers to remember
| Number | What it means | Source |
|---|---|---|
| 4 parts | Decisions, a goal, rules, and the data the model is given: every optimization model has them. | This lesson |
| 4 outcomes | One best corner, a tie, infeasible or unbounded: every linear program ends in one of them. | This lesson |
| 145 MW | The gas Prairie Town needs at 19:00 on 3 September 2025, after nuclear, wind and sun. | Lesson 0's day; EIA-930 shapes, scaled (illustrative) |
| $5,800 | The cheapest gas plan for that hour: 145 MW from the combined-cycle, none from the peaker. The fixed-output plant's constant $1,000 makes $6,800 in all. | This lesson's model (illustrative) |
Next on the starter path
In the real world
Grid operators' dispatch models have the same four parts, with many more decisions: every plant, every line, every interval.
Open modelling tools such as PyPSA and JuMP write them in code.
Sources and further reading
- EIA. Hourly Electric Grid Monitor (Form EIA-930): the Southwest Power Pool data behind Prairie Town's day.
- HiGHS. Documentation: the open-source solver that lesson 11 runs in your browser.
- JuMP. Modelling language for mathematical optimization in Julia.
- Earlier lessons: lesson 0 (the day you ran by hand), lesson 8 (the merit order as an optimization).
Spotted an error, or stuck? Write to hlli@ksu.edu. Corrections are made in place and dated here.
Text licensed CC BY 4.0, code MIT: teachers and students may reuse and adapt it, with credit to Honglin Li.