---
title: Economic dispatch
heading: Generator cost curves and incremental cost, the equal-incremental-cost rule and the system lambda, generator limits, transmission losses and penalty factors, and why the result is also the price of electricity
eyebrow: S10 · Lesson 27 · Economic dispatch
xp: 50
---

::: hook
Every few minutes, a grid operator decides how much each online generator should produce to meet the load at the least total cost. The answer is a single number, the system's marginal cost λ, in dollars per megawatt-hour: every generator not at a limit runs where its own incremental cost equals λ. That same λ, adjusted for losses and congestion, is the wholesale price of electricity at each location. This lesson derives the rule and computes it.
:::

::: play
- The incremental cost curves of two generators, $dC/dP$ in dollars per MWh against output, with a horizontal line at the system λ.
- Each unit runs where its curve crosses λ. Raise λ and both produce more; the readouts give each output and their total.
- Slide λ until the total equals the 800 MW load: that's the economic dispatch, at λ = 9.22 dollars per MWh.
:::

```sim plot
view: graph
x: P = 0..800 MW
y: IC = 5..12
slider: L = 6..11 = 9.22
plot: 5.3 + 0.008*P | samples: 200 | label: unit 1
plot: 5.5 + 0.012*P | samples: 200 | color: ch3 | label: unit 2
plot: L + 0*P | dashed | color: ch4 | label: λ
readout: unit 1 output, MW = (L - 5.3)/0.008 | digits: 4
readout: unit 2 output, MW = (L - 5.5)/0.012 | digits: 4
readout: total, MW = (L - 5.3)/0.008 + (L - 5.5)/0.012 | digits: 4
```

::: predict
## Two generators share 800 MW. Unit 1 costs $C_1 = 500 + 5.3P + 0.004P^2$ dollars per hour and unit 2 $C_2 = 400 + 5.5P + 0.006P^2$. How much do they save per hour by dispatching economically instead of splitting 400/400?

- [ ] Nothing: the costs are almost the same
- [x] About 81 dollars per hour
- [ ] About $800 per hour
- [ ] They lose money, since unit 1 runs harder

::: reveal
Economic dispatch puts unit 1 at 490 MW and unit 2 at 310 MW, both at 9.22 dollars per MWh incremental cost, for a total of 6739 dollars per hour. The even split costs 6820 dollars per hour, because unit 2's incremental cost at 400 MW (10.30) is well above unit 1's (8.50): shifting load from 2 to 1 saves money until the two are equal.
:::
:::

::: nameit
## Costs

A thermal unit's fuel cost is roughly quadratic in its output: $C_i(P_i) = a_i + b_iP_i + c_iP_i^2$ dollars per hour. Its **incremental cost** is $dC_i/dP_i = b_i + 2c_iP_i$ dollars per MWh.

## The equal-incremental-cost rule

Minimize $\sum C_i$ subject to $\sum P_i = P_D$. With a Lagrange multiplier λ, the optimum has

$$\frac{dC_i}{dP_i} = \lambda \text{ for every unit not at a limit}, \qquad P_i = \frac{\lambda - b_i}{2c_i}$$

and the demand fixes λ:

$$\lambda = \frac{P_D + \sum_ib_i/2c_i}{\sum_i1/2c_i}$$

If shifting load from a unit with high incremental cost to one with low incremental cost saves money, the dispatch wasn't optimal; at equal incremental costs no shift helps.

## Limits

A unit whose $P_i$ would fall outside $[P_\text{min}, P_\text{max}]$ is fixed at the violated limit, and the rest are redispatched at a new λ.

## Losses

With transmission losses $P_L$, the condition becomes $\frac{dC_i}{dP_i}\cdot\frac{1}{1 - \partial P_L/\partial P_i} = \lambda$: a unit whose extra output raises losses is penalized by its **penalty factor** $1/(1 - \partial P_L/\partial P_i)$.

## Prices

λ is the cost of serving one more megawatt-hour, the **marginal cost**. Markets set prices at it; with congestion and losses, each bus gets its own locational marginal price (lesson 29).
:::

::: example
## Dispatch the two units for 800 MW.

::: solution
1. **System lambda.**
   $$\begin{aligned} \lambda &= \frac{800 + 5.3/0.008 + 5.5/0.012}{1/0.008 + 1/0.012} \\ &= \frac{800 + 662.5 + 458.3}{125 + 83.3} \\ &= 9.22 \end{aligned}$$
   dollars per MWh.
2. **Unit outputs.**
   $$\begin{aligned} P_1 &= (9.22 - 5.3)/0.008 \\ &= 490\ \text{MW} \\ P_2 &= (9.22 - 5.5)/0.012 \\ &= 310\ \text{MW} \end{aligned}$$
3. **Total cost.**
   $$\begin{aligned} C &= 4057.4 + 2681.6 \\ &= 6739 \end{aligned}$$
   dollars per hour.

**Answer:** λ = 9.22 dollars per MWh, with unit 1 at 490 MW and unit 2 at 310 MW, for 6739 dollars per hour.
:::
:::

::: example
## Unit 1 can produce at most 450 MW. Redispatch.

::: solution
1. **Hold unit 1 at its limit.** Its optimum of 490 violates the limit, so fix it at 450 MW and give unit 2 the remaining 350.
2. **The new lambda.** Unit 2's incremental cost rises to
   $$\begin{aligned} \lambda &= 5.5 + 0.012 \times 350 \\ &= 9.70 \end{aligned}$$
   dollars per MWh, which becomes the system λ: the marginal megawatt now comes from the more expensive unit.
3. **Total cost.** It rises to 6755 dollars per hour.

**Answer:** unit 1 at 450 MW and unit 2 at 350 MW, with λ = 9.70 dollars per MWh and a total of 6755 dollars per hour.
:::
:::

::: example
## Three units have incremental costs 8 + 0.01P, 9 + 0.008P and 7 + 0.016P dollars per MWh (P in MW). Dispatch them for 900 MW.

::: solution
1. **Each unit's output.** Each unit runs at
   $$P_i = (\lambda - b_i)/(2c_i)$$
2. **Balance the load.**
   $$\begin{aligned} &\frac{\lambda - 8}{0.01} + \frac{\lambda - 9}{0.008} \\ &\quad + \frac{\lambda - 7}{0.016} = 900 \end{aligned}$$
3. **Solve for λ.**
   $$287.5\lambda = 3262.5$$
   so λ = 11.35 dollars per MWh.
4. **Unit outputs.** The units produce 334.8, 293.5 and 271.7 MW.
5. **Read the result.** The unit with the lowest starting cost doesn't produce the most: its steep slope makes each extra MW expensive.

**Answer:** λ = 11.35 dollars per MWh, with the units at 334.8, 293.5 and 271.7 MW.
:::
:::

::: check
given: b = 4 | 6.5; c = 0.002 | 0.008; P = 100 | 350
answer: b + 2*c*P
tolerance: 0.5%

## A unit's cost is $a + \given{b}P + \given{c}P^2$ dollars per hour. What's its incremental cost at {P} MW, in dollars per MWh?

::: right
Right. $b + 2cP$ = {answer} dollars per MWh.
:::

::: misses
- [b + c*P] The derivative of $cP^2$ is $2cP$.
- [any] Not yet. Differentiate the cost.
:::
:::

::: check
given: b = 5 | 6; c = 0.003 | 0.005; d = 5.5 | 6.5; e = 0.004 | 0.008; D = 300 | 700
answer: (D + b/(2*c) + d/(2*e))/(1/(2*c) + 1/(2*e))
tolerance: 0.5%

## Units with incremental costs {b} + 2({c})P and {d} + 2({e})P share {D} MW. What's λ, in dollars per MWh?

::: right
Right. $\frac{P_D + \sum b_i/2c_i}{\sum 1/2c_i}$ = {answer} dollars per MWh.
:::

::: misses
- [any] Not yet. Set both incremental costs equal to λ and add the outputs.
:::
:::

::: check
given: b = 5 | 6; c = 0.003 | 0.005; d = 5.5 | 6.5; e = 0.004 | 0.008; D = 300 | 700
answer: ((D + b/(2*c) + d/(2*e))/(1/(2*c) + 1/(2*e)) - b)/(2*c)
unit: MW
tolerance: 0.5%

## For the same pair, how much does the first unit produce?

::: right
Right. $(\lambda - b_1)/2c_1$ = {answer} MW.
:::

::: misses
- [D/2] An even split is optimal only for identical units.
- [any] Not yet. Find λ first.
:::
:::

::: check
given: a = 200 | 600; b = 4.5 | 6; c = 0.002 | 0.007; P = 150 | 450
answer: a + b*P + c*P^2
tolerance: 0.5%

## What does a unit with cost $\given{a} + \given{b}P + \given{c}P^2$ cost per hour at {P} MW?

::: right
Right. {answer} dollars per hour.
:::

::: misses
- [b + 2*c*P] That's the incremental cost, in dollars per MWh.
- [any] Not yet. Substitute P.
:::
:::

::: check
given: I = 7 | 9.5; s = 0.02 | 0.06 | 0.1
answer: I/(1 - s)
tolerance: 0.5%

## A unit's incremental cost is {I} dollars per MWh and each extra MW it produces raises losses by {s} MW. What's its effective incremental cost, in dollars per MWh?

::: right
Right. $IC/(1 - \partial P_L/\partial P)$ = {answer} dollars per MWh.
:::

::: misses
- [I*(1 - s)] The penalty factor divides by $1 - \partial P_L/\partial P$: losses make the unit look more expensive.
- [any] Not yet. Apply the penalty factor.
:::
:::

::: check
given: b = 5.5 | 6.2; c = 0.004 | 0.009; M = 200 | 300; D = 500 | 650
answer: b + 2*c*(D - M)
tolerance: 0.5%

## A cheap unit is pinned at its {M} MW maximum, and a second unit with cost {b}P + {c}P² (plus constant) supplies the rest of a {D} MW load. What's the system λ, in dollars per MWh?

::: right
Right. The second unit's incremental cost at {D} − {M} MW: {answer} dollars per MWh.
:::

::: misses
- [b + c*(D - M)] The derivative of $cP^2$ is $2cP$.
- [any] Not yet. The unit not at a limit sets λ.
:::
:::

::: check
kind: parts
given: a = 7 | 8; c = 0.004 | 0.006; b = 9 | 10; e = 0.008 | 0.012; d = 6 | 7; f = 0.005 | 0.009; D = 600 | 1200

## Three units have incremental costs {a} + 2({c})P, {b} + 2({e})P and {d} + 2({f})P dollars per MWh, sharing {D} MW.

::: part
answer: (D + a/(2*c) + b/(2*e) + d/(2*f))/(1/(2*c) + 1/(2*e) + 1/(2*f))
tolerance: 0.5%

### What is λ, in dollars per MWh?

::: misses
- [any] $\lambda = \frac{D + \sum b_i/2c_i}{\sum 1/2c_i}$.
:::
:::

::: part
answer: ((D + a/(2*c) + b/(2*e) + d/(2*f))/(1/(2*c) + 1/(2*e) + 1/(2*f)) - a)/(2*c)
unit: MW
tolerance: 0.5%

### How much does the first unit produce?

::: misses
- [any] $(\lambda - b_1)/2c_1$.
:::
:::
:::

::: check
kind: derivation
vars: a = 5..15, c = 0.001..0.02, b = 5..15, e = 0.001..0.02, D = 100..2000

## Two units with incremental costs a + 2cP and b + 2eP share D MW, neither at a limit.

::: step
answer: (D + a/(2*c) + b/(2*e))/(1/(2*c) + 1/(2*e))

### What is λ?
:::

::: step
answer: ((D + a/(2*c) + b/(2*e))/(1/(2*c) + 1/(2*e)) - a)/(2*c)

### What does the first unit produce?
:::

::: right
Right. The units share a single incremental cost, and the flatter one takes more of each extra MW.
:::
:::

::: explain
## Why must every unit that isn't at a limit run at the same incremental cost in an economic dispatch?

::: model
Suppose two units ran at different incremental costs, one at 8 and one at 10 dollars per megawatt-hour. Moving one megawatt from the expensive unit to the cheap one would save about 10 dollars per hour on one and cost about 8 on the other, a net saving, while still meeting the load. Any dispatch with unequal incremental costs can be improved this way, so the cheapest one can't have any such pair. The only exceptions are units at a limit, which can't be moved in the direction that would save money. The common incremental cost is the marginal cost of the whole system.
:::
:::

::: practice

::: check
given: b = 3.5 | 7; c = 0.001 | 0.01; P = 80 | 500
answer: b + 2*c*P
tolerance: 0.5%

## Incremental cost (dollars per MWh): b = {b}, c = {c}, P = {P} MW?

::: misses
- [any] $b + 2cP$.
:::
:::

::: check
given: b = 4.5 | 5.5; c = 0.002 | 0.006; d = 5 | 6; e = 0.003 | 0.01; D = 400 | 900
answer: (D + b/(2*c) + d/(2*e))/(1/(2*c) + 1/(2*e))
tolerance: 0.5%

## λ for two units ({b}, {c}) and ({d}, {e}) sharing {D} MW (dollars per MWh)?

::: misses
- [any] $\frac{P_D + \sum b/2c}{\sum 1/2c}$.
:::
:::

::: check
given: I = 6 | 11; s = 0.03 | 0.08
answer: I/(1 - s)
tolerance: 0.5%

## Effective incremental cost: {I} dollars per MWh, loss sensitivity {s}?

::: misses
- [any] $IC/(1 - s)$.
:::
:::
:::
