Build a nation’s pathway: a multi-region, multi-decade model
Write Prairieland’s five regions to 2050 as one linear program with vintages, residual value, links, a cumulative carbon budget and an import cap, then test it against foresight, shocks and full years of hours
The lesson in one table: Prairieland's pathway, run as one linear program (2025 dollars, illustrative)
| Pathway | Cost to 2050 (present value) | CO₂ 2026–2050 | Imports, highest year | Full years of hours (2030, 2050; 2025 and 2024 weather) |
|---|---|---|---|---|
| Central, perfect foresight | $401.6 billion | 3,600 of 3,600 Mt | 32% | all 4 checks survive |
| Central, decade by decade | $412.0 billion | 3,600 of 3,600 Mt | 36% | all 4 checks survive |
| Deep cuts (3,000 Mt), perfect foresight | $394.6 billion | 3,000 of 3,000 Mt | 35% | 2 of 4 checks fail (CO₂ more than 10% above the slices) |
| Central without the peak-hour rule | $391.9 billion | 3,600 of 3,600 Mt | 35% | 4 of 4 checks fail (demand unserved, up to 240 hours) |
Precomputed with this engine on 7 November 2026. Cost: the supply side and every fuel bought, 2026–2050 in 2025 dollars; end-use equipment left out.
With JavaScript on, you solve each pathway with a real solver in your browser, move the budget and read its dual, compare perfect foresight with decade-by-decade decisions, inject a shock and map near-optimal plans. Prairieland is fictional; its numbers are illustrative.
- Illustrative: Prairieland, its regions, fleet, links, demand and shocks (prairieland.json); the existing plants' operating costs, the penalties and the peak-hour rule are set for teaching (e4-pathways.json).
- Based on public data: new plants' costs from EIA's 2026 assumptions, fuel prices from EIA's 2025 data, CO₂ factors from the IPCC, hourly shapes from SPP's 2025 and 2024 grid (EIA-930).
- Left out of the cost: end-use equipment (heat pumps, cars, boilers): electrification is a choice you set, not one the model makes.
- Solver: HiGHS (open source), loaded on your first run (about 3.5 MB, once). The full-year checks come from a library precomputed with this engine.
- Against lesson A20: no pathway here gets below about 2,700 Mt (straight-line counting, central demand). A20 meets 2,600 Mt because its fastest path electrifies buildings and industry years sooner (step 7).
Build it in Python · notebook lab, about 60 minutes, then 120 minutes of practice
The engine's pathway with scipy.optimize.linprog and HiGHS.
- The LP: vintages and residual value, the slices and their stores, links with losses, fuels bought domestic first, the budget and the import cap.
- Reading it: the budget's dual as a carbon value, a tighter budget, the run without the peak-hour rule.
- Practice: the straight line to zero, decade by decade, a shock's re-plan, near-optimal plans, two ways of counting the years.
What it checks: assert cells match the browser's cost, CO₂ by model year, imports, what is built and the budget's dual.
- Download the notebook and the three data files; put them in one folder.
- Upload all four to Google Colab (File → Upload notebook, then the folder icon), or open the notebook locally with Python 3, NumPy and SciPy 1.9 or later.
- Run all cells, then try the practice tasks at the end.
Notebook (.ipynb) Prairieland (JSON) Engine settings (JSON) Precomputed runs (JSON)
What you just did, as diagrams
- Vintages
- A plant runs in its model year and the later ones its life covers; it pays only for the years up to 2050, the rest is its residual value.
- The budget
- CO₂ summed over the model years, each with its weight, stays within the budget; its dual is what one more tonne allowed would save.
- The import cap
- Crude imports and LNG stay within a share of primary energy in every model year.
- Foresight
- Perfect foresight plans 2030–2050 at once; decade by decade sees two model years at a time and costs more.
- Time
- Twelve slices stand for each year; a full year of hours checks which conclusions survive.
Go deeper · ModelerThe pathway in symbols
Regions \(r\) (5), model years \(p\) (5; each stands for the five years ending in it), slices \(s\) (12, with hours \(h_s\)), technologies \(g\), links \(\ell\) (7). The rows below are selected and schematic; money is in millions of 2025 dollars ($M).
| Symbol | What it is | Unit | Decided or given |
|---|---|---|---|
| \(n_{r,g,q}\) | built in region \(r\), technology \(g\), model year \(q\) (the firm option: one national \(n_{q}\)) | MW | decided, within the build limits |
| \(k_{u,p}\) | capacity of existing fossil unit \(u\) kept open in \(p\) (never rises again) | MW | decided |
| \(x_{\cdot,s,p}\) | output, battery charge and discharge, link flows in slice \(s\) | MW (slice average) | decided |
| \(a_{\ell,q}\) | transfer limit added to link \(\ell\) | MW | decided |
| \(f_p\) | fuels bought: domestic and imported crude, domestic gas and LNG, coal | PJ a year | decided |
| \(y_p\), \(i\) | the calendar year of model year \(p\) (2030, …, 2050); the real discount rate, as a decimal (5% is 0.05) | year; per year | given |
| \(D_p\) | \(\sum_{t=y_p-4}^{y_p} (1+i)^{-(t-2025)}\), the discount sum of a model year | years | given |
| \(A_g\) | capital × the capital recovery factor over the life, plus fixed O&M | $ per kW a year | given (fixed ranges) |
| \(L_{r,p}\), \(d_s\) | average busbar load (the region’s use plus 6% grid losses, at the plants’ outlets); the slice’s demand factor | MW; ratio | given (the plan) |
| \(c_f\) | the price of fuel \(f\) (domestic gas, LNG, coal, crude oil), on net calorific values | $ per GJ | given (fixed ranges) |
| \(\alpha_{g,s}\) | availability of plant type \(g\) in slice \(s\) (wind and solar: that slice’s output per MW) | share | given |
| \(\lambda_\ell\) | the share of a link’s flow lost on the way (1% per 100 km) | share | given |
| \(x^{\text{dis}}\), \(x^{\text{ch}}\), \(u_{r,s,p}\) | battery discharge and charge; electricity not served | MW (slice average) | decided |
| \(w_p\) | the budget’s weight of each model year (2, 5, 5, 5, 5, 3 with straight lines between) | years | given |
\[\min \sum_p D_p \Big(\sum_f c_f f_p + \text{O\&M}_p\Big) + \sum_{r,g,q} \frac{A_g}{1000}\, n_{r,g,q} \sum_{p \ge q,\; y_p - y_q < \text{life}_g} D_p + \text{links} + \text{penalties} + \text{ties}\]
Fuel \(f_p\) in PJ times \(c_f\) in $ per GJ is $M (1 PJ is a million GJ); \(A_g\) in $ per kW-year times MW, divided by 1,000, is $M a year. Penalties and the tie rule are never part of a reported cost.
\[\sum_g x_{g,r,s,p} + x^{\text{dis}}_{r,s,p} - x^{\text{ch}}_{r,s,p} + \sum_{\ell \to r} (1 - \lambda_\ell)\, x_{\ell,s,p} - \sum_{r \to \ell} x_{\ell,s,p} + u_{r,s,p} = L_{r,p}\, d_s\]
\[x_{g,r,s,p} \le \alpha_{g,s}\Big(K^{\text{exist}}_{g,r,p} + \sum_{q \le p,\; y_p - y_q < \text{life}_g} n_{r,g,q}\Big)\]
\[\sum_p w_p\, \text{CO}_2(f_p) + w_{2025}\cdot 214.9 \le B \qquad \text{imports}(f_p) \le \text{cap} \cdot \text{primary}_p \quad \forall p\]
- The dual as a price. The budget’s dual \(\mu\) is in present-value dollars a tonne. As a price in model year \(p\)’s own dollars it is \(\mu\, w_p / D_p\); only in a model of every year, each counted once, is it \(\mu (1+i)^{t-2025}\).
- Batteries. They cycle within each representative day; the scarce-wind week’s store may enter full and run down over seven days.
- Stress hours. At two stress hours of 2025, each region’s load plus 10% must be covered by available capacity and the links.
Go deeper · ResearcherWhere this model stops
- Electrification is set by you, not chosen: without end-use equipment costs, the model would electrify as fast as allowed, and a plan that electrifies more looks cheaper than it is.
- No clean fuels for the oil and gas that stay: deep budgets are out of reach here, not necessarily in the world.
- Twelve slices smooth the sunniest, windiest and tightest hours; the full-year check shows how much (spilled energy several times higher).
- Perfect foresight is a benchmark, not a forecast: real decisions are made decade by decade, by many actors.
- Plans within a millionth of the least cost can build a gigawatt more or less: report what they share, or say which plan you show (near-optimal methods map them).
Check yourself
A wind farm built in 2045 should be charged its whole cost in a model that ends in 2050.
- Myth
- Fact
Answer
Myth. It serves for decades after 2050; charging only its payments to 2050 leaves the rest as residual value, so late builds are not penalised.
Under a cumulative budget, one tonne cut in any year of 2026–2050 has the same value in present-value dollars.
- Myth
- Fact
Answer
Fact. Every tonne uses the same budget. In a model of every year its price in each year's dollars then rises at the discount rate; here the model years' weights bend that path (step 6).
If twelve slices serve every MWh, so will the full year.
- Myth
- Fact
Answer
Myth. Without the peak-hour rule, the central plan leaves demand unserved for up to 240 hours in 2024's weather: slice averages hide the tightest hours.
Numbers, sources and what’s next
Inputs the model uses
| Input (2025 dollars) | Default | Range you can set (set for teaching) | Source, and the source's own range |
|---|---|---|---|
| Wind farm, capital | $1,712/kW (EIA Table 3) | $1,500/kW to $2,400/kW | EIA AEO2026 Table 4, its regions: $1,478/kW to $4,335/kW |
| Solar farm, capital | $1,484/kW (EIA Table 3) | $1,350/kW to $1,900/kW | EIA AEO2026 Table 4, its regions: $1,342/kW to $1,949/kW |
| Battery (4 hours, 85% round trip), capital | $1,521/kW (EIA Table 3) | $1,380/kW to $1,690/kW | NREL's 2025 battery update (low) and EIA AEO2026 Table 4 (high): $1,371/kW to $1,698/kW |
| Gas combined cycle, capital | $1,032/kW (EIA Table 3) | $850/kW to $1,400/kW | EIA AEO2026 Table 4, its regions: $830/kW to $1,445/kW |
| Gas turbine, capital | $1,158/kW (EIA Table 3) | $950/kW to $1,580/kW | EIA AEO2026 Table 4, its regions: $946/kW to $1,585/kW |
| Generic firm clean plant, capital | $7,000/kW (set for teaching) | $3,000/kW to $11,000/kW | EIA AEO2026 Table 4, firm low-carbon plants that burn no fuel: $2,685/kW to $11,568/kW |
| New transmission | $1,500 per MW-km (set for teaching) | $800 per MW-km to $3,000 per MW-km | set for teaching |
| Domestic gas | $4.05/GJ (EIA, 2025: $3.85 per MMBtu, on net calorific values) | $2.00/GJ to $9.00/GJ | EIA Electric Power Annual, Table 7.4 |
| LNG imports | $10.00/GJ (set for teaching) | $6.00/GJ to $30.00/GJ | set for teaching |
| Coal (Ridge County) | $2.41/GJ (EIA, 2025: $2.42 per MMBtu, on net calorific values) | $1.50/GJ to $4.00/GJ | EIA Electric Power Annual, Table 7.4 |
| Crude oil | $12.00/GJ (set for teaching: about $70 a barrel) | $7.00/GJ to $22.00/GJ | set for teaching |
| CO₂ factors: crude oil, gas, coal | 73.3, 56.1, 94.6 t per TJ | fixed | IPCC 2006 Guidelines, Volume 2, net calorific values |
| Build limits, a region a period | wind 6, solar 8, batteries 6, gas 4 + 4, firm 2 GW | fixed | set for teaching: one generic rule, no technology's own timeline |
| Discount rate (real) | 5% (set for teaching) | 2% to 8% | set for teaching |
| Hourly shapes | SPP's 2025 grid (slices); 2024 for the independent year | fixed | EIA Hourly Electric Grid Monitor (Form EIA-930) |
Keep going
Built on and used in
Sources and further reading
- DeCarolis, J., et al. (2017). Formalizing best practice for energy system optimization modelling. Applied Energy, 194, 184–198.
- Pfenninger, S., Hawkes, A., and Keirstead, J. (2014). Energy systems modeling for twenty-first century energy challenges. Renewable and Sustainable Energy Reviews, 33, 74–86.
- Trutnevyte, E. (2016). Does cost optimization approximate the real-world energy transition? Energy, 106, 182–193.
- U.S. Energy Information Administration (April 2026). Assumptions to the Annual Energy Outlook 2026: Electricity Market Module, Tables 3 and 4 (read 7 Nov 2026).
- Intergovernmental Panel on Climate Change (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories, Volume 2: Energy, chapters 1 and 2.
- U.S. Energy Information Administration. Hourly Electric Grid Monitor (Form EIA-930), Southwest Power Pool, 2025 and 2024.
- HiGHS. Documentation of the open-source solver in your browser and in the notebook (through SciPy's
linprog).
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.