Energy Systems Modeling Worked Examples

Teaching · REE 4301 / IE 5300 Energy Systems Modeling · Worked examples

One interactive for each of the course's six modules. They follow the system the course follows: from the demand a city places on the grid, to the plants that meet it, the wires and pipes that carry it, the storage and the metal behind it, and finally one facility deciding what to build. Each section sets up a question; the interactive is where you answer it. The worked example is folded underneath, and the matching course notebook is named in it.

The foundation is What a Grid Is Made Of: Module 4 uses its coefficients, so the two pages cannot disagree. All prices and costs here are illustrative, for teaching, not forecasts.

  1. A model, and its boundary
  2. Demand
  3. Generation
  4. Networks
  5. Storage and supply chains
  6. One facility, two sizes

0. A model, and its boundary

  • Write a small model in its five parts: sets, parameters, variables, objective, constraints
  • Solve a one-hour dispatch by hand, then by solver
  • Say where a price comes from in a model, and where the boundary is

One hour, one place, 100 MW to serve. Solar has 40 MW available at no running cost; gas has 500 MW at $22.14/MWh. Which runs, how much, and what does the hour cost? Solve it in your head first, then move the sliders.

Try it. One hour, one place. Move demand past the solar available, then past everything. What sets the price each time?

Worked example: the toy LP, by hand min⁡ 0 psolar+22.14 pgass.t.psolar+pgas=100,psolar≤40,pgas≤500,p≥0\min\ 0\,p_{\text{solar}} + 22.14\,p_{\text{gas}} \quad\text{s.t.}\quad p_{\text{solar}} + p_{\text{gas}} = 100,\quad p_{\text{solar}} \le 40,\quad p_{\text{gas}} \le 500,\quad p \ge 0
  1. Solar costs nothing, so run all 40 MW of it.
  2. The other 60 MW comes from gas: 60×22.14=1,328.4060 \times 22.14 = 1{,}328.40 dollars for the hour.
  3. One more MW of demand would come from gas, so the price, the dual of the balance constraint, is $22.14/MWh.

Notebooks: M0_Toy_LP_to_PyPSA (the same problem on paper, in gurobipy and in PyPSA) and M0B_Model_Boundary.

Here the price came out of the model. If you were running one warehouse, would you compute this price, or download it?

1. Demand

  • Build a load profile from its sectors
  • Tell energy (MWh) from peak (MW), and compute a load factor
  • Add a new load, such as EVs, and see what it does to each

A city's day is the sum of its sectors: homes peak in the evening, offices in the working day, industry runs nearly flat. Transportation is joining them as EVs. A grid is sized for its peak but paid for through its energy, so the two numbers that matter are the day's MWh and its highest MW, and their ratio, the load factor = average ÷ peak.

Try it. Add EVs and move when they charge. Which changes more, the day's energy or its peak?

Worked example: 60,000 EVs, three ways to charge

The default city uses about 10,984 MWh a day with a peak of 625 MW at 18:00, a load factor of 0.73. Add 60,000 EVs at 10 kWh each, 600 MWh a day:

When they chargeDay's energyPeakLoad factor
On arrival home, 17:00–22:0011,584 MWh775 MW0.62
Overnight, 0:00–6:0011,584 MWh625 MW0.77
At work, 9:00–15:0011,584 MWh625 MW0.77

The same energy every time. Which of these would you rather plan a grid for, and what would it take to make drivers choose it?

Notebooks: SB1_Example_Energy_Balance (one house's energy balance) and SB2_Representative_Days (a year compressed into three days, and the check that it reconciles).

A facility's bill often charges for its demand in four peak intervals a year (ERCOT's 4CP). Where in this day would you least want your own peak to fall?

2. Generation

  • Build a merit order from running costs: heat rate × fuel price + variable O&M
  • Find the clearing price, and say which plant sets it
  • Compute a levelized cost (LCOE), and say what it leaves out

In each hour, plants are dispatched cheapest first until demand is met, and the last one needed sets the price everyone is paid. Over a lifetime, a plant's LCOE spreads its capital, upkeep and fuel over the energy it makes:

LCOE=CRF×capital+fixed O&M8.76×capacity factor+variable O&M+heat rate1000×fuel price,CRF=r(1+r)n(1+r)n−1\text{LCOE} = \frac{\text{CRF}\times\text{capital} + \text{fixed O\&M}}{8.76 \times \text{capacity factor}} + \text{variable O\&M} + \frac{\text{heat rate}}{1000}\times\text{fuel price},\qquad \text{CRF} = \frac{r(1+r)^n}{(1+r)^n - 1}

Try it. Move demand through the stack, then change the gas price. When does coal run ahead of gas, and what happens to the price?

Try it. Pick a technology and change its capital cost or capacity factor. Then raise the discount rate. Which technologies care most?

Worked examples: a clearing price, and two LCOEs

Clearing price. At 55 GW, wind, solar, nuclear and coal are all running and the last MW comes from combined-cycle gas: 6.6×$3.50+$2=$25.106.6 \times \$3.50 + \$2 = \$25.10/MWh. Coal, at 10.0×$2.00+$4.50=$24.5010.0 \times \$2.00 + \$4.50 = \$24.50, runs just ahead of it. Drop gas to $2 and the order flips.

LCOE at 7% over 30 years (CRF=0.0806\text{CRF} = 0.0806):

  • Solar, $1,300/kW, $20/kW-yr, capacity factor 0.24: (0.0806×1300+20)/(8.76×0.24)=49.83+9.51(0.0806 \times 1300 + 20)/(8.76 \times 0.24) = 49.83 + 9.51 = $59.34/MWh
  • Gas combined cycle, $1,100/kW, $15/kW-yr, $2 VOM, heat rate 6,600 at $3.50, capacity factor 0.56: 18.07+3.06+2+23.1018.07 + 3.06 + 2 + 23.10 = $46.23/MWh

Solar's cost is almost all capital; gas's is half fuel. Which of the two would a higher interest rate hurt more, and which would a gas price spike?

Notebook: SB3_Capital_and_LCOE (two 250 MW plants, coal and gas, one line of arithmetic at a time).

A small site buys at whatever this stack clears at. What would it take for a site to move the clearing price itself?

3. Networks

  • Tell a transport model (pipelines: you choose the flows) from a power-flow model (wires: physics does)
  • Compute DC power flows on a small network
  • Explain locational prices and congestion rent

Three buses in a triangle, every line the same: 150 MW of free wind in West Texas, 100 MW of gas at $40 in Houston, 120 MW of demand in Dallas. The West Texas–Dallas line holds only 70 MW. In a power-flow model each line's flow is set by the angle difference across it, Fij=(θi−θj)/XijF_{ij} = (\theta_i - \theta_j)/X_{ij}, so power takes every path at once.

Try it. Before you touch anything: wind is free and there is 150 MW of it for 120 MW of demand. Why isn't Dallas's price $0? Then tighten and loosen the line.

Worked example: the notebook's answer
  1. With equal reactances, a MW injected in West Texas splits two-thirds on the direct line to Dallas and one-third the long way through Houston; Houston's gas splits the mirror way.
  2. So the direct line carries 23w+13g≤70\tfrac23 w + \tfrac13 g \le 70 with w+g=120w + g = 120: wind can run at most w=90w = 90, and gas makes up 30.
  3. Flows: 70 MW West Texas → Dallas (full), 50 MW Houston → Dallas, 20 MW West Texas → Houston.
  4. Prices: $0 in West Texas, $40 in Houston, $80 in Dallas. One more MW in Dallas needs wind turned down by 1 and gas up by 2.
  5. Congestion rent: Dallas pays 120×80=9,600120 \times 80 = 9{,}600 dollars an hour, generators receive 1,200, and the grid operator keeps $8,400.

Raise the limit past 80 and wind serves all 120 MW: every price falls to $0, and the rent vanishes with it.

Notebooks: M3_Transport_Companion (pipelines as a transport model) and M3_PowerFlow_Companion (this example). The Texas grid demo shows where ERCOT's power is actually made.

If you were siting a large load, would you rather sit at the constrained bus or the cheap one, and what would your arrival do to the price you picked it for?

4. Storage and supply chains

  • Value storage by buying low and selling high, after losses
  • Turn a build plan into tonnes of metal and of rock
  • Walk a mineral supply chain from mine to refinery, and measure its concentration

A battery earns by moving energy from cheap hours to dear ones, and loses some on the way. Every MW and MWh built is also made of something: steel, copper, aluminum, lithium, nickel. That metal comes from rock, and the rock comes from a handful of countries.

Try it. Make the battery longer, then less efficient. Which hours does it give up first, and why?

Try it. Build a grid, then follow one metal back to the ground. Which step of the chain is the narrowest?

Walk one metal upstream

Worked examples: a day of arbitrage, and what 1 GW of solar is made of

Arbitrage. A 100 MW, 4-hour battery at 85% round trip buys 400 MWh in the four cheapest hours (11:00–14:00, $4,700) and sells 340 MWh in the four dearest later ones (17:00–20:00, $31,025). $26,325 a day, about $24,000 a year per MWh of storage if every day were like this one.

1 GW of solar (the /materials/ coefficients):

MetalTonnes of metalTonnes of rock
Steel25,55040,880
Aluminum9,50039,900
Copper3,000660,000

Steel is the heaviest metal by far; copper is the heaviest rock. And 1 TWh a year needs 0.48 GW of solar but only 0.34 GW of wind, because of capacity factor. Which of those two multipliers would you check first in someone else's study?

Notebook: M4_Supply_Chain (cobalt sourcing as the Module 3 transport model with new labels, then build-plan accounting). Related: Why Supply Can't Catch Up and the mineral supply chains demo.

A site that wants storage on its own meter is buying these same metals. Would you rather it chose LFP or NMC, and what would you want to know about the supply chain first?

5. One facility, two sizes

  • State a facility's boundary: what is inside, outside, and crossing it
  • Tell a price taker from a price maker
  • Decide whether a site should build its own generation

The Metroplex Industrial Park, north of Dallas, draws 50 MW. In the course's story, investors convert it into a 500 MW data center: same land, same substation, ten times the load. Here it joins the city from Module 1 in a small local market built from Module 2's merit order. Does the site take the price, or make it? And should it build solar on site?

Try it. Start at 50 MW, then grow the site to 500. At what size does the site start setting its own price? Then add on-site solar.

Worked example: the park and the data center
SiteAverage local priceThe city's extra costSite's grid bill
50 MW$35.00 → $35.00$0 a day$15.3M a year
200 MW$35.00 → $40.66$67,000 a day$69.4M a year
500 MW$35.00 → $90.00$604,000 a day$394.2M a year

Now add on-site solar at its Module 2 LCOE of $59.34/MWh:

  • 50 MW site with 50 MW of solar: $9.7M of grid power plus $9.6M of solar, against $15.3M for the grid alone.
  • 500 MW site with 300 MW of solar: $274.5M of grid power plus $57.7M of solar, against $394.2M for the grid alone.

Same technology, same cost, opposite answers. What changed between the two sites, and which number in your model captured it?

Notebooks: M0B_Model_Boundary (one site, two lives) and M5_Facility_Decision (should the Metroplex Industrial Park build on-site generation?).

The course's open textbook: Introduction to Energy System Modeling (Mavs Open Press, in progress). More on this site: What a Grid Is Made Of, Why Supply Can't Catch Up, the Texas grid demo and the mineral supply chains demo.

← Energy Systems Modeling