You are on page 1of 255

Introduction to Optimization

and Application to Economic


Dispatch and Unit Commitment

Daniel Kirschen
Perspective

• Conventional PS economics problems:


– Economic Dispatch (ED)
– Unit Commitment (UC)
– Optimal Power Flow (OPF)
• Assume monopoly, vertically integrated utility
• Why?
– Conceptually simpler
– Variants for competitive electricity markets
– Comparison with “benevolent monopolist”
© 2018 D. Kirschen and University of Washington 2
Economic dispatch problem

L
A B C

• Several generating units serving the load


• What share of the load should each
generating unit produce?
• Consider the limits of the generating units
• Ignore the limits of the network

© 2018 D. Kirschen and University of Washington 3


Types of Power Plants
• Thermal power plants
• Renewable energy sources
• Hydro power plants

© 2018 D. Kirschen and University of Washington 4


Thermal power plants

• Burn a fuel to generate electric power


– Coal, oil, gas, biomass, uranium, ..
• Economic characteristics:
– Substantial operating cost
– On/off status and power output can be changed
• Within limits
• Nuclear units:
– Low operating cost but very limited flexibility
• Typically multiple units in a power plant
© 2018 D. Kirschen and University of Washington 5
Renewable energy sources

• Wind, solar, geothermal, tidal


• Economic characteristics:
– Negligible operating cost
– Intermittent (except geothermal)
– Stochastic (wind, solar)
– High investment cost per kW of capacity
Use it or lose it

© 2018 D. Kirschen and University of Washington 6


Hydro power plants
• Economic characteristics
– Negligible operating cost
– Storage capability
• Hydro with reservoir
– Controllable output
– Size of the reservoir is highly variable
• Days to years
• “Run of the river” hydro
– No reservoir or negligible reservoir
– Uncontrollable output: use it or lose it
© 2018 D. Kirschen and University of Washington 7
Concept of net load

- =
actual load – uncontrolled renewable generation
= net load
= controllable generation

We’ll assume that the uncontrollable renewable generation


is known and dispatch the controllable generation to meet
the net load
© 2018 D. Kirschen and University of Washington 8
Hydro-thermal coordination

Q: Would you rather generate a MWh using hydro


or thermal generation?
A: It depends..
 If there is a reservoir (and it is not full) a MWh from
hydro can be generated now or later
 It may have more value later, depending on how
much the thermal MWh costs now and later
• We will assume that the hydro production is
given

© 2018 D. Kirschen and University of Washington 9


Characteristics of the thermal units
B T G J/h

Input
Fuel Electric Power
(Input) (Output) MW
Pmin Pmax
• Thermal generating units
Output
• Consider the running costs only
• Input / Output curve
– Fuel vs. electric power
• Fuel consumption measured by its energy content
• Upper and lower limit on output of the generating unit

© 2018 D. Kirschen and University of Washington 10


Cost Curve
• Multiply fuel input by fuel cost
• No-load cost
– Cost of keeping the unit running if it could produce zero MW

$/h
Cost

No-load cost
MW
Pmin Pmax
© 2018 D. Kirschen and University of Washington
Output 11
Incremental Cost Curve
• Incremental cost curve Cost [$/h]

D FuelCost vs Power
D Power ∆F
∆P
• Derivative of the cost curve MW
• In $/MWh
Incremental Cost
• Cost of the next MWh [$/MWh]

MW
© 2018 D. Kirschen and University of Washington 12
Mathematical formulation

• Objective: Minimize
C = CA (PA ) + CB (PB ) + CC (PC ) A B C
L

• Constraints
– Load / Generation balance:
L = PA + PB + PC

– Unit Constraints:
PAmin £ PA £ PAmax
PBmin £ PB £ PBmax
This is an optimization problem
PCmin £ PC £ PCmax

© 2018 D. Kirschen and University of Washington 13


Introduction to Optimization
Objective
• Achieving the best possible design or
operating conditions requires a way of
measuring the goodness of this result
• We will call this measure our objective F
• Examples:
– minimize cost of building a transformer
– minimize cost of supplying power
– minimize losses in a power system
– maximize profit from a bidding strategy

© 2018 D. Kirschen and University of Washington 15


Decision Variables

• The value of the objective is a function of


some decision variables:
F = f ( x 1 , x 2 , x 3 ,… x n )

• Examples of decision variables:


– Dimensions of the transformer
– Output of generating units, position of taps
– Parameters of bids for selling electrical energy

© 2018 D. Kirschen and University of Washington 16


Optimization Problem

• What value should the decision variables take


so that F = f ( x 1 , x 2 , x 3 ,… x n ) is minimum or
maximum?

© 2018 D. Kirschen and University of Washington 17


Example: function of one variable
f(x*) f(x)

x* x

f(x) is maximum for x = x*

© 2018 D. Kirschen and University of Washington 18


Minimization and Maximization
f(x*) f(x)

x* x

-f(x)
-f(x*)

If x = x* maximizes f(x) then it minimizes - f(x)


© 2018 D. Kirschen and University of Washington 19
Minimization and Maximization

• Maximizing f(x) is thus the same thing as


minimizing g(x) = -f(x)

• Minimization and maximization problems are


thus interchangeable

• Depending on the problem, the optimum is


either a maximum or a minimum

© 2018 D. Kirschen and University of Washington 20


Necessary Condition for Optimality
f(x)
f(x*)

df df
>0 <0
dx dx

x* x
If x = x * maximises f ( x ) then:
df
f ( x ) < f ( x ) for x < x Þ
* *
> 0 for x < x *
dx
df
f ( x ) < f ( x ) for x > x Þ
* *
< 0 for x > x *
dx
© 2018 D. Kirschen and University of Washington 21
Necessary Condition for Optimality
f(x) df
=0
dx

x* x

df
If x = x maximises f ( x ) then
*
= 0 for x = x *
dx

© 2018 D. Kirschen and University of Washington 22


Example
f(x)

x
df
For what values of x is =0?
dx
In other words, for what values of x is the necessary condition for
optimality satisfied?

© 2018 D. Kirschen and University of Washington 23


Example

f(x)

A B C D x
• A, B, C, D are stationary points
• A and D are maxima
• B is a minimum
• C is an inflexion point

© 2018 D. Kirschen and University of Washington 24


How can we distinguish minima and maxima?

f(x)

A B C D x

d2 f
For x = A and x = D, we have: <0
dx 2

The objective function is concave around a maximum


© 2018 D. Kirschen and University of Washington 25
How can we distinguish minima and maxima?

f(x)

A B C D x

d2 f
For x = B we have: >0
dx 2

The objective function is convex around a minimum


© 2018 D. Kirschen and University of Washington 26
How can we distinguish minima and maxima?

f(x)

A B C D x

d2 f
For x = C , we have: =0
dx 2

The objective function is flat around an inflexion point


© 2018 D. Kirschen and University of Washington 27
Necessary and Sufficient Conditions of Optimality

df
• Necessary condition: =0
dx

• Sufficient condition:
d2 f
– For a maximum: <0
dx 2

d2 f
– For a minimum: >0
dx 2

© 2018 D. Kirschen and University of Washington 28


Isn’t all this obvious?

• Can’t we tell all this by looking at the objective


function?
– Yes, for a simple, one-dimensional case when we
know the shape of the objective function
– For complex, multi-dimensional cases (i.e. with
many decision variables) we can’t visualize the
shape of the objective function
– We must then rely on mathematical techniques

© 2018 D. Kirschen and University of Washington 29


Feasible Set

• The values that the decision variables can take


are usually limited
• Examples:
– Physical dimensions of a transformer must be
positive
– Active power output of a generator may be
limited to a certain range (e.g. 200 MW to 500
MW)
– Reactive power output of a generator may be
limited to a certain range (e.g. -100 MVAr to 150
MVAr)
© 2018 D. Kirschen and University of Washington 30
Feasible Set

f(x)

xMIN A xMAX D x

Feasible Set
The values of the objective function outside
the feasible set do not matter
© 2018 D. Kirschen and University of Washington 31
Two-Dimensional Case
f(x1,x2)

x1*

x1
x2 *

x2 f(x1,x2) is minimum for x1*, x2*


© 2018 D. Kirschen and University of Washington 32
Necessary Conditions for Optimality
f(x1,x2)

¶f ( x 1 ,x 2 )
=0
¶x 1
x * ,x *
1 2
¶f ( x 1 ,x 2 )
=0
¶x 2 x * ,x *
1 2
x1*
x1
x2*

x2
© 2018 D. Kirschen and University of Washington 33
Multi-Dimensional Case
At a maximum or minimum value of f ( x 1 , x 2 , x 3 ,… x n )
we must have: ¶f
=0
¶x 1
¶f
=0
¶x 2

¶f
=0
¶x n

A point where these conditions are satisfied is called a stationary point

© 2018 D. Kirschen and University of Washington 34


Sufficient Conditions for Optimality
f(x1,x2) minimum maximum

x1

x2
© 2018 D. Kirschen and University of Washington 35
Sufficient Conditions for Optimality
f(x1,x2)

Saddle point

x1

x2
© 2018 D. Kirschen and University of Washington 36
Sufficient Conditions for Optimality
Calculate the Hessian matrix at the stationary point:

æ ¶2 f ¶2 f ¶2 f ö
ç ¶x 2 ¶x 1 ¶x 2 ¶x 1 ¶x n ÷
ç 1 ÷
ç ¶2 f ¶2 f ¶ f ÷
2

ç ÷
ç ¶x 2 ¶x 1 ¶x 22 ¶x 2 ¶x n ÷
ç ÷
ç ¶2 f ¶2 f ¶2 f ÷
ç ÷÷
ç ¶x ¶x ¶x n ¶x 2
è n 1 ¶x n ø
2

© 2018 D. Kirschen and University of Washington 37


Sufficient Conditions for Optimality
• Calculate the eigenvalues of the Hessian matrix at the
stationary point
• If all the eigenvalues are greater or equal to zero:
– The matrix is positive semi-definite
– The stationary point is a minimum
• If all the eigenvalues are less or equal to zero:
– The matrix is negative semi-definite
– The stationary point is a maximum
• If some or the eigenvalues are positive and other are
negative:
– The stationary point is a saddle point

© 2018 D. Kirschen and University of Washington 38


Calculating eigenvalues
The eigenvalues of a matrix A are such that:

det λ𝐼 − 𝐴 = 0
1 0 0
Where I is the identity matrix: 0 1 0
0 0 1

© 2018 D. Kirschen and University of Washington 39


Contours
f(x1,x2)

F2

F1

x1

F1 F2
x2
© 2018 D. Kirschen and University of Washington 40
Contours
A contour is the locus of all the point that give the same value
to the objective function

x2

x1
Minimum or maximum
© 2018 D. Kirschen and University of Washington 41
Example 1
Minimise C = x 12 + 4 x 22 - 2 x 1 x 2

Necessary conditions for optimality:


¶C
= 2 x1 - 2 x 2 = 0
¶x 1 ì x1 = 0 is a stationary
í point
¶C îx 2 = 0
= -2 x 1 + 8 x 2 = 0
¶x 2

© 2018 D. Kirschen and University of Washington 42


Example 1
Sufficient conditions for optimality:

æ ¶ 2C ¶ 2C ö
ç ¶x 2 ¶x 1 ¶x 2 ÷ æ 2 -2 ö
Hessian Matrix: ç 1
÷ =ç ÷
ç ¶ 2C ¶ C ÷ è -2 8 ø
2

ç ÷
è ¶x 2 ¶x 1 ¶x 22 ø

must be positive definite (i.e. all eigenvalues must be positive)


l-2 2
= 0 Þ l 2 - 10 l + 12 = 0
2 l-8
10 ± 52 The stationary point
Þl = ³0
2 is a minimum
© 2018 D. Kirschen and University of Washington 43
Example 1

x2

C=9
C=4
C=1

x1

Minimum: C=0

© 2018 D. Kirschen and University of Washington 44


Example 2
Minimise C = - x 12 + 3 x 22 + 2 x 1 x 2

Necessary conditions for optimality:


¶C
= -2 x 1 + 2 x 2 = 0
¶x 1 ì x1 = 0 is a stationary
í point
¶C îx 2 = 0
= 2 x1 + 6 x 2 = 0
¶x 2

© 2018 D. Kirschen and University of Washington 45


Example 2
Sufficient conditions for optimality:
æ ¶ 2C ¶ 2C ö
ç ¶x 2 ¶x 1 ¶x 2 ÷ æ -2 2 ö
Hessian Matrix: ç 1
÷ =ç ÷
ç ¶ 2C ¶ C2
÷ è 2 6 ø
ç ÷
è ¶x 2 ¶x 1 ¶x 2 ø
2

l+2 -2
= 0 Þ l2 - 4 l - 8 = 0
-2 l-6
4 + 80
Þl = >0
2 The stationary point
is a saddle point
4- 80
or l = <0
2
© 2018 D. Kirschen and University of Washington 46
Example 2
x2
C=0

C=9

C=4
C=1

C=-9 C=-4 C=-1 C=-4 C=-9

x1
C=1

C=4
C=9

This stationary point is a saddle point C=0


© 2018 D. Kirschen and University of Washington 47
In practice..

• In practice we don’t check the sufficient


conditions for optimality
• If the problem is convex a stationary point will
be a minimum
• Or we rely on the nature of the problem to
“ensure” that a stationary point will be a
minimum or a maximum

© 2018 D. Kirschen and University of Washington 48


Optimization with Constraints
Optimization with Equality Constraints
• There are usually restrictions on the values
that the decision variables can take
Minimise
f ( x 1 , x 2 ,… , x n ) Objective function
subject to:
w 1 ( x 1 , x 2 ,… , x n ) = 0
Equality constraints
w m ( x 1 , x 2 ,… , x n ) = 0

© 2018 D. Kirschen and University of Washington 50


Number of Constraints

• N decision variables
• M equality constraints
• If M > N, the problems is over-constrained
– There is usually no solution
• If M = N, the problem is determined
– There may be a solution
• If M < N, the problem is under-constrained
– There is usually room for optimization

© 2018 D. Kirschen and University of Washington 51


Example 1
Minimise f ( x 1 , x 2 ) = 0.25 x + x
1
2 2
2

x2 Subject to w ( x 1 , x 2 ) º 5 - x 1 - x 2 = 0

w ( x1 , x 2 ) º 5 - x1 - x 2 = 0

Minimum

x1
f ( x 1 , x 2 ) = 0.25 x + x
2
1
2
2
© 2018 D. Kirschen and University of Washington 52
Example 2: Economic Dispatch

x1 x2
L
G1 G2

C 1 = a1 + b1 x 12 Cost of running unit 1


C 2 = a 2 + b 2 x 22 Cost of running unit 2
C = C 1 + C 2 = a1 + a 2 + b1 x 12 + b 2 x 22 Total cost

Optimization problem:
Minimise C = a1 + a 2 + b1 x 12 + b 2 x 22
Subject to: x 1 + x 2 = L
© 2018 D. Kirschen and University of Washington 53
Solution by substitution
Minimise C = a1 + a 2 + b1 x 12 + b 2 x 22
Subject to: x 1 + x 2 = L
Þ x 2 = L - x1
Þ C = a1 + a 2 + b1 x 12 + b 2 ( L - x 1 )
2

Unconstrained minimization
dC
= 2 b1 x 1 - 2 b 2 ( L - x 1 ) = 0
dx 1
b2 L æ b1 L ö
Þ x1 = çÞ x2 = ÷
b1 + b 2 è b1 + b 2 ø
d 2C
= 2b1 + 2 b 2 > 0 Þ minimum
© 2018 D. Kirschen and University of Washington dx 1
2
54
Solution by substitution

• Difficult
• Usually impossible when constraints are non-
linear
• Provides little or no insight into solution

Solution using Lagrange multipliers

© 2018 D. Kirschen and University of Washington 55


Gradient

Consider a function f ( x 1 , x 2 ,… , x n )
æ ¶f ö
ç ¶x 1 ÷
ç ÷
ç ¶f ÷
The gradient of f is the vector Ñf = ç ¶x 2 ÷
ç ÷
ç ÷
ç ¶f ÷
ç ÷
è ¶x n ø

© 2018 D. Kirschen and University of Washington 56


Properties of the Gradient
• Each component of the gradient vector
indicates the rate of change of the function in
that direction
• The gradient indicates the direction in which a
function of several variables increases most
rapidly
• The magnitude and direction of the gradient
usually depend on the point considered
• At each point, the gradient is perpendicular to
the contour of the function
© 2018 D. Kirschen and University of Washington 57
Example 3
f ( x , y ) = ax 2 + by 2
æ ¶f ö
ç ¶x ÷ æ 2 ax ö
Ñf = ç ÷ = ç ÷
¶f
ç ÷ è 2 by ø y
è ¶y ø

© 2018 D. Kirschen and University of Washington 58


Example 4
f ( x , y ) = ax + by f = f3
æ ¶f ö
ç ¶x ÷ æ a ö f = f2 y
Ñf = ç ÷ = ç ÷ Ñf
¶f
ç ÷ è bø
è ¶y ø
f = f1 Ñf

Ñf

© 2018 D. Kirschen and University of Washington 59


Lagrange multipliers
Minimise f ( x 1 , x 2 ) = 0.25 x 12 + x 22 subject to w ( x 1 , x 2 ) º 5 - x 1 - x 2 = 0

w ( x1 , x 2 ) = 5 - x1 - x 2

f = 0.25 x 12 + x 22 = 6
f = 0.25 x 12 + x 22 = 5

© 2018 D. Kirschen and University of Washington 60


Lagrange multipliers
æ ¶f ö
ç ¶x 1 ÷
Ñf = ç ÷
w ( x1 , x 2 ) ç ¶f ÷
Ñf ç ÷
è ¶x 2 ø
f ( x1 , x 2 ) = 6

f ( x1 , x 2 ) = 5 Ñf

Ñf

© 2018 D. Kirschen and University of Washington 61


Lagrange multipliers
æ ¶w ö
ç ¶x 1 ÷
Ñw = ç ÷
w ( x1 , x 2 ) çç ¶w ÷÷
è ¶x 2 ø
f ( x1 , x 2 ) = 6

f ( x1 , x 2 ) = 5

Ñw

Ñw

© 2018 D. Kirschen and University of Washington


Ñw 62
Lagrange multipliers
• The solution must be on the constraint
• To reduce the value of f, we must move
in a direction opposite to the gradient
w ( x1 , x 2 )
Ñf

f ( x1 , x 2 ) = 6

f ( x1 , x 2 ) = 5 Ñf

Ñf

© 2018 D. Kirschen and University of Washington 63


Lagrange multipliers
• We stop when the gradient of the function
is perpendicular to the constraint because
moving further would increase the value
w ( x1 , x 2 ) of the function
Ñf
f ( x1 , x 2 ) = 6

f ( x1 , x 2 ) = 5 Ñf

Ñw
Ñf
Ñw
At the optimum, the gradient of the
function is parallel to the gradient
of the constraint Ñw
© 2018 D. Kirschen and University of Washington 64
Lagrange multipliers
At the optimum, we must have: Ñf Ñw
Which can be expressed as: Ñf + l Ñw = 0

In terms of the co-ordinates: ¶f ¶w


+l =0
¶x 1 ¶x 1
¶f ¶w
+l =0
¶x 2 ¶x 2

The constraint must also be satisfied: w ( x 1 , x 2 ) = 0

l is called the Lagrange multiplier

© 2018 D. Kirschen and University of Washington 65


Lagrangian function
To simplify the writing of the conditions for optimality,
it is useful to define the Lagrangian function:

( x 1 , x 2 ,l ) = f ( x 1 , x 2 ) + lw ( x 1 , x 2 )
The necessary conditions for optimality are then given
by the partial derivatives of the Lagrangian:
¶ ( x 1 , x 2 ,l ) ¶f ¶w
= +l =0
¶x 1 ¶x 1 ¶x 1
¶ ( x 1 , x 2 ,l ) ¶f ¶w
= +l =0
¶x 2 ¶x 2 ¶x 2
¶ ( x 1 , x 2 ,l )
= w ( x1 ,x 2 ) = 0
© 2018 D. Kirschen and University of Washington ¶l 66
Example
Minimise f ( x 1 , x 2 ) = 0.25 x 12 + x 22 subject to w ( x 1 , x 2 ) º 5 - x 1 - x 2 = 0

( x 1 , x 2 , l ) = 0.25 x 12 + x 22 + l ( 5 - x 1 - x 2 )

¶ ( x 1 , x 2 ,l )
º 0.5 x 1 - l = 0
¶x 1
¶ ( x 1 , x 2 ,l )
º 2x2 -l = 0
¶x 2
¶ ( x 1 , x 2 ,l )
º 5 - x1 - x 2 = 0
¶l

© 2018 D. Kirschen and University of Washington 67


Example

¶ ( x 1 , x 2 ,l )
º 0.5 x 1 - l = 0 Þ x1 = 2 l
¶x 1
¶ ( x 1 , x 2 ,l ) 1
º 2x2 -l = 0 Þ x2 = l
¶x 2 2
¶ ( x 1 , x 2 ,l ) 1
º 5 - x1 - x 2 = 0 Þ 5 - 2l - l = 0
¶l 2

Þl=2
Þ x1 = 4
Þ x2 =1
© 2018 D. Kirschen and University of Washington 68
Example
Minimise f ( x 1 , x 2 ) = 0.25 x + x
1
2 2
2

x2 Subject to w ( x 1 , x 2 ) º 5 - x 1 - x 2 = 0

w ( x1 , x 2 ) º 5 - x1 - x 2 = 0

f ( x1 , x 2 ) = 5 Minimum
1

4 x1
© 2018 D. Kirschen and University of Washington 69
Important Note!
If the constraint is of the form: ax 1 + bx 2 = L

It must be included in the Lagrangian as follows:

= f ( x 1 ,… , x n ) + l ( L - ax 1 - bx 2 )

And not as follows:

= f ( x 1 ,… , x n ) + l ( ax 1 + bx 2 )

© 2018 D. Kirschen and University of Washington 70


Application to Economic Dispatch
x1 x2
L minimise f ( x 1 , x 2 ) = C 1 ( x 1 ) + C 2 ( x 2 )
G1 G2
s.t . w ( x 1 , x 2 ) º L - x 1 - x 2 = 0

( x 1 , x 2 , l ) = C1 ( x 1 ) + C 2 ( x 2 ) + l ( L - x 1 - x 2 )
¶ dC 1
º -l =0
¶x 1 dx 1 dC 1 dC 2
= =l
¶ dC 2 dx 1 dx 2
º -l =0
¶x 2 dx 2
¶ Equal incremental cost
º L - x1 - x 2 = 0
¶l solution
© 2018 D. Kirschen and University of Washington 71
Incremental Cost

C1 ( x 1 ) C2 ( x 2 )
Cost curves:

x1 x2

dC 1 dC 2
Incremental dx 1 dx 2
cost curves:

x1 x2
© 2018 D. Kirschen and University of Washington 72
Interpretation of this solution
dC 1 dC 2
dx 1 dx 2

x1 x2

-
L -
+

If < 0, reduce λ
L - x1 - x 2 If > 0, increase λ
© 2018 D. Kirschen and University of Washington 73
Physical interpretation
dC DC
= lim
C( x ) dx Dx®0 Dx

DC For Dx sufficiently small:


Dx dC
DC » ´ Dx
dx
x If Dx = 1 MW :
dC(x) dC
DC »
dx dx
The incremental cost is the cost of
one additional MW for one hour.
This cost depends on the output of
x the generator.
© 2018 D. Kirschen and University of Washington 74
Physical interpretation
dC 1
: Cost of one more MW from unit 1
dx 1
dC 2
: Cost of one more MW from unit 2
dx 2
dC 1 dC 2
Suppose that >
dx 1 dx 2
dC 1
Decrease output of unit 1 by 1MW Þ decrease in cost =
dx 1
dC 2
Increase output of unit 2 by 1MW Þ increase in cost =
dx 2
dC 2 dC 1
Net change in cost = - <0
© 2018 D. Kirschen and University of Washington dx 2 dx 1 75
Physical interpretation

It pays to increase the output of unit 2 and decrease the


output of unit 1 until we have:

dC 1 dC 2
= =l
dx 1 dx 2

The Lagrange multiplier λ is thus the cost of one more MW


at the optimal solution.

This is a very important result with many applications in


economics.

© 2018 D. Kirschen and University of Washington 76


Generalization
Minimise
f ( x 1 , x 2 ,… , x n )
subject to:
w 1 ( x 1 , x 2 ,… , x n ) = 0

w m ( x 1 , x 2 ,… , x n ) = 0
Lagrangian:
= f ( x 1 ,… , x n ) + l 1 w 1 ( x 1 ,… , x n ) + + l m w m ( x 1 ,… , x n )
• One Lagrange multiplier for each constraint
• n + m variables: x1, …, xn and λ1, …, λm

© 2018 D. Kirschen and University of Washington 77


Optimality conditions
= f ( x 1 ,… , x n ) + l 1 w 1 ( x 1 ,… , x n ) + + l m w m ( x 1 ,… , x n )
¶ ¶f ¶w 1 ¶w m
= + l1 + +lm =0
¶x 1 ¶x 1 ¶x 1 ¶x 1
n equations
¶ ¶f ¶w 1 ¶w m
= + l1 + +lm =0
¶x n ¶x n ¶x n ¶x n

= w1 ( x1 , ,x n ) = 0
¶l 1
m equations


= w m ( x1 , ,x n ) = 0 n + m equations in
¶l m n + m variables
© 2018 D. Kirschen and University of Washington 78
Optimization with inequality constraints
Minimise
f ( x 1 , x 2 ,… , x n ) Objective function
subject to:
w 1 ( x 1 , x 2 ,… , x n ) = 0
Equality constraints

w m ( x 1 , x 2 ,… , x n ) = 0
and:
g1 ( x 1 , x 2 ,… , x n ) £ 0
Inequality constraints
g p ( x 1 , x 2 ,… , x n ) £ 0
© 2018 D. Kirschen and University of Washington 79
Example: Economic Dispatch
x 1min £ x 1 £ x 1max
x1 x2
L
G1 G2 x 2min £ x 2 £ x 2max

Minimise C = a1 + b1 x 12 + a 2 + b 2 x 22
Subject to:
x1 + x 2 = L Equality constraints

x 1 - x 1max £ 0

x 1min - x 1 £ 0
Inequality constraints
x2 - x max
2 £0
x 2min - x 2 £ 0
© 2018 D. Kirschen and University of Washington 80
Example: Economic Dispatch
Minimise C = a1 + b1 x 12 + a 2 + b 2 x 22 Family of ellipses

x2 Ellipse tangent to equality constraint at A


Inequality constraints are satisfied
x1 + x 2 = L

x2max

A
x2min

min x1max x1
x1
© 2018 D. Kirschen and University of Washington 81
Example: Economic Dispatch
What is the solution for a larger load?

x2 Ellipse tangent to equality constraint at B


Inequality constraints are NOT satisfied!

x1 + x 2 = L x 1 + x 2 = L'

x2max

A B
x2min

x1min x1max x1
© 2018 D. Kirschen and University of Washington 82
Example: Economic Dispatch
C is the solution because it is the point on
the equality constraint that satisfies the
x2 inequality constraints at minimum cost

x1 + x 2 = L x 1 + x 2 = L'

x2max

A B
x2min

x1min x1max x1
© 2018 D. Kirschen and University of Washington 83
Binding Inequality Constraints
• A binding inequality constraint is an inequality constraint that is
satisfied exactly
• Example:
– If we must have x1 ≤ x1max
– And at the solution we have x1 = x1max
– Then the constraint x1 ≤ x1max is said to be binding
• ALL of the inequality constraints must be satisfied
• Only a FEW will be binding (or active) at any given time
• But we don’t know ahead of time which inequality constraints
will be binding!
• All equality constraints are always binding

© 2018 D. Kirschen and University of Washington 84


Solution using Lagrange multipliers
Minimise f ( x 1 , x 2 ,… , x n )
subject to:
w i ( x 1 , x 2 ,… , x n ) = 0 i = 1,...m
g j ( x 1 , x 2 ,… , x n ) £ 0 j = 1,... p

Lagrangian function:
( )
x 1 ,… , x n , l 1 ,..., l m , m 1 ,..., m p = f ( x 1 ,… , x n )
m
+ å l i w i ( x 1 ,… , x n )
i=1

+ å m j g j ( x 1 ,… , x n )
j =1
© 2018 D. Kirschen and University of Washington 85
Optimality Conditions
(Known as the Karush Kuhn Tucker (KKT) conditions
m p

( x ,l ,m ) = f ( x ) + å l i w i ( x ) + å m j g j ( x )
i=1 j =1

¶ ( x , l , m ) ¶f ( x ) m ¶w k ( x ) p ¶g j ( x )
º + ål k + åm j =0 i = 1,...n
¶x i ¶x i k =1 ¶x i j =1 ¶x i
¶ ( x ,l ,m )
º w k ( x) = 0 k = 1,...m
¶l k
gj (x)£ 0 j = 1,... p
m j g j ( x) = 0 j = 1,... p
mj ³0 Complementary Slackness Conditions j = 1,... p
© 2018 D. Kirschen and University of Washington 86
Complementary slackness conditions
m j g j ( x) = 0
mj ³0

Two possibilities for each constraint j:

m j = 0 then the constraint g j ( x ) is non - binding Þ g j ( x ) < 0

OR

g j ( x ) = 0 then the constraint g j ( x ) is binding Þ m j > 0

© 2018 D. Kirschen and University of Washington 87


Warning!
• Difficulty with the complementary slackness
conditions

– They tell us that an inequality constraint is either


binding or non-binding
– They DON’T tell us which constraints are binding
and non-binding
– The binding constraints have to be identified
through trial and error

© 2018 D. Kirschen and University of Washington 88


Example
Minimise
f ( x 1 , x 2 ) = 0.25 x + x
2
1
2
2

Subject to:
w ( x1 ,x 2 ) º 5 - x1 - x 2 = 0
g ( x 1 , x 2 ) º x 1 + 0.2 x 2 - 3 £ 0

© 2018 D. Kirschen and University of Washington 89


Example
x2
g ( x 1 , x 2 ) º x 1 + 0.2 x 2 - 3 £ 0

f ( x 1 , x 2 ) = 0.25 x 12 + x 22

x1

© 2018 D. Kirschen and University of Washington


w ( x1 , x 2 ) º 5 - x1 - x 2 = 0 90
Example
( x 1 , x 2 , l , m ) = f ( x 1 , x 2 ) + lw ( x 1 , x 2 ) + mg ( x 1 , x 2 )
= 0.25 x 12 + x 22 + l ( 5 - x 1 - x 2 ) + m ( x 1 + 0.2 x 2 - 3 )


º 0.5x1 - l + m = 0
¶x1

º 2x2 - l + 0.2 m = 0
¶x2

º 5 - x1 - x2 = 0
¶l

º x1 + 0.2x2 - 3 £ 0
¶m
m g(x) º m ( x1 + 0.2x2 - 3) = 0 and m ³ 0
© 2018 D. Kirschen and University of Washington 91
Example
KKT conditions do not tell us if inequality constraint is binding
Must use a trial and error approach
Trial 1: Assume inequality constraint is not binding μ = 0

From solution of example without inequality constraint, we


know that the solution is then:
x 1 = 4 ;x 2 = 1
but this means that:
x 1 + 0.2 x 2 - 3 = 1.2 ³ 0

This solution is thus not an acceptable solution

© 2018 D. Kirschen and University of Washington 92


Example
Trial 2: Assume that the inequality constraint is binding


º 5 - x1 - x 2 = 0 x 1 = 2.5
¶l
¶ x 2 = 2.5
º x 1 + 0.2 x 2 - 3 = 0
¶m

º 0.5 x 1 - l + m = 0 l = 5.9375
¶x 1
¶ m = 4.6875
º 2 x 2 - l + 0.2 m = 0
¶x 2

All KKT conditions are satisfied. This solution is acceptable


© 2018 D. Kirschen and University of Washington 93
Example: graphical solution
x2
g ( x 1 , x 2 ) º x 1 + 0.2 x 2 - 3 £ 0

Solution of problem
with inequality constraint

Solution of problem
f ( x 1 , x 2 ) = 0.25 x + x 2
1
2
2 without inequality
constraint

x1
Solution of problem
without constraints
w ( x1 , x 2 ) º 5 - x1 - x 2 = 0
© 2018 D. Kirschen and University of Washington 94
Application to Economic Dispatch
x1 x2
L
G1 G2

minimise f ( x 1 , x 2 ) = C 1 ( x 1 ) + C 2 ( x 2 )
s.t . w ( x 1 , x 2 ) º L - x 1 - x 2 = 0
g1 ( x 1 , x 2 ) º x 1 - x 1max £ 0
x 1min £ x 1 £ x 1max
g 2 ( x 1 , x 2 ) º x 1min - x 1 £ 0

g 3 ( x 1 , x 2 ) º x 2 - x 2max £ 0
x 2min £ x 2 £ x 2max
g 4 ( x 1 , x 2 ) º x 2min - x 2 £ 0

© 2018 D. Kirschen and University of Washington 95


Application to Economic Dispatch
( x 1 , x 2 ,l ,m 1 ,m 2 ,m 3 ,m 4 ) = C1 ( x 1 ) + C 2 ( x 2 ) + l ( L - x 1 - x 2 )
+ m 1 ( x 1 - x 1max ) + m 2 ( x 1min - x 1 )

+ m 3 ( x 2 - x 2max ) + m 4 ( x 2min - x 2 )
KKT Conditions:

¶ dC 1
º - l + m1 - m 2 = 0
¶x 1 dx 1
¶ dC 2
º -l +m3 -m4 = 0
¶x 2 dx 2

º L - x1 - x 2 = 0
¶l
© 2018 D. Kirschen and University of Washington 96
Application to Economic Dispatch
KKT Conditions (continued):


º x 1 - x 1max £ 0 m 1 ( x 1 - x 1max ) = 0 ; m 1 ³ 0
¶m 1


º x 1min - x 1 £ 0 m 2 ( x 1min - x 1 ) = 0 ; m 2 ³ 0
¶m 2


º x 2 - x 2max £ 0 m 3 ( x 2 - x 2max ) = 0 ; m 3 ³ 0
¶m 3

º x 2min - x 2 £ 0 m 4 ( x 2min - x 2 ) = 0 ; m 4 ³ 0
¶m 4

© 2018 D. Kirschen and University of Washington 97


Solving the KKT Equations
Case #1: No generator is at a limit
No inequality constraint is binding and all μ’s are equal to zero

¶ dC 1
º -l =0
¶x 1 dx 1 dC 1 dC 2
= =l
¶ dC 2 dx 1 dx 2
º -l =0
¶x 2 dx 2

º L - x1 - x 2 = 0
¶l

All generators operate at the same incremental cost

© 2018 D. Kirschen and University of Washington 98


Solving the KKT Equations
Case #2: Generator 1 is at its upper limit; Other limits not binding
x1 - x1max = 0 Þ m1 ³ 0; m2 = m3 = m4 = 0
¶ dC 1 dC 1
º - l + m1 = 0 = l - m1 £ l
¶x 1 dx 1 dx 1
¶ dC 2 dC 2
º -l =0 =l
¶x 2 dx 2 dx 2

All generators do NOT operate at the same incremental cost!

The incremental cost of unit 1 is lower…. Why?

If that was possible, more power would be produced by unit 1


© 2018 D. Kirschen and University of Washington 99
Solving the KKT Equations
Case #3: Generator 1 is at its lower limit; other limits not binding
x1min - x1 = 0 Þ m2 ³ 0; m1 = m3 = m4 = 0
¶ dC 1 dC 1
º -l -m2 = 0 = l + m2 ³ l
¶x 1 dx 1 dx 1
¶ dC 2 dC 2
º -l =0 =l
¶x 2 dx 2 dx 2

Again, all generators do NOT operate at the same incremental cost!

The incremental cost of unit 1 is higher… Why?


If that was possible, less power would be produced by unit 1
© 2018 D. Kirschen and University of Washington 100
Physical Interpretation of Lagrange Multipliers

Minimise C ( x )
subject to: w ( x ) = L Û L - w ( x ) = 0
and: g( x) ³ K Û K - g( x ) £ 0
( x ,l ,m ) = C ( x ) + l ( L - w ( x ) ) + m ( K - g ( x ) )
At the optimum x * , l * , m * : =0 =0
( x *
, l *
, m *
) = C ( x *
)

= l * Marginal cost of equality constraint
¶L Optimum

= m* Marginal cost of inequality constraint
¶K Optimum
© 2018 D. Kirschen and University of Washington 101
Physical Interpretation of Lagrange Multipliers

• Constraints always increase the cost of a


solution
• The Lagrange multipliers give the incremental
cost of the binding constraints at the optimum
• They are sometimes called shadow costs
• Non-binding inequality constraints have a zero
incremental cost

© 2018 D. Kirschen and University of Washington 102


Economic Dispatch

Example of Calculation Using


Lagrange Multipliers
Economic Dispatch Example

A load of 800 MW is supplied by three generating units.


The cost characteristics of these generating units are
given by the following expressions:

C1 = 100 + 8 P1 + 0.1 P12 [$/h] 230 ≤ P1 ≤ 400 MW

C2 = 200 + 7 P2 + 0.06 P22 [$/h] 100 ≤ P2 ≤ 500 MW

C3 = 250 + 9 P3 + 0.07 P32 [$/h] 100 ≤ P3 ≤ 260 MW

Calculate the optimal economic dispatch.

© 2018 D. Kirschen and University of Washington 104


Example: Form the Lagrangian
= 100 + 8P1 + 0.1P 1
2

+200 + 7P2 + 0.06P 2


2

+250 + 9P3 + 0.07P 3


2

+ l (L - P1 - P2 - P3 )
+ m1 (P1 - 400) + m2 (230 - P1 )
+ m3 (P2 - 500) + m4 (100 - P2 )
+ m5 (P3 - 260) + m6 (100 - P3 )
© 2018 D. Kirschen and University of Washington 105
Example: Optimality Conditions
Set the partial derivatives of the Lagrangian with respect to the
decision variables and λ to zero:

º 8 + 0.2P1 - l + m1 - m2 = 0 (1)
¶P1

º 7 + 0.12P2 - l + m 3 - m 4 = 0 (2)
¶P2

º 9 + 0.14P3 - l + m5 - m6 = 0 (3)
¶P3

º L - P1 - P2 - P3 = 0 (4)
¶l
© 2018 D. Kirschen and University of Washington 106
Example: Optimality Conditions
Set the partial derivatives of the Lagrangian with respect to the
μ’s to zero:


º P1 - 400 £ 0
¶ m1

º 230 - P1 £ 0
¶ m2

º P2 - 500 £ 0
¶ m3

© 2018 D. Kirschen and University of Washington 107


Example: Optimality Conditions
Set the partial derivatives of the Lagrangian with respect to the
μ’s to zero:


º 100 - P2 £ 0
¶m4

º P3 - 260 £ 0
¶ m5

º 100 - P3 £ 0
¶ m6

© 2018 D. Kirschen and University of Washington 108


Example: Complementary slackness
m1.(P1 - 400) = 0; m1 ³ 0

m2 .(230 - P1 ) = 0; m2 ³ 0

m3 .(P2 - 500) = 0; m3 ³ 0

m4 .(100 - P2 ) = 0; m4 ³ 0

m5 .(P3 - 260) = 0; m5 ³ 0

m6 .(100 - P3 ) = 0; m6 ³ 0
© 2018 D. Kirschen and University of Washington 109
Example: First Trial (1)
Assume that none of the inequality constraints is binding
This means that all the μ‘s are zero
Set the μ’s equal to zero in the optimality conditions.
Equations (1) to (3) become:
¶ l-8
º 8 + 0.2P1 - l = 0 Þ P1 =
¶P1 0.2
¶ l-7
º 7 + 0.12P2 - l = 0 Þ P2 =
¶P2 0.12
¶ l-9
º 9 + 0.14P3 - l = 0 Þ P3 =
¶P3 0.14
© 2018 D. Kirschen and University of Washington 110
Example: First Trial (2)
Inserting these expressions in Equation (4), we get:

L - 5(l - 8) - 8.33(l - 7) - 7.14(l - 9) = 0


With L = 800MW, we get: l = 46.96 $/MWh
Replacing λ in the equations on the previous slide, we have:

P1 = 194.8 MW <P
1
min
= 230 MW
Not a valid solution
P2 = 333.0 MW  trial fails

P3 = 271.2 MW >P
3
max
= 260 MW
© 2018 D. Kirschen and University of Washington 111
Example: Second Trial (1)
We must try another combination of binding constraints.

6 inequality constraints  26 = 64 possible combinations


Realistic system  ridiculously large number of combinations

Must use information from previous trials

Let us try:

P1 = P1min = 230 MW Þ m2 ¹ 0
P3 = P 3
max
= 260 MW Þ m5 ¹ 0
m1 = m3 = m4 = m6 = 0
© 2018 D. Kirschen and University of Washington 112
Example: Second Trial (2)

L - P1 - P2 - P3 = 0

P1 = P1min = 230 MW Þ P2 = 310 MW

P3 = P 3
max
= 260 MW

However, we must check that the μ‘s meet the


complementary slackness conditions

© 2018 D. Kirschen and University of Washington 113


Example: Second Trial (3)
m1 = m3 = m4 = m6 = 0

º 8 + 0.2P1 - l - m2 = 0 Þ m2 = 9.8 $/MWh
¶P1

º 7 + 0.12P2 - l = 0 Þ l = 44.2 $/MWh
¶P2

º 9 + 0.14P3 - l + m5 = 0 Þ m5 = -1.2 $/MWh
¶P3

© 2018 D. Kirschen and University of Washington


£ 0! 114
Example: Second Trial (4)
The constraint P3 £ P 3
max
should not be binding!
What is happening?

First trial:
P1
P1
P
1
min P1
max

P2
P2
P2min P2max

P3
P3
P 3
min
P3
max

© 2018 D. Kirschen and University of Washington 115


Example: Second Trial (5)
In the second trial, we “pushed” P1 towards its lower limit and P3
towards its upper limit. However, there was no need to push P3
because increasing P1 would naturally reduce P3 below its limit.
Second trial:
P1

P1
P
1
min P
1
max

P2
P2
P2min P2max
P3
P3
P 3
min
P
3
max

© 2018 D. Kirschen and University of Washington 116


Example: Third Trial (1)
P1 = P1min = 230 MW Þ m2 ¹ 0
m1 = m3 = m4 = m5 = m6 = 0


º 7 + 0.12P2 - l = 0
¶P2 l = 44.75 $/MWh
¶ P2 = 315 MW
º 9 + 0.14P3 - l = 0
¶P3
P3 = 255 MW

º L - P1 - P2 - P3 = 0
¶l
© 2018 D. Kirschen and University of Washington 117
Example: Third Trial (2)

º 8 + 0.2P1 - l - m2 = 0 Þ m2 = 9.25 $/MWh
¶P1
Solution that satisfies all the optimality conditions:

P1 = 230 MW
P2 = 315 MW
P3 = 255 MW
l = 44.75 $/MWh  Cost of an extra MW of load
m2 = 9.25 $/MWh  Value of reducing P1min by 1MW
© 2018 D. Kirschen and University of Washington 118
Example: Optimal Solution

Third trial:
P1

P1
P
1
min P
1
max

P2
P2
P2min P2max
P3
P3
P 3
min
P 3
max

© 2018 D. Kirschen and University of Washington 119


Practical Economic Dispatch
Equal Incremental Cost Dispatch

dC A dC B dC C
dPA dPB dPC

PA PB PC

PA + PB + PC
© 2018 D. Kirschen and University of Washington 121
Lambda search algorithm
1. Choose a starting value for l

¶C A (PA ) ¶C B (PB ) ¶C C (PC )


2. Calculate PA ,PB , PC such that = = =l
¶PA ¶PB ¶PC

3. If one of these values exceeds its lower or upper limit, fix it at that limit

4. Calculate PTOTAL = PA + PB + PC

5. If PTOTAL < L, then increase l


Else If PTOTAL > L, then decrease l
Else If PTOTAL » L, then exit

6. Go To Step 2
© 2018 D. Kirschen and University of Washington 122
Linear Cost Curves
CA CB

PA PB

PAMAX PBMAX

dC A dC B
dPA dPB

l
PA PB

PAMAX PBMAX

© 2018 D. Kirschen and University of Washington 123


Linear Cost Curves
CA CB

PA PB

PAMAX PBMAX

dC A dC B
dPA dPB

l
PA PB

PAMAX PBMAX

© 2018 D. Kirschen and University of Washington 124


Linear Cost Curves
CA CB

PA PB

PAMAX PBMAX

dC A dC B
dPA dPB

PA PB

PAMAX PBMAX

© 2018 D. Kirschen and University of Washington 125


Linear Cost Curves

• The output of the unit with the lowest


incremental cost (in this case unit A) is
increased first (it is “loaded” first)
• The output of the other units is not increased
until unit A is loaded up to its maximum
• The output of the unit with second lowest
incremental cost is then increased (i.e. the
“second cheapest” unit)
• And so on until the generation meets the load
© 2018 D. Kirschen and University of Washington 126
Linear cost curves with minimum generation
CA CB

PA PB

PAMIN PAMAX PBMIN PBMAX

dC A dC B
dPA dPB

PA PB

PAMIN PAMAX PBMIN PBMAX

© 2018 D. Kirschen and University of Washington 127


Linear cost curves with minimum generation

• All generating units are first loaded up to their


minimum generation
• The generating units are then loaded in order
of incremental cost

© 2018 D. Kirschen and University of Washington 128


Piecewise Linear Cost Curves
CA CB

PA PB

dC A dC B
dPA dPB

PA PB

© 2018 D. Kirschen and University of Washington 129


Economic Dispatch with Piecewise Linear Cost Curves

CA CB

PA PB

dC A dC B
dPA dPB

l
PA PB

© 2018 D. Kirschen and University of Washington 130


Economic Dispatch with Piecewise Linear Cost Curves

CA CB

PA PB

dC A dC B
dPA dPB

l
PA PB

© 2018 D. Kirschen and University of Washington 131


Economic Dispatch with Piecewise Linear Cost Curves

CA CB

PA PB

dC A dC B
dPA dPB

PA PB

© 2018 D. Kirschen and University of Washington 132


Economic Dispatch with Piecewise Linear Cost Curves

CA CB

PA PB

dC A dC B
dPA dPB

PA PB

© 2018 D. Kirschen and University of Washington 133


Economic Dispatch with Piecewise Linear Cost Curves

CA CB

PA PB

dC A dC B
dPA dPB

PA PB

© 2018 D. Kirschen and University of Washington 134


Economic Dispatch with Piecewise Linear Cost Curves

• All generators except one are at breakpoints of their cost


curve
• The marginal generator is between breakpoints to balance the
load and generation
• Not well-suited for lambda-search algorithm
• Very fast table lookup algorithm:
– Rank all the segments of the piecewise linear cost
curves in order of incremental cost
– First dispatch all the units at their minimum
generation
– Then go down the table until the generation
matches the load
© 2018 D. Kirschen and University of Washington 135
Example
dC A
dPA
Unit PSegment Ptotal Lambda
0.7 A&B min 20+30 = 50 50
B 70-20=50 100 0.1
0.5
0.3 A 80-30=50 150 0.3
A 120-80=40 190 0.5
30 80 120 150 PA B 110-70=40 230 0.6
A 150-120=30 260 0.7
B 140-110=30 290 0.8
dC B
dPB

0.8 If Pload = 210MW


0.6 The optimal economic dispatch is:
PA = 120MW
0.1 PB = 90 MW
20 70 110 140
PB λ = 0.6
© 2018 D. Kirschen and University of Washington 136
Local and Global Optima

© 2015 Daniel Kirschen and


University of Washington 137
Which one is the real maximum?

f(x)

A D x

df d2 f
For x = A and x = D, we have: = 0 and <0
dx dx 2

© 2015 Daniel Kirschen and University of


Washington

138
Which one is the real optimum?

x2

x1

© 2015 Daniel Kirschen and University of


Washington

139
Local and Global Optima
• The optimality conditions are local conditions
• They do not compare separate optima
• If I find an optimum can I be sure that it is the
global optimum?
• In general, to find the global optimum, we
must find and compare all the optima
• In large problems, this can be very difficult
and time consuming

© 2015 Daniel Kirschen and University of Washington 140


Convexity

• If the feasible set is convex and the objective


function is convex, there is only one minimum
and it is thus the global minimum

© 2015 Daniel Kirschen and University of Washington 141


Examples of Convex Feasible Sets

x2 x2

x1 x1

x2

x1 x1
x1 min x1 max
© 2015 Daniel Kirschen and University of Washington

142
Example of Non-Convex Feasible Sets

x2 x2

x1 x1

x2
x1

x1 x1
x1 a x1 b c
x1 x1 d
© 2015 Daniel Kirschen and University of
Washington

143
Example of Convex Feasible Sets

A set is convex if, for any two points belonging to the set, all the
points on the straight line joining these two points belong to the set
x2 x2

x1 x1

x2

min max
x1 x1
x1 x1

© 2015 Daniel Kirschen and University of Washington 144


Example of Non-Convex Feasible Sets

x2 x2

x1 x1

x2
x1

x1
x1a x1b x1c x1d x1

© 2015 Daniel Kirschen and University of Washington 145


Example of Convex Function

f(x)

© 2015 Daniel Kirschen and University of


Washington

146
Example of Convex Function

x2

x1

© 2015 Daniel Kirschen and University of Washington 147


Example of Non-Convex Function

f(x)

© 2015 Daniel Kirschen and University of Washington


148
Example of Non-Convex Function

x2

x1

© 2015 Daniel Kirschen and University of Washington 149


Definition of a Convex Function
f(x)

f(y)

xa y xb x

A convex function is a function such that, for any two points xa and xb
belonging to the feasible set and any k such that 0 ≤ k ≤1, we have:

z = kf ( x a ) + (1- k ) f ( x b ) ³ f ( y ) = f [ kx a + ( 1- k ) x b ]

© 2015 Daniel Kirschen and University of Washington


150
Example of Non-Convex Function

f(x)

© 2015 Daniel Kirschen and University of Washington


151
Importance of Convexity

• If we can prove that a minimization problem is convex:


– Convex feasible set
– Convex objective function
Then, the problem has one and only one solution

• Proving convexity is often difficult


• Power system problems are usually not convex
There may be more than one solution to power system
optimization problems

© 2015 Daniel Kirschen and University of Washington 152


Unit Commitment
Daniel Kirschen

© 2015 Daniel Kirschen and the


153
University of Washington
Economic Dispatch: Problem Definition
• Given load
• Given set of units on-line
• How much should each unit generate to meet
this load at minimum cost?

L
A B C

© 2015 Daniel Kirschen and the University of


154
Washington
Unit Commitment

• Given load profile


(e.g. values of the load for each hour of a day)
• Given set of units available
• When should each unit be started, stopped
and how much should it generate to meet the
load at minimum cost?
? ? ?
Load Profile
G G G

© 2015 Daniel Kirschen and the University of Washington 155


Typical summer and winter loads

Figure courtesy of National Grid (UK) 156


A Simple Example
• Unit 1:
• PMin = 250 MW, PMax = 600 MW
• C1 = 510.0 + 7.9 P1 + 0.00172 P12 $/h
• Unit 2:
• PMin = 200 MW, PMax = 400 MW
• C2 = 310.0 + 7.85 P2 + 0.00194 P22 $/h
• Unit 3:
• PMin = 150 MW, PMax = 500 MW
• C3 = 78.0 + 9.56 P3 + 0.00694 P32 $/h
• What combination of units 1, 2 and 3 will produce 550 MW at minimum cost?
• How much should each unit in that combination generate?

© 2015 Daniel Kirschen and the University of Washington 157


Cost of the various combinations

Example borrowed from Wood and Wollenberg’s Power Generation, Operation and Control 158
Observations on the example:

• Far too few units committed:


Can’t meet the demand
• Not enough units committed:
Some units operate above optimum
• Too many units committed:
Some units below optimum
• Far too many units committed:
Minimum generation exceeds demand

© 2015 Daniel Kirschen and the University of Washington 159


Effect of the no-load cost
• Example:
C1 = 510 + 7.9P1 + 0.00172P12
• Economic dispatch looks
No-load cost only at marginal cost:

dC1
= 7.9 + 0.00344 P1
• dP1
This example considered the total cost
• The no-load cost affects the solution

© 2015 Daniel Kirschen and the University of


160
Washington
Another Example

• Optimal generation schedule


for a load profile Load
• Decompose the profile into a
set of period 1000

• Assume load is constant over


each period 500

• For each time period, which Time


units should be committed to 0 6 12 18 24

generate at minimum cost


during that period?

Example borrowed from Wood and Wollenberg’s Power Generation, Operation and Control 161
Optimal combination for each hour

Example borrowed from Wood and Wollenberg’s Power Generation, Operation and Control 162
Matching the combinations to the load

Load
Unit 3

Unit 2

Unit 1

0 12 24
Time
6 18

© 2015 Daniel Kirschen and the University of Washington 163


Unit commitment as an optimization problem

• Minimize total cost over time horizon


– Total cost = running cost + startup cost
• Constraints
– Unit constraints
– System constraints

• Time horizon is divided in a set of optimization periods:


• During each period:
– The load is assumed constant
– The decision variables are constant

© 2015 Daniel Kirschen and the University of Washington 164


Notations

u(i,t) : Status of unit i at period t

u(i,t) = 1: Unit i is ON during period t

u(i,t) = 0 : Unit i is OFF during period t

p(i,t) : Power produced by unit i during period t

Ci [ p(i,t)] : Running cost of unit i during period t

SCi [u(i,t)] : Startup cost of unit i during period t

N: Number of available generating units

T: Number of periods in the optimization horizon

© 2015 Daniel Kirschen and the University of Washington 165


Running cost

• Cost of generating power with a given unit


• Depends on the power output of the unit
• Same cost function as used in economic
dispatch
• Includes the no-load cost

© 2015 Daniel Kirschen and the University of Washington 166


Start-up cost
• Thermal generating units:
– Coal, gas, oil, biomass
• These units must be “warmed up” before they
can be brought on-line
• Warming up a unit requires fuel and therefore
costs money
• Incurred only during the first period when the
unit is turned on

© 2015 Daniel Kirschen and the University of Washington 167


Start-up cost

• Start-up cost depends on time unit has been


off
– If the unit has not been off for a long time, the
water will still be warm
– Hot start vs. cold start
t iOFF
-
SC i (t OFF
i ) = a i + b i (1 - e t i )

αi + βi

αi

tiOFF

© 2015 Daniel Kirschen and the University of Washington 168


Effect of the start-up cost
• Need to “balance” start-up costs and running
costs
• Example:
– Diesel generator: low start-up cost, high running cost
– Coal plant: high start-up cost, low running cost
• Issues:
– How long should a unit run to “recover” its start-up
cost?
– Start-up one more large unit or a diesel generator to
cover the peak?
– Shutdown one more unit at night or run several units
part-loaded?

© 2015 Daniel Kirschen and the University of Washington 169


Objective function

T N

min åå{C [ p(i,t)]+ SC [u(i,t)]}


u(i,t ); x(i,t ) t=1 i=1
i i

Running cost Startup cost


Decision
variables

© 2015 Daniel Kirschen and the University of Washington 170


Unit Constraints

• Constraints that affect each unit individually:


– Maximum generating capacity
– Minimum stable generation
– Minimum “up time”
– Minimum “down time”
– Ramp rate

© 2015 Daniel Kirschen and the University of


171
Washington
Unit Constraints
• Minimum up time
– Once a unit is running it may not be shut down
immediately:
If u(i,t) = 1 and tiup < tiup,min then u(i,t +1) = 1

• Minimum down time


– Once a unit is shut down, it may not be started
immediately
If u(i,t) = 0 and tidown < tidown,min then u(i,t +1) = 0

© 2015 Daniel Kirschen and the University of


172
Washington
Unit Constraints
• Maximum ramp rates
– To avoid damaging the turbine, the electrical output of a
unit cannot change by more than a certain amount over a
period of time:

Maximum ramp up rate constraint:


p (i,t +1) - p (i,t ) £ DPi up,max

Maximum ramp down rate constraint:


p(i,t) - p(i,t +1) £ DPi down,max

© 2015 Daniel Kirschen and the University of Washington 173


System Constraints

• Constraints that affect more than one unit


– Load/generation balance
– Reserve generation capacity
– Emission constraints
– Network constraints

© 2015 Daniel Kirschen and the University of Washington 174


Load/Generation Balance Constraint

At all times, the power produced by the generating


units must be equal to the load
N

åu(i,t)p(i,t) = L(t)
i=1

© 2015 Daniel Kirschen and the University of Washington 175


Reserve Constraint
• Unanticipated loss of a generating unit or an
interconnection causes unacceptable frequency
drop if not corrected
• Need to increase production from other units to
keep frequency drop within acceptable limits
• Rapid increase in production only possible if
committed units are not all operating at their
maximum capacity
• Some of the capacity of the generating units must
be kept “in reserve”
© 2015 Daniel Kirschen and the University of Washington 176
Reserve Constraint

Pi max - p(i,t) : Contribution of unit i to reserve at


period t (“headroom”)
N

å u(i,t)[Pi
max
- p(i,t)] ³ R(t) Reserve requirement at period t
i=1
N

åu(i,t)p(i,t) = L(t) Load generation balance


i=1

åu(i,t)P i
max
³ L(t)+ R(t) Reserve constraint at period t
i=1

© 2015 Daniel Kirschen and the University of Washington 177


How much reserve?

• Protect the system against “credible outages”


• Reserve requirement:
– Capacity of largest unit or interconnection
– Percentage of peak load

© 2015 Daniel Kirschen and the University of Washington 178


Types of Reserve
• Spinning reserve
– Primary
• Quick response for a short time
– Secondary
• Slower response for a longer time
• Tertiary reserve
– Replace primary and secondary reserve to protect
against another outage
– Provided by units that can start quickly
• e.g. gas turbines
– Also called scheduled or off-line reserve
© 2015 Daniel Kirschen and the University of Washington 179
Cost of Reserve

• Reserve has a cost even when it is not called


– More units scheduled than required
• Units not operated at their maximum efficiency
• Extra start up costs
– Must build units capable of rapid response
– Cost of reserve proportionally larger in small
systems
• Important driver for the creation of interconnections
between systems

© 2015 Daniel Kirschen and the University of


180
Washington
Emission Constraints
• Amount of pollutants that generating units can emit may be limited
• Pollutants:
– SO2, NOx
• Various forms:
– Limit on each plant at each hour
– Limit on plant over a year
– Limit on a group of plants over a year
– Etc…

© 2015 Daniel Kirschen and the University of Washington 181


Network Constraints

• Transmission network may have an effect on


the commitment of units
– Some units must run to provide voltage support
– The output of some units may be limited because
their output would exceed the transmission
capacityAof the network B

Cheap generators More expensive generator


May be “constrained off” May be “constrained on”

© 2015 Daniel Kirschen and the University of Washington 182


Why can’t we treat each period separately?

• Large units are efficient but have a substantial


startup cost
– Need to “amortize” this startup cost over the
optimization horizon

• Some constraints create a link between the


periods
– Minimum up- and down-time constraint
– Ramping constraints

© 2015 Daniel Kirschen and the University of Washington 183


Economic Dispatch vs. Unit Commitment

• Generation scheduling or unit commitment is


a more general problem than economic
dispatch
• Economic dispatch is a sub-problem of
generation scheduling
• Unit commitment must strike a balance
between cheaper inflexible units and more
expensive flexible units

© 2015 Daniel Kirschen and the University of Washington 184


Flexible Plants
• Power output can be adjusted (within limits)
• Examples:
– Coal-fired
– Oil-fired Thermal units
– Open cycle gas turbines
– Combined cycle gas turbines
– Hydro plants with storage
• Status and power output can be optimized

© 2015 Daniel Kirschen and the University of Washington 185


Inflexible Plants

• Power output cannot be adjusted for technical


or commercial reasons
• Examples:
– Nuclear
– Run-of-the-river hydro
– Renewables (wind, solar,…)
– Combined heat and power (CHP, cogeneration)
• Output treated as given when optimizing

© 2015 Daniel Kirschen and the University of Washington 186


Solving the Unit Commitment Problem
• Decision variables:
– Status of each unit at each period:

u(i,t) Î{0,1}   " i,t

– Output of each unit at each period:


p(i,t) Î {0,éëPi min ; Pi max ùû}   " i,t

• Combination of integer and continuous variables

© 2015 Daniel Kirschen and the University of Washington 187


Optimization with integer variables
• Continuous variables
– Can follow the gradients or use LP
– Any value within the feasible set is OK

• Discrete variables
– There is no gradient
– Can only take a finite number of values
– Problem is not convex
– Must try combinations of discrete values

© 2015 Daniel Kirschen and the University of Washington 188


How many combinations are there?

111
• Examples
110

101 – 3 units: 8 possible


100 states
– N units: 2N possible
011

010

001 states
000

© 2015 Daniel Kirschen and the University of Washington 189


How many solutions are there anyway?

• Optimization over a
time horizon divided
into intervals
• A solution is a path
linking one combination
at each interval
• How many such paths
are there?
T= 1 2 3 4 5 6

© 2015 Daniel Kirschen and the University of Washington 190


How many solutions are there anyway?

Optimization over a time


horizon divided into intervals
A solution is a path linking
one combination at each
interval
How many such path are
there?
Answer: (2 N )( 2 N ) … ( 2 N ) = (2 N )
T

T= 1 2 3 4 5 6

© 2015 Daniel Kirschen and the University of Washington 191


The Curse of Dimensionality
• Example: 5 units, 24 hours

(2 N T
) = (2 )
5 24
= 6.2 10 35 combinations

• Processing 109 combinations/second, this


would take 1.9 1019 years to solve
• There are 100’s of units in large power
systems...
• Many of these combinations do not satisfy the
constraints
© 2015 Daniel Kirschen and the University of Washington 192
How do you Beat the Curse?

Brute force approach won’t work!

• Need to be smart
• Try only a small subset of all combinations
• Can’t guarantee optimality of the solution
• Try to get as close as possible within a
reasonable amount of time

© 2015 Daniel Kirschen and the University of Washington 193


Main Solution Techniques
• Characteristics of a good technique
– Solution close to the optimum
– Reasonable computing time
– Ability to model constraints
• Possible techniques
– Priority list / heuristic approach
– Dynamic programming
– Lagrangian relaxation
– Mixed Integer Programming State of the art
• Heuristic techniques (e.g particle swarm
optimization) are a waste of time
© 2015 Daniel Kirschen and the University of Washington 194
A Simple Unit Commitment Example

195
Unit Data

Min Min No-load Marginal Start-up


Pmin Pmax Initial
Unit up down cost cost cost
(MW) (MW) status
(h) (h) ($) ($/MWh) ($)

A 150 250 3 3 0 10 1,000 ON

B 50 100 2 1 0 12 600 OFF

C 10 50 1 1 0 20 100 OFF

© 2015 Daniel Kirschen and the University of Washington 196


Cost curves

C(p)

C B A

© 2015 Daniel Kirschen and the University of Washington 197


Demand Data

Hourly Demand
350
300
250
200
Load
150
100
50
0
1 2 3
Hours

Reserve requirements are not considered

© 2015 Daniel Kirschen and the University of Washington 198


Feasible Unit Combinations (states)

Combinations 1 2 3
Pmin Pmax
A B C 150 300 200
1 1 1 210 400
1 1 0 200 350
1 0 1 160 300
1 0 0 150 250
0 1 1 60 150
0 1 0 50 100
0 0 1 10 50
0 0 0 0 0

© 2015 Daniel Kirschen and the University of Washington 199


Transitions between feasible combinations

1 2 3
A B C
1 1 1
1 1 0
1 0 1
1 0 0 Initial State
0 1 1

© 2015 Daniel Kirschen and the University of Washington 200


Infeasible transitions: Minimum down time of unit A

1 2 3
A B C
1 1 1
1 1 0
1 0 1
1 0 0 Initial State
0 1 1
TD TU
A 3 3
B 1 2
C 1 1

© 2015 Daniel Kirschen and the University of Washington 201


Infeasible transitions: Minimum up time of unit B

1 2 3
A B C
1 1 1
1 1 0
1 0 1
1 0 0 Initial State
0 1 1
TD TU
A 3 3
B 1 2
C 1 1

© 2015 Daniel Kirschen and the University of Washington 202


Feasible transitions

1 2 3
A B C
1 1 1
1 1 0
1 0 1
1 0 0 Initial State
0 1 1

© 2015 Daniel Kirschen and the University of Washington 203


Operating costs

1 1 1 4

1 1 0 3 7

1 0 1
2 6
1 0 0 1
5

© 2015 Daniel Kirschen and the University of Washington 204


Economic dispatch

State Load PA PB PC Cost


1 150 150 0 0 1500
2 300 250 0 50 3500
3 300 250 50 0 3100
4 300 240 50 10 3200
5 200 200 0 0 2000
6 200 190 0 10 2100
7 200 150 50 0 2100
Unit Pmin Pmax No-load cost Marginal cost
A 150 250 0 10
B 50 100 0 12
C 10 50 0 20

© 2015 Daniel Kirschen and the University of Washington 205


Operating costs

1 1 1 4
$3200
1 1 0 3 7
$3100 $2100
1 0 1 2 6
$3500 $2100
1 0 0 1 5
$1500 $2000

© 2015 Daniel Kirschen and the University of Washington 206


Start-up costs

1 1 1 4
$3200
$0
1 1 0 $700 3 $0 7
$3100 $600 $2100
$600
1 0 1 2 $0 6
$100 $3500 $2100
$0
1 0 0 $0 1 5
$1500 $2000
Unit Start-up cost

A 1000
B 600
C 100

© 2015 Daniel Kirschen and the University of Washington 207


Accumulated costs

$5400
1 1 1 4
$3200
$0
1 1 0 $5200 $7300
$700 3 $0 7
$3100 $600 $2100
$600 $5100 $7200
1 0 1 2 $0 6
$100 $3500 $0
$2100
1 0 0 $1500 $7100
$0 1 5
$1500 $2000

© 2015 Daniel Kirschen and the University of Washington 208


Total costs

1 1 1 4

1 1 0 $7300
3 7
$7200
1 0 1 2 6

1 0 0 $7100
1 5

Lowest total cost

© 2015 Daniel Kirschen and the University of Washington 209


Optimal solution

1 1 1

1 1 0

1 0 1 2

$7100
1 0 0 1 5

© 2015 Daniel Kirschen and the University of Washington 210


Notes
• This example is intended to illustrate the
principles of unit commitment
• Some constraints have been ignored and others
artificially tightened to simplify the problem and
make it solvable by hand
• Therefore it does not illustrate the true
complexity of the problem
• The solution method used in this example is
based on dynamic programming. This technique
is no longer used in industry because it only
works for small systems (< 20 units)
© 2015 Daniel Kirschen and the University of Washington 211
Linear Programming (LP)

212
Motivation

• Many optimization problems are linear


– Linear objective function
– All constraints are linear
• Non-linear problems can be linearized:
– Piecewise linear cost curves
– DC power flow
• Efficient and robust method to solve such
problems

© 2011 Daniel Kirschen and University of Washington


213
Piecewise linearization of a cost curve

CA

PA

© 2011 Daniel Kirschen and University of Washington 214


Mathematical formulation

n
minimize Σ cj xj
j =1

n
subject to: Σ aij xj ≤ bi, i = 1, 2, . . ., m
j =1

n
Σ hij xj = di, i = 1, 2, . . ., p
j =1

Decision variables: xj

Constants: cj, aij, bi, hij, di

© 2011 Daniel Kirschen and University of Washington 215


Example 1

y
Maximize x + y 4

Subject to: x ≥ 0; y≥0


3
x≤3 Feasible
Region
y≤4 2
x+2y≥2
1

0 x
0 1 2 3

Example borrowed from Piyush Kumar of Florida State University)


Example 1

Maximize x + y
y
Subject to: x ≥ 0; y≥0 4
x≤3
3
y≤4
x+2y≥2
2

0 x
0 1 2 3
x+y=0
Example 1

Maximize x + y
y
Subject to: x ≥ 0; y≥0 4
x≤3
3
y≤4
x+2y≥2
2 Feasible
Solution
1

0 x
0 1 2 3
x+y=1
Example 1

Maximize x + y
y
Subject to: x ≥ 0; y≥0 4
x≤3
3
y≤4
x+2y≥2
2

1
Feasible
Solution
0 x
0 1 2 3
x+y=2
Example 1

Maximize x + y
y
Subject to: x ≥ 0; y≥0 4
x≤3
3
y≤4
x+2y≥2
2

0 x
0 1 2 3
x+y=3
Example 1

Maximize x + y Optimal
y Solution
Subject to: x ≥ 0; y≥0 4
x≤3
x+y=7
3
y≤4
x+2y≥2
2

0 x
0 1 2 3
Solving a LP problem (1)

• Constraints define a polyhedron in n


dimensions
• If a solution exists, it will be at an extreme
point (vertex) of this polyhedron
• Starting from any feasible solution, we can
find the optimal solution by following the
edges of the polyhedron
• Simplex algorithm determines which edge
should be followed next
© 2011 Daniel Kirschen and University of Washington
222
Which direction?

Maximize x + y Optimal
y Solution
Subject to: x ≥ 0; y≥0 4
x≤3
x+y=7
3
y≤4
x+2y≥2
2

0 x
0 1 2 3
3D Polyhedron

© 2011 Daniel Kirschen and University of Washington


Solving a LP problem (2)

• If a solution exists, the Simplex algorithm will


find it
• But it could take a long time for a problem
with many variables!
– Interior point algorithms

© 2011 Daniel Kirschen and University of Washington


225
Interior point methods

Extreme points
(vertices)

Constraints
(edges)

Simplex: search from vertex to Interior-point methods: go through


vertex along the edges the inside of the feasible space

© 2011 Daniel Kirschen and University of Washington 226


Conclusions

• Robustness of LP is an enormous advantage


– If there is a solution, it will be found
• Many non-linear optimization problems are
linearized so they can be solved using LP
• Very efficient implementation of LP solution
algorithms are available in commercial solvers

© 2011 Daniel Kirschen and University of Washington


227
Sequential Linear Programming (SLP)

• Used if more accuracy is required


• Algorithm:
– Linearize
– Find a solution using LP
– Linearize again around the solution
– Repeat until convergence

© 2011 Daniel Kirschen and University of Washington


228
Mixed Integer Linear
Programming
LP formulation of Economic Dispatch

CA

L
A B C

PA=x1

CA = c1.x1 CB PAMAX

CB = c2 .x2
CC = c3 .x3
PB=x2
x1 £ P A
MAX
CC PBMAX

x2 £ PBMAX
x3 £ PCMAX
PC=x3

PCMAX

© 2011 D. Kirschen & the University of Washington 230


LP formulation of Economic Dispatch

Minimize CT = c1 x1 + c2 x2 + c3 x3
Subject to: x1 + x2 + x3 = L
x1 ³ 0 x1 £ PAMAX
x2 ³ 0 x2 £ PBMAX
x3 ³ 0 x3 £ PCMAX

• Objective function is linear


• All constraints are all linear
• All variables are real
 Problem can be solved using standard linear programming

© 2011 D. Kirschen & the University of Washington 231


LP formulation of Economic Dispatch

CA

Minimize CT = c1 x1 + c2 x2 + c3 x3
Subject to: x1 + x2 + x3 = L a1
PA=x1

x1 ³ PAMIN CB PAMIN PAMAX

x2 ³ PBMIN
x3 ³ PCMIN a2 PB=x2

x1 £ PAMAX CC PBMIN PBMAX

x2 £ PBMAX
x3 £ PCMAX a3 PC=x3

PCMIN PCMAX

© 2011 D. Kirschen & the University of Washington 232


Can we use LP for unit commitment?

CA

x1 = 0 or PAMIN £ x1 £ PAMAX
a1
PA=x1

CB PAMIN PAMAX

x2 = 0 or PBMIN £ x2 £ PBMAX

a2
x3 = 0 or P MIN
£ x3 £ PMAX PB=x2
C C CC PBMIN PBMAX

a3 PC=x3

PCMIN PCMAX

© 2011 D. Kirschen & the University of Washington 233


Can we use LP for unit commitment?

CA
x1 = 0 or P A
MIN
£ x1 £ P
A
MAX

x2 = 0 or PBMIN £ x2 £ PBMAX a1
PA=x1

CB PAMIN PAMAX

x3 = 0 or PCMIN £ x3 £ PCMAX
a2 PB=x2

CC PBMIN PBMAX

The variables no longer have


a continuous domain.
Standard linear programming a3 PC=x3

is no longer applicable. PCMIN PCMAX

© 2011 D. Kirschen & the University of Washington 234


Integer Programming
• Integer programming:
– All decision variables are integers
– Special case: binary variables {0,1}
• Mixed Integer Programming
– Some decision variables are integer or binary
– Other variables are real
• Mixed Integer Linear Programming (MILP)
– Objective function and constraints are linear
• Mixed Integer Non-Linear Programming
(MINLP)
© 2011 D. Kirschen & the University of Washington 235
Example

Except for the fact that the variables are integer, this
looks very much like a linear programming problem.

© 2011 D. Kirschen & the University of Washington 236


Example

© 2011 D. Kirschen & the University of Washington 237


LP Relaxation

The LP solution “relaxes” the


constraints that all variables
can only take integer values

© 2011 D. Kirschen & the University of Washington 238


LP Relaxation

The relaxed LP solution is always


“better” than the solution of
original problem!
(Lower objective for minimization
problem, higher for maximization)

© 2011 D. Kirschen & the University of Washington 239


Solution of the integer problem

Can we find it by simply


“rounding” the LP solution
to the nearest integer?

© 2011 D. Kirschen & the University of Washington 240


Integer Programming Example

© 2011 D. Kirschen & the University of Washington 241


Naïve rounding off

x
2

-cT
x1

LP solution
IP solution

The optimal integer solution can be far away from the LP solution

© 2011 D. Kirschen & the University of Washington 242


Finding the integer solution

• Large number of integer variables


• Vast number of possible integer solutions
• Need a systematic procedure to search this
solution space
• Fix the variables to the nearest integer one at
a time
• “Branch and Bound” algorithm

© 2011 D. Kirschen & the University of Washington 243


Another example

Relaxed LP solution: (1.75, 0.75)

© 2011 D. Kirschen & the University of Washington 244


Branch on x1

Problem 0

x1 ³ 0; x2 ³ 0 x1 ³ 0 ; x2 ³ 0
x1 £ 1 x1 ³ 2

Problem 1 Problem 2

© 2011 D. Kirschen & the University of Washington 245


Branch on x1

Problem 2
Problem 1

Solution of
Problem 1 Solution of Problem 2

© 2011 D. Kirschen & the University of Washington 246


Search Tree: first layer

Solution of Problem 1: Solution of Problem 2:


• x1 integer • x1 & x2 integer
• x2 real • Feasible solution of
• Not a feasible solution yet the original problem
• Can still branch on x2 • Bound on the optimum
• Best solution so far

© 2011 D. Kirschen & the University of Washington 247


Branch on x2

Problem 1

x1 £ 1; x2 ³ 0

x1 ³ 0; x2 ³ 0 x1 ³ 0; x2 ³ 0
x1 £ 1; x2 £ 1 x1 £ 1; x2 ³ 2
Problem 3 Problem 4

© 2011 D. Kirschen & the University of Washington 248


Branch on x2 for Problem 1

Problem 2
Problem 1

Problem 4
x2 = 2
x2 = 1
Problem 3

© 2011 D. Kirschen & the University of Washington 249


Branch on x2 for Problem 1

Problem 2
Problem 1

Solution of
Problem 4 Problem 4
x2 = 2
x2 = 1
Problem 3
No solution!

© 2011 D. Kirschen & the University of Washington 250


Search Tree: second layer

No solution
No integer solution yet

© 2011 D. Kirschen & the University of Washington 251


Branch and Bound: what next?

Optimal solution

Solution of relaxed
Can’t go any problem 4 is bounded
further in this by solution of problem
No solution
direction 2. No point in going
further

© 2011 D. Kirschen & the University of Washington 252


Comments on Branch and Bound
• Search tree gets very big if there are more
than a few integer or binary variables
• Even with the bounds provided by the relaxed
solutions, exploring the tree usually takes a
ridiculous amount of time
• Clever mathematicians have developed
techniques to identify “cuts”
– Constraints based on the structure of the problem
that eliminate part of the search tree
– “Branch and Cut” algorithm

© 2011 D. Kirschen & the University of Washington 253


Mixed Integer Linear Programming

• Start with linear programming formulation


• Use branch and cut algorithm for integer and
binary variables
• Each node of the search tree involves the
solution of an LP problem

© 2011 D. Kirschen & the University of Washington 254


Duality Gap

• Finding the optimal solution for a large


problem can take too much time even with
branch and cut
• Best solution of relaxed problem provides a
bound on the solution
• Duality gap: Difference between best solutions
of relaxed problem and actual problem
• Stop searching the tree if duality gap is
sufficiently small
© 2011 D. Kirschen & the University of Washington 255

You might also like