Economic Dispatch: Equal Incremental Cost and -Iteration
A load flow tells you what happens for a given set of generator outputs. But who decides those outputs? With of load and two power stations that burn fuel at different rates, there are infinitely many splits that satisfy the load, and they cost different amounts per hour. Economic dispatch picks the cheapest split for the units that are already running, every few minutes, within each unit's limits. Its answer, the marginal cost , is also the price that most electricity markets publish (Energy Markets and Grid Operation).
Safety. This lesson is pure calculation about power-station scheduling; nothing is built or measured on live plant.
Cost curves and incremental cost
A thermal unit's fuel use grows with output a little faster than linearly, because efficiency falls away from the best operating point. A quadratic fits test data well:
The derivative is the incremental cost: what one more megawatt-hour from this unit costs at its present output. For the two units of network N4 (The Load-Flow Problem), with in MW:
| Unit | (€/h) | (€/MWh) | () | Limits (MW) |
|---|---|---|---|---|
| G1 at bus 1 | 500 | 42.0 | 0.016 | 50 to 250 |
| G2 at bus 2 | 400 | 38.0 | 0.020 | 50 to 200 |
(Illustrative numbers. Real values depend on fuel prices and carbon costs and change daily.)
The equal incremental cost rule
Minimise subject to . With a Lagrange multiplier :
If one unit were producing a megawatt-hour more cheaply at the margin than another, shifting a megawatt to it would save money; at the optimum no such shift exists. A unit whose incremental cost at is still below runs at ; one whose incremental cost at is above runs at . The multiplier is the system marginal cost: the cost of serving one more megawatt of load.
Losses and penalty factors
Power from a distant unit loses more on the way. With losses , the balance becomes and the optimum condition
The penalty factor is a little above 1 for units whose extra output raises losses. The classic way to express is the B-coefficient (Kron) loss formula, in its simplest form a quadratic form in the generator outputs fitted to load-flow results, . Here a diagonal version is used, (MW), chosen to give about the that the Newton–Raphson load flow found for N4. Modern dispatch replaces the B formula with sensitivities from the network model (optimal power flow), but the idea is the same.
The -iteration
For a given , each unit's output follows from , clipped to its limits. Total output rises monotonically with , so bisection on finds the value at which the outputs add up to the demand (plus losses). With losses, update the penalty factors from the new outputs and repeat until they settle.
Worked example: 250 MW without losses
Given: the two units above, , losses neglected.
Find: , , and the hourly cost.
Solve:
The cost is .
Check: both units are inside their limits, and both incremental costs equal . The cheaper unit (lower ) carries more, but not everything: its incremental cost rises faster ().
In Python: -iteration with limits and penalty factors
import numpy as np
# Two units of network N4: cost C(P) = a + b P + c P^2 in EUR/h, P in MW
units = {"G1 (bus 1)": dict(a=500.0, b=42.0, c=0.016, Pmin=50.0, Pmax=250.0),
"G2 (bus 2)": dict(a=400.0, b=38.0, c=0.020, Pmin=50.0, Pmax=200.0)}
U = list(units.values())
B = np.array([0.00015, 0.00010]) # loss coefficients (1/MW): P_loss = sum B_i P_i^2
def output(lam, pen):
"""Each unit runs where its incremental cost times its penalty factor equals lambda."""
return np.array([np.clip((lam / L - u["b"]) / (2 * u["c"]), u["Pmin"], u["Pmax"])
for u, L in zip(U, pen)])
def dispatch(demand, losses=False, tol=1e-6):
pen = np.ones(2)
for _ in range(50): # outer loop: update penalty factors
lo, hi = 0.0, 100.0 # lambda-iteration by bisection (EUR/MWh)
while hi - lo > tol:
lam = (lo + hi) / 2
P = output(lam, pen)
Ploss = float(B @ P**2) if losses else 0.0
lo, hi = (lam, hi) if P.sum() < demand + Ploss else (lo, lam)
if not losses:
break
new = 1 / (1 - 2 * B * P) # penalty factor L_i = 1/(1 - dPloss/dP_i)
if np.abs(new - pen).max() < 1e-9:
break
pen = new
cost = sum(u["a"] + u["b"] * p + u["c"] * p * p for u, p in zip(U, P))
return lam, P, Ploss, pen, cost
for D, loss in [(250, False), (250, True), (420, False)]:
lam, P, Pl, pen, cost = dispatch(D, loss)
print(f"D = {D} MW, losses {'on ' if loss else 'off'}: lambda = {lam:.3f} EUR/MWh, "
f"P1 = {P[0]:.2f}, P2 = {P[1]:.2f} MW, loss = {Pl:.2f} MW, cost = {cost:.0f} EUR/h"
+ (f", penalty factors {pen[0]:.4f} {pen[1]:.4f}" if loss else ""))
# compare with the operating point used in the load-flow lessons: P2 = 100 MW, slack covers the rest
P = np.array([150.0, 100.0])
for _ in range(20): # slack output including losses
P[0] = 250 + B @ P**2 - P[1]
cost_lf = sum(u["a"] + u["b"] * p + u["c"] * p * p for u, p in zip(U, P))
print(f"load-flow schedule P1 = {P[0]:.2f}, P2 = {P[1]:.2f} MW costs {cost_lf:.0f} EUR/h")
import matplotlib.pyplot as plt
lam, P, _, _, _ = dispatch(250)
for (name, u), p in zip(units.items(), P):
x = np.linspace(u["Pmin"], u["Pmax"], 50)
plt.plot(x, u["b"] + 2 * u["c"] * x, label=f"{name}: dC/dP")
plt.plot(p, lam, "ko")
plt.axhline(lam, ls="--", color="gray", label=f"lambda = {lam:.2f} EUR/MWh")
plt.xlabel("unit output P (MW)"); plt.ylabel("incremental cost (EUR/MWh)")
plt.title("Equal incremental cost, 250 MW, no losses"); plt.legend(); plt.grid(alpha=0.3)
plt.show()D = 250 MW, losses off: lambda = 44.667 EUR/MWh, P1 = 83.33, P2 = 166.67 MW, loss = 0.00 MW, cost = 11400 EUR/h
D = 250 MW, losses on : lambda = 46.097 EUR/MWh, P1 = 89.40, P2 = 164.51 MW, loss = 3.91 MW, cost = 11575 EUR/h, penalty factors 1.0276 1.0340
D = 420 MW, losses off: lambda = 49.040 EUR/MWh, P1 = 220.00, P2 = 200.00 MW, loss = 0.00 MW, cost = 19314 EUR/h
load-flow schedule P1 = 154.58, P2 = 100.00 MW costs 11775 EUR/h
With losses the system rises to and the units together produce to cover of losses. The penalty factors ( for G1, for G2 with this loss formula) shift output toward the unit with the smaller loss sensitivity. At , G2 reaches its limit and G1 alone sets . Finally, the schedule assumed in the load-flow lessons (, the slack covering the rest) costs about more than the optimum: real money over a year ( million euros) for a two-unit system.
Guided lab: fit a cost curve from test data
Hand calculation. A plant heat-rate test gives fuel cost at four outputs, for example : , : , : and : (made-up data consistent with G1). Fit , , by least squares (Least-Squares Fitting), using three points by hand first.
Simulation. Use np.polyfit(P, C, 2) and put the fitted unit into the dispatch program; compare with the textbook coefficients.
What you would measure. On a real unit, the plant's performance engineers measure fuel flow (or coal mass and calorific value) against electrical output at steady loads. Fuel metering is typically good to to and calorific value to a similar amount, so , a small curvature term, is the least certain coefficient (often or worse): dispatch decisions near equal incremental costs are correspondingly uncertain. There is no bench version of this lab, and none is needed: it is a data-analysis exercise.
Hazards. None: no electrical work.
Pitfalls
- Equal costs instead of equal incremental costs. Average cost per MWh is irrelevant to the split; the margin decides.
- Forgetting limits. A unit at its limit no longer satisfies ; ignoring the limit gives impossible outputs.
- Penalty factors applied the wrong way. Multiply the incremental cost by ; units with a high are made to look more expensive.
- Treating dispatch as network-free. Line limits (from the DC load flow) can force a more expensive split; that is security-constrained dispatch.
Practice
- With the units above and no losses, find , and for .
- What is the cost of serving the 251st megawatt at (no losses)?
- For , why is not the incremental cost of G2?
Answer
- , so , below G1's minimum: G1 runs at , G2 at , (set by G2).
- About .
- G2 is at with an incremental cost of ; it cannot respond to more load, so the marginal unit is G1 at .
Test yourself
At the economic dispatch optimum (no losses, no limits active), every running unit has the same…
- output
- average cost per MWh
- incremental cost
- efficiency
A unit has €/h. Its incremental cost at 150 MW is…
- 38 €/MWh
- 44 €/MWh
- 41 €/MWh
- 50 €/MWh
A penalty factor greater than 1 means that extra output from that unit…
- reduces system losses
- increases system losses, so it is made to look more expensive
- is free
- violates its limit
In the -iteration, why does bisection on work?
- the cost is linear
- total output is a monotonically increasing function of
- there is only one unit
- losses are zero