TExcelTAD

Unit Commitment

Economic dispatch shares the load among units that are already running. But a large thermal unit cannot be switched on in a minute: it takes hours to warm up, burns fuel and money to start, and once running it cannot go below a minimum output. So the day before, operators (or market algorithms) decide which units to commit for each hour of tomorrow, given the load forecast and a reserve margin. That is unit commitment: a scheduling problem with on/off decisions, which makes it much harder than dispatch.

Safety. A scheduling calculation; nothing is built or switched.

What makes it hard

For each period tt and unit ii there is a binary decision ui,t∈{0,1}u_{i,t} \in \{0, 1\} and an output Pi,tP_{i,t}. The objective is

min⁡∑t∑i(ui,t Ci(Pi,t) Δt+Si ui,t (1−ui,t−1))\min \sum_t \sum_i \Big( u_{i,t}\,C_i(P_{i,t})\,\Delta t + S_i\,u_{i,t}\,(1 - u_{i,t-1}) \Big)

where CiC_i is the running cost per hour and SiS_i the start-up cost, subject to:

  • load balance ∑iPi,t=Dt\sum_i P_{i,t} = D_t in every period;
  • output limits ui,tPimin≤Pi,t≤ui,tPimaxu_{i,t}P_i^\text{min} \le P_{i,t} \le u_{i,t}P_i^\text{max}: a committed unit cannot go below its minimum;
  • spinning reserve: committed capacity ∑iui,tPimax≥Dt(1+r)\sum_i u_{i,t}P_i^\text{max} \ge D_t(1 + r), so that the loss of a unit can be covered at once;
  • in practice also minimum up and down times, ramp rates, start-up times, crew and fuel constraints, and network limits.

With NN units there are 2N2^N combinations per period and 2NT2^{NT} schedules: 1010 units over 2424 hours is 22402^{240}, so brute force is hopeless. Methods used over the decades: priority lists, dynamic programming over the combinations of each period, Lagrangian relaxation, and today mixed-integer linear programming with commercial solvers, which handles thousands of units in market-clearing engines.

Priority lists and dynamic programming

A priority list ranks units by their average cost at full load and commits them in that order until the load plus reserve is covered. It is fast and often good, but it ignores start-up costs: it switches a unit off as soon as it is not needed and pays to restart it later.

Dynamic programming (DP) walks forward period by period. For each feasible combination (state) it keeps the cheapest way to reach it from any state of the previous period, adding the start-up costs of the units that switch on. At the end, the cheapest final state traces back the best schedule. With NN units there are at most 2N−12^N - 1 states per period, and DP finds the true optimum of this model (minimum up/down times need the time a unit has been on or off in the state, which multiplies the state count).

The example system

Three units, a day in six blocks of four hours, 10 %10\ \% spinning reserve:

Unit Type (typical role) PminP_\text{min}–PmaxP_\text{max} (MW) C(P)C(P) (€/h) Start-up (€) Full-load average (€/MWh)
A large steam unit (base load) 100–300 1200+30P+0.010P21200 + 30P + 0.010P^2 4000 37.0
B combined-cycle gas (mid-merit) 50–200 600+40P+0.015P2600 + 40P + 0.015P^2 5000 46.0
C open-cycle gas turbine (peaker) 20–100 200+70P+0.030P2200 + 70P + 0.030P^2 300 75.0

Load forecast: 180180, 380380, 250250, 470470, 350350, 220 MW220\ \text{MW}. Unit A is already running at midnight. (Illustrative numbers.)

Worked example: block 4 by hand

Given: block 4, D=470 MWD = 470\ \text{MW}, reserve rule ∑Pmax≥1.1⋅470=517 MW\sum P^\text{max} \ge 1.1 \cdot 470 = 517\ \text{MW}.

Find: the cheapest feasible commitment for this block alone and its dispatch.

Solve: A + B has 500 MW500\ \text{MW} of capacity, short of 517517, so C must run too (A + B + C: 600 MW600\ \text{MW}). Dispatch with equal incremental cost: A's incremental cost at 300 MW300\ \text{MW} is 30+0.02⋅300=36 €/MWh30 + 0.02 \cdot 300 = 36\ \text{€/MWh}, still the cheapest, so A runs at its maximum. C runs at its minimum, 20 MW20\ \text{MW} (its incremental cost 71.2 €/MWh71.2\ \text{€/MWh} there is above anything else). B takes the rest: 470−300−20=150 MW470 - 300 - 20 = 150\ \text{MW}, incremental cost 40+0.03⋅150=44.5 €/MWh40 + 0.03 \cdot 150 = 44.5\ \text{€/MWh}, which is λ\lambda.

CA=1200+9000+900=11 100 €/h,CB=600+6000+337.5=6937.5 €/hCC=200+1400+12=1612 €/h,block cost=4⋅19 649.5=78 598 €\begin{aligned} C_A &= 1200 + 9000 + 900 = 11\,100\ \text{€/h}, \quad C_B = 600 + 6000 + 337.5 = 6937.5\ \text{€/h} \\ C_C &= 200 + 1400 + 12 = 1612\ \text{€/h}, \quad \text{block cost} = 4 \cdot 19\,649.5 = 78\,598\ \text{€} \end{aligned}

Check: C is committed only for reserve: it produces 20 MW20\ \text{MW} at a high price because the rule forces it on. A cheaper option would be more reserve from elsewhere (a storage plant or demand response), which is why reserve markets exist.

In Python: priority list against dynamic programming

python · try it yourself
import itertools
import numpy as np

# name: (Pmin, Pmax, a, b, c, start-up cost); cost a + bP + cP^2 in EUR/h, P in MW
units = {"A": (100, 300, 1200, 30.0, 0.010, 4000),
         "B": (50, 200, 600, 40.0, 0.015, 5000),
         "C": (20, 100, 200, 70.0, 0.030, 300)}
names = list(units)
load = [180, 380, 250, 470, 350, 220]   # MW, six 4-hour blocks of one day
hours = 4
reserve = 0.10                           # online capacity must cover load + 10 %

def dispatch(on, D):
    """Lossless economic dispatch of the committed units (lambda bisection). None if infeasible."""
    U = [units[n] for n in on]
    if not U or sum(u[0] for u in U) > D or sum(u[1] for u in U) < D * (1 + reserve):
        return None
    lo, hi = 0.0, 500.0
    for _ in range(60):
        lam = (lo + hi) / 2
        P = [min(max((lam - u[3]) / (2 * u[4]), u[0]), u[1]) for u in U]
        lo, hi = (lam, hi) if sum(P) < D else (lo, lam)
    return sum(u[2] + u[3] * p + u[4] * p * p for u, p in zip(U, P)), P

states = [s for r in range(1, 4) for s in itertools.combinations(names, r)]

# 1) priority list: commit by full-load average cost until the reserve rule is met
avg = {n: (u[2] + u[3] * u[1] + u[4] * u[1] ** 2) / u[1] for n, u in units.items()}
order = sorted(names, key=avg.get)
print("full-load average cost (EUR/MWh):", ", ".join(f"{n} {avg[n]:.1f}" for n in order))
prev, total = ("A",), 0.0
for t, D in enumerate(load):
    on = []
    for n in order:
        on.append(n)
        if dispatch(tuple(sorted(on)), D):
            break
    on = tuple(sorted(on))
    run, P = dispatch(on, D)
    start = sum(units[n][5] for n in on if n not in prev)
    total += hours * run + start
    print(f"  block {t+1}: {D} MW -> {'+'.join(on):5s} start-up {start:5.0f}  outputs {np.round(P, 1)}")
    prev = on
print(f"priority list total: {total:,.0f} EUR")

# 2) dynamic programming over all on/off combinations (forward, keeps the cheapest path to each state)
best = {("A",): (0.0, [])}               # A is already running at midnight
for D in load:
    new = {}
    for s in states:
        res = dispatch(s, D)
        if res is None:
            continue
        for p, (cost, path) in best.items():
            c = cost + hours * res[0] + sum(units[n][5] for n in s if n not in p)
            if s not in new or c < new[s][0]:
                new[s] = (c, path + ["+".join(s)])
    best = new
cost, path = min(best.values())
print(f"dynamic programming: {' | '.join(path)}  total {cost:,.0f} EUR")
full-load average cost (EUR/MWh): A 37.0, B 46.0, C 75.0
  block 1: 180 MW -> A     start-up     0  outputs [180.]
  block 2: 380 MW -> A+B   start-up  5000  outputs [300.  80.]
  block 3: 250 MW -> A     start-up     0  outputs [250.]
  block 4: 470 MW -> A+B+C start-up  5300  outputs [300. 150.  20.]
  block 5: 350 MW -> A+B   start-up     0  outputs [300.  50.]
  block 6: 220 MW -> A     start-up     0  outputs [220.]
priority list total: 301,964 EUR
dynamic programming: A | A+B | A+B | A+B+C | A+B | A  total 300,614 EUR

The priority list switches B off in block 3 (250 MW250\ \text{MW} fits in A's 300 MW300\ \text{MW} with reserve) and pays its 5000 €5000\ \text{€} start-up again in block 4. Dynamic programming keeps B running at its 50 MW50\ \text{MW} minimum through block 3 instead. That costs 3650 €3650\ \text{€} more in fuel for the four hours (B's no-load and minimum-output cost, minus what A saves by producing 50 MW50\ \text{MW} less), which is less than the 5000 €5000\ \text{€} restart: the day costs 300 614 €300\,614\ \text{€} instead of 301 964 €301\,964\ \text{€}. With B's start-up at 1500 €1500\ \text{€} the two methods would agree. Real units also have minimum down times that may forbid the stop-and-restart altogether.

Guided lab: check a schedule against the forecast

Hand calculation. For the DP schedule, compute block 3 by hand: A + B dispatched at 250 MW250\ \text{MW}. Equal incremental cost gives 30+0.02PA=40+0.03PB30 + 0.02P_A = 40 + 0.03P_B with PA+PB=250P_A + P_B = 250, so PB=−100 MWP_B = -100\ \text{MW} (and PA=350 MWP_A = 350\ \text{MW}, above A's maximum): far below B's minimum, so B sits at 50 MW50\ \text{MW} and A at 200 MW200\ \text{MW}.

Simulation. Change the load forecast by ±5 %\pm 5\ \% in the program and see whether the commitment changes: commitment decisions are made on forecasts, and the reserve rule is what absorbs the error.

What you would measure. Operators compare the day-ahead forecast with metered demand: day-ahead load forecasts for a whole system typically miss by 11 to 3 %3\ \% (mean absolute error), more on unusual days, and wind and solar forecasts much more. The real-time dispatch then corrects within the committed units, and the reserve covers forced outages. No bench work: this is a scheduling calculation.

Hazards. None.

Pitfalls

  • Forgetting minimum output. A committed unit adds its PminP_\text{min} whether or not you need it; at night that can force other units off or require exports.
  • Ignoring start-up costs (the priority list's flaw) or minimum up/down times (which can make a "cheaper" schedule infeasible).
  • Treating reserve as free. It forces expensive units on, as in block 4.
  • Assuming the forecast is exact. Robust and stochastic unit commitment plan for forecast errors, especially with a lot of wind and solar (Storage, Capacity Factor and LCOE).

Practice

  1. In block 1 (180 MW180\ \text{MW}), B alone would also satisfy the limits and the reserve rule (200≥198 MW200 \ge 198\ \text{MW}). Why does every good schedule keep A instead?
  2. What would a reserve requirement of 20 %20\ \% change in block 2 (380 MW380\ \text{MW})?
  3. B's start-up cost falls to 1500 €1500\ \text{€}. Which schedule is now cheaper in block 3, and by how much?
Answer
  1. A is already running (no start-up) and cheaper: at 180 MW180\ \text{MW} A costs 1200+5400+324=6924 €/h1200 + 5400 + 324 = 6924\ \text{€/h}, B would cost 600+7200+486=8286 €/h600 + 7200 + 486 = 8286\ \text{€/h}, plus B's 5000 €5000\ \text{€} start-up. B alone would also leave almost no reserve margin.
  2. 1.2⋅380=456 MW1.2 \cdot 380 = 456\ \text{MW}: A + B (500500) still suffices, so nothing changes; in block 4 (564 MW564\ \text{MW} needed) A + B + C (600600) still suffices.
  3. Stopping B and restarting it: 3650 €3650\ \text{€} of fuel saved minus 1500 €1500\ \text{€} start-up, so stopping is cheaper by 2150 €2150\ \text{€}.

Test yourself

What does unit commitment decide that economic dispatch does not?

  1. the output of each running unit
  2. which units are on or off in each period
  3. the line flows
  4. the voltage setpoints

Why can a priority list give a more expensive schedule than dynamic programming?

  1. it ignores fuel costs
  2. it ignores start-up costs and the coupling between periods
  3. it violates the reserve rule
  4. it uses the wrong load

A spinning-reserve requirement of 10 % at 470 MW means the committed units must have a total maximum output of at least…

  1. 470 MW
  2. 517 MW
  3. 423 MW
  4. 564 MW

With 10 units and 24 hourly periods, how many on/off schedules exist?

  1. 240
  2. 2102^{10}
  3. 22402^{240}
  4. 241024^{10}