Professional Documents
Culture Documents
Daniel Kirschen
Perspective
L
A B C
- =
actual load – uncontrolled renewable generation
= net load
= controllable generation
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
$/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
x* x
x* x
-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
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?
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
f(x)
A B C D x
d2 f
For x = A and x = D, we have: <0
dx 2
f(x)
A B C D x
d2 f
For x = B we have: >0
dx 2
f(x)
A B C D x
d2 f
For x = C , we have: =0
dx 2
df
• Necessary condition: =0
dx
• Sufficient condition:
d2 f
– For a maximum: <0
dx 2
d2 f
– For a minimum: >0
dx 2
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 *
¶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
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
det λ𝐼 − 𝐴 = 0
1 0 0
Where I is the identity matrix: 0 1 0
0 0 1
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
æ ¶ 2C ¶ 2C ö
ç ¶x 2 ¶x 1 ¶x 2 ÷ æ 2 -2 ö
Hessian Matrix: ç 1
÷ =ç ÷
ç ¶ 2C ¶ C ÷ è -2 8 ø
2
ç ÷
è ¶x 2 ¶x 1 ¶x 22 ø
x2
C=9
C=4
C=1
x1
Minimum: C=0
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
x1
C=1
C=4
C=9
• 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
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
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
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 ø
Ñf
w ( x1 , x 2 ) = 5 - x1 - x 2
f = 0.25 x 12 + x 22 = 6
f = 0.25 x 12 + x 22 = 5
f ( x1 , x 2 ) = 5 Ñf
Ñf
f ( x1 , x 2 ) = 5
Ñw
Ñw
f ( x1 , x 2 ) = 6
f ( x1 , x 2 ) = 5 Ñf
Ñf
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
( 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
¶ ( 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
= f ( x 1 ,… , x n ) + l ( L - ax 1 - bx 2 )
= f ( x 1 ,… , x n ) + l ( ax 1 + bx 2 )
( 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 1 dC 2
= =l
dx 1 dx 2
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
¶
= 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
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?
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
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
OR
Subject to:
w ( x1 ,x 2 ) º 5 - x1 - x 2 = 0
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
¶
º 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
¶
º 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
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
+ 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
¶ 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
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
+ 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
¶
º 100 - P2 £ 0
¶m4
¶
º P3 - 260 £ 0
¶ m5
¶
º 100 - P3 £ 0
¶ m6
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:
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.
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
P3 = P 3
max
= 260 MW
First trial:
P1
P1
P
1
min P1
max
P2
P2
P2min P2max
P3
P3
P 3
min
P3
max
P1
P
1
min P
1
max
P2
P2
P2min P2max
P3
P3
P 3
min
P
3
max
¶
º 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
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
3. If one of these values exceeds its lower or upper limit, fix it at that limit
4. Calculate PTOTAL = PA + PB + PC
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
PA PB
PAMAX PBMAX
dC A dC B
dPA dPB
l
PA PB
PAMAX PBMAX
PA PB
PAMAX PBMAX
dC A dC B
dPA dPB
PA PB
PAMAX PBMAX
PA PB
dC A dC B
dPA dPB
PA PB
PA PB
dC A dC B
dPA dPB
PA PB
CA CB
PA PB
dC A dC B
dPA dPB
l
PA PB
CA CB
PA PB
dC A dC B
dPA dPB
l
PA PB
CA CB
PA PB
dC A dC B
dPA dPB
PA PB
CA CB
PA PB
dC A dC B
dPA dPB
PA PB
CA CB
PA PB
dC A dC B
dPA dPB
PA PB
f(x)
A D x
df d2 f
For x = A and x = D, we have: = 0 and <0
dx dx 2
138
Which one is the real optimum?
x2
x1
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
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
x2 x2
x1 x1
x2
x1
x1
x1a x1b x1c x1d x1
f(x)
146
Example of Convex Function
x2
x1
f(x)
x2
x1
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 ]
f(x)
L
A B C
Example borrowed from Wood and Wollenberg’s Power Generation, Operation and Control 158
Observations on the example:
dC1
= 7.9 + 0.00344 P1
• dP1
This example considered the total cost
• The no-load cost affects the solution
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
αi + βi
αi
tiOFF
T N
åu(i,t)p(i,t) = L(t)
i=1
å u(i,t)[Pi
max
- p(i,t)] ³ R(t) Reserve requirement at period t
i=1
N
åu(i,t)P i
max
³ L(t)+ R(t) Reserve constraint at period t
i=1
u(i,t) Î{0,1} " i,t
• Discrete variables
– There is no gradient
– Can only take a finite number of values
– Problem is not convex
– Must try combinations of discrete values
111
• Examples
110
010
001 states
000
• 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
T= 1 2 3 4 5 6
(2 N T
) = (2 )
5 24
= 6.2 10 35 combinations
• 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
195
Unit Data
C 10 50 1 1 0 20 100 OFF
C(p)
C B A
Hourly Demand
350
300
250
200
Load
150
100
50
0
1 2 3
Hours
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
1 2 3
A B C
1 1 1
1 1 0
1 0 1
1 0 0 Initial State
0 1 1
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
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
1 2 3
A B C
1 1 1
1 1 0
1 0 1
1 0 0 Initial State
0 1 1
1 1 1 4
1 1 0 3 7
1 0 1
2 6
1 0 0 1
5
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
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
$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
1 1 1 4
1 1 0 $7300
3 7
$7200
1 0 1 2 6
1 0 0 $7100
1 5
1 1 1
1 1 0
1 0 1 2
$7100
1 0 0 1 5
212
Motivation
CA
PA
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
y
Maximize x + y 4
0 x
0 1 2 3
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)
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
Extreme points
(vertices)
Constraints
(edges)
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
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
CA
Minimize CT = c1 x1 + c2 x2 + c3 x3
Subject to: x1 + x2 + x3 = L a1
PA=x1
x2 ³ PBMIN
x3 ³ PCMIN a2 PB=x2
x2 £ PBMAX
x3 £ PCMAX a3 PC=x3
PCMIN PCMAX
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
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
Except for the fact that the variables are integer, this
looks very much like a linear programming problem.
x
2
-cT
x1
LP solution
IP solution
The optimal integer solution can be far away from the LP solution
Problem 0
x1 ³ 0; x2 ³ 0 x1 ³ 0 ; x2 ³ 0
x1 £ 1 x1 ³ 2
Problem 1 Problem 2
Problem 2
Problem 1
Solution of
Problem 1 Solution of Problem 2
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
Problem 2
Problem 1
Problem 4
x2 = 2
x2 = 1
Problem 3
Problem 2
Problem 1
Solution of
Problem 4 Problem 4
x2 = 2
x2 = 1
Problem 3
No solution!
No solution
No integer solution yet
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