Honglin Li
  • Research
  • Projects
  • Publications
  • Software
  • Teaching
  • Learn
  • Notes
  • CV
  • Journeys

Ask the solver, then check its answer

HiGHS in your browser: solve, check, and read prices

Lesson 11 of Energy Systems, Step by Step: solve Prairie Town’s day as a linear program with the HiGHS solver in the browser, try to beat it, check its answer, catch a planted error, read the shadow price of the demand rule, and see why a mixed-integer solve returns no such prices.
  1. Learn
  2. Lesson 11
  • Modeler · L3
  • Lesson 11 of 14
  • 15 min
  • After lesson 10
  • Completed
  1. 1Step by step
  2. 2Explain
  3. 3Check
  4. 4Sources

3 September 2025: the solver's plan for Prairie Town's day

The solver's plan for lesson 0's day: hourly supply stacked by plant, with demand as a dashed line. The combined-cycle plant covers every gap; the peaker never runs; 35 MWh of wind and solar is curtailed to keep the combined-cycle within its ramp limit. 010020030040000:0006:0012:0018:0024:00
NuclearWindSolarGas combined-cycleGas peakerDemand

With JavaScript on, you run the solver yourself (about 3.5 MB, loaded once), try to beat it and check its answer.

Data: 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, costs and the unserved-energy penalty. Solver: HiGHS (MIT licence), on your device.

What you just did, as diagrams

Solver
Software that finds the best plan of a model, or proves that none exists; here HiGHS, in well under a second once it has loaded.
Checks
Balance, limits, ramps, energy and money: a solver answers the model you wrote, so check it against the world.
Shadow price
How much the best cost rises per small extra MWh of demand, away from a kink; $40 in 18 of 24 hours, where the combined-cycle is the marginal plant.
Mixed-integer programs
Their solve returns no ordinary shadow prices; prices come from a linear program with the on-or-off choices fixed (lesson M2).
Go deeper · inside the solverPeek inside: the simplex method walks the corners

Lesson 10's hour again. The simplex method starts at a corner and moves along an edge to a neighbouring corner that is never worse, again and again, until no neighbour is cheaper. In a linear program that corner is the best plan overall. On this hour every move is cheaper.

With JavaScript on, step through the walk here.

Go deeper · ModelerWhy a mixed-integer solve returns no shadow prices
  • Linear program. As demand changes, the best cost is continuous and piecewise linear: straight pieces joined at kinks. The slope of a piece is the shadow price.
  • Mixed-integer program. The solver searches over on-or-off choices (an off peaker, or one at 30 MW or more), so it returns no ordinary LP shadow prices. The best cost can also jump when a plant switches on.
At a 30 MW/h ramp limit Linear program Mixed-integer program
Best cost for the day $106,300 $107,200
Peaker 35 MWh, some hours below 30 MW off all day; more wind and solar curtailed
Shadow prices from the solve one per hour none

To price a mixed-integer plan, fix its unit commitment (which plants are on), re-solve the linear program, and read prices conditional on that commitment. Lesson M2 builds that model.

Go deeper · ModelerWhen a shadow price is not unique

Away from a kink, the shadow price is the cost change per small extra MWh. At a kink, compare the increase and the decrease separately: any value between them is a valid shadow price.

Hour +1 MWh costs −1 MWh saves HiGHS reports
07:00 $100 $80 $80
09:00 $40 $20 $40
  • 07:00. Up: the peaker makes the MWh, since the ramp rule would lift 08:00 and 09:00 too. Down: 07:00 and 08:00 each fall by 1 MWh.
  • 09:00. Up: the combined-cycle. Down: 07:00, 08:00 and 09:00 each fall by 1 MWh ($120), and the peaker covers 07:00 (−$100).

Such optima are called degenerate. They are common in real models, so read a single reported price with care.

Each price here is a marginal value under stated assumptions: fixed plant sizes, a linear model, and Prairie Town as an island. It is the merit-order price of lesson 8 read from a solver, not a forecast of a market price.

Check yourself

Myth or fact? “If the solver says ‘optimal’, the model is right.”

  • Myth
  • Fact
Answer

Myth. The sign-error model was ‘optimal’ too, at $52,160. Optimal means best for the model as written; checks tell you whether the model is right.

Myth or fact? “The demand rule's shadow price always equals the running cost of a plant that is running.”

  • Myth
  • Fact
Answer

Myth. Where a ramp rule is at its limit it is $0 or $80 here: a change at one hour moves the plan in a neighbouring hour too, and the price counts both.

Myth or fact? “In a linear program, a plan that no small change can improve is the best plan overall.”

  • Myth
  • Fact
Answer

Fact. A linear program has no ‘local’ best that is not also the global best. That is why you could not beat the solver.

Myth or fact? “A mixed-integer program gives shadow prices just like a linear program.”

  • Myth
  • Fact
Answer

Myth. A mixed-integer solve returns no ordinary shadow prices. Prices need a second step: fix the on-or-off choices, re-solve the linear program, and read prices conditional on them.

At 19:00 the shadow price of the demand rule is $40/MWh. A new 5 MW load runs for that hour. By about how much does the best cost rise?

  • $40
  • $200
  • $500
  • $0
Answer

About $200: 5 MWh × $40. A shadow price holds for small changes that leave the same rules binding (exactly at their limits).

A model reports a day's cost far below what you expected. What should you do first?

  • Celebrate the saving
  • Run a different solver
  • Check that supply equals demand every hour with the reported plan
  • Lower the time limit
Answer

Check the plan against the physics. Another solver would solve the same wrong model just as well.

Numbers, sources and what’s next

Numbers to remember

Number What it means Source
$104,000 The best total cost of lesson 0's day, with nothing unserved: $400 below the cheapest-first rule's $104,400. The model has 96 decisions and 72 rules. This lesson's model (illustrative)
$40/MWh The demand rule's shadow price in 18 of 24 hours: the combined-cycle's running cost. This lesson's model (illustrative)
MIT HiGHS, the solver on this page, is open source under the MIT licence; it solves linear programs by simplex, interior point or first-order methods, and mixed-integer programs by branch-and-cut. HiGHS documentation · checked 2 Nov 2026
5 minutes How often the western Energy Imbalance Market dispatched generating units, as EIA reported in July 2017. EIA, Today in Energy · published 14 Jul 2017

Next on the starter path

Lesson 12 · Cheap or clean? How do you weigh cost against emissions?

In the real world

Market operators re-solve dispatch models like this one every few minutes: 5 in the western Energy Imbalance Market, as EIA reported in 2017.

Their prices are shadow prices of balance rules, one for each location on the network: lesson M1.

Sources and further reading

  • HiGHS. Documentation: the open-source linear and mixed-integer solver used on this page.
  • EIA (2017). The western U.S. sub-hourly wholesale electricity market is expanding. Today in Energy.
  • EIA. Hourly Electric Grid Monitor (Form EIA-930): the Southwest Power Pool data behind Prairie Town's day.
  • JuMP. Modelling language for mathematical optimization, with HiGHS among its solvers.
  • Earlier lessons: lesson 0 (the day by hand), lesson 10 (the model written down), lesson 8 (the merit-order price).

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.

© 2026 Honglin Li · Kansas State University · hlli@ksu.edu

 

Last updated: November 2026 · Built with Quarto