Sei sulla pagina 1di 100

Economics Operation of Power Systems

Drexel University @ PJM Interconnection Fall 2009 Wednesday Evenings Text: Power Generation, Operation, and Control by Wood and Wallenberg

Course Scope
o Term #1 o Characteristics of Power Generation o Economic Dispatch (Problem) Optimization with Constraints o Transmission System Effects Power Flow Equations / Analysis Calculation of Losses Effects on Scheduling o Unit Commitment Dynamic Programming Term #2 / #3???

Grading
o o o o o 20% homeworks 20% quizzes (2 during term) 25% midterm exam 30% final exam 5% special assignment

Why is it important to learn about economic operation of power systems? o electric generation has risen rapidly since the middle of 20th century o before 1973 U.S. spent 20% of total revenue on electric power generation o by 1980 U.S. was spending 40% of total revenue on electric power generation o fuel costs have fluctuated drastically o in between electric utility fuel costs escalated at a rate of 25% per year o consequently, efficient generation / fuel utilization is more important than ever

Lecture #1: The Energy Market


What is an electricity market? o facilitates the buying and selling of electric power, as a commodity. o utilizes principles of supply and demand, to set price. o composed of e.g o independent system operators (ISO) o independent power producers (IPP) o transmission network operators o distribution network operators o customers How does it differ from other energy markets (e.g. natural gas)? o electricity, by nature, is difficult to store. o note, however, that methods do exist e.g. flywheel, compressed air, battery, fuel cell o consequently, it must be available on demand. o supply and demand vary constantly. o much faster than that of other commodities o a system operator is required to ensure that demand is met by available supply in real-time What is economic dispatch? the process we utilize to manage supply such that it meets demand What is regulation? o regulation the power network (generation, transmission, distribution facilities) is owned and operated by a single or small set of parties with government-mandated pricing structure. o deregulation each part of the power network is owned and operated individually within the construct of an energy market without govenrment mandated pricing.

Topic #1: Problems New and Old


What is the CLASSIC economic dispatch problem? to fire fossil-fueled generating units such that operating cost (maintenance, fuel, etc.) is minimal What new issues exist for MODERN economic dispatch problem? o deregulation o increases number of parties involved in / complexity of economic dispatch o security o of greater concern now e.g. because of network stress, terrorism o power loss o of greater concern now e.g. because of rising fuel costs and expanding grid o environmental factors

o pollution output is considered cost in the same manner fuel o note that, in a deregulated market, customers may choose green energy providers others such as distributed generation, renewable sources

How has the industry reacted? o incorporation of power flow equations in to mathematics of generator scheduling o necessary to consider factors such as security and power loss o development of new optimal power flow techniques o formalized methods for computation of the optimal or lowest cost system configuration o new computational tools o e.g. digital computer

Lecture #2: Characteristics of Power Generating Units


Topic #1: Characteristics of Steam Units
Why do we care? the behavior of power generating units is fundamental to understanding of economic dispatch What is the SMALL boiler/turbine/generator unit? o single boiler steam single turbine single generator o gross electrical output composed of: o net electric output: 94 98% supplied to grid o overhead: 2 6% required for generator operation e.g. fuel pumps, fans, water pumps o efficiency generally described by (1).

efficiency =

net output gross input

(1)

Figure 1: Boiler-Turbine-Generator Unit

Figure 2: Input-Output Curve of a Steam Turbine Generator

Note the following terms:

H = Btu per hour heat input to unit MBtu / h F = Fuel cost times H is R per hour R / h / / 144444424444444 4 3
note that R is a fictional monetary unit utilized in this book /

For a generating unit, what characteristics are we concerned with? o net electric power output P o minimum operating output Pmin o influenced by design, e.g. minimum fuel flow required to cool furnace o maximum operating output Pmax o influenced by maximum fuel flow and heat constraints o incremental heat rate characteristic H/P or F/P o derivative of the input-output characteristic o incremental cost refer to (2).

R / H = ( fuel cost in R per Btu ) / P 14444 244444 P 4 3


units R / / R Btu = ( MW ) MWh Btu h

(2)

What is the unit (net) heat rate characteristic? o the effect of P on efficiency o high heat rate characteristic = low efficiency = bad o defined as H/P vs. P o typical range o 30 - 35% efficiency o 11,400 9800 Btu / kWh

Figure 3: Unit (Net) Heat Rate Characteristic

How do we represent the input output characteristics? o linear representation (most basic) o polynomial curve refer to (3) o piece-wise representation refer to (4) o unlike others, derivative of this function is not always defined
functional description of heat rate characteristics

polynomial representation 6447448 6 74 4 8 H/P 2 1 0 h ( , P ) = = 2 P 2 + 1 P + 0 P

(3)

as nonlinear function is approximated set of (generally linear) sub-functions 4 8 6444 74444 ( Plim1 P < Plim 2 ) 1 P h ( , P lim , P ) = ( Plim 2 P < Plim 3 ) 2 P M

(4)

Topic #2: Variations in Steam Unit Characteristics


What is the LARGE steam generating unit ? o A single boiler, with multiple steam admission valves, leading to a single turbine / generator o response medium o heat rate varies o efficiency varies How do these units operate? 1. turn on boiler 2. slightly open throttling valve #1 a. continue to open throttling valve #1, increase output P b. fully open throttling valve #1 3. slightly open throttling valve #2 a. continue to open throttling valve #2, increase output P b. fully open throttling valve #2 4. slightly open next throttling valve

How do represent its input-output characteristic?

continue to open throttling valve #3 continue to open throttling valve continue to open #2 throttling valve #1

boiler is on throttling valve #1 is fully open, open throttling valve #2

throttling valve #2 is fully open, open throttling valve #3

efficiency increases as throttling valve #2 opens

efficiency increases as throttling valve #2 opens

Figure 4: Characteristic of a Steam Turbine Generator w/ Four Boilers and Steam Admission Valves

What is a common-header plant? o Multiple boilers, connected to a single steam line, turbine, and generator o response medium o heat rate varies o efficiency varies How do represent its input-output characteristic? depends on boiler combinations

Figure 5: Common-Header Steam Plant

What is a gas / combustion turbine? o types o simple cycle (simpler, but lower efficiency) 1. inlet air compressed / burned 2. high temperature gas expands to drive compression, turbine, and generator 3. exhaust is released o combined cycle (more complex, but higher efficiency) 4. exhaust is utilized to drive steam turbine for loss recover o response fast o heat rate approximately 6285Btu/kWh o efficiency approximately 50%, for combined cycle How do represent its input-output characteristic?

efficiency increases as turbine #2 increases output

Figure 6: Combined Cycle Plan Heat Rate Characteristic

What is cogeneration plant? o similar to common-header steam plant, yet utilized to produce both steam (for industrial purposes) and electricity o response medium o heat rate approximately 4000 Btu/kWh o efficiency approximately 75%, including energy supplied as steam. What is light-water moderated nuclear reactor units? o utilize pressurized water reactors (PWR) or boiling water reactors (BWR) with slightly enriched uranium as power source o response slow o heat rate very complex, not discussed in this course o efficiency very complex, not discussed in this course o input-output characteristics o very complex, not discussed in this course What is hydroelectric unit? o method o moving water utilized to rotate turbines and generate electric power o input volume of water per unit of time (acre-ft/h) o output electric power (MW) o response slow o heat rate n/a o efficiency n/a How do represent its input-output characteristic?

Figure 7: Characteristics of Hydroelectric Plant

Figure 8: Power Generation in the United States [2006] by Type

Lecture #3: Econ. Dispatch of Thermal Units and Methods of Sol.


Topic #1: The Economic Dispatch Problem
System Definition: N thermal units committed to serve load Pload. Refer to Figure 9.

Figure 9: N thermal units committed to serve a load of Pload Outline System Parameters:
real power demand by all loads = PLoad total number of generating units = N fuel cost (for i th generator) = Fi real power output (of i th generator) = Pi 14444444 24444444 3
array of these values P = ( P 1 P2 PN )

(5)

cost function (for i th generator) = fi 1444444 2444444 3


set of these functions f = ( f1 f2 f N )

total cost function (for system as a whole) = F How is the economic dispatch problem defined? o Objective: o To find optimal value of P ( P* ) such that total cost is minimal (quantified by the objective function F) and all system constraints are maintained (as defined by g). o Methods (we will discuss these): o Lagrange Function o Lambda Iteration o Gradient Search o Newtons Method How is total cost function (F) defined? sum of all fuel costs

F ( P ) = fi ( Pi ) = cost_function i ( output i ) 14 244 1 24 4 3 4 3 { i =1 i =1


total cost $ / kWh kWh

for this example, objective function is defined (simply) as total fuel cost 6444444447444444444 4 8 N N

(6)

How are system constraints (g) defined? conservation of energy / power


system (equality) constraint 6444 74444 4 8

note that this constraint assumes that no transmission losses

g ( Pload , P ) = Pload Pi
i =1

(7)

For our optimization, what is the objective function? the Lagrange Function What is a Lagrange Function? o In mathematical optimization, the method of Lagrange Multipliers provides a strategy for finding the maximum / minimum of a function subject to constraints. o It ensures that, as opposed to the cost function (F) which is minimized, the constraint function (g) is driven to zero. o Refer to (8).

Figure 10: Contour Maps of Sample Lagrange Function

*** GENERAL FORM OF LAGRANGE FUNCTION ***


to be driven to zero 64 744 4 8 } L ( Pload , P, ) = F ( P ) + g ( Pload , P ) 4 14 244 4 3 14 244 3 Lagrange Function note that is Lagrange Multiplier to be minimized

(8)

Because L is an objective function, the goal is to minimize it. How does one solve for extrema of L? o Step #1: take the 1st derivative of L with respect to all parameters, including o Refer to (9) and (10)

dL ( Pload , P, ) dP dL ( Pload , P, ) dP dL ( Pload , P, ) dPi

= = =

dF ( P ) dP

g ( Pload , P )
dP
(9)

N d N d fi ( Pi ) + dP Pload Pi dP i =1 i =1

dfi dPi

d L ( Pload , P, ) d

= g ( Pload , P )

(10)

o o

Step #2: set these derivatives equal to zero Step #3: solve for x, y, and which satisfy these equations. o refer to (11), derived from (9) and (10)
*** SOLUTION FOR LAGRANGE METHOD ***

dfi ( Pi * ) dPi

=*

N equations 2N inequality constraints 1 equality constraint


(11)

Pi ,min Pi * Pi ,max
g ( Pload , P* ) = 0

Example #1: Simple Lagrange Function .

Step #1: Define the example system.

f ( x, y ) = x + y g ( x, y ) = x 2 + y 2 1

(12)

Step #2: Determine the optimal value of x, y that which yields an extreme / minimal value of f(x, y) as well as zero / minimal value of g(x, y). One method is the utilization of an objective function (obj).
obj ( x, y ) = f ( x, y ) + g ( x, y ) = ( x + y ) + ( x 2 + y 2 1) Step #3a: To find the minimum, take the partial derivates of obj with respect to x and y. dobj = 1+ 2x dx dobj = 1+ 2 y dy Step #3b: Solve for the values of x* and y* which satisfy (14). (13)

(14)

x* } 1 dobj 1 = 1+ 2 = 0 x* = 2 dx 2 1 dobj 1 = 1+ 2 = 0 y* = 2 dy 2 { y*

(15)

What is the problem with this solution? o It finds the minimal value of obj, not the minimal value of f such that g = 0. o As such o this optimal point (x*, y*) does not satisfy the system constraint, g(x, y) = -1/2 . o this optimal point (x*, y*) does not lie on the surface described by g(x, y). o Refer to (16). the system constraint 64444444 is NOT fulfilled 74444444 8 1 2 1 2 1 g ( x*, y *) = + 1 = 0 2 2 2

(16)

How does the addition of a Lagrange Multiplier ( ) fix this problem? o It changes the meaning of the function o w/o : minimize the sum of f and g. o w/ : minimize the sum of f and g for all . the only way g will be minimal for all values of is if it is equal to zero Step #4: Calculate the partial derivatives of L with respect to x, y, and .
dL = 1 + 2 x = 0 dx dL = 1 + 2 y = 0 dy dL = x2 + y2 1 = 0 4 3 d 1 m24 syste constraint
g (x, y )

(17)

Step #5: Set all partial derivatives equal to 0, solve for x, y, and . Step A: Solve dL / dx and dL / dy for .
x= 1 2 1 y= 2

(18)

Step B: Substitute these values in to dL / d.

644 x7444 4+y 8 2 2 dL 1 1 0= = + 1 d 2 2


2 2

1 0 = 2 1 2 1 1 = 2 2 1
2

1 1 = 2 2

(19)

1 1 = 2 2 1 * = 14 244 4 2 0.5 3
solution

= 2 0.5

Step C: Calculate the corresponding x and y.


1 1 1 x* , y* = = 2 0.5 = 0.5 2 2

(20)

What is the problem with this solution? n/a


64444744448 2 2 * * * g ( x , y , ) = 0.5 + 0.5 1 = 0
g x* , y* , * = 0

) (

(21)

Which solution (of the four possible) is optimal? try them all (trial and error)
sol #1 f + 0.5, + 0.5 = 0.5 + 0.5 = 2 0.5 sol #2 sol #3 sol #4

( ) f ( 0.5, + 0.5 ) = 0.5 + 0.5 = 0 f ( + 0.5, 0.5 ) = + 0.5 0.5 = 0 f ( 0.5, 0.5 ) = 0.5 0.5 = 2 0.5 144444444 44444444 2 3
optimal solution x *, y * yields minimal value of f ( x , y )

(22)

Step #5: After quantifying f(x, y) for all possible solutions, state the solution.
we don't care which one is used 6 74 4 8 * * * (23) ( x , y , ) = 0.5, 0.5, 2 10.5 .

How does the introduction of inequality constraints change the problem? o Our cost function (f) may not always be tangent to the surface defined by g. o One or more equalities may become an inequality. o Refer to (24)

d fi ( Pi* ) d fi ( Pi* ) d fi ( Pi* ) dPi dPi dPi

= * * *

Pi ,min Pi * Pi ,max Pi * = Pi ,max Pi * Pi ,min (24)

Example 3A: Simple Dispatch of 3 Units ........................

Unit #1 Coal-Fired Steam Unit Max Output 600 MW Min Output 150 MW Fuel Cost 1.1 R/Mbtu 3.75 R/MW Input-Output Curve
1 h1 ( P ) = 510.0 + 7.2 P + 0.00142 P 2 1 1
0.293
W

MBtu h (25)

Btu } MW h1 ( P ) = 0.293 ( 510.0 + 7.2 P + 0.00142 P 2 ) 1 1 1 144444 2444444 h 4 3

147.9 + 2.10 P + 0.000416 P 2 1 1

Unit #2 Oil-Fired Steam Unit Max Output 400 MW Min Output 100 MW Fuel Cost 1.0 R/Mbtu 3.413 R/MW Input-Output Curve
h ( P2 ) = 310.0 + 7.85P2 + 0.00194 P22 2 MBtu h (26)

MW h 2 ( P2 ) = 0.293 ( 310.0 + 7.85P2 + 0.00194 P22 ) 1444444 2444444 3 h


90.83 + 2.3 P2 + 0.000568 P22

Unit #3 Oil-Fired Steam Unit Max Output 200 MW Min Output 500 MW Fuel Cost 1.0 R/Mbtu 3.413 R/MW Input-Output Curve
h 3 ( P3 ) = 78.0 + 7.97 P3 + 0.00482 P32 MBtu h (27)

MW h 3 ( P3 ) = 0.293 ( 78.0 + 7.97 P3 + 0.00482 P32 ) 144444 2444444 h 4 3


22.85 + 2.34 P3 + 0.0014 P32

Step #1: State the individual cost functions (f).

6444444 7444444 h 8 R / MW / } R MW R / / = f1 ( P ) = 3.75 (147.9 + 2.10 P + 0.000416 P 2 ) 1 1 1 MW h h / R f 2 ( P2 ) = 1.0 ( 310 + 7.85P2 + 0.00194 P 2 ) 1 h / R 2 f 3 ( P3 ) = 1.0 ( 78.0 + 7.97 P3 + 0.00482 P3 ) h

554.6 + 7.875 P + 0.0016 P 2 = 1.1 510.0 + 7.2 P + 0.00142 P 2 in 1 1 1 1

R /

(28)

Note: there is no need to convert from MBtu to MW, the cost function is in terms of R/h and (consequently) is independent of these units even for the constraint which is equal to 850 in MW. Note: however, there is a need to convert from kW to MW magnitude does matter. Step 2: State the optimum conditions for dispatch.
dF1 R / = 7.92 + 0.003124 P = 1 MWh dP 1 dF2 R / = 7.85 + 0.00388P2 = MWh dP2 dF3 R / = 7.97 + 0.00964 P3 = MWh dP3 P + P2 + P3 = PLoad MW 1 (29)

Step #3: Solve for .


P= 1 1 ( 7.92 ) = 320.1( ) 2535.2MW 0.003124 1 P2 = ( 7.85 ) = 257.7 ( ) 2023.2MW 0.00388 1 P3 = ( 7.97 ) = 103.7 ( ) 826.7 MW 0.00964

(30)

P + P2 + P3 = PLoad 1
681.5 ) 5385.1 64444444444 (744444444444 4 8 320.1( ) 2535.2 + 257.7 ( ) 2023.2 + 103.7 ( ) 826.7 = 850

(31)

= 9.148
Step #4: Solve for P1, P2, P3

R / MWh

P2 = 257.7 ( 9.148 ) 2023.2 = 334.2396MW P3 = 103.7 ( 9.148 ) 826.7 = 121.9476MW

P = 320.1( 9.148) 2535.2 = 393.0748MW 1

(32)

Step #4: Evaluate cost (g).

P + P2 + P3 = PLoad 1 393.0748 + 334.2396 + 121.9476 850MW 144444 2444444 4 3


849.2620

(33)

Topic #2: Thermal System Dispatching with Network Losses Considered ...
How does the consideration loss change the dispatch problem? o Must consider losses in addition to generation and load, as shown in (34). o Note the following definitions: o power loss (PLoss) o power loss function (pLoss)
system (equality) constraint 644444 7444444 4 8 N

g ( Pload , P, K) = Pload + PLoss Pi { i =1


addition of loss

(34)

How do we solve for the extrema? o Step #1: take the 1st derivative of L with respect to all parameters, including o refer to (35) and (36).
dL df ( P ) g ( Pload , P ) = + P dP dP
N dL d N d = fi ( Pi ) + dP Pload + p loss Pi P dP i =1 i =1

dL d N d d d N = fi ( Pi ) + dP ( Pload ) + dP ( ploss ) dP Pi P dP i =1 i =1 1 24 4 3 1 24 4 3
=0 we assume Ploss is function of P N

(35)

for i

d d dL df i = + ( ploss ) Pi dPi dPi dPi i =1 Pi 14 3 24


=1

dL df i d = + ( ploss ) Pi dPi dPi dp dL df i = 1 loss Pi dPi dPi dL ( Pload , P, ) d = g ( Pload , P )

(36)

o o

Step #2: Set these derivatives equal to zero. Step #3: Solve for x, y, and which satisfy these equations. o Refer to (37), derived from (35) and (36)
*** SOLUTION FOR LAGRANGE METHOD WITH LOSSES ***

dfi ( Pi * ) * dp loss * + = dPi dPi Pi ,min Pi * Pi ,max g ( Pload , P* ) = 0

N equations (37)

2N inequality constraints 1 equality constraint

Example 3C: Simple Dispatch of 3 Units with Losses..................

Step #1: Utilize the definition of power loss defined below:


ploss ( P ) = 0.00003P 2 + 0.00009 P22 + 0.00012 P32 1 1 24 4 3
functional description of PLoss

(38)

Step #2: Starting from step #2 of Example 3A, state the optimal conditions for dispatch.
this form comes 64444444 from (37) above 74444444 8 R / 7.92 + 0.003124 P = (1 2 * 0.00003P ) 1 1 MWh R / 7.85 + 0.00388P2 = (1 2 * 0.00009 P2 ) MWh R / 7.97 + 0.00964 P3 = (1 2 * 0.00012 P3 ) MWh P + P2 + P3 = Pload + p loss MW 1

(39)

What is the problem here? Can we just solve for ? no, because dFi / dPi is nonlinear, we cannot solve for What is the solution process the Lambda-Iteration Method? o Step A: Pick a set of starting values for P1, P2, and P3 which sum to Pload. o Step B: Calculate the incremental losses dPloss / dPi as well as Ploss. The incremental losses and total losses will be considered constant until returning to Step B. o Step C: Calculate the value of that causes P1, P2, and P3 to sum the total load plus losses. This is now as simple as the calculations in Example 3A, since the equations are now linear again. o Step D: Compare P1, P2, and P3 from Step C to the values used at the start of Step B. If there is no significant change in any one of the values, go to Step E, otherwise go back to Step B. o Step E: Done Step #3 / Step A: Initialize P (
0)

P ( ) = 400MW 1
0

P2( 0) = 300 MW P3
( 0)

(40)

= 150MW

Step #4 / Step B: Calculate the incremental losses dPloss / dPi as well as Ploss.

dploss P ( dP 1 dploss P ( dP2

( ) ) = 2*0.00003 (}) = 0.0240 400


0
0 P( ) 1

( ) ) = 2*0.00009 ( 300) = 0.0540


0

(41)

dp loss P dP3
( 0)

( ) = 2*0.00012 (150) = 0.0360


( 0)
2

ploss P

( ) = 0.00003 ( 400)
df i ( P ) dPi

+ 0.00009 ( 300 ) + 0.00012 (150 ) = 15.6MW


2 2

Step #5 / Step C: Calculate the value of that causes P1, P2, and P3 to sum the total load plus losses.

sample

dploss P ( 0) = 1 dPi

( )

R / MWh / R 7.85 + 0.00388P2 = (1 2*0.00009*300 ) = 0.9460 MWh / R 7.97 + 0.00964 P3 = (1 2*0.00012*150 ) = 0.9640 MWh P + P2 + P3 = 850 + 15.6 MW 1 { 7.92 + 0.003124 P = (1 2*0.00003* 400 ) = 0.9760 1
Ploss calculated above

(42)

Step #5a / Step Ca: Solve for .


note that this 64444equation is now linear 8 4 744444 7.92 + 0.003124 P = 0.9760 1

7.85 + 0.00388P2 = 0.9460 7.97 + 0.00964 P3 = 0.9640

0.9760 7.92 = 312.420 2535.2 0.003124 0.9460 7.85 P2 = = 243.8144 2023.2 0.00388 0.9640 7.97 P2 = = 100 826.7365 0.00964 P= 1

(43)

P3 644 7444 644 7444 4 P1 8 4P2 8 6447448 312.420 2535.2 + 243.8144 2023.2 + 100 826.7365 = 865.6

656.2344 5385.1 = 865.6 R (1)4 9.5251 = 14 244 MWh 3 first iteration of


Step #5b / Step Cb: Calculate P .

(44)

P (1) 1
1 1

6 74 4 8 = 312.420 ( 9.5251) 2535.2 = 433.94MW (45)

(1)

P2( ) = 243.8144 ( 9.5251) 2023.2 = 300.11MW P3( ) = 100 ( 9.5251) 826.7365 = 131.74MW

Step #6 / Step D: Compare first iteration of P1, P2, and P3 to initial condition.
433.94 400 33.94 P = 300.11 300 = 0.11 131.74 150 18.26 4 3 1 24
significant enough to warrant another iteration

(46)

Step #7: Go back to Step B, refer to Table 1.

Table 1: Iterative Process Used to Solve Example

................................................................................................

How can we visualize the Lambda-Iteration Method, described in (40) through (46)? refer to Figure 11.

Figure 11: Economic Dispatch by the Lambda-Iteration Method

Topic #3: Gradient Method for Economic Dispatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


Under what circumstances can we not utilize the lambda iteration methods? o If the cost-function (f) is highly non-linear, we cannot complete Step C of the Lambda-Iteration Process o Refer to the example presented in (47)
d fi ( P )

example

1 + 2 P + exp ( 3 P ) = 1 1

644474448

dPi

d ploss P ( 0 ) dPi

( )

(47)

One alternative is the Gradient Search o Works on the principle that the minimum of a function (f) can be found by following the direction or gradient toward lesser cost. o Process o Step #1: Define the set of unknown variables ( x ), initialize their values as x ( 0) . o Step #2: Begin with iteration k = 0. Note that k represents iteration number. Note that x(k) represents the kth iteration of x. o Step #3: Calculate the gradient of f ( f ) with respect to all variables of interest ( x ) for the operating point x ( k ) refer to (48).

(0)

df x ( dx

( ) ) = f ( x( ) )
0 0

f x( x2

x1

( ))
0

f x( xn

( ))
0

(48)

Step #4: Calculate the next iteration of x ( x ( k +1) ) as defined in (48). Note that is a scaling coefficient utilize >> 1 to maximize speed utilize << 1 to maximize stability

x ( k +1) = x ( k ) f ( k )
o

(49)

Step #5: Check for convergence. If method has converged, utilize x ( k +1) as solution. Otherwise, increment k by 1 and return to Step #3. Note the sample convergence criterion below. Note that x * represents a solution of x .

x( k +1) x ( k ) 0 144 244 3


if this relaxed equality holds true then...

min ( f ) = f x* = x ( k +1) 1444 24444 4 3


our solution (x ) is the value of x which minimizes the cost function (f)

(50)

Example #2: Simple Gradient Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Objective: Solve the following equation for x.

f ( x) = ex + x 2 Step #1: Solve for x algebraically. ex + x 2

0.5 = 0

(51)

= 0.5

(x 2)

= 0.5 e x

x 2 = 0.5 e x (52)

x x = 0. 2444 2 144 5 e + 3 4 we cannot solve this

What is the problem? we cannot solve for x because this function is non-linear Step #2: Try the Gradient Method, define x(0). x( ) = 1
0

(53)

Step #3: Calculate f . f = f


( 0)

d f ( x) dx
1

= e + 2 1 2 1.8899

d x e + x 2 dx

0.5 = e x + 2 x 2

(54)

Step #4: Calculate the next iteration with = 0.1.

x (1) = { 0.1 f ( k ) = 0.8110 x ( 0) 123 4 4 1


1.8899

(55)

The figures below present the results of further iterations, note that both settle to the ideal solution of approrximatly 0.55. As the analysis progresses, the magnitude of gradients settles.
1 0.8 0.6 0.4 0.2 0 0 5 10 15 1 0.8 0.6 0.4 0.2 0 0 5 10 15

Figures Above: show x(k) vs. k for = 0.1 (left) and = 0.5 (right) Topic #4: Gradient Method for Economic Dispatch (3.4.2)
How do we apply the Gradient Search to Economic Dispatch? o Set the cost function of (56) with consideration of the system constraints shown in (57). o As opposed to applying the Gradient Method to minimize the cost function alone, we utilize it to minimize the Lagrange Function of (58).
for this example, objective function is defined (simply) as total fuel cost 6444444447444444448 N
N

f ( P ) = fi ( Pi ) = cost_function i ( output i ) 14 244 1 24 4 3 4 3 { i =1 1 24 i =1 4 3 FT $ / kWh kWh N Fi


i =1

(56)

g ( Pload , P ) = Pload Pi
i =1

system (equality) constraint 6444 74444 4 8


N

(57)

N N L ( Pload , P, ) = f ( P ) + g ( Pload , P ) = fi ( Pi ) + Pload Pi 4 14 244 4 3 14 244 3 i =1 i =1

(58)

Lagrange Function

note that is Lagrange Multiplier

Consequently, we must calculate the gradient of the Lagrange function ( L ), as shown in (59).

L L = P

L L = 1 P

L L K P2 PN

L =K

N N fi ( Pi ) + Pload Pi d f ( P ) i =1 dP 1 1 1 P i =1 1 N N f (P ) + P P d f (P ) i load 2 2 P2 i =1 i i i =1 dP2 = K= M M d N N f i ( Pi ) + Pload Pi f N ( PN ) dP PN i =1 N i =1 N N Pload Pi d N dP f i ( Pi ) + Pload Pi 144 2444 4 i =1 3 i =1 1 i =1 L

(59)

The update equation, however, is relatively unchanged. x ( k +1) = x ( k ) L( k )

(60)

o Note that, for the application of gradient method to economic dispatch problem, the x vector is
defined as in (61).
x = (P 1 Refer to (62).
application of gradient method to economic dispatch of N generators, neglected power losses 64444444 744444444 4 8 d (k ) (k ) 1 dP f1 P 1 ( k +1) ( k ) P P d 1 1 (k ) (k ) ( k +1) ( k ) f 2 P2 P2 P2 dP2 M M = M ( k +1) ( k ) P PN d f P( k ) ( k ) N dP N N ( k +1) ( k ) N 4 3 2 1 24 1 3 N (k ) ( k +1) (k ) x x Pload Pi i =1 144424443

P2 K PN

(61)

( )

( )

(62)

( )
k L( )

What is the problem with this solution / formulation? 0 o Because we initialize P ( ) , generation will not necessarily meet load and (consequently) the solution will not necessarily lie on the surface defined by g. o Refer to (68).

Example 3E: Simple Economic Dispatch via Gradient Method

Problem Statement: Given the gnerator cost functions found in Example 3A, solve for the economic dispatch of generation with a total load of Pload = 800MW. Utilize an of 1 and the initial condition defined below. Step #1: Define the set of unknown variables ( x ), initialize their values as x ( 0) .
P ( 0) = ( 300, 200,300 )

( 0) =

1 3 d dP fi Pi(0) = 9.4484 3 i= 1444124444 4 i 3


this is a common approximation

( )

(63)

Step #2: Begin with iteration k = 0. Step #3: Calculate the gradient of L ( L ) with respect to all variables of interest ( x ) for the oprating point x ( k ) refer to (65).
L = 7.92 + 0.003124 P 1 P 1 L = 7.85 + 0.00388 P2 P2 L = 7.97 + 0.00964 P3 P3 L = Pload P + P2 + P3 41 3 1442444
again, note, that we are not considering power loss

/ R MWh / R MWh / R MWh (64)

( MW )

7.92 + 0.003124 P ( 0) ( 0) 7.92 + 0.003124 ( 300 ) 9.4484 0.5912 1 7.85 + 0.00388 P2( 0) ( 0) 7.85 + 0.00388 ( 200 ) 9.4484 0.8224 ( 0) L = = = ( 0) ( 0) 7.97 + 0.00964 P3 7.97 + 0.00964 ( 300 ) 9.4484 1.4136 0 0 0 0 800 300 200 300 Pload P ( ) + P2( ) + P3( ) 1

(65)

f( ) =
0

d f x( dx

( ) ) = f ( x( ) )
0 0

f x( x2

x1

( ))
0

f x ( xn

( ))
0

(66)

Step #4: Calculate the next iteration of x ( x ( k +1) ) as defined in (48).


P (1) 300 0.5912 300.5912 1 (1) P2 200 0.8224 200.8224 1 = (1) = { P3 300 1.4136 298.5864 (1) 9.4484 0 9.4484 24 1 24 { 4 3 14 3
1 x( ) 0 x( ) 0 L( )

(67)

Step #5: Continue iterations

500 450 400 350 300 250 200 150 100 50 0 0 5

x-axis: iteration (k)

P1(k) P2(k) P3(k) 10 15 20 25

Figure 12: Generation (MW) vs. Iteration # for Example 3E

What is the problem? This method does not converge How can we fix this? Make the following assumptionlets try this again
PN = Pload Pi i =1 144 2444 4 3
general statement
N 1

P3 = Pload P P2 1 144 2444 4 3


for example 3E

y-axis: generation

(68)

Topic #5: REDUCED Gradient Method for Economic Dispatch (3.4.2) . . . . . . . . . . .


How do we apply the Gradient Search to Economic Dispatch with the assumption of (68)? o Step #1: Set the cost function of (69) without explicit consideration of the system constraints shown in (70).
N 1 N 1 F ( P ) = fi ( Pi ) + f N Pload Pi { i =1 i =1 total 14 3 1442443 24 cost we pull f N ( PN ) out of this term with assumption of ( 67 ) N 1 Pi f N ( PN ) f N Pload i =1

(69)

incorporated in to cost function

g ( Pload , P ) = Pload Pi
i =1

(70)

Step #2: Define an appropriate Lagrange Function.


N 1 N 1 N L ( Pload , P, ) = F ( P ) + g ( Pload , P ) = fi ( Pi ) + f N Pload Pi + Pload Pi 4 14 244 4 3 14 244 3 i =1 i =1 4 i =1 3 14 244 Lagrange Function note that is Lagrange Multiplier that PN = Pload

(71)

because of our assumption

Pi ,
i =1

this term is neglected

Step #3: Consequently, we must calculate the gradient of the Lagrange function ( L ), as shown in (72).

dL L L = = dP P 1

L P2

L K PN 2

L =K PN 1

note that the book utilizes df1 df N dP dP 1 1 N 1 N N 1 because they take derivative with fi ( Pi ) + f N Pload Pi Pload Pi 644respect to P3 8 4 7444 P i =1 i =1 i =1 i 1 df1 ( P ) df N ( P ) 1 1 + N 1 N N 1 dP dP 1 1 fi ( Pi ) + f N Pload Pi Pload Pi P2 i =1 i =1 i =1 i df2 ( P2 ) df N ( P2 ) + K= M = dP2 dP2 N 1 N 1 N f P + f P P P P M i ( i ) N load i load i P i =1 i =1 df N 2 ( PN 2 ) df N ( PN 2 ) i N 2 i =1 + N 1 N N 1 dPN 2 dPN 2 f P + f P P Pload Pi P i ( i ) N load i i i =1 i =1 df N 1 ( PN 1 ) df N ( PN 1 ) N 2 i =1 + dPN 1 dPN 1 14444 244444 4 3

(72)

Step #4: The update equation, however, is relatively unchanged.


x ( k +1) = x ( k ) L( k )

(73)

Note that, for the application of gradient method to economic dispatch problem, the x vector is defined as in (74). **note that PN as well as are not included in x 6444447444444 8 T x = ( P P2 K PN 2 PN 1 ) (74) 1

Refer to (75).
again, note the book utilizes an opp 6444osite sign 4 74444 8 k df1 P ( k ) df N P ( ) 1 + dP dP 1 1 P ( k +1) P ( k ) 1 1 (k ) (k ) k +1 k df N P df2 P2 ( ) ( ) P2 P2 + dP2 dP2 M = M M P ( k +1) P ( k ) N 2 N 2 ( df PNk)2 df N P ( k ) P ( k +1) P ( k ) N 2 + 4 13 23 1N 1 N 1 24 dPN 2 dPN 2 ( k +1) (k ) x x k ( df N 1 PNk)1 df N P ( ) + dP dPN 1 N 1 14444 244444 4 3

( )

( )

( ) (

( )

(75)

( )

( )

L( k )

Example 3F: Simple Economic Dispatch via REDUCED Gradient Method . . . . . . . . . . . . . . . . . . . . . . . .

Problem Statement: Given the generator cost functions found in Example 3A, solve for the economic dispatch of generation with a total load of Pload = 800MW. Utilize an value of 1 and the initial condition defined below. Step #1: Define the set of unknown variables ( x ), initialize their values as x ( 0) . P ( ) = ( 300, 200,300 )
0

( 0) =

1 3 dfi Pi = 9.4484 3 i =1 dPi 1444 2444 3


this is a common approximation

( ( ))
0

(76)

Step #2: Begin with iteration k = 0. Step #3: Calculate the gradient of L ( L ) with respect to all variables of interest ( x ) for the operating point x ( k ) . Step #3a: Restate the cost functions (f1-3), utilizing (71). R / h R / f 2 ( P2 ) = 1.0 ( 310 + 7.85P2 + 0.00194 P22 ) h R / f3 ( P3 ) = 1.0 ( 78.0 + 7.97 P3 + 0.00482 P32 ) h f1 ( P ) = 1.1( 510.0 + 7.2 P + 0.00142 P 2 ) 1 1 1 Step #3b: Put the Nth, or 3rd in this case, cost function in terms of P1 through PN-1. 644P3 744 8 64 744 4P3 8 2 f3 ( P , P2 ) = 78.0 + 7.97 ( Pload P P2 ) + 0.00482 ( Pload P P2 ) 1 1 1
2

(77)

(78)

Step #3c: Perform all differentiation required to build the Lagrange Gradient, as defined in (75).

df1 / R = 7.92 + 2*0.003124 P 1 dP MWh 1 df 2 / R = 7.85 + 2*0.00194 P2 dP2 MWh df 3 R / = 7.97 ( P ) + 2*0.00482 ( Pload P P2 ) 1 1 MWh dP 1 df 3 R / = 7.97 ( P2 ) + 2*0.00482 ( Pload P P2 ) 1 MWh dP2 Step #3d: Calculate L .

(79)

df1 P ( 0 ) df 3 P ( 0 ) 1 dP dP 1 1 ( 0) L = =K 0 df2 P2( 0) df 3 P ( ) dP dP2 2 ( 0) ( 0) 7.92 + 2*0.003124 P + 2*0.00482 Pload P ( 0 ) P2( 0) 1 7.97 P 1 1 K= =K ( 0) (0) ( 0) (0) 7.85 + 2*0.00194 P2 7.97 P2 + 2*0.00482 Pload P P2 1

( )

( )

( )

( )

( ) ( )

( (

) )

(80)

7.92 + 2* 0.00312 ( 300 ) 7.97 ( 300 ) + 2*0.00482 ( 800 300 200 ) K= =K 7.85 + 2*0.00194 ( 200 ) 7.97 ( 200 ) + 2*0.00482 ( 800 300 200 ) 1.0624 K= 2.236 Step #4: Calculate the next iteration of x ( x ( k +1) ) as defined in (48).
P (1) 300 1.0624 310.676 1 1 = 1 = { P ( ) 200 2.236 222.36 14 3 2 1 3 24 2 { (0) ( 0)
1 x( )

(81)

Step #5: Continue iterations

450 400 350 300 250 200 150 100 50 0 0 20

x-axis: iteration (k)

P1(k) P2(k)

40

60

80

100

Figure 13: Generation (MW) vs. Iteration # for Example 3F

Topic #6: Newtons Method (3.5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


What is the difference between gradient search and Newtons Method? o In the gradient search, we drive cost (F) to zero and acknowledge a solution when L = 0 . o In Newtons Method, we drive the gradient ( L ) itself to zero. How do we drive the gradient of a function g(x) to zero?

y-axis: generation

Step #1: Take first order Taylor Series Expansion of g. Refer to (82).
first-order Taylor Series Expansion 6444447444444 4 8 dg ( x ) d 2g ( x ) 2 g ( x + x ) = g ( x ) + ( x ) + ( x ) + higher order terms... 2 dx dx 12 3 Jacobian Matrix

(82)

g1 ( x ) g2 ( x ) g ( x) = M g ( x) n

dg1 ( x ) dg1 ( x ) dg1 ( x ) K dx2 dxn dx1 dg ( x ) dg ( x ) dg 2 ( x ) 2 dg ( x ) 2 K = dx1 dx2 dxn dx M M M dg n ( x ) dg n ( x ) dg n ( x ) K dx dx2 dxn 1 1444444 2444444 3
Jacobian Matrix

(83)

o o

Step #2: Calculate g(x). Step #3: Set this expression, of (82), equal to zero and solve for x the change in x required to minimize g(x). Refer to (84).
g ( x + x ) = g ( x ) + dg ( x ) dx

( x )

dg ( x ) x = g ( x) dx

(84)

Adapt this Expression for Lagrange d x = L L dx


x ( ) = x ( ) + x 1442443
k +1 k

(85)

(86)

we inject the iteration number k

Where the Lagrange Function is as defined below.


N N L ( Pload , P, ) = F ( P ) + g ( Pload , P ) = fi ( Pi ) + Pload Pi 4 14 244 4 3 14 244 3 i =1 i =1 Lagrange Function note that is Lagrange Multiplier

(87)

Note: that the Jacobian Matrix of L is equivalent to the Hessian Matrix of L.

dF1 d P 1 { x1 dF2 P2 d{ x2 d d M L = =K dx dx dFN d PN { xN N Pload Pi 14 4 i =1 g ( P2, P )3 load d 2L 2 dx1 d 2L dx2 dx1 K= M d 2L dxN dx1 dL dx dx N +1 1
d 2L dx1dx2 d 2L 2 dx2 M d L dxN dx2 dL dxN +1dx2
2

K K

d 2L dx1dxN d 2L dx2 dxN M d L 2 dxN dL dxN +1dxN K K


2

K K

d 2L dx1dxN +1 d 2L dx2 dxN +1 =K M d 2L dxN dxN +1 dL 2 dxN +1 d 2 F1 d dPdPN dPN 1 d 2 F2 d dP2 dPN dPN M d FN d 2 dPN dPN
2

d 2 F1 d 2 dP 1 1 dP d 2F d 2 dP2 dP dP 1 1 M K= d 2 FN d dPN dP dP 1 1 N d Pi i =1 dP dP N +1 1 d 2 F1 2 1 dP 0 K= M 0 1 0
d 2 F2 dP22 M

d 2 F1 d dPdP2 dP2 1 d 2 F2 d dP22 dP2 M d FN d dPN dP2 dP2


2

d Pi
i =1

d Pi K
i =1

dPN +1dP2 K K

dPN +1dPN

d 2 F1 d dPd d 1 d 2 F2 d dP2 dPN +1 d M =K d 2 FN d dPN dPN +1 d N d Pi i =1 d 2

0 0
M

0
1

K K

d FN 2 dPN 1

1 1 M 1 0

(88)

Why utilize Newtons Method? o More computationally intensive, because we will have to invert the Jacobian Matrix.

Allows much faster convergence.

Example 3G: Newtons Method for Economic Dispatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Problem Statement: Given the generator cost functions found in Example 3A, solve for the economic dispatch of generation with a total load of Pload = 800MW. Utilize an value of 1 and the initial condition defined below. Step #1: Define the set of unknown variables ( x ), initialize their values as x ( 0) . (89) Step #2: Begin with iteration k = 0. Step #3: Calculate the Jacobian Matrix of Gradient / Hessian Matrix of Lagrange Function. Step #3a: Restate the cost functions (f1-3), utilizing (71).
R / h R / f 2 ( P2 ) = 1.0 ( 310 + 7.85P2 + 0.00194 P22 ) h R / f3 ( P3 ) = 1.0 ( 78.0 + 7.97 P3 + 0.00482 P32 ) h

f1 ( P ) = 1.1( 510.0 + 7.2 P + 0.00142 P 2 ) 1 1 1

(90)

Step #3b: Perform all differentiation required to build the Jacobian, as defined in (91).
df1 = 7.92 + 2 * 0.00312 P 1 dP 1 df 2 = 7.85 + 2 * 0.00194 P2 dP2 df3 = 7.97 + 2 * 0.00482 P3 dP3 d 2 f1 = 0.00624 dP 2 1 d 2f2 = 0.00388 dP22 d 2 f3 = 0.00964 dP22

(91)

Step #3d: Calculate L . 0 0 1 0.00624 0 0.00388 0 1 d L = 0 0 0.00964 1 dx 0 1 1 1 Step #4: Calculate the Langrange Function for 0th iteration.

(92)

L(

0)

df1 P ( 0) 1 0 ( ) dP 1 df2 P2( 0) 7.92 + 2 * 0.00312 ( 300 ) 0 9.7920 0 ( ) dP2 = 7.85 + 2 * 0.00194 ( 200 ) 0 = 8.6260 = 7.97 + 2 * 0.00482 ( 300 ) 0 10.8620 ( 0) df3 P3 (0) 800 300 200 300 0 dP3 N Pload Pi ( 0 ) i =1

( )

( )

( )

(93)

Step #5: Update the control variables. 0 0 1 0.00624 0 0.00388 0 1 x = 0 0 0.00964 1 0 1 1 1 144444424444443
d 0 L( ) dx 1

9.7920 58.2143 8.6260 = 206.8925 10.8620 148.6781 40 3 9.4287 1 24


0 L( )

(94)

P (1) 300 58.2143 241.78 11 P2( ) 200 206.8925 406.89 + = (1) = P3 300 148.6781 151.32 (1) 0 9.4287 9.4287 2 4 3 1 3 14 244 {
1 x( )

(95)

x(0)

x ( 0 )

Note: that Newtons Method converges much more quickly than Gradient / Lamda Iteration Methods, in one iteration

450

400

350

300

250

200

150

100

50

10

Figure 14: Generation (MW) vs. Iteration # for Example 3G

% initialize the state vector clear all x(:,1) = [300; 200; 300; 0]; % P1, P2, P3, lambda PLoad = 800; L(:,1) = [ 0 ; 0 ; 0 ; 0 ]; % set up the iterative process for k = 1:10 it(k) = k; P1(k) = x(1,k); P2(k) = x(2,k); P3(k) = x(3,k); lambda(k) = x(4,k); J = [ 0.00624 0 0 -1 ; 0 0.00388 0 -1 ; 0 0 0.00964 -1 ; -1 -1 -1 0 ]; L1(k) L2(k) L3(k) L4(k) = = = = 7.92 + 2*0.00312*P1(k) - lambda(k); 7.85 + 2*0.00194*P2(k) - lambda(k); 7.97 + 2*0.00482*P3(k) - lambda(k); PLoad - P1(k) - P2(k) - P3(k);

L(1,k) = L1(k); L(2,k) = L2(k); L(3,k) = L3(k); L(4,k) = L4(k); deltax(:,k) = -inv(J)*L(:,k); x(:,k+1) = x(:,k) + deltax(:,k); end plot(it,P1,'r',it,P2,'b',it,P3,'g',it,lambda,'y')

Remember, we have examined four methods: o Lambda-Iteration o Gradient o Reduced Gradient o Newton

Topic #7: Economic Dispatch with Piecewise Linear Cost Functions (3.6) . . . . . .
Many electric utilities prefer to represent their generator cost functions as single or multiple segment piecewise linear functions. In that case, we increase output of the generator with the lowest incremental cost, as defined in (2), until load demand is met. The process is trial-and-error based. We will come back to this

Topic #8: Dynamic Programming (Appendix 3B) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


What is dynamic programming? o In terms of mathematical optimization, a method to simplify decision making by breaking it down into a sequence of decision steps over time. Formulation:

stages represented by roman numerals Stage #I: Foundation dirt (A) $20k
0 $1

Value Function V(Xi, Z): represents the cost to travel from stage i to choice node Z Stage #II: Exterior Walls

Optimal Policy: the lowest cost route Stage #IV: Windows brick (G) $10k
$2 0k

Stage #III: Interior Walls $10k


$3 5k

brick (B)

$50k
$3 5k

brick (D)

1-layer (J)

X1 = {BC}

Stage Xi: the path to making your ith choice

Example #3: Traveling Salesman via Dynamic Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

cement (C)

$35k
$6 0k

wood (E)

$35k
$1 0k

wood (H)

$30k
5k $1

2-layer (K)

Stone (F)

$20k

plaster (I)

$30k

3-layer (L)

fmin.(E) = 10 + 35 < 20 +35 Choice Node Set Xi: set of nodes representing all options for ith stage Minimum Cost fi(Z): defines minimal cost to travel to choice node Z

Figure 15: Example Formulation of Dynamic Programming

Figure 16: Dynamic Programming Example

Problem Statement: to find route with minimal cost, this is referred to as the optimal policy.

Figure 17: Dynamic Programming Example w/ Minimum Cost at Each Node Step #1: Identify that five stages exist, denoted as I, II, III, IV, and V. Step #2: Define the choice node sets.

X 0 = { A}

underline denotes set or array

X 1 = { B, C , D}

X 2 = { E , F , G} X 4 = { L, M } X 5 = {N }

X 3 = {H , I , J , K }

(96)

Step #3: Determine minimum cost (f) and optimal policy to travel to each choice node of set #1.
minimum cost to node B value from stage 0

6 74 4 8 } to choice node B f ( B) = V ( X0 , B) = 5

f ( D) = V ( X 0 , D) = 3 Step #4: Determine minimum cost (f) and optimal policy to travel to each choice node of set #2.

f (C ) = V ( X 0 , C ) = 2

(97)

f( C D 5, 2, 3 6B ) + V ( B ,8 6 ) + V ( C8 6 ) + V ( D8 } 611,74 4 8, 8 4 E ) f (4 , E ) f ( 4 , E ) 74 74 74 f ( E ) = min f ( X 1 ) + V ( X 1 , E ) = min 5 + 11 = 16, 2 + 8 = 10, 3 + = 16 = 10 f (B C D 6 ) + V ( B8 f6) + V ( C8) f6) + V ( D , F ) 4 , F ) (4 , F ( 4 8 74 74 74 5 + = , 2 + 4 = 6 , 3 + 6 = 9 = 6 f ( F ) = min f ( X 1 ) + V ( X 1 , F ) = min

optimal policy to travel to E 644 7444 4 8 opt ( E ) = { A, C , E}

optimal policy to travel to F 644 7444 4 8 opt ( F ) = { A, C , F }

f ( G ) = min f ( X 1 ) + V ( X 1 , G ) = min [5 + = , 2 + 9 = 11, 3 + 6 = 9] = 9

optimal p 644olicy to travel to G 4 7444 8 opt ( G ) = { A, D, G}

(98)
Step #5: For each stage (k), record the following pieces of information: o minimum cost from beginning to {Xk} for each choice node of set. o optimal path from beginning to {Xk} for each choice node of set.
k 1 2

nodes B, C, D E, F, G

f ( Xk ) 5, 2, 3 10, 6, 9

opt( Xk ) A, A, A AC, AC, AD

Step #6: Determine minimum cost (f) and optimal policy to travel to each choice node of set #3.

4 E 8 4F 8 4G 8 6 74 6 74 6 74 10 + 3 = 13, 6 + 8 = 14,9 + = = 13 f ( H ) = min f ( X 2 ) + V ( X 2 , H ) = min 64 E 8 6 74 6 74 74 4 F 8 4G 8 f ( I ) = min f ( X 2 ) + V ( X 2 , I ) = min 10 + 2 = 12, 6 + 11 = 17,9 + = = 12 G E F 8 6 74 74 4 4 8 64 8 6 74 f ( J ) = min f ( X 2 ) + V ( X 2 , J ) = min 10 + = , 6 + 5 = 11,9 + = = 11 G E F 8 6 74 74 4 4 8 64 8 6 74 f ( K ) = min f ( X 2 ) + V ( X 2 , J ) = min 10 + = , 6 + 9 = 15,9 + 4 = 13 = 13 (99)
k 1 2 3

opt ( H ) = opt ( E ) + H opt ( I ) = opt ( E ) + I opt ( J ) = opt ( F ) + J opt ( K ) = opt ( G ) + K

nodes B, C, D E, F, G H, I, J, K

f ( Xk ) 5, 2, 3 10, 6, 9 13, 12, 11, 13

opt( Xk ) A, A, A ACE, ACF, ADG ACEH, ACEI, ACFJ, ADGK

Step #7: Determine minimum cost (f) and optimal policy to travel to each choice node of set #4 f ( L ) = min f ( X 3 ) + V ( X 3 , L ) = min [13 + 9 = 22, 12 + 3 = 15, 11 + 7 = 18, 13 + = ] = 15 opt ( L ) = opt ( I ) + L f ( M ) = min f ( X 3 ) + V ( X 3 , M ) = min [13 + = , 12 + 6 = 18, 11 + 8 = 19, 13 + 5 = 18] = 18 opt ( M ) = opt ( I / K ) + L
(100)

k 1 2

nodes B, C, D E, F, G

f ( Xk ) 5, 2, 3 10, 6, 9

opt( Xk ) A, A, A ACE, ACF, ADG

3 4

H, I, J, K L, M

13, 12, 11, 13 15, 18

ACEH, ACEI, ACFJ, ADGK ACEIL, ACE(I/K)L

Step #8: Determine minimum cost (f) and optimal policy to travel to each choice node of set #5. f ( N ) = min f ( X 3 ) + V ( X 4 , N ) = min [15 + 4 = 19, 18 + 3 = 21] = 19 opt ( N ) = opt ( L ) + N (101)
k 1 2 3 4 5

nodes B, C, D E, F, G H, I, J, K L ,M N

f ( Xk ) 5, 2, 3 10, 6, 9 13, 12, 11, 13 15, 18 19

opt( Xk ) A, A, A ACE, ACF, ADG ACEH, ACEI, ACFJ, ADGK ACEIL, ACE(I/K)L ACEILN

Step #9: This table demonstrates the optimal path of ACEILN with a cost of 19 units.
Example #4: Allocation Problem via Dynamic Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Problem Statement: Find the optimal allocation of funds, to maximize profit, within four investments. Refer to INSERT Table 3.5. The only restriction is that investments must be made in integer amounts and must add up to 10 units total. Step #1: Note that the four funds may be divided in to four sets of funds, as shown below: o Individual Funds o Fund #0 = F0 o Fund #1 = F1 o Fund #2 = F2 o Fund #3 = F3 o Sets of Funds o Set #0 = S0 = {F0} o Set #1 = S1 = {F0, F1} o Set #2 = S2 = {F0, F1, F2} o Set #3 = S3 = {F0, F1, F2, F3} Step #2: Outline the example as a dynamic programming problem.

Figure 18: Formulation of Fund Allocation as Application of Dynamic Programming


Step #3: Determine minimum cost (f) and optimal policy to travel to each choice node of set #1.

X 0 [ 0] ) X 1) 1 1 f (64+ V ( X 0 [0], X1 [1]) f64+ V ( X 0 [1], X8]) 6 74 4 8 4 744 8 ( 0 [ ]4 744[ f ( X 0 ) + V ( X 0 , X 1 [1] ) = max 0 + 0.25 = 0.25 , 0.28 + 0 = 0.28 = 0.28 f ( X 1 [1]) = max

X 1 [1] rep. that $1 is invested in combination of ventures #1 and #2

Step #3a: First, examine optimal allocation between ventures #1 and #2 if only one dollar can be spent. when we have one dollar to spend, the optimal policy is to invest in venture #1 choice node opt(X1[1]) = { X0[0], X1[1] }

(102)

Step #3b: Next, examine optimal allocation between ventures #1 and #2 if only two dollars can be spent.
f ( X 1 [ 2]) = max f ( X 0 ) + V ( X 0 , X 1 [ 2]) = K
X 0 [ 0] ) f ( X 0 [1]) + X 2 , X1 2] ) f (64+ V ( X 0 [0], X1 [ 2]) 644V ( X 0 [1], X1 [4 f (64+ V ( X 0 [ 2]4[ 2]) 4 744 8 4 744 8 0 [ ])4 74 8 0 + 0.41 = 0.41 , 0.28 + 0.25 = 0.53, 0.45 + 0 = 0.45 = 0.53 K = max 14 244 144 2444 14 244 3 4 3 4 3 all4 in venture #2 split evenly in both ventures all in venture #1

(103)

Do we have to check every combination? o Note that as investors have more money to spend, they will only

when we have two dollars to spend, the optimal policy is to invest $1 in venture #1 and the rest in venture #2 opt(X1[2]) = { X0[1], X1[2] }

o o we can pick next investment based on incremental costs

add to, not take away from, previous optimal sub-policies. In other words, they must only examine two cases per allocation: o Additional Investment in New Fund (Fk) o Additional Investment in Previous Set (Sk-1)

644 7444 644 7444 4 8 4 8 } incremental increase for fund #1 incremental increase for fund #2 f ( X 1 [3]) = 0.53 + max 0.45 0.28 = 0.17 , 0.41 0.25 = 0.16 = 0.70

f ( X 1 [ 2] )

(104)

Step #3c: Next, examine optimal allocation between ventures #1 and #2 if only three dollars can be spent. This is shown above in (104).
f ( X 1 [3]) = max f ( X 0 ) + V ( X 0 , X 1 [3]) = K
X 0 [ 0] ) f( f X 2 )+ X 0 [3]) 3]) )+ V 1 3 1 3 f (64+ V ( X 0 [0], X8]) 6X 0 [1]4 ( X 0 [1], X1 [3]) 644V ( X 0 [2], X1 [8 f (64+ V ( X 0 [3], X8]) 7444 4 744[ 4 744[ 44 7444 ( 0 [ ]4 8 (105) 0 + 0.55 = 0.55 , 0.28 + 0.41 = 0.69 , 0.45 + 0.25 = 0.70 , 0.65 + 0 = 0.65 = 0.70 K = max 14 244 144 2444 144 2444 14 244 4 3 4 3 4 3 4 3 invest $1 in venture #1, invest $2 in venture #1, all in venture #1 all in venture #2 rest in #2 rest in #2

when we have three dollars to spend, the optimal policy is to invest $2 in venture #1 and the rest in venture #2 opt(X1[3]) = { X0[2], X1[3] }

Step #3: Complete this in a table form. Table 2: Stage I Allocation Table (S0 vs. F1)
k1 0 1 2 3 4 5 6 7 8 9 10 .f( X0[k1] ). 0 0.28 0.45 0.65 0.78 0.9 1.02 1.13 1.23 1.32 1.38 .V(X0,X1[k1]). 0 0.25 0.41 0.55 0.65 0.75 0.8 0.85 0.88 0.9 0.9 f( X0[+1] ) 0 0.28 0.45 0.7 0.9 1.03 1.19 1.33 1.45 1.57 1.68 f( X1[+1] ) 0 0.25 0.53 0.69 0.86 1.06 1.2 1.3 1.43 1.55 1.67 f( X1[k1] ) 0 0.28 0.53 0.7 0.9 1.06 1.2 1.33 1.45 1.57 1.68 Optimal Sub-Policy opt( S0 ) opt( F1 ) 0 0 1 0 1 1 2 1 3 1 3 2 3 3 4 3 5 3 6 3 7 3

how much is spent total? define profit of previous funds as function of k. define profit of new fund as function of k.

what profit does additional investment in previous funds provide? what profit does additional investment in the new fund provide?

what is the maximum of these two? What is the optimal distribution of money between stages?

Step #3: Determine the optimal allotment of money for stage III, between funds #1/2 and #3.

0.15 0.28 74444 6444 74444 8 4 8 64444 f ( X 2 [1]) = max f ( X 1 ) + V ( X 1 , X 2 [1]) = max f ( X 1 [ 0]) + V ( X 1 , X 2 [1]) , f ( X 1 [1]) + V ( X 1 , X 2 [1]) = 0.28 144444444444444444444424444444444444444444443

opt ( X 2 [1]) = opt ( X1 [1]) + X 2 [1]

0.45 0.53 74444 64444 744444 8 4 8 64444 f ( X 1 [1]) + V ( X 1 , X 2 [ 2] ) , f ( X 1 [1 + 1] ) + V ( X 1 , X 2 [ 2]) = 0.53 f ( X 2 [ 2]) = max f ( X 1 ) + V ( X 1 , X 2 [ 2]) = max 14444444444444444444444 24444444444444444444444 3

opt ( X 2 [ 2]) = opt ( X 1 [ 2]) + X 2 [ 2]

0.68 0 74444 64444 744444 8 4 .70 8 64444 f ( X 2 [3]) = max f ( X 1 ) + V ( X 1 , X 2 [3]) = max f ( X 1 [ 2]) + V ( X 1 , X 2 [3]) , f ( X 1 [ 2 + 1] ) + V ( X 1 , X 2 [ 3] ) = 0.70 14444444444444444444444244444444444444444444443

opt ( X 2 [3]) = opt ( X1 [3]) + X 2 [3]

0.8 0. 74444 64444 744444 8 4 90 8 64444 5 f ( X 2 [ 4]) = max f ( X 1 ) + V ( X 1 , X 2 [ 4] ) = max f ( X 1 [3]) + V ( X 1 , X 2 [ 4]) , f ( X 1 [3 + 1] ) + V ( X 1 , X 2 [ 4]) = 0.90 14444444444444444444444244444444444444444444443

opt ( X 2 [ 4]) = opt ( X 1 [ 4]) + X 2 [ 4]

1.05 74444 64444 1.06 8 4 744444 8 64444 f ( X 1 [ 4]) + V ( X 1 , X 2 [5]) , f ( X 1 [ 4 + 1]) + V ( X 1 , X 2 [5]) = 1.06 f ( X 2 [ 5]) = max f ( X 1 ) + V ( X 1 , X 2 [5]) = max 14444444444444444444444244444444444444444444443

opt ( X 2 [5]) = opt ( X 1 [ 4]) + X 2 [5]

etc... (106) Table 3: Stage II Allocation Table (S1 vs. F2)


k2 0 1 2 3 4 5 6 7 8 9 10 .f( X1[k2] ). .V(X1,X2[k2]). 0 0 0.28 0.15 0.53 0.25 0.7 0.4 0.9 0.5 1.06 0.62 1.2 0.73 1.33 0.82 1.45 0.9 1.57 0.96 1.68 1 f( X1[+1] ) 0 0.28 0.53 0.7 0.9 1.06 1.2 1.35 1.48 1.6 1.72 f( X2[+1] ) 0 0.15 0.43 0.68 0.85 1.05 1.21 1.31 1.45 1.58 1.7 f( X2[k2] ) 0 0.28 0.53 0.7 0.9 1.06 1.21 1.35 1.48 1.6 1.72 Optimal Sub-Policy opt( S0 ) opt( S1 ) opt( F2 ) 0 0, 0 0 1 1, 0 0 2 1, 1 0 3 2, 1 0 4 3, 1 0 5 3, 2 0 5 3, 2 1 6 3, 3 1 7 4, 3 1 8 5, 3 1 9 6, 3 1

Step #4: Determine the optimal allotment of money for stage III, between funds #1/2/3 and #4. Table 4: Stage III Allocation Table (S2 vs. F3)
k3 0 1 2 3 4 5 6 7 .f( X2[k3] ). .V(X2,X3[k3] ). f( X2[+1] ) 0 0 0 0.28 0.2 0.28 0.53 0.33 0.53 0.7 0.42 0.7 0.9 0.48 0.9 1.06 0.53 1.1 1.21 0.56 1.26 1.35 0.58 1.41 f( X3[+1] ) 0 0.2 0.48 0.73 0.86 1.03 1.23 1.39 f( X3[k3] ) 0 0.28 0.53 0.73 0.9 1.1 1.26 1.41 Optimal Sub-Policy opt( S2 ) opt( F3 ) 0, 0, 0 0 1, 0, 0 0 1, 1, 0 0 1, 1, 0 1 2, 1, 0 1 3, 1, 0 1 3, 2, 0 1 3, 2, 1 1

8 9 10

1.48 1.6 1.72

0.6 0.6 0.6

1.55 1.68 1.81

1.54 1.68 1.77

1.55 1.68 1.81

3, 3, 1 3, 3, 1 4, 3, 1

1 2 2

We see that the optimal allotment of funds is F1 = 4, F2 = 3, F3 = 1, F4 = 2 with a total profit of 1.81 units. This problem is similar to our needs for unit commitment.

Topic #9: Economic Dispatch Using Dynamic Programming (3.7) . . . . . . . . . . . . . .


In some cases, the cost vs. output behavior of a generator is supplied as a table of set values not single or set of mathematical functions. In these cases, we will utilize dynamic programming to solve for the economic dispatch. ** Note, this type of economic dispatch is similar to the resource allotment example we just completed.
Example 3H: Simple Economic Dispatch Via Dynamic Programming . . . . . . . . . . . . . . . . . . . . . . . . . . .

FORMATTING IS RIGHT, BUT IS SOLUTION RIGHT??? Problem Statement: Find the optimal economic dispatch, to minimize cost, with three generators. The only restriction is that generation should equal 310MW. Unlike the previous example, generation can take on any value (not necessarily 50MW intervals as utilized in table). Consequently, linear interpolation may be required. INSERT TABLE FROM BOOK How does this problem differ from the funds allocation example? o We cannot make the assumption that we will only add to, and never take away from, the output dispatched to a generator or set of generators. As such, we must examine all combinations not just two. Step #1: Note that the three generators may be divided in to three sets, as shown below. o Individual Gens o Gen #0 = P0 o Gen #1 = P1 o Gen #2 = P2 o Sets of Funds o Set #0 = S0 = {P0} o Set #1 = S1 = {P0, P1} o Set #2 = S2 = {P0, P1, P2} Step #2: Outline the example as a dynamic programming problem.

Figure 19: Economic Dispatch as Application of Dynamic Programming Note: from this point on we refer to the min function of dynamic programming as (fmindp) and cost functions as f1, f2
unlike fund allocation Create a table for optimal economic dispatch for generators #1 and #2 based of the behavior of Step #3: problem above, we must (107). examine all (not just two) dp fmin ( X 1 ) = f1 ( D P2 ) + f 2 ( P2 ) (107) combinations of S1 and P2 Generation by Unit #2 (P2)

t o t a l d e m a n d

D (MW) \ P2 (MW) 0 50 75 100 125 150 175 200 225 250 275

0 oo oo oo oo oo oo oo oo oo oo oo

50 oo oo oo 1560 2105 2210 2522.5 2835 3177.5 3510 oo

75 oo oo oo oo 1965 2510 2615 2927.5 3240 3582.5 3915

100 oo oo oo oo oo 2170 2715 2820 3132.5 3445 3787.5

125 oo oo oo oo oo oo 2465 3010 3115 3427.5 3740

150 oo oo oo oo oo oo oo 2760 3305 3410 3722.5

f(X2)

opt(S1) 0 50 75 50 50 50 50 50 100 100 125

opt(P2) 0 0 0 50 75 100 125 150 125 150 150

oo oo oo
1560 1965 2170 2465 2760 3115 3410 3722.5

300 325 350

oo oo oo 0

oo oo oo 50

oo oo oo 75

4120 oo oo 100

4082.5 4415 oo 125

4035 4377.5 4710 150

4035 4377.5 4710

150 175 200

150 150 150

summary of S1 behavior

Step #3: Create a table for optimal economic dispatch for generators #1/#2 and #3.
D (MW) \ P3 (MW) 0 50 75 100 125 150 175 200 225 250 275 300 325 350 100 125 oo oo oo oo oo oo oo oo 3264.5 3669.5 3874.5 4169.5 4464.5 4819.5 150 oo oo oo oo oo oo oo oo oo 3558 3963 4168 4463 4758 f(X3) opt(S2) 0 50 75 100 125 100 100 100 175 100 200 150 175 200 summary of S2 behavior opt(P3) 0 0 0 0 0 50 75 100 50 150 75 150 150 150

oo oo oo oo oo
2366 2668 2971 3271 3558 3868 4168 4463 4758

We see that the optimal economic dispatch for demand for: o D = 300 MW is P1, P2, P3 = 50, 100, 150 MW and total cost of 4168 R/h o D = 325 MW is P1, P2, P3 = 50, 125, 150 MW and total cost of 4463 R/h Step #4: Use linear interpolation to dispatch generation for D = 310MW. Step #4a: How do we determine which generator will provide 10MW? Look at the solution above. Because generator #2 provides additional generation as D moves from 300 to 325 MW, we will utilize that unit to provide an additional 10MW. Step #4b: Utilize linear interpolation to determine the cost for 10MW additional generation from unit #2.
6444 74444 4 8 x 7444 8 F2 @125 MW F2 @100 MW 6444 1655 1360 F2 = (110MW 100MW ) = (10 ) = 118 125 100 125MW 100MW
yhigh ylow xhigh xlow

(108)

For D = 310MW, the optimal economic dispatch is P1, P2, P3 = 50, 110, 150 MW with a cost of 4168 + 118 = 4286 R / h.

Topic #10: Base Point and Participation Factors (3.8) . . . . . . . . . . . . . . . . . . . . . . . . . . .


What if we have an optimal dispatch and demand changes?

Do we have to re-perform the whole process again? If change is small, we can adapt the existing dispatch with reasonable accuracy utilizing participation factors.

Step #1: Begin with an schedule / dispatch referred to as the base point. o P0 = P1, P2, = base point o P0 = P1, P2 = new dispatch o 0 = system cost at base point o Pload = load demand at base point o Pload = new load demand Step #2: Define change in output of ith generating unit (Pi) in terms of change in system cost ().
d 2 Fi Pi = 2 dPi
It may applied to the system as a whole.
N d 2 Fi Pload = P + P2 + K = 1 2 i =1 dP i 1 1

(109)

(110)

Step #3: Define participation factor a ratio of change in load demand to output of ith generator.
d 2 Fi dP 2 Pi i =1 = 2 i d Fi Pload dPi 2
N

(111)

Step #4: Calculate new dispatch.


Pi Pi = Pi + ( Pload Pload ) P 4 load 1 24 3
participation factor

(112)

Example 3I: Utilization of Participation Factors for Economic Dispatch . . . . . . . . . . . . . . . . . . . . . . . .

Problem Statement: Starting from the optimal economic solution found in Example 3A, use the participation factor method to calculate a new dispatch if load increases from 800 to 900 MW.
dF1 = 7.92 + 2*0.00312 P 1 dP 1 dF2 = 7.85 + 2*0.00194 P2 dP2 dF3 = 7.97 + 2*0.00482 P3 dP3 d 2 F1 = 0.00624 dP 2 1 d 2 F2 = 0.00388 dP22 d 2 F3 = 0.00964 dP22

Step #1: Begin with an schedule / dispatch referred to as the base point.

P0 = ( 393.2, 334.6, 122.2 )

(113)

Step #2: Define participation factors.


P 1/ 0.003124 320.10 1 = = = 0.47 Pload 1/ 0.003124 + 1/ 0.00388 + 1/ 0.00964 681.57 P2 = 0.38 Pload P3 = 0.15 Pload (114)

Step #3: Update dispatch schedule utilizing these participation factors.


P = 393.2 + 0.47 *50 = 416.7 1 P2 = 334.6 + 0.38*50 = 353.6 P3 = 122.2 + 0.15*50 = 129.7
Topic #11: Economic Dispatch vs. Unit Commitment (3.9) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(115)

What is the difference between economic dispatch and unit commitment? o In economic dispatch, it is assumed that N units are already connected to the system. Objective is to the optimal set of output (MW) for these generators. o In unit commitment, it is assumed that N units are available but not necessarily connected to the system. Objective is to find the optimal set of generators for which if economic dispatch is performed properly cost is minimal. o Economic dispatch is a subproblem of the UC.

Lecture #4: Transmission System Effects / Power Flow Analysis


What is the role of the transmission system in economic dispatch? o (#1) The total real power loss increases the total generation demand, and o (#2) The generation schedule may have to be adjusted (by location) to reduce transmission network congestion and meet local demand. How can we examine the effect of transmission network on economic dispatch? o Loss Formulae a basic relationship between generation and power loss, without consideration of network constraints on power flow. o Requires a set of assumptions, associated with typical power system operation. o Similar to what we utilized in previous chapter. o Power Flow Equations incorporate the full power system model, with consideration of network constraints on power flow o This is known as optimal power flow.

Topic #1: The Power Flow Problem (wood 4.1)


What is the power flow problem? o Find State (x) of an n-bus power transmission network where: o lines = model o transformers = ideal transformer w/ series impedance o generator / load behavior = constraints
Infinite Bus Generator Bus

real power injection (P2Inj) real power flow (P2)


ZSh

power injection is (generally) constant power flow is dependent on system state: x = |Vi|, i objective: find x which satisfies SiInj = Si

ZSeries
ZSh

-line model
ZSh ZSh

w flo er (S w 3)

co

complex power injection (-S3Inj)

pl ex

po

Figure 20: Overview of Power Flow Problem

Sub-Topic #1: Direct Current (DC) Networks (wood 4.1.1)


Consider the following example

How do we calculate voltage at bus #2 of power system below? o Rseries = 0.25ohms o Vsource = 1.0V o P2Inj = 1.2W

Note the following definitions o Bus (i) an electrical node. o Power Flow (Pik) the power flowing away from a bus i, or from a bus i to a bus k. o Current Flow (Iik) the current flowing away from a bus i, or from a bus i to a bus k. o Line Resistance (Rik) o Power Injection (PiInj) power flow in the steady-state. o e.g. generator output Pgen o e.g. load consumption Pload

Step #1: Calculate the current from bus #2 to bus #1.


I 21 = V2 V1 E2 1 = R12 0.25 (116)

Step #2: Calculate power flow from bus #2.


E 1 2 P2 = V2 I 21 = E2 2 = 4 ( E2 E2 ) = 1.2 0.25 (117)

Step #3: Solve for E2.


2 4 E2 4 E2 + 1.2 = 0

E2 =

( 4 )

4 * 4 * ( 1.2 )
2*4

4 16 + 19.2 1.2416 = 8 0.2416

(118)

How do we solve for voltage of a third bus (V3)?

Step #1: Calculate network currents.


1 1 V1 V2 V1 V3 1 1 + = + V1 + V2 + V3 R12 R13 R12 R12 R13 R13 1 1 V V V V 1 1 + I 2 = I 23 + I 21 = 2 3 + 2 1 = V1 + V2 + V3 R23 R21 R12 R12 R23 R23
I1 = I12 + I13 = I 3 = I 32 + I 31 =

(119)

1 1 V3 V2 V3 V1 1 1 + = + V1 + V2 + V3 R23 R13 R13 R23 R13 R23

Restate this in a matrix form.


referred to a YBus 6444444or addmittance matrix 8 7444444 1 1 1 1 + R12 R13 R12 R13 I1 V1 1 1 1 1 I2 = + V2 R12 R12 R23 R23 I V 3 3 1 1 1 1 + R13 R R13 R23 1444444 23 2444444 3
14 4 10 4 9 5 10 5 15

(120)

What is the problem here? We cannot solve the nonlinear equation below with quadratic equation, once Ybus is larger than 1 by 1.

step #1: declare expression below 64444744448 V 2 V2V1 V22 V2V3 P2 = 2 + R12 R23 14444244443 this expressions is derived from P V V V V I2 = 2 = 2 1 + 2 3 V2 R12 R23

1 1 1 2 1 P2 = + V2 + V2V3 V1V2 + R12 R23 R12 4 3 4R23 124 14243 124 3


(121)

P2 = V + V2 + V2V3
2 2

we cannot solve for V2 via quadratic equation

What about starting from an initial guess (to solve for V3)? Step #1: Take an initial guess for the system voltages?
V1old = 1, V2old = 1, V3old = 1
(122)

Step #2: Now we solve the system algebraically, as before, to update the system voltages.
Step #2a: Solve for V2New.
step #1: declare expression below 644444 7444444 4 8 P2 V2new V1 V2new V3 I 2 = old = + V2 R12 R23 1444 2444 3
I 2 =4V1 + 9V2new 5V3

step #2: re-arrange expression in terms of V2new

64444744444 4 8 1 P2 new V2 = old + 4V1 + 5V3 9 V2

(123)

step #3: fill numerical values 644444 in7444444 4 8 1 1.2 new V2 = + 4 (1) + 5 (1) = 1.13 9 1

Step #2b: Solve for V3New.


step #1: declare expression below 644444 7444444 4 8 P3 V3new V1 V3new V2 I 3 = old = + R13 R23 V3 1444 2444 3
P3 V3old

=10V1 5V2 +15V3new


new

step #2: re-arrange 64444expression in terms of V38 7 4 44444 P3 1 V3new = old + 10V1 + 5V2 15 V3 step #3: fill numerical values 64444444 in744444444 4 8 utilize updated value } 1 1.5 new V3 = + 10 (1) + 5 (1.13) = 0.9433 { { 15 1 V1 V2 V3{ old

(124)

Step #3: Continue with this process.


x-axis: iteration (k)

1.2 1 0.8 0.6 0.4

V2(k) 0.2 0 0 5 10 15 20
Figure 21: System Voltage vs. Iteration for Example

V3(k)

Note that, once the process is complete, Vold and Vnew should equal one another.
----- STEVENSON ---------------------------------------------------------------------------------------------------------

Sub-Topic #2: Alternating Current (AC) Networks


How do we define an AC power system? o Voltage (Vi) at each bus is denoted by a complex value.
64 8 6 74 r r r 74 r4 8 Vi = Vi e ji = Vi cos ( i ) + j Vi sin ( i ) 3 1444444 24444444 4
note that complex values are denoted by an arrow hat
ViRe ViIm

y-axis: voltage in volts

(125)

Impedances (zik) / Admittances (yik) are denoted in terms of resistance, reactance, conductance, and susceptance.
conductance = g ik susceptance = bik 64748 64748 r r jik r r yik = yik e = yik cos (ik ) + j yik sin (ik )

(126)

Current (Iik) is depicted in terms of voltage and admittance.


n r r r Bus r r Bus r r I k = Yi1 V1 + Yi 2 V2 + K = YikBusVk k =1

(127)

Complex Power (Sik) is similarly defined in terms of voltage and current.


real and reactive pow 4 er8 r r r* r n r Bus r * 674 Si = Vi I i = Vi Yik Vk = Pi + jQi k =1

(128)

Real / Reactive Power (Pik / Qik) in more detail, defined as below.


*** VERY IMPORTANT *** THE POWER FLOW EQUATIONS BELOW
not yik rr } r r Pi = ViVk YikBus cos i k YikBus
n k =1

)) ))
(129)

n rr r r Qi = ViVk YikBus sin i k YikBus k =1 14444444244444443

these are generally known as the power-flow equations

What is the difference between yik and YikBus ? o yik represents the impedance between buses i and k. o YikBus represents the [i, k] element of the YBus matrix.
6Y11 8 74 r4 r y +y 12 r 13 Bus Y21 } r y = r 12 Bus Y31 } r y 13
r Bus r Bus
Bus Y13 } r y13 r Bus Y23 } r y23 r Bus 6 Y33 r 4 8 74 r y13 + y23

Y12 } r y12

r Y Bus

6 Y22 r 74 r4 8 y12 + y23


} r y23
r Bus Y32

r Bus

(130)

** It is very important to understand this difference

In the power flow problem, we deal with many types of power including o Calculated Flow (Sicalc) a calculated / estimated value of the power flowing from bus i to all connected buses. o Scheduled Flow (Sisch) the expected value of Si, based on available generation / load at bus i. o In this class, we refer to this as Injection (SiInj). o Flow Mismatch (Si) the difference between calculated and expected flow

Generator

Load

Pigen power injection PInj network bus i

Pidem

power flow P
Figure 22: Definition of Power Generation (Pigen), Demand (Pidem), Injection (PInj), and Flow (P)

Pi = Pi

calc

Qi = Qicalc ( Qigen Qidem ) 14 244 4 3


QiInj

64 744 4Pi 8 gen ( Pi Pi dem )

Inj

(131)

What is the significance of Pi and Qi? o The goal of power flow is to find a solution (aka. system state x) which brings mismatch to zero (Pi = 0, Qi = 0)

Figure 23: Power Flow Constraints

How do we divide / define system buses?

Slack Bus o Known |Vi|, i o Unknown n/a o Used For Infinite / Slack Bus Voltage Controlled Bus (aka. P|V| Bus) o Known |Vi|, PiInj o Unknown i o Used For Generator Bus (with or without load) Load Bus (aka. PQ Bus) o Known PiInj, QiInj o Unknown |Vi|, i o Used For Loads

Why is the slack bus (absolutely) necessary for power flow analysis? o To Account for Losses o Circular Problem it is impossible to balance generation (Pigen) and load (Pidem) without knowledge of losses (Ploss). define losses (Ploss) without knowledge of system state (x = |Vi|, i). calculate system state (x) without knowledge of generation and load (Pigen, Pidem) o Without Slack Bus system is often overconstrained, and no solution exists.
64444 0 74444 8 n n + Pi gen Pi dem = Ploss i =1 i =1 i slack i slack
these can be schedule, approximately

Pslack

(132)

INSERT TABLE 4.4. from Wood / Wallenburg Mathematical Representation of AC Power Flow o System Constraints (g): a set of expressions which define steady-state behavior of a power system.
*** VERY IMPORTANT *** POWER FLOW CONSTRAINTS BELOW

6444444 Pi 7444444 8 r Bus Inj n r r r Bus Pi ViVk Yik cos i k Yik k =1 g= =0 n r r r Bus r Bus Q Inj V V Y sin Y i k ik i k ik i k =1 144444 2444444 4 3 Qi

))

))

(133)

System Paramateres / Input (u): a set of static parameters which define component and, consequently, system behavior. r Topology ( Y Bus ): defines the manner in which buses are connected to one another. o

8 6444444444444 444444444444 7 r Bus r Bus r Bus r Bus Y13 r Y12 Y14 64 Y11 r 4r 744 8 } } } I1 r r r r r V1 y12 y13 y14 r r y12 + y13 + y14 V r r r r r r r2 I2 = y12 + y23 + y24 y12 y23 y24 r I r r r r r r V3 3 y13 + y23 + y34 y13 y23 y34 r r I r r r r r r V 4 y14 + y24 + y34 4 y14 y24 y34
o

Y Bus

(134)

System State (x): a set of variables which describe the condition of the system.
x1 } u1 } V2 Pg , 2 2 = 0 R12 { 14 244 4 u2 3 simple example for 2-bus DC system
2

g ( x, u ) = 0

(135)

Objective: to find x.

Because the system constraints are nonlinear, we cannot solve them via simple algebra.

Example #1: Formulation of AC Power Flow Analysis (9.1S)


Problem Statement: Suppose that the PQ load is known at each of nine buses of a small power system with synchronous generators at buses 1, 2, 5, and 7. For a power-flow study, identfiy DP and DP mismatches and the state variables associated with each bus. Choose 1 as the slack bus. Step #1: State bus types.
Slack Bus: 1 PV Bus: 2, 5, 7 PQ Bus: 3, 4, 6, 8, 9

Step #2: State mismatches.

At PQ Buses: Pi, Qi At PV Buses: Pi only Total of 13 mismatches

13 equations to be solved

Step #3: Describe state variables.


At PQ Buses: |Vi|, i At PV Buses: i only Total of 13 state variables.

Topic #2: The Gauss-Seidel Method (9.2S) for Power Flow


What is the Gauss Method? o Although we do not refer to the process by name, it is the process we utilize in (122) through (124). How is it derived? Step #1: Create an expression which equates current injection (a function of power injection) and current flow refer to (136).
n r r I i = I im m =1

(Sr )
Vi*

Inj * i

64748 74 64 8 n r r Pi Inj jQiInj Bus r* = = Yim Vm { Vi m =1 element


m ( i ,r ) of Y bus

solve for current flow in terms of power injection

solve for current flow in terms of line flows

(136)

Step #2: For Bus i


Step #2a: Categorize Vi as either new (right) or old (left).
n r r Pi Inj jQiInj r Bus r new Bus + Yim Vm r old * = Yii Vi 1 3 m =1 2 Vi m i updated { guess

(137)

previous guess

Step #2b: Solve this expression for Vinew. n r r r 1 P Inj jQ Inj Bus Vi new = r Bus i r *i Yim Vm Yii V old m =1 i mi

(138)

Step #3: Replace terms old and new with iteration numbers (k).
*** VERY IMPORTANT *** GAUSS METHOD BELOW

k th iteration of Vi

} P Inj jQ Inj n r r (k ) r ( k 1) 1 Bus i Vi = r Bus i r Yim Vm Yii V ( k 1) * m =1 m i 1i23 4 4 ( k 1)th iteration of Vi

(139)

How does the Gauss-Seidel differ from Gauss? o Utilize the newest iteration of state variables available for update.
*** VERY IMPORTANT *** GAUSS-SEIDEL METHOD BELOW
utilization of state utilization of state variables 1i -1 variables i +1 n which have been which have not been updated 64748 64updated 8 4 744 Inj Inj i 1 r n r (k ) r Bus r ( k 1) 1 Pi jQi Bus = r Bus r Yim Vm Yim Vm { m = i +1 { Yii V ( k 1) * m =1 updated not i updated

rk Vi ( )

(140)

What is the problem with this expression? o For a voltage-controlled (PV) bus, reactive power injection (QInj) is not defined. So we cannot apply it directly to such a bus. How do we treat voltage-controlled / PV buses? Step #1: Calculate reactive power flow (QiInj) at the bus.
r = Im Vi ( k 1)
updated not already updated } n r i r Bus } r (k ) r ( k 1) Bus Yim Vm + Yim Vm (141) m = i +1 m =1

QiInj , calc

r n r Bus r = Im Vi * Yim Vm m =1

QiInj ,calc

Step #2: Calculate generator reactive power output (Qigen).


Qigen = QiInj ,calc + Qidem (142)

Step #3: Check for violation of reactive power output limit (Qilim) if one exists.
QiInj ,calc > Qilim (143)

Step #4: Update Vinew utilizing expression below.


Inj Inj , calc rk r r ) i 1 Y BusVr ( k ) n Y BusVr (k 1) = 1 Pi j ( Qi Vi ( ) = r Bus 1 im m m+1 im m r ( k 1) * Yii m= =i Vi

(144)

Step #5: If violation does not exist, replace the magnitude of Vi(k) with that defined in the problem statement.
defined in problem state.

} rk r Vi ( ) = Vi 1442443
essentially, we keep angle and replace magnitude

(145)

Example #2: Four-Bus Gauss-Seidel Power Flow (9.2S)


Problem Statement: Figure 9.2. shows the one-line diagram of a simple power system. Generators are connected at buses 1 and 4 while loads are indicated at all four buses. Base values or the transmission system are 100MVA, 230kV.

6 1274 6 1374 4 8 4 8 r r Y12 = 3.82 j19.08 Ysh1 = j 0.05125 + j 0.03875 = j 0.09 r r Y13 = 5.17 j 25.85 Ysh 2 = j 0.05125 + j 0.03875 = j 0.09 r r Y24 = 5.17 j 25.85 Ysh3 = j 0.03875 + j 0.06375 = j 0.1025 r r Y34 = 3.02 j15.11 Ysh 4 = j 0.03875 + j 0.06375 = j 0.1025

(Y

r shunt

/2

(Y

r shunt

/2

(146)

Step #1: Build the admittance matrix.


r r r y12 + y13 + ysh1 r y12 = r y13 0 8.99 j 44.84 3.82 + j19.08 = 5.17 + j 25.85 0 r y12 r r r y12 + y24 + ysh 2 0 r y24 r y13 0 r r r y13 + y34 + ysh 3 r y34

r Y bus

0 r y24 r y34 r r r y24 + y34 + ysh 4

r Y bus

3.82 + j19.08 5.17 + j 25.85 0 5.17 + j 25.85 8.99 j 44.84 0 0 8.19 j 40.86 3.02 + j15.11 5.17 + j 25.85 3.02 + j15.11 8.19 j 40.86

(147)

Step #2: Define system parameters as well as initialize the system state
r r r V1 = 1, 1 = 0, V4 = 1.02, Y bus , Pd 2 = 170, Qd 2 = 105.35,K u = K , P = 200, Q = 123.94, P = 318, P = 80, Q = 49.58 d3 d3 g4 d4 d4
5 state variables 644444 7444444 4 8 gen this is referred 6load bus8 6load bus8 bus to as a flat start 74 74 74 r4 ( 0) r4 ( 0) r } 64 8 0 0 0 = V2( ) , 2 , V3( ) , 3 , V2 , 4( ) = (1, 0,1, 0, 0 )

(148)

x(

0)

(149)

Step #3: Setup Gauss-Seidel update equations for all load buses.

r V2(1)

r1 V2( )

r V2(1) = 0.9836 j 0.0323 = 0.9841 e j 0.0328

2 P 2 ) j ( Qg 2 Q d ( Pg 64748d 2 ) sch sch r bus r r bus r P jQ 1 = r 2 r *2 Y21 V1( 0 ) Y24 V4( 0) = 0 Y22 V2( ) Pd 2 + Qd 2 Sbase 6447444 } 4 8 ( 170 + j105.35 ) /100 1 = 1.0 ( 3.82 + j19.08 ) 1.02 ( 5.17 + j 25.85 ) 8.99 j 44.84 1

( )

(150)

r V3(1)

r1 V3( )

r V3(1) = 0.9712 j 0.0417 = 0.9720 e j 0.0403

that we ( Pg 3 Pd 3 ) j ( Qg 3 Qd 3 ) noteupdated use value 64748 678 r r 4 r 4 sch sch r bus 1 P jQ bus = r bus 3 r * 3 Y31 V1(1) Y34 V4( 0) (0) Y33 V3 Pd 3 + Qd 3 Sbase 644 44 } 7 8 ( 200 + 123.94 ) /100 1 = 1.0 ( 5.17 + j 25.85 ) 1.02 ( 3.02 + j15.11) 8.19 j 40.86 1

( )

(151)

Step #4: Setup Gauss-Seidel update equations for all generator buses.
Step #4a: Update Q4.
already updated 6447444 674 8 not updated 4 8 r ( 0 ) * r bus r (1) r bus r (1) r bus r ( 0) Q4 = Im V4 Y42 V2 + Y43 V3 + Y44 V4 already updated 6444444444444447444444444444448 ( 5.17 + j 25.85 )( 0.9836 j 0.0323) + ( 3.02 + j15.11)( 0.9712 j 0.0417 ) + K (152) Q4 = Im 1.02 K + ( 8.19 j 40.86 )1.02 144 244 3 not updated

( )

Q4 = Im {1.2582 j1.4247} = 1.31 Step #4b: Update V4(1).

r1 V4( )

r1 V4( )

r1 V4( ) = 1.0227 + j 0.0125 = 1.0228 e j 0.0122

we calculate Pg 4 Pd 4 this } } calc r bus r (1) r bus r (1) 1 P4sch j Q4 = r bus Y24 V2 Y34 V3 r ( 0) * Y44 V4 calc Pg 4 Pd 4 jQ4 644 44 } 8 Sbase 7 238 j131.70 /100 ( ) 1 = ( 5.17 + j 25.85 )( 0.9836 j 0.0323) K 8.19 j 40.86 1.02 K 3.02 + j15.11 0.9712 j 0.0417 ) ( )(

( )

(153)

Step #4c: Correct voltage magnitude |V4|.


( ) V4( ) = V4,corr =
k k

V4 V4( k )

V4( ) = 1.02e j 0.0122


k

(154)

Step #5: Continue this process in Matlab.


clear all i = sqrt(-1); % construct the Ybus matrix Ybus = [-8.99-i*44.84 -3.82+i*19.08 -5.17+i*25.85 0 ; -3.82+i*19.08 8.99-i*44.84 0 -5.17+i*25.85 ; -5.17+i*25.85 0 8.19-i*40.86 -3.02+i*15.11 ; 0 -5.17+i*25.85 3.02+i*15.11 8.19-i*40.86]; % initialize the system state V2(1) = 1; V3(1) = 1; V4(1) = 1.02; % define the system parameters V1mag = 1; theta1 = 0; V4mag = 1.02; Pd2 = 1.7; Qd2 = 1.0535; Pd3 = 2; Qd3 = 1.2394; Pg4 = 3.18; Pd4 = 0.80; Qd4 = 0.4958; V1 = V1mag*( cos(theta1) + i*sin(theta1) ); for k = 1:20 it(k) = k; it(k+1) = k; % update the load bus voltages V2(k+1) = (1/Ybus(2,2)) * ( ((-Pd2+i*Qd2) / conj(V2(k))) - Ybus(1,2)*V1 Ybus(2,4)*V4(k) ); V3(k+1) = (1/Ybus(3,3)) * ( ((-Pd3+i*Qd3) / conj(V3(k))) - Ybus(1,3)*V1 Ybus(3,4)*V4(k) ); % update the generator bus voltage angle Q4calc(k) = -imag( conj(V4(k)) * ( Ybus(4,2)*V2(k+1) + Ybus(4,3)*V3(k+1) + Ybus(4,4)*V4(k) )); V4uncorr(k+1) = (1/Ybus(4,4)) * ((Pg4-Pd4-i*Q4calc(k))/ conj(V4(k)) Ybus(2,4)*V2(k+1) - Ybus(3,4)*V3(k+1)); % scale the generator bus voltage magnitude V4(k+1) = ( V4mag/abs(V4uncorr(k+1)) ) * V4uncorr(k+1); end plot(it,abs(V2),'ro-',it,abs(V3),'bo-') plot(it,angle(V2)*360/(2*pi),'ro-',it,angle(V3)*360/(2*pi),'bo',it,angle(V4)*360/(2*pi),'ko-')

1.005

1.5

1 0.995 0.5 0.99 0 0.985 -0.5 0.98 -1 0.975 -1.5

0.97

-2

0.965

10

12

14

16

18

20

-2.5

10

12

14

16

18

20

Figure 24: Results of Gauss-Seidel Power Flow for Example 9.2S Voltage Magnitude (left) and Angle (right) vs. Iteration #

Topic #3: Newton-Raphson Method (9.3S)

Generic

What is the Newton-Raphson Method? o A method to solve nonlinear systems based on the Taylor Series Expansion. Consider the example below o Let us consider the system below. Our goal is to find the values of x1 and x2 which satisfy these system constraint of g = 0. The problem is, however, that if g1 and g2 are nonlinear, a closed-form solution for x does not exist.
g ( x , x , u ) h1 ( x1 , x2 , u ) b1 g ( x1 , x2 , u ) = 1 1 2 = =0 g 2 ( x1 , x2 , u ) h 2 ( x1 , x2 , u ) b2 (155)

How do we derive a solution? Step #1: Approximate (155) as a Taylor Series Expansion.
Taylor Series Expansion 64444444444444 744444444444444 4 8 ( ( 0) ( 0) dg1 x1 , x2 , u dg1 x1( 0) , x20 ) , u 0 0 (0 (0 x1( ) + x2 ) + K = 0 g1 ( x1 , x2 , u ) = g1 x1( ) , x2 ) , u + dx1 dx2

g 2 ( x1 , x2 , u ) = g 2

( ( dg 2 x1( 0 ) , x20) , u dg 2 x1( 0 ) , x20) , u 0 0 (0 (0 x1( ) + x1( ) , x2 ) , u + x2 ) + K = 0 dx1 dx2

(156)

Step #2: Utilize only first-order approximation.

0 iteration of 6444444Jacobian Matrix - J 4 74444444 8 0 ( 0) ( 0) (0 dg1 x1 , x2 , u =0 mismatch x ( dg1 x1( ) , x2 ) , u 6 740) 64 744 4 8 4 8 ( * * g1 x1( 0 ) , x20) , u g1 ( x1 , x2 , u ) x1 x1( 0 ) dx1 dx2 + = ( 0) * * ( 0 ) ( 0) ( dg 2 x1( 0 ) , x20) , u x2 x2 ) ( 0) ( 0 ) g 2 ( x1 , x2 , u3 g 2 x1 , x2 , u dg 2 x1 , x2 , u 14 244 4 1442443 * g1 dx1 dx2 g( 0 ) 1 1444444 24444444 4 3 *

th

( 0)

( (

) )

(157)

g1

g( 0 ) 2

dg( 0 ) 1 dx1 dg( 0 ) 2 dx1

(0 dg1 ) dx1 ( 0) dg 2 dx2

Step #3: Solve (157) for x.


( ( dg10) dg10) dx2 x1 dx1 = ( 0) dg (20) x2 dg 2 dx 4 dx23 141 244
0 J( )

( g1 x1( 0 ) , x20) , u ( 0) + x1 ( 0) 0) 0) ( g 2 x1( , x2 , u x2 1442443


0 g( )

( (

) )

(158)

Step #4: Adapt (158) for iterative implementation.


( ( dg1k ) dg1k ) x1( k +1) dx2 dx1 k +1 = k ( ) x( ) dg (2k ) 4 4 2 dg 2 123 dx x ( k +1) 4 dx23 141 244
k J( )

( g1 x1( k ) , x2k ) , u ( k ) + x1 (k ) ( k ) (k ) g 2 x1 , x2 , u x2 { 1442444 4 3 k x( )


k g ( )

( (

) )

(159)

Example #3: Simple Non-Power-Flow Newton-Raphson Example (9.4S)


Problem Statement: Using the Newton-Raphson method, solve for x1 and x2 of the nonlinear equations below. Utilize the following initial condition: x1(0) = 0rad, x2(0) = 1.0.
g1 644474448 g1 ( x1 , x2 , u ) = h1 ( x1 , x2 , u ) b1 = 4ux2 sin ( x1 ) + 0.6 = 0

644444g2 744444 8 2 g 2 ( x1 , x2 , u ) = h 2 ( x1 , x2 , u ) b2 = 4 x2 4 ( u ) x2 cos ( x1 ) + 0.3 = 0 {


u =1

(160)

Step #1: Calculate partial differential of g with respect to x.

dg1 dx 1 J = dg 2 dx1

dg1 dx2 4ux2 cos ( x1 ) 4u sin ( x1 ) = dg 2 4ux2 sin ( x1 ) 8 x2 4u cos ( x1 ) dx2

(161)

Step #2: Use the following expression, derived from (158), to solve this example.
4ux2 cos ( x1 ) 4u sin ( x1 ) x1 = ) x2 4ux2 sin ( x1 )48 x2 4u cos ( x13 144444 2444444
0 J( )

0 x1( ) 4ux2 sin ( x1 ) + 0.6 2 + (0) cos ( x1 ) + 0.3 4 x2 4 ( u ) x244444 x2 14444 2 4 3


0 g ( )

(162)

Note the Matlab code presented below.


clear all clc % step #1: define u u = 1; % step #2: define initial condition of x x(1,1) = 0; x(2,1) = 1; % step #3: initiaize the jacobian matrix J = eye(2,2); for i = 1:5 % step #4: record the index index(i) = i; index(i+1) = i+1; % step #5: calculate the Jacobian matrix J = [ 4*u*x(2,i)*cos(x(1,i)) 4*u*sin(x(1,i)); 4*u*x(2,i)*sin(x(1,i)) 8*x(2,i)4*u*cos(x(1,i)) ]; % step #6: calculate g1 and g2 g1 = 4*u*x(2,i)*sin(x(1,i)) + 0.6 g2 = 4*x(2,i)*x(2,i)-4*u*x(2,i)*cos(x(1,i)) + 0.3 % step #7: update voltage magnitude / angle x(:,i+1) = -inv(J)*[g1; g2] + x(:,i) end % step #8: plot solution plot(index,x(1,:),index,x(2,:))

1.2

0.8

0.6

0.4

0.2

-0.2

10

11

Figure 25: Newton-Raphson Solution

Step #3: Plug solution (x) in to (160). g1 ( x1 = 0.1669, x2 = 0.9031, u = 1) = 4 (1)( 0.9031) sin ( 0.1669 ) + 0.6 = 0.000114 g 2 ( x1 = 0.1669, x2 = 0.9031, u = 1) = 4 ( 0.9031) 4 (1)( 0.9031) cos ( 0.1669 ) + 0.3 = 0.000153
2

(163)

Topic #3: Newton-Raphson Method (9.4S) for Power Flow


How do we define the power flow problem for Newton-Raphson? o System State (x) Voltage Magnitude |Vi| and Angle (i)
(left) voltage angles 2 n , 6444444444(right) voltage magnitudes 2 n 4 74444444444 8 r r r r x = 2 3 K n 1 n V2 V2 K Vn 1 Vn

(164)

System Constraints (g) Power Flow Constraints (133).


*** BELOW, A VARIATION ON (133) ***
P 6444444444i 7444444444 8 r Bus Re{Yik } 6 8 n rr r 7 r r2 P Inj V ( G Bus ) + V V Y Bus cos Y Bus i i ii i k ik i k ik k =1 k i g= =0 n rr r r Inj r 2 Bus Qi Vi ( Bii ) + ViVk YikBus sin i k YikBus 1 r 3 k =1 2 Bus k i Im{Yik } 144444444424444444444 4 3 Qicalc
calc

))

(165)

))

How do we adapt the Newton-Raphson solution method, presented in (159), to power flow? Step #1: Declare a generic matrix-form of the the solution method.
*** VERY IMPORTANT *** GENERAL NEWTON-RAPHSON SOLUTION BELOW

x ( k +1) = J ( k ) g ( x , u ) + x ( k )

(166)

Step #2: Define all arrays, except J.

64444444444444 4444444444444 7 8 calc 6444444444P2 4 74444444448 4 r n r r r Bus r Bus 2 V G Bus + V V Y cos Y Inj P2 2 ( 22 ) 2 k 2 k 2 2k k k =1 k 2 r n r r r r Bus 2 Bus P3Inj V3 ( G33 ) + V3Vk Y3Bus cos 3 k Y3k k k =1 k 3 k k) ( x( ) 678 6 74 4x 8 M (k ) 2( k +1) 2 k +1 r n ( ) r r r Bus r Bus ( k ) 2 2 3 PnInj Vn1 ( GnBus n1 ) + Vn1Vk Yn1,k cos n1 k Yn1,k 1 1, k =1 M M k n 1 k ( k +1) n(1) r n1 n r r r r (k ) V 2 G Bus + V V Y Bus cos Y Bus Inj ( k +1) Pn n ( nn ) n k nk n k nk n n k =1 (k ) ( k ) 1 k n +V V2( k +1) = J 2 r n r r r V ( k +1) V (k ) r Bus 2 Inj V B Bus + V V Y Bus sin Y 3 3 Q2 2 ( 22 ) 2 k 2 k k 2 2k M k =1 M k 2 k V ( k +1) Vn(1) r n 1 n r r r r 2 Bus Q3Inj V3 ( B33 ) + V3VkY3Bus sin 3 k Y3Bus ( k +1) k k Vn( k ) Vn k =1 k 3 M r n r r r Bus r Bus 2 Inj Bus Qn1 Vn1 ( Bn1,n1 ) + Vn1Vk Yn1k sin n1 k Yn1,k k =1 k n1 r n r r r Bus r Bus 2 Bus QnInj Vn ( Bnn ) + VnVkYnk sin n k Ynk k =1 k n

))

))

))

))

))

))

))

))

(167)

Step #2: Define the Jacobian Matrix [ J ].

P2 2 P3 2 M Pn 1 2 Pn 2 J = Q2 2 Q3 2 M Q n 1 2 Qn 2

P2 3 P3 3 M

dP/dM
K K K K

J11
K

P2 n 1 P3 n 1 Pn 1 n 1

P2 n P3 n M Pn 1 n Pn n Q2 n Q3 n M Qn 1 n Qn n

P2 V2 P3 V2 M Pn 1 V2 Pn V2 Q2 V2 Q3 V2 M Qn 1 V2 Qn V2

P2 V3 P3 V3

J12
K K K K K

P2 Vn 1 P3 Vn 1 Pn 1 Vn 1

dP/d|V| M M
Pn Vn 1 Q2 Vn 1 Q3 Vn 1

Pn 1 3 Pn 3 Q2 3 Q3 3 M

Pn 1 V3 Pn V3 Q2 V3 Q3 V3

Pn n 1 Q2 n 1 Q3 n 1

Qn 1 Qn 1 K 3 n 1 Qn 3 K Qn n 1

dQ/dM

J21

J22
K

Qn 1 Qn 1 K V3 Vn 1 Qn V3 Qn Vn 1

M M dQ/d|V|

P2 Vn P3 Vn M Pn 1 Vn Pn Vn Q2 Vn Q3 Vn M Qn 1 Vn Qn Vn

(168)

How many types elements do we need to define? o Off-Diagonals rr r r Pi = ViVk YikBus sin i k YikBus = ik k rr r r Qi = ViVk YikBus cos i k YikBus = ik k rr r Pi 1 = Vi YikBus cos i k YikBus = r ik Vk Vk

))

))

( (

))

(169)

rr r Qi = Vi YikBus sin i k YikBus Vk

r ) ) = V1

ik

Diagonals

n rr r r Pi = ViVk YikBus sin i k YikBus i k =1

)) = ))

ii

r = Qi Vi

(B )
Bus ii

k i

n r rr r r2 B Qi = YikBusViVk cos i k YikBus = ii = Pi Vi ( Gii us ) i k =1 (170) n r r Bus r r Bus r r Pi 1 1 Bus Bus Bus = 2 Vi ( Gii ) Yik Vk cos i k Yik = r ii + 2 Vi ( Gii ) = r Pi + Vi ( Gii ) Vi Vi Vi k =1

))

k i

n r r r r Qi Bus = 2 Vi ( Bii ) YikBusVk sin i k YikBus Vi k =1

1 ) ) = Vr
i

ii

r r 1 B 2 Vi ( Bii us ) = r Qi Vi ( BiBus ) i Vi

Can we define the Jacobian in terms of , ?

23 22 33 32 M M n 1, 2 n 1,3 n3 n2 J = 23 22 33 32 M M n 1, 2 n 1,3 n3 n2

K K

2, n 1 3, n 1
M

2n 3n
M

dP/d
K K L

J11 J21
K

r 1 Bus r 22 + 2 V2 ( G22 ) V2 1 r 32 V2 M 1 r n 1,2 V2 1 r n2 V2 r 1 Bus r 22 2 V2 ( B22 ) V2 1 r 32 V2 M 1 r n 1,2 V2 1 r n2 V2

1 r 23 V3 r 1 Bus r 33 + 2 V3 ( G33 ) V3 M 1 r n 1,3 V3 1 r n3 V3 1 r 23 V3

J12
K K K K

1 r 2, n 1 Vn 1 1 r 3, n 1 Vn 1

K n 1, n 1 n 1, n

dP/d|V|

M r 1 r n 1, n 1 + 2 Vn 1 ( GnBus n 1 ) 1, Vn 1 1 r Vn 1 n, n 1 1 r 2, n 1 Vn 1 1 r 3, n 1 Vn 1 M

n 1, n 2, n 1 3, n 1
M

nn 2n 3n
M

r 1 Bus r 33 2 V3 ( B33 ) K V3 M 1 r n 1,3 V3 1 r n3 V3

dQ/d
K n 1, n 1

J22
K

n 1, n nn

dQ/d|V|

r 1 K r n 1, n 1 2 Vn 1 ( BnBus n 1 ) 1, Vn 1 1 r n , n 1 Vn 1

n , n 1

1 r 3n Vn M 1 r n 1, n Vn r 1 Bus r nn + 2 Vn ( Gnn ) Vn 1 r 2n Vn 1 r 3n Vn M 1 r n 1, n Vn r 1 Bus r nn 2 Vn ( Bnn ) Vn 1 r 2n Vn

(171)

Note
In (167), the voltage magnitude |V| and angle at every system bus is considered unknown. However, we do know |V| at many system buses (e.g. generator).

How do we handle voltage-controlled buses? o Delete Appropriate Rows / Columns o if bus i is voltage-controlled delete all rows / columns corresponding to |Vi| and Qi For example Take the Newton-Raphson updated expression shown below. If bus #2 is voltage-controlled, then we must delete the third row / column of all matrices.
delete all 64444444444444444444444elements in red 4 744444444444444444444444 8 r n r r r r P Inj V 2 G Bus + V V Y Bus cos Y Bus 2 2k k 2 2 ( 22 ) 2 k 2 k 1 k =1 P2 P2 P2 P2 k 2 3 V2 V3 r 2 n r r r Bus r Bus 2( k ) 2( k +1) 2 Bus P3 P3 P3 P3Inj V3 ( G33 ) + V3Vk Y3k cos 3 k Y3k P3 ( k +1) k =1 3( k ) 3 k 3 2 3 V2 V3 ( k +1) = (k ) Q Q + V2 Q2 Q2 r V2 2 2 n r r r r 2 Bus 2 3 V2 V3 Q2Inj V2 ( B22 ) + V2Vk Y2Bus sin 2 k Y2Bus ( k ) k k V3( k +1) V3 k =1 k2 Q3 Q3 Q3 Q3 2 3 V2 V3 n r r r Bus r Bus Inj r 2 Bus Q3 V3 ( B33 ) + V3Vk Y3k sin 3 k Y3k k =1 k 3 (172)

))

))

))

))

Example #4: Four-Bus Newton-Raphson Power Flow (9.5S)

Problem Statement: o A small power system of Example 9.2. has the line data and bus data presented in Tables 9.2. and 9.3. A power fow study of the system is to be performed utilizing Newton-Raphson method.

Part A: How many rows / columns will the Jacobian matrix have? Step #1: Outline the system buses, and their corresponding unknowns
o o o o

Bus #1: Infinite Bus unknowns = n/a Bus #2: Load / PQ Bus unknowns = |V2|, 2 Bus #3: Load / PQ Bus unknowns = |V3|, 3 Bus #4: Gen / PV Bus unknowns = 4

Because we have five unknowns ( |V2|, |V3|, 2, 3, 4 ), the Jacobian matrix will be of size 5 x 5.

Part B: Calculate the initial mismatch at all buses Step #2: Outline the composition of mismatch constraints (g) utilizing information we know about unknowns to be solved. From it, we know that five power flow constraints must be solved for five constraints 64444 74444 8 r V2 Q2 constraint r V Q constraint 3 3 (173) 2 P2 constraint 3 P3 constraint P constraint 4 4 Note, we will need to utilize the previously calculated YBus matrix.

r Y Bus

r Y Bus

r r r y12 + y13 + ysh1 r y12 = r y13 0 8.99 j 44.84 3.82 + j19.08 = 5.17 + j 25.85 0

r y12 r r r y12 + y24 + ysh 2

r y13

0 r y24 8.99 j 44.84 0 5.17 + j 25.85

0 r r r y13 + y34 + ysh 3 r y34

0 r y24 r y34 r r r y24 + y34 + ysh 4

3.82 + j19.08 5.17 + j 25.85

0 5.17 + j 25.85 0 8.19 j 40.86 3.02 + j15.11 3.02 + j15.11 8.19 j 40.86

(174)

Step #3: State these constraints, as defined in (165).


8 6444444444444444 74444444444444444 4Q2 r r r Bus r Bus r r r Bus r Bus Inj r 2 Bus + V2V4Y24 sin 2 4 Y24 Q2 V2 ( B22 ) + V2V1Y21 sin 2 1 Y21 r 2 Bus r r r Bus r Bus r r r Bus r Bus Q Inj V B + V3V1Y31 sin 3 1 Y31 + V3V4Y34 sin 3 4 Y34 3 ( 33 ) 3 P2 8 6444444444444444 74444444444444444 (175) 4 g = r 2 Bus r r r Bus r Bus r r r Bus r Bus P Inj V ( G ) + V V Y cos Y + V2V4Y24 cos 2 4 Y24 22 2 1 21 2 1 21 2 2 r 2 Bus r r r Bus r Bus r r r Bus r Bus P3Inj V3 ( G33 ) + V3V1Y31 cos 3 1 Y31 + V3V4Y34 cos 3 4 Y34 r r r Bus r Bus r r r Bus r Bus Inj r 2 Bus + V4V3Y43 cos 4 3 Y43 P4 V4 ( G44 ) + V4V2Y42 cos 4 2 Y42

( (

))

))

( (

))

))

( ( (

))

))

))

( ( (

))

))

))

Step #4: Fill in numerical values. Utilize a flat start of V = 1 + j0 at all buses
load @ bus #2 6 74 4 8 2 1.0535 1 ( 44.84 ) + 1*1*19.45 sin 0 0 (101.31O ) + 1*1.02* 26.36 sin 0 0 (101.31O ) load @ bus #3 6 74 4 8 2 1.2394 1 ( 40.86 ) + 1*1* 26.36 sin 0 0 (101.31O ) + 1*1.02*15.40 sin 0 0 (101.31O ) load @ bus #2 } 2 g= 1.70 1 ( 8.99 ) + 1*1*19.45 cos 0 0 (101.31O ) + 1*1.02* 26.36 cos 0 0 (101.31O ) load @ bus #3 } 2 2.00 1 ( 8.19 ) + 1*1* 26.36 cos 0 0 (101.31O ) + 1*1.02*15.40 cos 0 0 (101.31O ) generation - load @ 4bus #4 8 64 744 2 ( 3.18 0.80 ) 1.02 ( 8.19 ) + 1.02*1* 26.36 cos 0 0 (101.31O ) + 1.02*1*15.40 cos 0 0 (101.31O ) (176)

( (

) )

Step #4a: Simplify this expression

0.45 0.83 g = 1.59 1.93 2.21

(177)

Part C: Calculate the Jacobian Matrix (J) Step #5: Define elements of the Jacobian.
J11 = r r r Bus r Bus Q2 g1 Bus = = 2 V2 ( B22 ) V1Y21 sin 2 1 Y21 V2 x1

)) V Y

r r Bus
4 24

r Bus sin 2 4 Y24

) ) = 44.74 (178)
(179)

J13 =

r r r Bus Q2 g1 = = V2V1Y21 2 x3

Q2 g1 = =0 V3 x2 r Bus r r r Bus r Bus cos 2 1 Y21 V2V4Y24 cos 2 4 Y24 J12 =

))

) ) = 8.9852 (180)
(181)

J14 = J15 =

Q2 g1 = =0 3 x4

r r r Bus r Q2 g1 = = V2V4Y24 cos 2 4 Y2Bus 4 4 x5

) ) = 5.1696

(182) (183)

J 22 =

r r r Bus Q3 g 2 Bus = = 2 V3 ( B33 ) V1Y31 V3 x2

Q3 g 2 = =0 V2 x1 r r r Bus r Bus sin 3 1 Y3Bus V4Y34 sin 3 4 Y34 1 J 21 =

))

) ) = 40.7613
(185)

J 24 =

r r r Bus Q3 g 2 = = V3V1Y31 3 x4 J 25 =

(184) Q3 g 2 J 23 = = =0 2 x3 r Bus r r r Bus r Bus cos 3 1 Y31 V3V4Y34 cos 3 4 Y34

))

) ) = 8.1933 (186)
(187)

r r r Bus r Q3 g 2 = = V3V4Y34 cos 3 4 Y3Bus 4 4 x5

) ) = 3.0237
r cos 2 4 Y2Bus 4

J 31 =

r r r Bus r Bus P2 g 3 Bus = 2 V2 ( G22 ) V1Y21 cos 2 1 Y21 r = x1 V2

)) V Y

r r Bus
4 24

) ) = 8.9852
(189)

J 32 J 33 =

(188) P2 g 3 = r = =0 x2 V3

r r r Bus r Bus P2 g 3 = = V2V1Y21 sin 2 1 Y21 2 x3

)) + V V Y

r r r Bus
2 4 24

r Bus sin 2 4 Y24

)) = 44.9260 (190)
(191)

P2 g 3 = =0 3 x4 r r r Bus r Bus P2 g 3 J 35 = = = V2V4Y24 sin 2 4 Y24 4 x5 J 34 =

) ) = 25.8478

(192)

J 41 =

P3 g 4 =0 r = x1 V2

(193)

J 42 =

r r r Bus r Bus P3 g 4 Bus = 2 V3 ( G33 ) V1Y31 cos 3 1 Y31 r = x2 V3

)) V Y

r r Bus
4 34

r cos 3 4 Y3Bus 4

) ) = 8.1933
(195)

J 44 =

r r r Bus P3 g 4 = = V3V1Y31 3 x4 J 45 =

(194) P3 g 4 J 43 = = =0 2 x3 r Bus r r r Bus r Bus sin 3 1 Y31 + V3V4Y34 sin 3 4 Y34

))

) ) = 40.9663 (196)
(197) (198) (199) (200) (201)

r r r Bus r Bus P3 g 4 = = V3V4Y34 sin 3 4 Y34 4 x5 r r Bus r Bus P g J 51 = r 4 = 5 = V4Y42 cos 4 2 Y42 x1 V2

) ) = 15.1185 ) ) = 5.1696 ) ) = 3.0237 )) ))

J 52 = J 53 =

r r Bus r Bus P4 g 5 = V4Y43 cos 4 3 Y43 r = x2 V3

r r r Bus r Bus P4 g 5 = = V4V2Y42 sin 4 2 Y42 = 25.8478 2 x3 r r r Bus r Bus P4 g 5 J 54 = = = V4V3Y43 sin 4 3 Y43 = 15.1185 3 x4 r r r Bus r Bus r r r Bus r Bus P4 g 5 J 55 = = = V4V2Y42 sin 4 2 Y42 + V4V3Y43 sin 4 3 Y43 4 x5

))

) ) = 40.9663 (202)

5.1696 0 8.9852 0 44.7460 40.7613 3.0237 0 0 8.1933 J = 8.9852 44.9260 0 0 25.8478 8.1933 40.9663 15.1185 0 0 3.0237 25.8478 15.1185 40.9663 5.1696
Part D: Perform Newton-Raphson Power Flow in Matlab Step #6: Utilize the update expression below (for first iteration)

(203)

x( )
1

x( 0) 8 } 64444444444444 4444444444444 7 1 0 8.9852 0 5.1696 0.45 1 0.9917 44.7460 40.7613 3.0237 0.83 1 0.9855 0 0 8.1933 = 8.9852 0 0 25.8478 1.59 + 0 = 0.0081 (204) 44.9260 8.1933 40.9663 15.1185 1.93 0 0.0156 0 0 5.1696 3.0237 25.8478 15.1185 40.9663 2.21 0 0.0135

J g

Step #7: Display Matlab code below.


% Example 9.4S clear all clc

j = sqrt(-1); % step #1: declare the YBus matrix YBus = [8.985190-j*44.835953 -3.815629+j*19.078144 -5.169561+j*25.847809 0 ; 3.815629+j*19.078144 8.985190-j*44.835953 0 -5.169561+j*25.847809 ; 5.169561+j*25.847809 0 8.193267-j*40.863838 -3.023705+j*15.118525 ; 0 5.169561+j*25.847809 -3.023705+j*15.118528 8.193267-j*40.863838] GBus = real(YBus); BBus = imag(YBus); % step #2: declare the injections PInj = [ -0.50 -1.70 -2.00 3.18-0.80 ]; QInj = [ -0.3099 -1.0535 -1.2394 -0.4958 ]; % step #3: initialize the system voltages V4mag = 1.02; x(:,1) = [ 1; 1; 0; 0; 0 ]; for m = 1:20 it(m) = m; it(m+1) = m+1; % step #4: transfer updated voltage from x array to V V = [1 x(1,m)*cos(x(3,m))+j*x(1,m)*sin(x(3,m)) x(2,m)*cos(x(4,m))+j*x(2,m)*sin(x(4,m)) V4mag*cos(x(5,m))+j*V4mag*sin(x(5,m)) ]; % step #5: calculate the mismatches for i = 2:3 g1(i) = QInj(i) + abs(V(i))^2 * BBus(i,i); for k = 1:4 if i == k else g1(i) = g1(i) - abs(V(i))*abs(V(k))*abs(YBus(i,k))*sin( angle(V(i))-angle(V(k))-angle(YBus(i,k)) ); end end end for i = 2:4 g2(i) = PInj(i) - abs(V(i))^2 * GBus(i,i); for k = 1:4 if i == k else g2(i) = g2(i) - abs(V(i))*abs(V(k))*abs(YBus(i,k))*cos( angle(V(i))-angle(V(k))-angle(YBus(i,k)) ); end end end % step #6: consolidate mismatch array (g) g = [ g1(2); g1(3); g2(2); g2(3); g2(4) ]; % step #7: calculate the Jacobian Matrix (J) J(1,1) = 2*abs(V(2))*BBus(2,2) - abs(V(1)*YBus(2,1))*sin(angle(V(2))angle(V(1))-angle(YBus(2,1))) - abs(V(4)*YBus(2,4))*sin(angle(V(2))-angle(V(4))angle(YBus(2,4))); J(1,2) = 0; J(1,3) = -abs(V(2)*V(1)*YBus(2,1))*cos(angle(V(2))-angle(V(1))angle(YBus(2,1))) - abs(V(2)*V(4)*YBus(2,4))*cos(angle(V(2))-angle(V(4))angle(YBus(2,4))); J(1,4) = 0; J(1,5) = abs(V(2)*V(4)*YBus(2,4))*cos(angle(V(2))-angle(V(4))angle(YBus(2,4))); J(2,1) = 0 J(2,2) = 2*abs(V(3))*BBus(3,3) - abs(V(1)*YBus(3,1))*sin(angle(V(3))angle(V(1))-angle(YBus(3,1))) - abs(V(4)*YBus(3,4))*sin(angle(V(3))-angle(V(4))angle(YBus(3,4))); J(2,3) = 0; J(2,4) = -abs(V(3)*V(1)*YBus(3,1))*cos(angle(V(3))-angle(V(1))angle(YBus(3,1))) - abs(V(3)*V(4)*YBus(3,4))*cos(angle(V(3))-angle(V(4))angle(YBus(3,4)));

J(2,5) = abs(V(3)*V(4)*YBus(3,4))*cos(angle(V(3))-angle(V(4))angle(YBus(3,4))); J(3,1) = -2*abs(V(2))*GBus(2,2) - abs(V(1)*YBus(2,1))*cos(angle(V(2))angle(V(1))-angle(YBus(2,1))) - abs(V(4)*YBus(2,4))*cos(angle(V(2))-angle(V(4))angle(YBus(2,4))); J(3,2) = 0; J(3,3) = abs(V(2)*V(1)*YBus(2,1))*sin(angle(V(2))-angle(V(1))angle(YBus(2,1))) + abs(V(2)*V(4)*YBus(2,4))*sin(angle(V(2))-angle(V(4))angle(YBus(2,4))); J(3,4) = 0; J(3,5) = -abs(V(2)*V(4)*YBus(2,4))*sin(angle(V(2))-angle(V(4))angle(YBus(2,4))); J(4,1) = 0; J(4,2) = -2*abs(V(3))*GBus(3,3) - abs(V(1)*YBus(3,1))*cos(angle(V(3))angle(V(1))-angle(YBus(3,1))) - abs(V(4)*YBus(3,4))*cos(angle(V(3))-angle(V(4))angle(YBus(3,4))) J(4,3) = 0; J(4,4) = abs(V(3)*V(1)*YBus(3,1))*sin(angle(V(3))-angle(V(1))angle(YBus(3,1))) + abs(V(3)*V(4)*YBus(3,4))*sin(angle(V(3))-angle(V(4))angle(YBus(3,4))); J(4,5) = -abs(V(3)*V(4)*YBus(3,4))*sin(angle(V(3))-angle(V(4))angle(YBus(3,4))); J(5,1) = -abs(V(4)*YBus(4,2))*cos(angle(V(4))-angle(V(2))-angle(YBus(4,2))); J(5,2) = -abs(V(4)*YBus(4,3))*cos(angle(V(4))-angle(V(3))-angle(YBus(4,3))); J(5,3) = -abs(V(4)*V(2)*YBus(4,2))*sin(angle(V(4))-angle(V(2))angle(YBus(4,2))); J(5,4) = -abs(V(4)*V(3)*YBus(4,3))*sin(angle(V(4))-angle(V(3))angle(YBus(4,3))); J(5,5) = abs(V(4)*V(2)*YBus(4,2))*sin(angle(V(4))-angle(V(2))angle(YBus(4,2))) + abs(V(4)*V(3)*YBus(4,3))*sin(angle(V(4))-angle(V(3))angle(YBus(4,3))); % step #7: update system state x(:,m+1) = -inv(J)*g + x(:,m) end plot(it,x(1,:),'ro-',it,x(2,:),'bo-') plot(it,x(3,:)*360/(2*pi),'ro-',it,x(4,:)*360/(2*pi),'bo',it,x(5,:)*360/(2*pi),'ko-')

Step #8: Show results.


1.005 2

1.5

0.995

0.99

0.5

0.985

0.98

-0.5

0.975

-1

0.97

-1.5

0.965

10

15

20

25

-2

10

15

20

25

Figure 26: Voltage Magnitude (left) and Angle (right) vs. Iteration # for Newton-Raphson Power Flow of Example 9.5S

Topic #4: The Decoupled Power Flow Method (9.7S)


What is the decoupled power flow method? o Newton-Raphson power flow with the following assumptions: o Change in voltage angle (i) affects real power flow (Pi) predominantly o Change in voltage magnitude |Vi| affects reactive power flow (Qi) predominantly

Note: the following observation

5.1696 0 8.9852 0 44.7460 J11 = dQ/d|V| J12 = dP/d|V| 40.7613 3.0237 0 0 8.1933 J = 8.9852 44.9260 0 0 25.8478 J0 = dQ/d|V| J22 = dP/d 15.1185 21 8.1933 40.9663 0 5.1696 3.0237 25.8478 15.1185 40.9663
o o o o

(205) = (203)

Average Absolute Value of J11 = Average Value of J12 = Average Value of J 21 = Average Value of J 22 =

(
(
(

dP r dV dQ d dP d

) = 6.33

( ) = 42.75 ) = 6.33
dQ r dV

) = 29.82

On average, the values of J11 and J22 are much larger than the off-diagonals J12 and J21 So, how do we use this observation in decoupled power flow? o We equate the off-diagonal sub-matrices (J12, J21) to zero.
P2 2 P3 2 M Pn1 2 Pn 2 J = P2 3 P3 3 K K P2 n1 P3 n1 P2 n P3 n M Pn1 n Q3 n Q2 V2 Q2 V3 Q3 V3 M K K Q2 Vn1 Q3 Vn1 Q2 Vn Q3 Vn M Qn1 Vn Qn Vn

dP/d
Pn 2 K

M M Pn1 Pn1 K 3 n1 Q3 n1

J11

J12
dP/d|V|
0

(206)

dQ/d

J21
0

Q3 V3 M Qn1 V2 Qn V2

J22
K

dQ/d|V|
Qn1 Qn1 K Vn1 V3 Qn V3 Qn Vn1

We divide (166) in two.


*** VERY IMPORTANT *** DECOUPLED (NEWTON-RAPHSON) POWER FLOW SOLUTION BELOW

( ( k +1) = J11k ) g P ( x , u ) + ( k )

V(

k +1)

( = J 22 ) gQ ( x, u ) + V (
k

k)

(207)

Note: (207) is presented in more detail below.


4( ) 8 6444444444444 P74444444444444 r n r r r r Bus 2 Bus P2Inj V2 ( G22 ) + V2Vk Y2Bus cos 2 k Y2 k k k =1 k 2 ( k +1) ( k +1) 678 4 4 r } n r r r Bus r Bus 2 ( k +1) Bus 2 2( k ) P3Inj V3 ( G33 ) + V3Vk Y3k cos 3 k Y3k k +1 (k ) k =1 2( ) k 3 2 1 + M (k ) M M = J11 k ( k +1) r n(1) n r r r Bus r Bus n1 2 Inj Bus ( k +1) Pn1 Vn1 ( Gn1,n1 ) + Vn1VkYn1,k cos n1 k Yn1,k n( k ) n k =1 k n1 r n r r r r Bus 2 Bus Bus PnInj Vn ( Gnn ) + VnVk Ynk cos n k Ynk k =1 k n
g x ,u

))

))

(208)

))

))

r n r r r r 2 Bus Q2Inj V2 ( B22 ) + V2VkY2Bus sin 2 k Y2Bus k k k =1 k 2 r V (k ) V2( k +1) n r r r r Bus 2 Bus 2 Q3Inj V3 ( B33 ) + V3VkY3Bus sin 3 k Y3k k (k ) ( k +1) k =1 k 3 V3 V3 1 + M M = J (k ) M 22 ( k +1) (k ) V n r r r Bus r Bus Vn1 Inj r 2 Bus n1 Qn1 Vn1 ( Bn1,n1 ) + Vn1Vk Yn1k sin n1 k Yn1,k ( k ) ( k +1) Vn k =1 Vn 4 4 k n1 123 123 k +1 k V( ) V( ) r n r r r Bus r Bus 2 Bus QnInj Vn ( Bnn ) + VnVkYnk sin n k Ynk k =1 k n 3 4444444444444 4444444444444 1 2

))

))

(209)

))

))

gQ ( x ,u )

What are the advantages / disadvantages of the method described in (207) and (208)? o Advantages o Less Computationally Complex Even for a digital computer, the amount of computing power / time required to invert a square matrix increases exponentially with its size. It is much easier / faster, to invert two matrices of n/2 x n/2 size that one matrix of size n x n. o Disadvantages o More Susceptible to Calculation Instabilities In certain cases, the decoupled power flow may fail to yield a stable solution yet the un-decoupled power flow does o Some Coupling Exists J11 an J22 are still inter-dependent, both a function of both voltage angle and magnitude. So we cannot solve these equations in complete parallel.

How can we make the two equations of (207) completely independent from one another? What other assumptions / simplifications can we employ? o Assumption #1: the angular difference between buses are typically small such that

(i k ) 0
o

cos ( i k ) 1 sin ( i k ) i k

(210)

Assumption #2: the line susceptances (Bik) are many times larger than conductances (Gik) such that

Gik sin (i k ) << Bik cos ( i k )


o

(211)

Assumption #3: the reactive power (Qi) injected into any bus is much less than the reactive power which would flow to all lines if that bus were shorted to the reference, such that

r 2 Bus Qi << Vi Bii


How do we use these assumptions to simplify the Jacobian? Refer back to (169) and (170).
sin ( a + b ) = sin ( a ) cos ( b ) + cos ( a ) sin ( b ) 6444447444448 r r r Bus r Pi = ViVk Yik sin i k YikBus k step #1: the identity below

(212)

)) ) ( )

rr r Pi ViVk YikBus k

step #2: step #2: regroup these terms regroup these terms 64 744 4 r 8 64 744 4 r 8 sin ( i k ) cos YikBus + cos (i k ) sin YikBus

step #3: re-equate this to Gik step #3: re-equate this to -Bik 8 4 r r 644 7444 r Bus 4 r Bus r r 644 7444 r r 8 Pi ViVk Yik cos Yik sin ( i k ) + ViVk YikBus sin YikBus cos (i k ) k

Bus

Bus

(213)

step assume step #4: we assume Gik #4: wei k ) 0 Bus sin ( cos (i k ) 1 6447448 64748 r r Bus Pi Bus ViVk Gik sin (i k ) Bik cos (i k ) k r r Bus Pi ViVk Bik k

Note: in a similar manner

r r Bus r r Bus r r r r Bus V2V2 B22 K V2V3 B23 V2Vn 1 B2, n 1 V2Vn B2Bus n r r r r Bus r r r r Bus Bus V V B Bus K V3V3 B33 V3Vn 1 B3, n 1 V3Vn B3 n 3 2 32 =K J dc = M M M M r r r r Bus r r r r Bus Bus Bus Vn 1V2 Bn 1,2 Vn 1V3 Bn 1,3 K Vn 1Vn 1 Bn 1, n 1 Vn 1Vn Bn 1, n r r r r r r r r Bus VnV2 BnBus VnV3 BnBus K VnVn 1 BnBus1 VnVn Bnn 3 ,n 2 r r V2 V2 0 K 0 0 0 K 0 0 (214) Bus Bus Bus Bus B22 K B2, n 1 B23 B2 n r r 0 V K Bus Bus Bus 0 V3 K 0 0 B Bus 0 0 K B3, n 1 B33 B3 n 3 32 K= M M M M M M M M M M M M Bus r r Bus Bus Bus 0 0 K Vn 1 0 Bn 1,2 Bn 1,3 K Bn 1, n 1 Bn 1, n 0 0 K Vn 1 0 r r B Bus BnBus K BnBus1 BnBus 3 ,n n 0 4 3 144444424444444 0 Vn n 2 Vn 0 K 0 0 K 0 B 14444 244444 4 3 14444 244444 4 3
V V

How does this decoupled and simplified Jacobian (Jdc) fit in to the system?
ideal

} k +1 k (k 0 g P ( x , u ) J dc ) ( ) ( )

( 0 gQ ( x, u ) J dc ) V ( ) 2 1 3
k k

(V

)
k)

( k +1)

V(

(215)

note the distinction btw V and V

How do we solve for x(k+1)?

} (k g P ( x, u ) J dc ) ( k +1) ( k )

step #1: expand this matrix

) ) ( )
(216)

6 8 7 V ( k ) B V ( k ) ( k +1) ( k ) g P ( x, u )

step #2: move this to other side

64 744 } 4 8 k k +1 k ( k ) 1 ( k ) V g P ( x , u ) V V B V ( ) ( ) ( ) step #4: flip the sides 64444444444 of this equation / rearrange 4 744444444444 8 1 1 1 k) V ( g P ( x , u ) B B V ( k ) ( k +1) ( k ) B
( k ) 1

=1

step #3: move to other side

6 8 7 1 1 k k +1 k k V ( ) ( ) B V ( ) g P ( x, u ) + ( )

step #5: set these voltages equal to 1

( k +1) B V ( k ) g P ( x , u ) + ( k )

} k +1 k (k gQ ( x , u ) J dc ) V ( ) V ( )

step #1: expand this matrix

) ( )
(217)

4=1 8 6 74 64 744 4 8 1 V ( k ) B V ( k ) V ( k ) V ( k +1) V ( k ) gQ ( x , u )


step #3: flips the sides 64444444of this expression / rearrange 4 744444444 8 1 1 V ( k ) gQ ( x , u ) V ( k +1) V ( k ) B

step #2: move this to other side

V(

k +1)

k k B V ( ) gQ ( x , u ) + V ( )

*** VERY IMPORTANT *** SIMPLIEID & DECOUPLED (NEWTON-RAPHSON) POWER FLOW SOLUTION BELOW

( k +1) B V ( k ) g P ( x, u ) + ( k )
V(
k +1) k k B V ( ) gQ ( x , u ) + V ( ) 1 1

(218)

Note: (218) is presented in more detail below.


6444 7444 8 Inj P2 P2 x ( k ) , u k V2( ) ( k +1) ( k +1) 4 8 674 4 8 Inj 674 k P3 P3 x ( ) , u ( k +1) k +1) 1 Bus Bus Bus 2( 2 B22 B23 B2Bus K B2, n 1 n k +1 ( k +1) k Bus ( ) Bus Bus Bus V3( ) 2 B33 B3n K B3, n 1 2 B32 + M M M M M M M = Bus Bus Bus Bus k+ ( k +1) Bn 1,2 Bn 1,3 K Bn 1, n 1 Bn 1, n PnInj Pn 1 x ( k ) , u n( 1 1) n 1 1 Bus B Bus BnBus K BnBus1 Bnn ( k +1) 3 ,n (k ) n( k +1) n 2 444424444444 n 4 3 Vn 1 144 B Inj (k ) Pn Pn x , u k Vn( ) V ( k ) g x ( k ) , u P
1

(219)

Q2Inj Q 2 x ( k ) , u k V2( ) (k ) Inj (k ) V2( k +1) Q3 Q3 x , u V2 Bus Bus Bus Bus 1 B22 B23 B2 n K B2, n 1 (k ) V ( k +1) (k ) Bus Bus Bus V3 B33 B3Bus K B3, n 1 V3 3 n B32 + M = M M M M M M Bus Bus Bus Bus k V ( k +1) Bn 1,2 Bn 1,3 K Bn 1, n 1 Bn 1, n QnInj1 Q n 1 x ( k ) , u Vn(1) n 1 Bus Bus Bus B Bus Bn 3 K Bn , n 1 Bnn k (k ) n2 ( k +1) 144444424444444 4 3 Vn(1) Vn Vn B 4 3 4 4 1 24 Inj 123 (k ) k ( k +1) V( ) V Qn Q n x , u k Vn( ) 144424443

(220)

(
(

V ( k ) g x ( k ) , u Q

Example #5: Simplified / Decoupled Newton-Raphson Power Flow (9.9S)


Problem Statement: o A small power system of Example 9.2. has the line data and bus data presented in Tables 9.2. and 9.3. A power flow study of the system is to be performed utilizing Simplified / Decoupled Newton-Raphson method.

Step #1: Define the B matrix. 0 25.85 44.84 B= 0 40.86 15.11 25.85 15.11 40.86 Step #2: Define the initial condition of system state. x ( ) = ( Vi = 1, i = 0 )
0 1 1 Step #3: Define the V ( k ) g P x ( k ) , u and V ( k ) gQ x ( k ) , u matrices. Note that we can take these values from (177).

(221)

(222)

V ( k ) g P

1.59 1.0 1.93 (k ) x ,u = 1.0 2.21 1.02

(223)

V ( k ) gQ

0.45 1.0 k x( ) , u = 0.83 1.0

Step #4: Calculate first iteration utilizing solution method outlined in (218).
V g x , u P( ) } 674 4 8 (k ) 6 74 4 8 ( k +1) 1 2 0 25.85 44.84 1.59 0 0.0193 k +1 3( ) = 0 40.86 15.11 1.93 + 0 = 0.0370 ( k +1) 2.16 0 0.0282 15.11 40.86 4 25.85 4 14444 244444 3
( k +1) (k )
1

(k )

(224)

k V ( k ) g x ( k ) , u 6 74 4 8 V( ) ) } Q( 6 74 4 8 ( k +1) 1 V2 0 0.45 1 0.9819 = 44.84 + = V ( k +1) 3 0 4 40.86 0.83 1 0.9796 144 2444 3 B
1

V ( k +1)

(225)

Step #5: Perform further iterations in Matlab, as shown below.


% Example 9.9S clear all clc j = sqrt(-1); % step #1: declare the YBus matrix YBus = [8.985190-j*44.835953 -3.815629+j*19.078144 -5.169561+j*25.847809 0 ; 3.815629+j*19.078144 8.985190-j*44.835953 0 -5.169561+j*25.847809 ; 5.169561+j*25.847809 0 8.193267-j*40.863838 -3.023705+j*15.118525 ; 0 5.169561+j*25.847809 -3.023705+j*15.118528 8.193267-j*40.863838] GBus = real(YBus); BBus = imag(YBus);

% step #2: declare the injections PInj = [ -0.50 -1.70 -2.00 3.18-0.80 ]; QInj = [ -0.3099 -1.0535 -1.2394 -0.4958 ]; % step #3: initialize the system voltages V4mag = 1.02; x(:,1) = [ 1; 1; 0; 0; 0 ]; for m = 1:20 it(m) = m; it(m+1) = m+1; % step #4: transfer updated voltage from x array to V V = [1 x(1,m)*cos(x(3,m))+j*x(1,m)*sin(x(3,m)) x(2,m)*cos(x(4,m))+j*x(2,m)*sin(x(4,m)) V4mag*cos(x(5,m))+j*V4mag*sin(x(5,m)) ]; % step #5: calculate the mismatches

for i = 2:3 g1(i) = QInj(i) + abs(V(i))^2 * BBus(i,i); for k = 1:4 if i == k else g1(i) = g1(i) - abs(V(i))*abs(V(k))*abs(YBus(i,k))*sin( angle(V(i))-angle(V(k))-angle(YBus(i,k)) ); end end end for i = 2:4 g2(i) = PInj(i) - abs(V(i))^2 * GBus(i,i); for k = 1:4 if i == k else g2(i) = g2(i) - abs(V(i))*abs(V(k))*abs(YBus(i,k))*cos( angle(V(i))-angle(V(k))-angle(YBus(i,k)) ); end end end % step #6: transfer these values to the appropriate arrays gP = [g2(2) g2(3) g2(4)]; gQ = [g1(2) g1(3)]; % step #7: divide mismatches by voltagem magnitudes, as required by decoupled power flow x(1:2,m+1) = -inv(BBus(2:3,2:3))*gQ' + x(1:2,m) x(3:5,m+1) = -inv(BBus(2:4,2:4))*gP' + x(3:5,m) end plot(it,x(1,:),'ro-',it,x(2,:),'bo-') %plot(it,x(3,:)*360/(2*pi),'ro-',it,x(4,:)*360/(2*pi),'bo',it,x(5,:)*360/(2*pi),'ko-')

1.005

1.5

1 0.995 0.5 0.99 0 0.985 -0.5 0.98 -1 0.975 -1.5

0.97

-2

0.965

10

15

20

25

-2.5

10

15

20

25

Figure 27: Voltage Magnitude (left) and Angle (right) vs. Iteration # for Decoupled / Simplified Newton-Raphson Power Flow of Example 9.9S

Topic #5: Comparison of Examples

1.005

1.5

1 0.995 0.5 0.99 0 0.985 -0.5 0.98 -1 0.975 -1.5

0.97

-2

0.965

10

12

14

16

18

20

-2.5

10

12

14

16

18

20

Figure 28: Example Results via Gauss-Seidel

1.005

1.5

0.995

0.99

0.5

0.985

0.98

-0.5

0.975

-1

0.97

-1.5

0.965

10

15

20

25

-2

10

15

20

25

Figure 29: Example Results via Newton-Raphson


1.005 2

1.5

1 0.995 0.5 0.99 0 0.985 -0.5 0.98 -1 0.975 -1.5

0.97

-2

0.965

10

15

20

25

-2.5

10

15

20

25

Figure 30: Example Results via Decoupled / Simplified Newton-Raphson

Lecture #5: Optimal Power Flow


Topic #1: Introduction (13.1)
History of Optimal Power Flow? o First discussed (in basic form) by Carpentier in 1962. o Current methods take in to account many issues including efficiency and security. Previously? o We introduced the concept of economic dispatch, but with only one constraint that generation equals load plus and estimation of losses. Refer to (226).
N N L = cost ( Pi ) + Pload + Ploss Pi i =1 i =1

g = Pload + Ploss Pi
i =1

(226)

only one constraint

What is Optimal Power Flow (OPF)? economic dispatch which considers a nonlinear description of power flow. Why set up the economic dispatch as OPF? o More Accurate Representation of Losses If the entire set of power flow equations are solved simultaneously with minimization of generating costs, the representation of incremental losses is exact. o Consider Other System Constraints The previous economic dispatch problems consider only generation limits (Pimin < Pi < Pimax). Through consideration of the power flow equations we can consider many others: o |Vimax| < Vi < |Vimax| o MVAikmin < MVAik < MVAikmax o Increased Security The OPF can also include constraints that represent operation of the system after contingency outages. This is referred to as security constrained OPF, or SCOPF. o |Vimax| < Vi (with line ik out) < |Vimax| o MVAikmin < MVAik (with line i,k+1 out) < MVAikmax o More Degrees of Freedom for Increased Optimality Unlike traditional economic dispatch for which the objective is to define P, in OPF the user may also determine optimal values of: o generator Voltage o LTC transformer tap settings o switch capacitor settings o reactive injection for VAR compensator o load shedding o DC line flows o More Objective Functions provide a more flexible analytical tool: o Preventative Dispatch a derivation of SCOPF in which generator settings are adjusted for minimal cost and maximum security in the face of various outages. o Corrective Dispatch a derivation of SCOPF which defines a contingency plan. In other words, how do we adjust the control variables if an outage occurs? o For others, refer to book

Topic #2: Solution of the Optimal Power Flow (13.2)

What methods are employed to solve OPF? the same ones discussed previously. o Lambda-Iteration Method Losses may be represented by a [B] matrix, or penalty factors which are calculated outside of the power flow. o Handles Inequality Constraints? Well, the basis of many standard online economic dispatch programs. o Gradient Methods o Convergence? slow o Handles Inequality Constraints? poorly o Newtons Method o Convergence? fast o Handles Inequality Constraints? poorly o Linear Programming Methods (LPOPF) is one of the fully developed methods now commonly used for OPF. Nonlinear objective functions and constraints handled by linearization. o Convergence? depends o Handles Inequality Constraints? good o Interior Point Method is another fully developed method now commonly used for OPF. o Convergence? depends o Handles Inequality Constraints? good Objective of OPF? To minimize a cost function (f) such that the follow constraints are satisfied: o Equality shown in (227). o (Direct) Inequality shown in (228). o (Indirect) Inequality shown in (229). g( z) = 0
For right now, z is defined as the set of all adjustable controls, states, and fixed parameters. We will split them up later

(227) (228)

z min z z max
array of all min values

} } } h min h ( z ) h max

functions describing constrained values

array of all max values

(229)

Topic #2a: The Gradient Method for OPF (13.2.1)

Note: We begin with a basic cost function, which only considers total fuel costs. Refer to (230).
74 64 8 64 8 74 N gen cost ( P ) = fi ( Pi gen )
i =1 cost function is defined as cost sum of all individual cost functions ( f )

(230)

Step #1: Define state vector (x).


i for each PQ bus x = Vi } for each PV bus i

(231)

Step #2: Define the vector of all parameters that must be specified (y).

Note that some parameters are Inj Inj fixed (e.g. P , Q for loads) from point of view of OPF But some parameters are Inj adjustable (e.g. P for gen)

1 on the reference bus V1 p Inj Pi y = Inj on each PQ bus Q i P Inj u i on each PV bus Vi

(232)
In the derivation below, we do not consider |Vi| to be a control variable

Step #3: Divide the y vector in to two parts input (u) and parameters (p).
p y= u

(233)

Note: at this point, we are only representing equality constraints. Step #4: Define a set of m equations that govern power flow.
Pi ( x ) Pi Inj for PQ buses Qi ( x ) QiInj g x, y = Inj Pi ( x ) Pi } for PV buses

( )

(234)

Step #5: Re-define cost function to account for reference bus.


Note that we consider Pi to be a control variable, but really it is gen Pi we manipulate. Inj gen load Pi = Pi Pi
Inj
cost for all dispatched generators cost for ref. bus is dependent on flow / x

cost ( x , u ) =

f (P )
gen i i i=2

64 8 74
N

6447444 4 8 + f1 P1 ( x ) + Pload 1 { 0

(235)

Step #6: Define the objective / Lagrange function for optimization. L x, u , p = cost ( x, u ) + g x, y Note: the following definitions: o x = vector of state variables o u = vectors of control variables o p = vectors of fixed parameters o l = vector of Lagrange multipliers o g = set of equality constraints representing power flow equations o cost = cost function o L = Lagrange / objective function Also note: that o underline denotes array / vector. o bold represents function. o italic represents variable / parameter. Step #7: Rewrite the objective / Lagrange function as shown below.

( )

(236)

64 744 4 8 P2 ( x ) P2Inj 644 7444 Q x Q Inj 4 8 ( ) 2 L x, u , p = cost ( x, u ) + ( 1 2 3 K) 2 P ( x ) P Inj 3 3 M

(237)

Step #8: Like in previous chapters, set the gradient of Lagrange function equal to zero.

L = 0
to x to u to } } } Step #9: Define this gradient in three components L x , Lu , L .
T

(238)
respect respect

respect

L x =

dL dcost dg = + dx dx dx
T

dL dcost dg L u = = + du du du L = Step #9a: Begin with dcost / dx. dcost d N gen = fi ( Pi ) + f1 ( P1 ( x ) ) dx dx i = 2


d 64 744 64P1744 4= 0 8 4 dx 8 N dcost d d gen = fi ( Pi ) + dx f1 ( P1 ( x ) ) dx dx i = 2

(239)

dL = g x, u , p d

df1 ( P1 ( x ) ) dP1 ( x )

note that x affects cost only at 644reference bus #18 4 7444 df1 ( P1 ( x ) ) dP1 ( x )

dcost = dx
Non-zero value for reference bus only

dP 1

dx

expand to vector form 644474448 df1 ( P1 ( x ) ) dP1 ( x ) dP d1 1 dcost df1 ( P1 ( x ) ) dP1 ( x ) = r dx dP d V1 1 0 M

(240)

Step #9b: Continue with dg/dx.

dPi d k dQ i dg = d k dx dP i +1 d k M

dPi d Vk dQ i d Vk dPi +1 d Vk M

dPi d k +1 dQ i d k +1 dPi +1 d k +1 M

K d Pi ( x ) Pi Inj dx d Inj K Qi ( x ) Qi = dx d Inj K Pi +1 ( x ) Pi +1 dx M

(241)

Step #9c: Continue with dcost / du.


dcost d N = fi ( Pi gen ) + f1 ( P1 ( x )) du i = 2 dx reference bus = 0 64 748 4 4 d dcost d N = fi ( Pi gen ) + dx f1 ( P1 ( x ) ) dx i = 2 dx d N gen Inj fi ( Pi ) dPi i = 2 d N gen Inj fi ( Pi ) = dPi +1 i = 2 d N Inj fi ( Pi gen ) dPi +1 i = 2 M d d d gen gen gen dP Inj fi ( Pi ) + dP Inj fi +1 ( Pi +1 ) + dP Inj fi + 2 ( Pi + 2 ) + K i i i d d d gen gen gen Inj fi ( Pi ) + Inj fi +1 ( Pi +1 ) + Inj fi + 2 ( Pi + 2 ) + K dPi +1 dPi +1 = dPi +1 d d d gen gen gen f P ) + Inj f 2 ( P2 ) + Inj fi + 2 ( Pi + 2 ) + K Inj 1 ( 1 dPi + 2 dPi + 2 dPi + 2 M

dcost dx

dcost dx

d gen dP Inj fi ( Pi ) i d gen dcost Inj fi +1 ( Pi +1 ) = dPi +1 du d gen Inj fi + 2 ( Pi + 2 ) dPi + 2 M

(242)

Step #9d: Continue with dg / du.

dg du

dg du

dg du

d Inj du Pi ( x ) Pi d Inj Qi ( x ) Qi = du d Inj Pi +1 ( x ) Pi +1 du M d d d Inj P x Pi Inj P x Pi Inj K dP Inj Pi ( x ) Pi Inj i ( ) Inj i ( ) dPi +1 dPi + 2 i d d d Inj Inj Inj Q x Qi Inj i ( ) dP Inj Qi ( x ) Qi dP Inj Qi ( x ) Qi K = dPi i +1 i+2 d d d Inj Inj Inj P x Pi +1 P x Pi +1 K Inj Pi +1 ( x ) Pi +1 Inj i +1 ( ) Inj i +1 ( ) dP dP i +1 i+2 dPi M M M 0 1 0 678 } 678 } 678 } 404 404 404 dPi ( x ) dPi Inj dPi ( x ) dPi Inj dPi ( x ) dPi Inj Inj Inj Inj K Inj Inj Inj dPi dPi +1 dPi +1 dPi + 2 dPi + 2 dPi = M M M M M M M M M 0 K 0 K 0 K M (243)
If we do not consider any Inj control variables except Pi , then this matrix is composed of zeroes and ones.
respect respect respect

1 0 0 0 = du 0 1 M M dg

to x to u to } } } Step #10: Provide a summary of these matrices below L x , Lu , L .

*** DEFINITION OF PARTIAL LAGRANGE GRADIENTS *** Non-zero value for reference bus only
dcost dx

644444744444 8 644474448 T dPi dPi dPi df1 ( P1 ( x ) ) dP1 ( x ) K 678 d k d Vk d k +1 dP d1 1 m dQ i dQ i dQ i K m +1 df1 ( P1 ( x ) ) dP1 ( x ) L x = + d k d Vk d k +1 r dP d V1 1 m + 2 dPi +1 dPi +1 dPi +1 K M 0 d k d Vk d k +1 M M M M

dg dx

(244)

dcost

8 644 7444 4du T dg d du gen 4 8 dP Inj fi ( Pi ) 644 7444 6 8 7 i 1 0 0 K T k d gen fi +1 ( Pi +1 ) 0 0 0 K k +1 Inj Lu = dPi +1 + 0 1 0 K k +2 d gen Inj fi + 2 ( Pi + 2 ) M M M M dPi + 2 M 644 744 8 Pi ( x ) Pi Inj Q ( x ) QiInj L = i P ( x ) P Inj i +1 i +1 M
What solution method (based on Gradient Search) is employed for OPF?
g

(245)

(246)

Figure 31: Flowchart of Gradient Optimal Power Flow (OPF) Method

dg T dcost = dx dx
Example #1: The Gradient Method for OPF Applied to Four-Bus (dc) System

(247)

Problem Statement: The four-bus system shown in Error! Reference source not found. is modeled via DC power flow. o Known Parameters (p) o P2, P3, and 4 = 0 o x12, x14, x24, x23, and x34 o f1(P1) and f4(P4) o |V1|, |V2|, |V3|, and |V4| = 1 o Unknown Parameters (u) o P1 o System State (u) o 1, 2, and 3 Step #1: Define the cost function for the OPF.

644 7444 4 8 cost ( u ) = f1 ( P gen ) + f4 P4 ( x ) + P4load 1 { 0


Step #2: Define the algebraic system constraints. P1 ( x, u ) P Inj 1 g ( x, u ) = P2 ( x, u ) P2Inj P ( x, u ) P Inj 3 3
Step #3: Expand this definition.

generation at the reference bus is dependent on system state ( x )

(248)

(249)

P1 ( x , u ) = P + P 12 14 6444474444 8 1 1 Inj B (1 2 ) + (1 4 ) P1 6444444 74444444 } 4 8 x x12 x14 1 1 1 Inj x12 + x14 1 P 0 x12 1 Inj 1 1 1 1 1 1 1 1 Inj g ( x, u ) = x12 x23 2 P2 = x12 + x24 + x23 ( 2 1 ) + ( 2 4 ) + ( 2 3 ) P2 x24 x23 x 1 1 0 x23 x23 + x341 3 P3Inj 12 1 1 (3 2 ) + (3 4 ) P3Inj x23 x34 (250)

Step #4: Define the objective / Lagrange function for this optimization.

cost 6444 ( x ,u ) 7444 8 L ( x, u ) = f1 ( P gen ) + f 4 ( P4 ( x ) ) + ( 1 1

L ( x, u ) = f1 ( P gen ) + f 4 ( P4 ( x ) ) + ( 1 1

( ) 6447448 P1 ( x, u ) P Inj 1 3 ) P2 ( x, u ) P2Inj Inj P3 ( x, u ) P3 x } 1 P Inj 1 3 ) B 2 P2Inj P Inj 3 3


g x ,u

(251)

Step #3: Define the three gradient components.

Step #3a: Define L as well as its inverse (when equal to zero).


Inj 1 P 1 Inj L = B 2 P2 = 0 P Inj 3 3

(252)

solution to DC power flow

P Inj 1 1 1 Inj 2 = B P2 P Inj 3 3

(253)

Step #3b: Define L x as well as inverse (when equal to zero).


dcost

6444 74444 4dx 8 df 4 ( P4 ( x ) ) dP4 ( x ) 678 T dP4 d1 dg dx m } df 4 ( P4 ( x ) ) dP4 ( x ) T m +1 =0 L x = + B dP4 d 2 m + 2 df 4 ( P4 ( x ) ) dP4 ( x ) M dP4 d 3

(254)

dcost

6444 74444 4dx 8 dP4 ( x ) d1 T 1 df 4 ( P ( x ) ) dP4 ( x ) 1 = B dP4 d 2 dP4 ( x ) d 3

( )

(255)

x141 df 4 ( P1 ( x ) ) 1 = B x24 dP4 x 1 34

( )

Step #3c: Define Lu .


T } dg 6 74 4du 8 du 1 df1 ( P gen ) 64748 1 L u = + ( 1 0 0 ) 2 Inj dP 1 3
dcost

(256)

Step #4: Given a set of fixed parameters (p), assume a set of control variables (u).
u ( ) = ( P Inj 0 ) 1
0

(257)

Step #5: Solve a power flow, to ensure that (246) is equal to zero. Refer to (253).
64444444 74444444 8 1 1 1 1 P Inj = 0 0 0 x12 1 x12 + x14 1 Inj 1 1 1 1 1 x12 + x24 + x23 x23 P2 = 0 = 0 2 = x12 1 1 0 x23 + x341 P3Inj = 0 0 x23 3 B
1

(258)

Step #13: Solve for lambda (), as shown below.


x141 1 df 4 ( P1 ( x ) ) T 1 df 4 ( P ( x ) ) 1 1 = 1 = B x24 dP4 dP4 1 x 1 34

( )

(259)

Step #14: Substitute in to (256) to acquire gradient of L with respect to control variables.

T } dg 6 74 4du 8 du 748 1 df1 ( P gen ) 64 1 L u = + ( 1 0 0 ) 2 Inj dP 1 3 1 df1 ( P gen ) 1 df 4 ( P1 ( x ) ) + ( 1 0 0 ) 1 L u = Inj dP4 dP 1 1

dcost

(260)

L u =

df1 ( P gen ) 1 dP
Inj 1

df 4 ( P1 ( x ) ) dP4

Note: this gives us the same solution from Chapter 3.


Example #2: The Gradient Method for OPF Applied to Three-Bus AC Power System (13.B)

Problem Statement: Given the three bus network shown in Figure 32

Figure 32: Sample Power System

with the following parameters P3Inj + jQ3Inj = (2.0 j1.0) per unit P2Inj = 1.7 per unit y12 = 0 per unit y13 = 4 j10 per unit y23 = 4 j5 per unit Note that: o real power generation at bus #2 as well as complex injection at bus #3 are fixed p = [ 1 P2Inj P3Inj Q3Inj ]
o

control variables are voltage magnitude at buses #1 and #2 u = [ |V1| |V2| ] state variables will be phase angles at buses #2 and #3 as well as voltage angle at load bus #3. x = [2 3 |V3| ]

Objective: Find the value of u which minimizes real power loss in the power system, via optimal power flow. Ploss(x, u) = P1(x, u) + P2Inj + P3Inj Step #1: Define the cost function for the OPF. cost(u) = Ploss(x, u) Step #2: Define the algebraic system constraints (g).
P2 ( x , u ) P2Inj g ( x , u ) = P3 ( x, u ) P3Inj Q ( x , u ) Q Inj 3 3

(261)

Step #3: Construct the YBus matrix.


0 4 + j10 4 j10 = 0 4 j 5 4 + j 5 4 + j10 4 + j 5 8 j15

Bus

(262)

Step #4: Expand the definition of g. Note that ang denotes the angle of a complex number. g1(x, u) = |V2|2 (G22Bus) + |V2V3Y23Bus| cos(2 3 ang(Y23Bus)) P2Inj g2(x, u) = |V3V1Y13Bus| cos(3 1 ang(Y13Bus)) + |V3V2Y23Bus| cos(3 2 ang(Y23Bus)) + |V3|2 (G33Bus) P2Inj g3(x, u) = |V3V1Y13Bus| sin(3 1 ang(Y13Bus)) + |V3V2Y23Bus| sin(3 2 ang(Y23Bus)) |V3|2 (B33Bus) Q2Inj Step #5: Define the objective / Lagrange function for this optimization. L(x, u) = cost(x, u) + ( 1 2 3 ) g(x, u) Step #6: Define the three gradient components.
L = g ( x , u ) L x = L u = dg ( x , u ) d cost ( x, u ) + dx dx
T

(263)

dg ( x , u ) d cost ( x , u ) + du du
T

Step #6a: Define dcost(x, u) / dx. dPloss(x, u) / d2 = 0 dPloss(x, u) / d3 = |V1V3Y13Bus| sin(1 3 ang(Y13Bus)) * (1) = 11 dPloss(x, u) / d|V3| = |V1Y13Bus| cos(1 3 ang(Y13Bus)) = 4.4

Step #5b: Define dg(x, u) / dx. dg1(x, u) / d2 = |V2V3Y23Bus| sin(2 3 ang(Y23Bus)) dg1(x, u) / d3 = |V2V3Y23Bus| sin(2 3 ang(Y23Bus)) * (1) dg1(x, u) / d|V3| = |V2Y23Bus| cos(2 3 ang(Y23Bus)) dg2(x, u) / d2 = |V3V2Y23Bus| sin(3 2 ang(Y23Bus)) * (1) dg2(x, u) / d3 = |V3V2Y23Bus| sin(3 2 ang(Y23Bus)) dg2(x, u) / d|V3| = |V1Y13Bus| cos(3 1 ang(Y13Bus)) + |V2Y23Bus| cos(3 2 ang(Y23Bus)) + 2|V3| (G33Bus) dg3(x, u) / d2 = |V3V2Y23Bus| cos(3 2 ang(Y23Bus)) * (1) dg3(x, u) / d3 = |V3V2Y23Bus| cos(3 2 ang(Y23Bus)) dg3(x, u) / d|V3| = |V1Y13Bus| sin(3 1 ang(Y13Bus)) + |V2Y23Bus| sin(3 2 ang(Y23Bus)) + 2|V3| (B33Bus) Step #5c: Define dPloss(x, u) / du. dP1(x, u) / d|V1| = 2|V1| (G11Bus) + |V3Y13Bus| cos(1 3 ang(Y13Bus)) = + 4.8 dP1(x, u) / d|V2| = 0 Step #5d: Define dg(x, u) / du (note that u = [ |V1| |V2| ] ) dg1(x, u) / d|V1| = 0 dg1(x, u) / d|V2| = 2 |V2| (G22Bus) + |V3Y23Bus| cos(2 3 ang(Y23Bus)) = 3.2 etc Note: Remainder of problem solved via Matlab below
clear all clc j = sqrt(-1); % step #1: declare control and state variables as well as fixed parameters syms V1 V2 V3 th1 th2 th3 P2Inj P3Inj Q3Inj y12 y13 y23 g12 g13 g23 b12 b13 b23 magYBus23 angYBus23 angYBus13 angYBus13 lam1 lam2 lam3 % ... as well as their arrays ... u = [V1 V2] x = [th2 th3 V3] p = [th1 P2Inj P3Inj Q3Inj] lam = [lam1; lam2; lam3] % step #2: YBus = GBus = BBus = YBus = define YBus (GBus + [ y12+y13 -y12 -y13 [ g12+g13 -g12 -g13 [ b12+b13 -b12 -b13 GBus+j*BBus; jBBus) ; -y12 ; -g12 ; -b12 matrix y12+y23 -y23 ; -y13 -y23 y13+y23 ]; g12+g23 -g23 ; -g13 -g23 g13+g23 ]; b12+b23 -b23 ; -b13 -b23 b13+b23 ];

% step #3: define cost function of the OPF (to minimize power loss)

P1 = (V1^2)*GBus(1,1) + V1*V3*abs(YBus(1,3))*cos(th1-th3-angYBus13); Ploss = P1 + P2Inj + P3Inj; cost = Ploss; % <-- cost function for optimization % step #4: define the algebraic system costraints P2 = (V2^2)*GBus(2,2) + V2*V3*abs(YBus(2,3))*cos(th2-th3-angYBus23); P3 = (V3^2)*GBus(3,3) + V3*V1*abs(YBus(1,3))*cos(th3-th1-angYBus13)+ V3*V2*abs(YBus(2,3))*cos(th3-th2-angYBus23); Q3 = -(V3^2)*BBus(3,3) + V3*V1*abs(YBus(1,3))*sin(th3-th1-angYBus13)+ V3*V2*abs(YBus(2,3))*sin(th3-th2-angYBus23); g = [P2 - P2Inj; P3 - P3Inj; Q3 - Q3Inj]; % step #5: define objective function (Lagrange) for OPF L = cost + transpose(lam) * g; % step #6: define the three gradient components % step #6a: define gradient with respect to lambda gradL_lam = g; % step #6b: define gradient with respect to x dcost_dth2 = diff(cost,th2); dcost_dth3 = diff(cost,th3); dcost_dV3 = diff(cost,V3); dcost_dx = [dcost_dth2; dcost_dth3; dcost_dV3] dg_dth2 = diff(g,th2); dg_dth3 = diff(g,th3); dg_dV3 = diff(g,V3); dg_dx = [dg_dth2 dg_dth3 dg_dV3] % CHECK OTHERS FOR SAME MISTAKE gradLx = dcost_dx + transpose( dg_dx ) * lam; % step #6c: define gradient with respect to u dcost_dV1 = diff(cost,V1); dcost_dV2 = diff(cost,V2); dcost_du = [dcost_dV1; dcost_dV2]; dg_dV1 = diff(g,V1); dg_dV2 = diff(g,V2); dg_du = [dg_dV1 dg_dV2] gradLu = dcost_du + transpose( dg_du ) * lam; % step #7: define the system parameters / initial conditions num_V1 = 1; num_V2 = 0.9; num_V3 = 0.8; num_th1 = 0; num_th2 = 0; num_th3 = 0; x(1,:) x(1,:) x(1,:) x(1,:) x(1,:) x(1,:) = = = = = = vpa(subs(x,V1, num_V1 ),5); vpa(subs(x,V2, num_V2 ),5); vpa(subs(x,V3, num_V3 ),5); vpa(subs(x,th1, num_th1 ),5); vpa(subs(x,th2, num_th2 ),5); vpa(subs(x,th3, num_th3 ),5); 0.0001; 0.0001; 4; -10; 4; -5;

num_g12 num_b12 num_g13 num_b13 num_g23 num_b23

= = = = = =

num_y12 = num_g12 + j*num_b12; num_y13 = num_g13 + j*num_b13; num_y23 = num_g23 + j*num_b23; num_YBus = [ num_y12+num_y13 -num_y12 -num_y13 ; -num_y12 num_y12+num_y23 -num_y23 ; -num_y13 -num_y23 num_y13+num_y23 ]; num_angYBus12 = angle(num_YBus(1,2));

num_angYBus13 = angle(num_YBus(1,3)); num_angYBus23 = angle(num_YBus(2,3)); num_P3Inj = -3; % per unit num_Q3Inj = -1; % per unit num_P2Inj = 1.7; % per unit temp_g = g; temp_dg_dx = dg_dx; temp_dg_du = dg_du; temp_dcost_dx = dcost_dx; temp_dcost_du = dcost_du; temp_P1 = P1; u(1,:) u(1,:) u(1,:) u(1,:) u(1,:) u(1,:) = = = = = = vpa(subs(u,V1, num_V1 ),5); vpa(subs(u,V2, num_V2 ),5); vpa(subs(u,V3, num_V3 ),5); vpa(subs(u,th1, num_th1 ),5); vpa(subs(u,th2, num_th2 ),5); vpa(subs(u,th3, num_th3 ),5);

% step #8: begin optimal power flow for i = 1:100 % step #9: run power flow on system to find constrained state for k = 1:3 g = temp_g; dg_dx = temp_dg_dx; dg_du = temp_dg_du; dcost_dx = temp_dcost_dx; dcost_du = temp_dcost_du; P1 = temp_P1; g g g g g g g g g g g g g g g g g = = = = = = = = = = = = = = = = = vpa(subs(g,V1, num_V1 ),5); vpa(subs(g,V2, num_V2 ),5); vpa(subs(g,V3, num_V3 ),5); vpa(subs(g,th1, num_th1 ),5); vpa(subs(g,th2, num_th2 ),5); vpa(subs(g,th3, num_th3 ),5); vpa(subs(g,g12, num_g12 ),5); vpa(subs(g,b12, num_b12 ),5); vpa(subs(g,g13, num_g13 ),5); vpa(subs(g,b13, num_b13 ),5); vpa(subs(g,g23, num_g23 ),5); vpa(subs(g,b23, num_b23 ),5); vpa(subs(g,angYBus23, num_angYBus23 ),5); vpa(subs(g,angYBus13, num_angYBus13 ),5); vpa(subs(g,P2Inj, num_P2Inj ),5); vpa(subs(g,P3Inj, num_P3Inj ),5); vpa(subs(g,Q3Inj, num_Q3Inj ),5); = = = = = = = = = = = = = = vpa(subs(dg_dx,V1, num_V1 ),5); vpa(subs(dg_dx,V2, num_V2 ),5); vpa(subs(dg_dx,V3, num_V3 ),5); vpa(subs(dg_dx,th1, num_th1 ),5); vpa(subs(dg_dx,th2, num_th2 ),5); vpa(subs(dg_dx,th3, num_th3 ),5); vpa(subs(dg_dx,g12, num_g12 ),5); vpa(subs(dg_dx,b12, num_b12 ),5); vpa(subs(dg_dx,g13, num_g13 ),5); vpa(subs(dg_dx,b13, num_b13 ),5); vpa(subs(dg_dx,g23, num_g23 ),5); vpa(subs(dg_dx,b23, num_b23 ),5); vpa(subs(dg_dx,angYBus23, num_angYBus23 ),5); vpa(subs(dg_dx,angYBus13, num_angYBus13 ),5);

dg_dx dg_dx dg_dx dg_dx dg_dx dg_dx dg_dx dg_dx dg_dx dg_dx dg_dx dg_dx dg_dx dg_dx

x(k+1,:) = vpa( -inv(dg_dx)*g + transpose(x(k,:)) ,5); num_th2 = x(k+1,1); num_th3 = x(k+1,2); num_V3 = x(k+1,3); end % step #10: solve for lambda array dcost_dx dcost_dx dcost_dx dcost_dx = = = = vpa(subs(dcost_dx,V1, num_V1 ),5); vpa(subs(dcost_dx,V2, num_V2 ),5); vpa(subs(dcost_dx,V3, num_V3 ),5); vpa(subs(dcost_dx,th1, num_th1 ),5);

dcost_dx dcost_dx dcost_dx dcost_dx dcost_dx dcost_dx dcost_dx dcost_dx dcost_dx dcost_dx

= = = = = = = = = =

vpa(subs(dcost_dx,th2, num_th2 ),5); vpa(subs(dcost_dx,th3, num_th3 ),5); vpa(subs(dcost_dx,g12, num_g12 ),5); vpa(subs(dcost_dx,b12, num_b12 ),5); vpa(subs(dcost_dx,g13, num_g13 ),5); vpa(subs(dcost_dx,b13, num_b13 ),5); vpa(subs(dcost_dx,g23, num_g23 ),5); vpa(subs(dcost_dx,b23, num_b23 ),5); vpa(subs(dcost_dx,angYBus23, num_angYBus23 ),5); vpa(subs(dcost_dx,angYBus13, num_angYBus13 ),5);

lam = vpa( -inv(transpose(dg_dx)) * dcost_dx , 5); % step #11: update control parameters dcost_du dcost_du dcost_du dcost_du dcost_du dcost_du dcost_du dcost_du dcost_du dcost_du dcost_du dcost_du dcost_du dcost_du dg_du dg_du dg_du dg_du dg_du dg_du dg_du dg_du dg_du dg_du dg_du dg_du dg_du dg_du = = = = = = = = = = = = = = = = = = = = = = = = = = = = vpa(subs(dcost_du,V1, num_V1 ),5); vpa(subs(dcost_du,V2, num_V2 ),5); vpa(subs(dcost_du,V3, num_V3 ),5); vpa(subs(dcost_du,th1, num_th1 ),5); vpa(subs(dcost_du,th2, num_th2 ),5); vpa(subs(dcost_du,th3, num_th3 ),5); vpa(subs(dcost_du,g12, num_g12 ),5); vpa(subs(dcost_du,b12, num_b12 ),5); vpa(subs(dcost_du,g13, num_g13 ),5); vpa(subs(dcost_du,b13, num_b13 ),5); vpa(subs(dcost_du,g23, num_g23 ),5); vpa(subs(dcost_du,b23, num_b23 ),5); vpa(subs(dcost_du,angYBus23, num_angYBus23 ),5); vpa(subs(dcost_du,angYBus13, num_angYBus13 ),5);

vpa(subs(dg_du,V1, num_V1 ),5); vpa(subs(dg_du,V2, num_V2 ),5); vpa(subs(dg_du,V3, num_V3 ),5); vpa(subs(dg_du,th1, num_th1 ),5); vpa(subs(dg_du,th2, num_th2 ),5); vpa(subs(dg_du,th3, num_th3 ),5); vpa(subs(dg_du,g12, num_g12 ),5); vpa(subs(dg_du,b12, num_b12 ),5); vpa(subs(dg_du,g13, num_g13 ),5); vpa(subs(dg_du,b13, num_b13 ),5); vpa(subs(dg_du,g23, num_g23 ),5); vpa(subs(dg_du,b23, num_b23 ),5); vpa(subs(dg_du,angYBus23, num_angYBus23 ),5); vpa(subs(dg_du,angYBus13, num_angYBus13 ),5);

num_gradLu = dcost_du + transpose( dg_du )*lam; u(i,1) = vpa( -0.03*num_gradLu(1) + num_V1, 5); num_V1 = u(i,1); u(i,2) = vpa( -0.03*num_gradLu(2) + num_V2, 5); num_V2 = u(i,2); P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 end = = = = = = = = = = = = = = vpa(subs(P1,V1, num_V1 ),5); vpa(subs(P1,V2, num_V2 ),5); vpa(subs(P1,V3, num_V3 ),5); vpa(subs(P1,th1, num_th1 ),5); vpa(subs(P1,th2, num_th2 ),5); vpa(subs(P1,th3, num_th3 ),5); vpa(subs(P1,g12, num_g12 ),5); vpa(subs(P1,b12, num_b12 ),5); vpa(subs(P1,g13, num_g13 ),5); vpa(subs(P1,b13, num_b13 ),5); vpa(subs(P1,g23, num_g23 ),5); vpa(subs(P1,b23, num_b23 ),5); vpa(subs(P1,angYBus23, num_angYBus23 ),5); vpa(subs(P1,angYBus13, num_angYBus13 ),5)

Potrebbero piacerti anche