What should Prairie Town build? Plan its power system
Choose what to build, run a year of real weather, and ask the optimizer
The cheapest plan for Prairie Town at each CO₂ cap (seven weeks of 2025, EIA and NREL costs)
| CO₂ cap a year | Cost a year | Wind | Solar | Gas (CC + peaker) | Nuclear | Battery (MW / MWh) |
|---|---|---|---|---|---|---|
| none (792 kt) | $102.9M | 0 MW | 33 MW | 425 MW | 0 MW | 0 / 0 |
| 600 kt | $108.8M | 181 MW | 54 MW | 367 MW | 0 MW | 0 / 0 |
| 400 kt | $117.3M | 389 MW | 50 MW | 341 MW | 0 MW | 0 / 0 |
| 200 kt | $129.3M | 576 MW | 100 MW | 302 MW | 0 MW | 15 / 15 |
| 100 kt | $143.1M | 649 MW | 216 MW | 280 MW | 0 MW | 28 / 40 |
| 0 kt | $288.9M | 220 MW | 59 MW | 0 MW | 330 MW | 62 / 447 |
kt: thousand tonnes. A battery has two sizes: power (MW, how fast it charges or discharges) and energy (MWh, how much it holds).
With JavaScript on, you choose the plants yourself, run the year in a solver and ask it for the cheapest plan under a CO₂ cap.
Weather and demand: real 2025 hourly shapes of the Southwest Power Pool grid (EIA-930), scaled to a 450 MW peak.
Wind and solar: output matched to EIA's 2025 U.S. capacity factors.
Costs: EIA's and NREL's, dated under Sources; constant within a scenario.
Price year: 2025 dollars throughout; NREL's 2024 battery costs are converted with BEA's GDP implicit price deflator (×1.0263).
Prairie Town: fictional.
About 15 guided minutes. Practice, about 20 more: by hand, earn all nine stars with a plan under 100 kt, or try a gas price of $6/MMBtu.
What you just did, as diagrams
- What to build
- Seven numbers: MW of five plants and the battery's MW and MWh; each costs money every year.
- Hourly operation
- Given what is built, the solver runs the plants and the battery at least cost each hour.
- Seven weeks
- Four typical weeks and three extreme ones stand for the 52 weeks of 2025.
- Storage link
- The battery's charge carries from each calendar week to the next.
- CO₂ cap
- An extra rule; its shadow price is the cost of the last tonne cut.
- Frontier
- The cheapest plan at each CO₂ level; no plan is both cheaper and cleaner.
Go deeper · ModelerThe capstone as a linear program
The model decides what to build (\(K_i\)) and how to run it every modelled hour \(t\), at least yearly cost:
\[\min \; \sum_i f_i K_i + \sum_t w_t \big(r_\mathrm{cc}\, g_t + r_\mathrm{pk}\, q_t + V u_t\big)\]
\[ \begin{aligned} a^{w}_t K_\mathrm{wind} + a^{s}_t K_\mathrm{solar} + 0.911\,K_\mathrm{nuc} + g_t + q_t + d_t - c_t + u_t &\ge D_t && \text{(demand)}\\ g_t \le K_\mathrm{cc}, \quad q_t \le K_\mathrm{pk}, \quad c_t + d_t &\le K_\mathrm{bp} && \text{(sizes)}\\ s_t = s_{t-1} + 0.85\,c_t - d_t, \qquad 0 \le s_t &\le K_\mathrm{be} && \text{(battery)}\\ \textstyle\sum_t w_t\,(0.329\, g_t + 0.484\, q_t) &\le \text{cap} && \text{(CO}_2\text{)} \end{aligned} \]
| Symbol | Meaning | Unit |
|---|---|---|
| \(K_i\) | size built: wind, solar, gas CC, peaker, nuclear; battery power \(K_\mathrm{bp}\) | MW |
| \(K_\mathrm{be}\) | battery energy | MWh |
| \(f_i\) | yearly cost of one unit built; for nuclear it also holds fuel and O&M, as its output is constant | $ per MW-year (per MWh-year) |
| \(g_t, q_t\) | output of the gas CC plant and the peaker | MW |
| \(r_\mathrm{cc}, r_\mathrm{pk}\) | running cost of gas | $/MWh |
| \(c_t, d_t, s_t\) | battery charge, discharge and level | MW, MW, MWh |
| \(u_t\) | demand left unserved | MW |
| \(V\) | $10,000 per unserved MWh: a weight that steers a fixed plan to keep the lights on, never counted in its cost | $/MWh |
| \(a^w_t, a^s_t\) | wind and solar output per MW built | MW per MW |
| \(D_t\) | demand | MW |
| \(w_t\) | hours of the year that modelled hour \(t\) stands for | h |
| \(0.911\) | nuclear output per MW built, the same every hour: a simplification | MW per MW |
- Yearly cost of a plant: overnight capital cost × capital recovery factor + fixed O&M (operation and maintenance). At a 4% real (after-inflation) cost of capital over 30 years, the factor is 0.05783.
- Running cost of gas: heat rate × gas price + variable O&M. MMBtu is a million Btu of fuel energy.
\[ \begin{aligned} \text{wind, per kW-year:}\;\; & 1{,}712 \times 0.05783 + 34.57 = \$133.6\\ \text{combined-cycle, per MWh:}\;\; & 6.226 \times \$3.85 + \$3.49 = \$27.46\\ \text{its CO}_2\text{, t per MWh:}\;\; & 6.226 \times 0.05291 = 0.329 \end{aligned} \]
Need a refresher? Toolbox K3 (discounting and the capital recovery factor).
Every term is linear, so this is a linear program. Your plan fixes the \(K_i\); the optimizer chooses them too, with \(u_t = 0\). M3 (capacity expansion) writes the same model in code, on representative weeks checked against the full year.
Go deeper · ModelerSeven weeks for a year: how, and how well
- Seasons. Each season’s representative week is its medoid: the real week closest, hour by hour, to the season’s other weeks. Scaled to keep the season’s demand, wind and solar energy, it stands for 11 (winter), 14 (spring), 11 (summer) or 13 (fall) weeks.
- Extremes. Three weeks are kept as they were: the year’s peak demand, the peak of demand minus wind and sun, and the least wind.
- Storage across weeks (after Kotzur and co-authors, 2018). Calendar week \(i\) starts at level \(S_i\), and its representative week \(k\) adds its net change: \(S_{i+1} = S_i + \Delta_k\).
- Within each week. Its lowest and highest swing, \(\ell_k\) and \(h_k\), keep \(0 \le S_i + \ell_k\) and \(S_i + h_k \le K_\mathrm{be}\). The year ends where it began.
The check: the optimizer’s plans, rounded up to the sliders’ steps, re-run hour by hour on all 8,760 hours.
| Plan | Cost, 7 weeks | Cost, full year | CO₂, 7 weeks | CO₂, full year | Unserved, full year |
|---|---|---|---|---|---|
| Optimizer at 400 kt | $118.6M | $118.7M | 392 kt | 393 kt | 43 MWh |
| Optimizer at 200 kt | $130.5M | $132.1M | 197 kt | 215 kt | 33 MWh |
| Optimizer at 100 kt | $144.4M | $147.2M | 98 kt | 131 kt | 0 MWh |
- Cost. Each plan costs at most 2% more on the full year.
- CO₂. Deeper cuts overshoot their caps: 215 kt against 200 kt (7% over) and 131 kt against 100 kt (31% over). Seven weeks miss some still, hot evenings when gas must run.
- Unserved energy. Tiny: at most 43 MWh, under 0.002% of the year’s demand.
- Re-optimized on all 8,760 hours. The cheapest 200 kt plan costs $133.2M, 3% more, and its last tonne $139 instead of $85: seven weeks underestimate the cost of deep cuts.
Planners respond with more or longer periods, extreme weeks and adequacy tests over many weather years (A5).
Check yourself
Myth or fact? “If wind is the cheapest way to cut CO₂, the cheapest clean plan is all wind.”
- Myth
- Fact
Answer
Myth. On still evenings the town still needs firm plants or storage; at 100 kt the optimizer keeps 280 MW of gas and adds solar and a battery.
Myth or fact? “The cheapest plan never spills any wind or sun.”
- Myth
- Fact
Answer
Myth. At a 100 kt cap the optimizer spills 9% on purpose: extra wind is cheaper than storing every last MWh.
Myth or fact? “Seven well-chosen weeks give exactly the same answer as the whole year.”
- Myth
- Fact
Answer
Myth. Re-run on all 8,760 hours, the optimizer's 200 kt plan emits 215 kt and leaves 33 MWh unserved.
Your plan costs $140.0M a year and emits 150 kt. The cheapest plan at 150 kt costs $134.5M. How far above the frontier are you?
- 5.5%
- 4.1%
- $5.5M
- 150 kt
Answer
4.1%: 140.0 ÷ 134.5 − 1 = 0.041. You could cut cost by $5.5M a year with the same CO₂.
Numbers, sources and what’s next
Numbers to remember
| Number | What it means | Source |
|---|---|---|
| $1,712/kW | Overnight capital cost (the building cost, as if paid at once) of a new onshore wind farm; solar with tracking: $1,484/kW. | EIA, AEO2026 assumptions, Table 3 (PDF) · 2025 dollars, April 2026 |
| $1,086/kW | A new gas combined-cycle plant; a combustion-turbine peaker: $1,158/kW. | EIA, AEO2026 assumptions, Table 3 (PDF) · 2025 dollars, April 2026 |
| $8,255/kW | EIA's overnight cost for a large light-water nuclear plant: the lesson's default, which you can change. | EIA, AEO2026 assumptions, Table 3 (PDF) · 2025 dollars, April 2026 |
| $247/kWh + $382/kW | A lithium-ion battery's energy and power costs in 2025 dollars (NREL's $241 and $372 in 2024 dollars, converted); a 4-hour battery: $343/kWh. | NREL, battery cost projections, 2025 update (PDF) · 2024 costs, June 2025; BEA, NIPA Table 1.1.9 · revised 29 Oct 2026 |
| $3.85/MMBtu | Average cost of natural gas to U.S. power plants in 2025. MMBtu: a million Btu of fuel energy. | EIA, Electric Power Annual, Table 7.4 · 2025 data |
| 91.1% | Capacity factor of the U.S. nuclear fleet in 2025. For simplicity, the lesson's plant makes a constant 91.1% of its size every hour; real output varies, with refuelling outages, so this cannot show reliability. | EIA, Electric Power Monthly, Table 6.07.B · 2025 data |
End of the starter path
In the real world
Real planning studies solve this problem with many regions, transmission and decades of investment. Two open examples: NLR's ReEDS model for the contiguous U.S., and PyPSA, a Python framework.
Sources and further reading
- EIA (2026). Assumptions to the Annual Energy Outlook 2026: Electricity Market Module (PDF), Table 3: capital, O&M and heat rates.
- EIA. Electric Power Annual, Table 7.4 (gas price) and Table 8.4 (nuclear fuel, 6.64 mills/kWh in 2025).
- EIA. Carbon Dioxide Emissions Coefficients: 52.91 kg CO₂ per MMBtu of natural gas.
- Cole, W., Ramasamy, V. and Turan, M. (2025). Cost Projections for Utility-Scale Battery Storage: 2025 Update (PDF). NREL/TP-6A40-93281. Only the 2024 costs (converted to 2025 dollars), life and efficiency are used.
- U.S. Bureau of Economic Analysis. NIPA Table 1.1.9: Implicit Price Deflators for Gross Domestic Product, line 1, annual (2017 = 100): 2024 125.587, 2025 128.893. Last revised 29 October 2026; accessed 5 November 2026. It converts the battery's 2024 costs to 2025 dollars.
- NLR. 2025 Electricity ATB: Financial Cases and Methods: the 30-year cost recovery period.
- Kotzur, L. et al. (2018). Time series aggregation for energy system design: Modeling seasonal storage. Applied Energy 213.
- NLR (2025). Regional Energy Deployment System (ReEDS) Model Documentation: 2025 (PDF).
- EIA. Hourly Electric Grid Monitor (Form EIA-930): the 2025 Southwest Power Pool data behind Prairie Town's year.
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.