ECEN615 Fall2022 Lect22-3

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 52

ECEN 615

Methods of Electric Power


Systems Analysis
Lecture 22: Linear Programming,
Optimal Power Flow,

Prof. Tom Overbye


Dept. of Electrical and Computer Engineering
Texas A&M University
overbye@tamu.edu
Announcements
• Read Chapter 8
• Read the Chapter 3 appendices (3A covers optimization with constraints,
3B covers linear programming, 3D covers dynamic programming, and 3E
convex optimization
• An excellent book on optimization is Linear and Nonlinear Programming
by Luenberger and Ye (the 5th edition came out in 2021)
• Homework 6 is due today
• Exam 2 is on Thursday Dec 1 during class (for the on campus students); it
will be comprehensive, but with more emphasis on the material after the
first exam

2
Quick Coverage of Linear Programming
• LP is probably the most widely used mathematical programming
technique
• It is used to solve linear, constrained minimization (or maximization)
problems in which the objective function and the constraints can be
written as linear functions

3
Example Problem 1 (mentioned in Lecture 21)
• Assume that you operate a lumber mill which makes both construction-
grade and finish-grade boards from the logs it receives. Suppose it
takes 2 hours to rough-saw and 3 hours to plane each 1000 board feet of
construction-grade boards. Finish-grade boards take 2 hours to rough-
saw and 5 hours to plane for each 1000 board feet. Assume that the saw
is available 8 hours per day, while the plane is available 15 hours per
day. If the profit per 1000 board feet is $100 for construction-grade and
$120 for finish-grade, how many board feet of each should you make
per day to maximize your profit?

4
Problem 1 Setup
Let x1 =amount of cg, x 2 = amount of fg
Maximize 100 x1  120 x2
s.t. 2 x1  2 x2 8
3x1  5 x2 15
x1, x2 0
Notice that all of the equations are linear, but they are
inequality, as opposed to equality, constraints; we are
seeking to determine the values of x1 and x2

5
Example Problem 2 (Nutritionist Problem)
• A nutritionist is planning a meal with 2 foods: A and B. Each ounce
of A costs $ 0.20, and has 2 units of fat, 1 of carbohydrate, and 4 of
protein. Each ounce of B costs $0.25, and has 3 units of fat, 3 of
carbohydrate, and 3 of protein. Provide the least cost meal which has
no more than 20 units of fat, but with at least 12 units of
carbohydrates and 24 units of protein.

6
Problem 2 Setup
Let x1 =ounces of A, x 2 = ounces of B
Minimize 0.20x1  0.25 x2
s.t. 2 x1  3 x2 20
x1  3 x2 12
4x1  3 x2 24
x1, x2 0

Again all of the equations are linear, but they are inequality, as opposed
to equality, constraints; we are again seeking to determine the values of
x1 and x2; notice there are also more constraints than solution variables

7
Three Bus Case Formulation
• For the earlier three bus system given the initial condition of an
overloaded transmission line, minimize the cost of generation such that
the change in generation 60 MW 60 MW
Bus 2 Bus 1
is zero, and the flow 10.00 $/MWh

on the line between 0.0 MW 10.00 $/MWh


buses 1 and 3 is not 120 MW 180.0 MW
120%

violating its limit 0 MW


60 MW

• Can be setup consider- Total Cost


1800 $/hr
60 MW
120% 120 MW

10.00 $/MWh
ing the change in Bus 3
180 MW

generation, (DPG1, DPG2, DPG3) 0 MW

8
Three Bus Case Problem Setup
Let x1 = PG1, x 2 = PG2 , x 3 = PG3
Minimize 10x1  12 x2  20 x3
2 1
s.t. x1  x2  20 Line flow constraint
3 3
x1  x2  x3 0 Power balance constraint
enforcing limits on x1, x2 , x3

9
LP Standard Form
The standard form of the LP problem is
Minimize cx Maximum problems can be treated as
s.t. Ax b minimizing the negative

x 0
where x n-dimensional column vector
c n-dimensional row vector
b m-dimensional column vector
A m×n matrix
For the LP problem usually n>> m
The previous examples were not in this form!
10
Replacing Inequality Constraints with Equality
Constraints
• The LP standard form does not allow inequality constraints
• Inequality constraints can be replaced with equality constraints
through the introduction of slack variables, each of which must
be greater than or equal to zero
 bi    yi bi with yi 0
 bi    yi bi with yi 0

• Slack variables have no cost associated with them; they merely


tell how far a constraint is from being binding, which will occur
when its slack variable is zero

11
Lumber Mill Example with Slack Variables

• Let the slack variables be x3 and x4, so


Minimize the negative
Minimize -(100 x1  120 x2 )
s.t. 2 x1  2 x2  x3 8
3x1  5 x2  x4 15
x1, x2 , x3 , x4 0

12
LP Definitions
A vector x is said to be basic if This is a key LP concept!
1. Ax b
2. At most m components of x are non-zero; these
are called the basic variables; the rest are non basic
variables; if there are less than m non-zeros then
x is called degenerate AB is called the basis matrix
 xB 
Define x   (with x B basic) and A  A B A N 
 xN 
 xB 
With  A B A N    b so x B A B  1 b  A N x N 
 xN 
13
Fundamental LP Theorem
• Given an LP in standard form with A of rank m then
– If there is a feasible solution, there is a basic feasible solution
– If there is an optimal, feasible solution, then there is an optimal, basic feasible
solution
• Note, there could be a LARGE number of basic, feasible solutions
– Simplex algorithm determines the optimal,
basic feasible solution usually very quickly

14
LP Graphical Interpretation
• The LP constraints define a polyhedron in the solution space
– This is a polytope if the polyhedron is bounded and nonempty
– The basic, feasible
solutions are
vertices of this
polyhedron A polyhedron can be
– With the linear cost unbounded
function the solution
will be at one of
vertices

Image: Figure 3.26 from course text


15
Simplex Algorithm
• The key is to move intelligently from one basic feasible solution (i.e.,
a vertex) to another, with the goal of continually decreasing the cost
function
• The algorithm does this by determining the “best” variable to bring
into the basis; this requires that another variable exit the basis, while
always retaining a basic, feasible solution
• This is called pivoting

16
Determination of Variable to Enter the Basis
• To determine which non-basic variable should enter the basis (i.e.,
one which currently 0), look at how the cost function changes w.r.t.
to a change in a non-basic variable (i.e., one that is currently zero)
 xB 
Define z c x [c B cN ]  Elements of xn
 xN 
are all zero, but
1
With x B A B b  A N x N  we are looking
to change one
 
Then z c B A B1b  c N  c B A B1A N x N to decrease the
cost

17
Determination of Variable to Enter the Basis, cont.
• Define the reduced (or relative) cost coefficients as
r is an n-m dimensional
r c N  c B A B1A N
row vector

• Elements of this vector tell how the cost function will change for
a change in a currently non-basic variable
• The variable to enter the basis is usually the one with the most
negative relative cost
• If all the relative costs are nonnegative then we are at an optimal
solution

18
Determination of Variable to Exit Basis
• The new variable entering the basis, say a position j, causes the
values of all the other basic variables to change. In order to retain a
basic, feasible solution, we need to insure no basic variables
become negative. The change in the basic variables is given by
1
x B x B  AB a j 
where  is the value of the variable entering the
basis, and a j is its associated column in A

19
Determination of Variable to Exit Basis, cont.
We find the largest value  such
1
x B x B  A B a j 0
If no such  exists then the problem is unbounded;
otherwise at least one component of x B equals zero.
The associated variable exits the basis.

20
Canonical Form
• The Simplex Method works by having the problem in what is
known as canonical form
• Canonical form is defined as having the m basic variables with the
property that each appears in only one equation, its coefficient in
that equation is unity, and none of the other basic variables appear
in the same equation
• Sometime canonical form is readily apparent
Minimize -(100 x1  120 x2 )
Note that with x3 and x4 as
s.t. 2 x1  2 x2  x3 8 basic variables AB is the
3x1  5 x2  x4 15 identity matrix
x1, x2 , x3 , x4 0
21
Canonical Form
• Other times canonical form is achieved by initially adding artificial
variables to get an initial solution
• Example of the nutrition problem in canonical form with slack and artificial
variables (denoted as y) used to get an initial basic feasible solution
Let x1 =ounces of A, x 2 = ounces of B
Minimize y1 +y 2 +y3 Note that with y1, y2,
s.t. 2 x1  3x2  x 3  y1 20 and y3 as basic
variables AB is the
x1  3x2  x4  y2 12
identity matrix
4x1  3x2  x5  y3 24
x1 , x2 , x3 , x4 , x5 , y1, y2 , y3 0
22
LP Tableau
• With the system in canonical form, the Simplex solution process
can be illustrated by forming what is known as the LP tableau
– Initially this corresponds to the A matrix, with a column appended to
include the b vector, and a row added to give the relative cost coefficients;
the last element is the negative of the cost function value
– Define the tableau as Y, with elements Yij
– In canonical form the last column of the tableau gives the values of the
basic variables
• During the solution the tableau is updated by pivoting

23
LP Tableau for the Nutrition Problem with Artificial
Variables
• When in canonical form the relative costs vector is
r c N  c B A B1A N c B A N
T T
 0   7
 0 2 3 1 0 0    9
    
 
r  0   1 1 1 1 3 0  1 0   1
 0    
   4 3 0 0  1  1 
 0   1 
• The initial tableau for the artificial problem is then
x1 x2 x3 x4 x5 y1 y2 y3
2 3 1 0 0 1 0 0 20 Note the last column
1 3 0 1 0 0 1 0 12 gives the values of
the basic variables
4 3 0 0 1 0 0 1 24
7 9 1 1 1 0 0 0  56
24
LP Tableau Pivoting
• Pivoting is used to move from one basic feasible solution to another
– Select the pivot column (i.e., the variable coming into the basis, say q) as the
one with the most negative relative cost
– Select the pivot row (i.e., the variable going out of the basis) as the one with
the smallest ratio of xi/Yiq for Yiq >0; define this as row p (xi is given in the last
column)
That is, we find the largest value  such
x B x B  A B1a q 0
If no such  exists then the problem is unbounded;
otherwise at least one component of x B equals zero.
The associated variable exits the basis.
25
LP Tableau Pivoting for Nutrition Problem
• Starting at
x1 x2 x3 x4 x5 y1 y2 y3
2 3 1 0 0 1 0 0 20
1 3 0 1 0 0 1 0 12
4 3 0 0 1 0 0 1 24
7 9 1 1 1 0 0 0  56

• Pivot on column q=2; for row get minimum of


{20/3, 12/3, 24/3), which is row p=2

26
LP Tableau Pivoting

• Pivoting on element Ypq is done by


– First dividing row p by Ypq to change the pivot element to unity.
– Then subtracting from the kth row Ykq/Ypq times the pth row for all rows with Ykq <> 0
x1 x2 x3 x4 x5 y1 y2 y3
2 3 1 0 0 1 0 0 20
I’m only showing
1 3 0 1 0 0 1 0 12
fractions with two
4 3 0 0 1 0 0 1 24
ROD digits
7 9 1 1 1 0 0 0  56
x1 x2 x3 x4 x5 y1 y2 y3
1 0 1 1 0 1 1 0 8
Pivoting gives 0.33 1 0  0.33 0 0 0.33 0 4
3 0 0 1 1 0 1 1 12
4 0 1 2 1 0 3 0  20 27
LP Tableau Pivoting, Example, cont.
• Next pivot on column 1, row 3
x1 x2 x3 x4 x5 y1 y2 y3
1 0 1 1 0 1 1 0 8
0.33 1 0  0.33 0 0 0.33 0 4
3 0 0 1 1 0 1 1 12
4 0 1 2 1 0 3 0  20
• Which gives
x1 x2 x3 x4 x5 y1 y2 y3
0 0 1 0.67 0.33 1  0.67  0.33 4
0 1 0  0.44 0.11 0 0.44  0.11 2.67
1 0 0 0.33  0.33 0  0.33 0.33 4.0
0 0  1  0.67  0.33 0 1.67 1.33 4
28
LP Tableau Pivoting, Example, cont.
• Next pivot on column 3, row 1
x1 x2 x3 x4 x5 y1 y2 y3 Since there are no
0 0 1 0.67 0.33 1  0.67  0.33 4 negative relative
0 1 0  0.44 0.11 0 0.44  0.11 2.67
costs we are done (with
getting a starting solution)
1 0 0 0.33  0.33 0  0.33 0.33 4
0 0  1  0.67  0.33 0 1.67 1.33 4
• Which gives
x1 x2 x3 x4 x5 y1 y2 y3
0 0 1 0.67 0.33 1  0.67  0.33 4
0 1 0  0.44 0.11 0 0.44  0.11 2.67
1 0 0 0.33  0.33 0  0.33 0.33 4
0 0 0 0 0 1 1 1 0
29
LP Tableau Full Problem
• The tableau from the end of the artificial problem is used as the starting
point for the actual solution
– Remove the artificial variables
– Update the relative costs with the costs from the original problem and update the
bottom right-hand corner value
c [0.2 0.25 0 0 0]
r c N  c B A B1A N c B A N
T  0.67 0.33  T
 0  0.04 
r     0 0.25 0.2   0.44 0.11  
 0    0.04 
 0.33  0.33
• Since none of the relative costs are negative we are done with x 1=4,
x2=2.7 and x3=4
30
Marginal Costs of Constraint Enforcement in LP
If we would like to determine how the cost function
will change for changes in b, assuming the set
of basic variables does not change The marginal costs will be
used to determine the OPF
then we need to calculate locational marginal costs
1 (LMPs)
z (c B x B ) (c B A B b)
  c B A B1 λ
b b b
So the values of λ tell the marginal cost of enforcing
each constraint.

31
Nutrition Problem Marginal Costs
• In this problem we had basic variables 1, 2, 3;
nonbasic variables of 4 and 5
1 There is no marginal
 2 3 1  20   4 
cost with the first
x B A B1 b  A N x N   1 3 0   12   2.67 
constraint since it is
     
 4 3 0   24   4  not binding; values
1 tell how cost changes
 2 3 1  0  if the b values were
λ c B A B1  0.2 0.25 0  1 3 0   0.044  changed
   
 4 3 0   0.039 

32
Lumber Mill Example Solution
Minimize -(100 x1  120 x2 )
An initial basic feasible solution
s.t. 2 x1  2 x2  x3 8
is x1 0, x2 0, x3 8, x4 15
3x1  5 x2  x4 15
x1, x2 , x3 , x4 0
Economic interpretation of l
The solution is x1 2.5, x2 1.5, x3 0, x4 0 is the profit is increased by
1 35 for every hour we up the
 2 2  35 first constraint (the saw) and
Then λ = 100 120     10 
 3 5    by 10 for every hour we up the
second constraint (plane)

33
Complications
• Often variables are not limited to being  0
– Variables with just a single limit can be handled by substitution; for
example if x  5 then x-5=z  0
– Bounded variables, high  x  0 can be handled with a slack variable so x
+ y = high, and x,y  0
• Unbounded conditions need to be detected (i.e., unable to pivot);
also the solution set could be null
Minimize x1  x2 s.t. x1  x2 8
 x1  x2  y1 8  x2 8 is a basic feasible solution
x1 x2 y1
1 1 1 8
2 0 1 8
34
Complications
• Degenerate Solutions
– Occur when there are less than m basic variables > 0
– When this occurs the variable entering the basis could also have a value of zero; it
is possible to cycle, anti-cycling techniques could be used
• Nonlinear cost functions
– Nonlinear cost functions could be approximated by assuming a piecewise linear
cost function
• Integer variables
– Sometimes some variables must be integers; known as integer programming;
we’ll discuss after some power examples

35
LP Optimal Power Flow

• LP OPF was introduced in


– B. Stott, E. Hobson, “Power System Security Control Calculations using Linear
Programming,” (Parts 1 and 2) IEEE Trans. Power App and Syst., Sept/Oct 1978
– O. Alsac, J. Bright, M. Prais, B. Stott, “Further Developments in LP-based Optimal
Power Flow,” IEEE Trans. Power Systems, August 1990
• It is a widely used technique, particularly for real power optimization; it
is the technique used in PowerWorld

36
LP Optimal Power Flow
• Idea is to iterate between solving the power flow, and solving an LP with
just a selected number of constraints enforced
• The power flow (which could be ac or dc) enforces the standard power
flow constraints
• The LP equality constraints include enforcing area interchange, while the
inequality constraints include enforcing line limits; controls include
changes in generator outputs
• LP results are transferred to the power flow, which is then resolved

37
LP OPF Introductory Example
• In PowerWorld load the B3LP case and then display the LP OPF
Dialog (select Add-Ons, OPF Case Info, OPF Options and Results)
• Use Solve LP OPF to 60 MW 60 MW
Bus 2 Bus 1

solve the OPF, initially 10.00 $/MWh

with no line limits 0.0 MW 10.00 $/MWh


120 MW
slack

180.0 MW

enforced; this is similar 0 MW


120%

to economic dispatch
60 MW

Total Cost 120% 120 MW


60 MW

with a single power


1800 $/h
Bus 3 10.00 $/MWh

180 MW

balance equality constraint 0 MW

• The LP results are available


from various pages on the dialog
38
LP OPF Introductory Example, cont

39
LP OPF Introductory Example, cont
• On use Options, Constraint Options to enable the enforcement of
the Line/Transformer MVA limits

40
LP OPF Introductory Example, cont.

20 MW 20 MW
Bus 2 Bus 1

10.00 $/MWh

slack

60.0 MW 12.00 $/MWh


100 MW 120.0 MW
100%
0 MW
80 MW

Total Cost 100% 100 MW


80 MW
1920 $/h
Bus 3 14.00 $/MWh

180 MW

0 MW

41
Example 6_23 Optimal Power Flow

On the Options,
Environment
page the simulation
can be set to solve an
OPF when simulating

Open the case Example6_23_OPF. In this example the load is gradually


42
increased
Locational Marginal Costs (LMPs)
• In an OPF solution, the bus LMPs tell the marginal cost of supplying
electricity to that bus
• The term “congestion” is used to indicate when there are elements (such
as transmission lines or transformers) that are at their limits; that is, the
constraint is binding
• Without losses and without congestion, all the LMPs would be the same
• Congestion or losses causes unequal LMPs
• LMPs are often shown using color contours; a challenge is to select the
right color range!

43
Example 6_23 Optimal Power Flow with Load
Scale = 1.72

44
Example 6_23 Optimal Power Flow with Load
Scale = 1.72
• LP Sensitivity Matrix (A Matrix)

The first row is the power balance constraint, while the second row is the line
flow constraint. The matrix only has the line flows that are being enforced.

45
Example 6_23 Optimal Power Flow with Load
Scale = 1.82
• This situation is infeasible, at least with available controls. There
is a solution because the OPF is allowing one of the constraints to
violate (at high cost)

80 MW 80 MW 124 MW 124 MW 143 MW


A A
57% 57% 54 Mvar
1.05 pu MVA 0.99 pu MVA
1.00 pu
3 4
1 16.82 $/MWh 20.74 $/MWh 22.07 $/MWh

133 MW 213 MW 64 MW 268 MW 42 MW


slack AGC ON 71 Mvar
A A

89% 58% A 280 MW


100% AGC ON
A
MVA MVA
48%
MVA MVA
64 MW
176 MW 56 MW
133 MW A
42 MW 100%
1.04 pu MVA 176 MW 0.95 pu
15.91 $/MWh 5 1101.78 $/MWh
2
71 MW 220 MW 231.9 MW
36 Mvar AGC ON 71.3 Mvar

Total Hourly Cost: 11297.88 $/h Load Scalar: 1.82


Total Area Load: 713.4 MW
Marginal Cost ($/MWh): 235.47 $/MWh 46
Generator Cost Curve Modeling
• LP algorithms require linear cost curves, with piecewise linear curves used
to approximate a nonlinear cost function
• Two common ways
of entering cost
information are
– Quadratic function
– Piecewise linear curve
• The PowerWorld OPF
supports both types

47
Security Constrained OPF
• Security constrained optimal power flow (SCOPF) is similar to OPF
except it also includes contingency constraints
– Again the goal is to minimize some objective function, usually the current system
cost, subject to a variety of equality and inequality constraints
– This adds significantly more computation, but is required to simulate how the
system is actually operated (with N-1 reliability)
• A common solution is to alternate between solving a power flow and
contingency analysis, and an LP

48
Security Constrained OPF, cont.
• With the inclusion of contingencies, there needs to be a distinction
between what control actions must be done pre-contingent, and which
ones can be done post-contingent
– The advantage of post-contingent control actions is they would only need to be done
in the unlikely event the contingency actually occurs
• Pre-contingent control actions are usually done for line overloads, while
post-contingent control actions are done for most reactive power control
and generator outage re-dispatch

49
SCOPF Example
• We’ll again consider Example 6_23, except now it has been enhanced to
include contingencies and we’ve also greatly increased the capacity on
the line between buses 4 and 5; named Bus5_SCOPF_DC
82 MW 82 MW 26 MW 26 MW 78 MW 82 MW 82 MW 26 MW 26 MW 78 MW
A A A A
57% 12% 29 Mvar 57% 12% 29 Mvar
1.05 pu MVA 1.00 pu MVA
1.00 pu 1.05 pu MVA 1.00 pu MVA
1.00 pu
3 4 3 4
1 14.33 $/MWh 14.87 $/MWh 15.05 $/MWh 1 14.33 $/MWh 14.87 $/MWh 15.05 $/MWh
53 MW 135 MW 91 MW 147 MW 96 MW 135 MW
53 MW 91 MW 147 MW 96 MW
slack AGC ON 39 Mvar AGC ON
slack
39 Mvar
A A

36% 80% A
A 84 MW 36%
A A

80% A 84 MW
MVA MVA
100% 268% AGC ON MVA MVA
A
80%
MVA
MVA 100% MVA AGC ON
91 MW 91 MW MVA

0 MW 127 MW 127 MW
53 MW 53 MW 0 MW
96 MW 96 MW
1.04 pu 0 MW 0.82 pu
1.04 pu 0 MW 0.82 pu
14.20 $/MWh 5 1540.19 $/MWh
2 14.20 $/MWh 5 15.05 $/MWh
173 MW 2
39 MW 127.4 MW 173 MW
AGC ON 39 MW 127.4 MW
20 Mvar 39.2 Mvar AGC ON
20 Mvar 39.2 Mvar
Total Hourly Cost: 5729.74 $/h Load Scalar: 1.00
Total Hourly Cost: 5729.74 $/h Load Scalar: 1.00
Total Area Load: 392.0 MW
Total Area Load: 392.0 MW
Marginal Cost ($/MWh): 319.73 $/MWh
Marginal Cost ($/MWh): 14.70 $/MWh

Original with line 4-5 limit of 60 Modified with line 4-5 limit of 200
MW with 2-5 out MVA with 2-5 out
50
PowerWorld SCOPF Application
Just click the button to solve

Number of times
to redo contingency
analysis

51
LP OPF and SCOPF Issues
• The LP approach is widely used for the OPF and SCOPF, particularly
when implementing a dc power flow approach
• A key issue is determining the number of binding constraints to
enforce in the LP tableau
– Enforcing too many is time-consuming, enforcing too few results in excessive
iterations
• The LP approach is limited by the degree of linearity in the power
system
– Real power constraints are fairly linear, reactive power constraints much less
so

52

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy