Lecture Notes (Economic Operation)

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 o Term #2 / #3??? Grading o 20% homeworks o 20% quizzes (2 during term) o 25% midterm exam o 30% final exam o 5% special assignment

Transcript of Lecture Notes (Economic Operation)

Page 1: Lecture Notes (Economic Operation)

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

o Term #2 / #3??? Grading

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

Page 2: Lecture Notes (Economic Operation)

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

Page 3: Lecture Notes (Economic Operation)

o pollution output is considered “cost” in the same manner fuel o note that, in a deregulated market, customers may choose “green” energy providers

o 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).

outputefficiencyinput

= netgross

(1)

Figure 1: Boiler-Turbine-Generator Unit

Page 4: Lecture Notes (Economic Operation)

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

Note the following terms:

note that R is a fictional monetary unit utilized in this book

Btu per hour heat input to unit Fuel cost times is R per ho r

//u

HF H

MBtu hR h

/

=/= /

14444444244444443

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).

( )

( )units

fuel cost in per

R R Btu MWMWh Btu h

R HR BtuP P

/ /⎛ ⎞⎛ ⎞→ = ÷⎜ ⎟⎜ ⎟⎝ ⎠⎝ ⎠

∆ / ∆= /∆ ∆1444442444443

(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

Page 5: Lecture Notes (Economic Operation)

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…

( )

functionaldescription of

heat ratepolynomial representationcharacteristi

2

cs

2 1 02 1 0

/, H PP P PP

α α α α= = + +h644744864748

(3)

( )( )( )

nonlinear function is approximatedas set of (generally linear) sub-functions

lim1 lim 2 1

lim lim 2 lim3 2, ,P P P P

P P P P P Pα

α α

⎧ ⎫⎪ ⎪

≤ < →⎪ ⎪⎪ ⎪= ≤ < →⎨ ⎬⎪ ⎪⎪ ⎪⎪ ⎪⎩ ⎭

h

6444474

M

4448

(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…

Page 6: Lecture Notes (Economic Operation)

How do represent its input-output characteristic?

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

boiler is on

continue to open throttling valve

#1

continue to open throttling valve

#2

throttling valve #2 is fully open, open

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

throttling valve #2

efficiency increases as

throttling valve #2 opens

continue to open throttling valve

#3

efficiency increases as

throttling valve #2 opens

Page 7: Lecture Notes (Economic Operation)

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?

Page 8: Lecture Notes (Economic Operation)

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?

efficiency increases as turbine #2

increases output

Page 9: Lecture Notes (Economic Operation)

Figure 7: Characteristics of Hydroelectric Plant

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

Page 10: Lecture Notes (Economic Operation)

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:

( )1 2array of these values

real power demand by all loadstotal number of generating units

fuel cost (for generator)

real power output (of generator)

cost fuN

Load

t

P

hi

thi

P P P

PN

i F

i P→ = …

==

=

=14444444244444443

( )1 2set of these functions

nction (for generator)

total cost function (for system as a whole)N

thii

→ = …

=

=f f f f

f

F

144444424444443

(5)

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 Newton’s Method

How is “total cost function” (F) defined? sum of all fuel costs

Page 11: Lecture Notes (Economic Operation)

( ){

( ) ( )

for this example, objective function is defined (simply) as total fuel cost

total cost $ /

N

1 1cost_function output

kWh kW

N

i ii

i

h

ii

P P==

==∑ ∑F f

644444444474444444448

144244314243 (6)

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

( )

system (equality) cons

1

traint

gnote that this constraint assumes

that no transmission losses

, N

load load ii

P P P P=

→ = −∑64444744448

(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

to be driven to zerominimized

Lagrange Function note that isLagrange Multiplier

, , ,load loadP P P P Pλ

λ λ= + ⎡ ⎤⎣ ⎦L F g6447448

1442443 1442443 (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)

Page 12: Lecture Notes (Economic Operation)

( ) ( ) ( )

( ) ( )

( )1 1

,, ,

, ,

, ,

loadload

N Nload

i i

lo

load ii i

ad i

i i

P Pd P P d PdP dP dP

d P P d dP P PdP dP d

d P P dd

P

P dP

λ

λλ

λ

λλ

= =

⎡ ⎤⎣ ⎦= +

⎡ ⎤⎡ ⎤ ⎛ ⎞= + −⎢ ⎥⎜ ⎟⎢ ⎥⎣ ⎦ ⎝ ⎠⎣ ⎦

= −

∑ ∑L f

gL F

Lf (9)

( ) ( )L , ,

g ,loadload

d P PP P

λ= (10)

o Step #2: set these derivatives equal to zero o Step #3: solve for x, y, and λ which satisfy these equations.

o refer to (11), derived from (9) and (10)

*** SOLUTION FOR LAGRANGE METHOD ***

( )

( )

*

*,min ,max

*

equations

2 inequality constraints

1 equality constraint

*

, 0

i i

i

i i i

load

d P

dP

P P

P

N

P

P

N

λ=

≤ ≤

→=

f

g

(11)

Example #1: Simple Lagrange Function ……………………………………………………………………………………. Step #1: Define the example system.

( )( ) 2 2

,

, 1

x y x y

x y x y

= +

= + −

f

g (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). ( ) ( ) ( ) ( ) ( )2 2, , , 1x y x y y x yx xy = + −= ++ +obj f g (13) Step #3a: To find the minimum, take the partial derivates of obj with respect to x and y.

1 2

1 2

d xdx

d ydy

= +

= +

obj

obj (14)

Step #3b: Solve for the values of x* and y* which satisfy (14).

Page 13: Lecture Notes (Economic Operation)

}

{

*

*

1 1* 1 2 02 21 1* 1 2 02 2

x

y

dxdx

dydy

⎛ ⎞= − → = + − =⎜ ⎟⎝ ⎠⎛ ⎞= − → = + − =⎜ ⎟⎝ ⎠

obj

obj (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 is NOT fulfi

2

l d

2

le

1 1 1*, * 12 2 2

0x y⎡ ⎤⎛ ⎞ ⎛ ⎞= − + − − = −⎢ ⎥⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠ ⎥

≠⎢⎣ ⎦

g

64444444744444448

(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 λ.

( )syste

2

m constraint

2

,

1 2 0

1 2 0

1 0

d xdxd ydyd x yd

λ

λ

λ

= + =

= + =

= + − =

g x y

L

L

L14243

(17)

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

121

2

x

y

λ

λ

= −

= − (18)

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

Page 14: Lecture Notes (Economic Operation)

2 2

2 2 2

2 2

*

L 1 1 10 1 0 2 12 2 2

1 1 1 12 2 2 2

1 1 1 2 0.

12

5

0.5

2 2

x y

solution

dd

λ

λ λ λ λ

λ λ

λ λ

λ

+

⎛ ⎞ ⎛ ⎞ ⎛ ⎞= = − + − − → = − −⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠ ⎝ ⎠

⎛ ⎞ ⎛ ⎞= − → − = ±⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠

= ± → =

±

±

=

644474448

1442443

(19)

Step C: Calculate the corresponding x and y.

( )* *, 0.1 1 1 2 0.52 2

5x yλ

⎛ ⎞− = ± =⎜ ⎟⎝ ⎠

= ± (20)

What is the problem with this solution? n/a

( ) ( ) ( )( )* * *

2 2*

g , , 0

* *g , , 0.5 0.5 1 0

x y

x y

λ

λ

=

⎡ ⎤= ± + ± − =⎢ ⎥⎣ ⎦

64444744448

(21)

Which solution (of the four possible) is optimal? try them all (trial and error)

( )( )( )( )

( )optimal solution *, * yields minimal value of f ,

f 0.5, 0.5 0.5 0.5 2 0.5

f 0.5, 0.5 0.5 0.5 0

f 0.5, 0.5 0.5 0.5 0

sol #1

sol #2

sol #3

sol #4 f 0.5, 0.5 0.5 0.5 2 0.5

x y x y

+ + = + =

− + = − + =

+ − = + − =

− −

→ = − − = −1444444442 344444444

(22)

Step #5: After quantifying f(x, y) for all possible solutions, state the solution.

( )

we don'tcare whichone is

* *

used

* 1, , 0.5, 0.5, 2 0.5

x y λ

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟= − − ±⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

64748

(23)

………………………………………………………………………………………………………………………………………………………. 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)

Page 15: Lecture Notes (Economic Operation)

( )

( )

( )

** *

,min ,max

** *

,max

** *

,min

f

f

f

i ii i i

i

i ii i

i

i ii i

i

d PP P P

dP

d PP P

dP

d PP P

dP

λ

λ

λ

= → ≤ ≤

≤ → =

≥ → ≤

(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

( )

( )}

( )2

1 1

0.293

147.9 2.10 0

21 1 1 1

21 1

.0004

1

6

1

1

h 510.0 7.2 0.00142

h 0.293 510.0 7.2 0.00142

WBtu

P P

MBP P P

P P

tuh

MWPh

+ +

′ = + +

= + +144444424444443

(25)

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

( )

( ) ( )2

2 2

22 2 2 2

22 2

90.83 2.3 0.00056

2

8

2

h 310.0 7.85 0.00194

h 0.293 310.0 7.85 0.00194

P P

P P P

P P

MBtuh

MWh

P

+ +

′ = + +

= + +144444424444443

(26)

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

( )

( ) ( )2

3 322.85 2

2

.34 0.0014

3 3 3 3

23 3 3 3

h 78.0 7.97 0.00482

h 0.293 78.0 7.97 0.00482

P P

P P P

P P

MBtuh

P MWh

+ +

′ = + +

= + +144444424444443

(27)

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

Page 16: Lecture Notes (Economic Operation)

( )}

( )

( )

( ) ( )

( ) ( )

2 21 1 1 1

R554.6 7.875 0.0016 1.1 510.0 7.2 0.00142 in

21 1 1 1

22 2 2 1

23 3 3

/

3

f 3.75 147.9 2.10 0.000416

f 1.0 310 7.85 0.00194

f 1.0 78.0 7.97 0.00482

P P P Ph

R MW R MW RMW h h

RhR

P P

P

h

P

P P

P P P

/+ + = + +

/

= + +

= + +

= + +

/ /=

/

/

644444474444448

(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.

11

1

22

2

33

3

1 2 3

7.92 0.003124

7.85 0.00388

7.97 0.00964

Load

dFP

dPdF

PdPdF

Pd

RMWh

RMWh

RMWh

MWP

P P P P

λ

λ

λ

= + =

= + =

= + = /

+ + =

/

/ (29)

Step #3: Solve for λ.

( ) ( )

( ) ( )

( ) ( )

1

2

3

1 7.92 320.1 2535.20.003124

1 7.85 257.7 2023.20.00388

1 7.97 103.7 826.70.00964

MW

M

P

WP M

P W

λ λ

λ λ

λ λ

= − = −

= − = −

= − = −

(30)

( ) ( ) ( )( )681.5 538

1 2 3

5.1

320.1 2535.2 257.7 2023.2 103.7 826.7 850

9.148

LoadP

RMW

P P

h

λ λ λ

λ

+ +

/− + =

=

− + −

=

6444444444447444444444448 (31)

Step #4: Solve for P1, P2, P3…

( )( )( )

1

2

3

320.1 9.148 2535.2 393.0748

257.7 9.148 2023.2 334.2396

103.7 9.148 826.7 121.9476

P

P

M

M

MP

W

W

W

= − =

= − =

= − =

(32)

Step #4: Evaluate cost (g).

Page 17: Lecture Notes (Economic Operation)

849.26

2 3

20

1

393.0748 334.2396 121.9476 850LoadP P P P

MW+ +

+=

+ ≈144444424444443 (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

additionof los

1s

, ,N

load load Loss ii

P P P P P=

= + −∑g

6444444744 8

K

4444

(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).

( ) ( )

( )

( ) ( ) ( )

1 1

1 1

0 we assume is function of

for

,

loss

N N

i i load loss ii i

N N

i i load

l

lo

oa

ss ii i

P

i

i

d

P

d d dP P PP dP dP

d d d d dP P PP dP dP

P Pd PdP dP dP

dP dP

ddiP

λ

λ

λ λ λ

= =

= =

=

⎡ ⎤⎡ ⎤ ⎛ ⎞= + + −⎢ ⎥⎜ ⎟⎢ ⎥⎣ ⎦ ⎝ ⎠⎣ ⎦⎡ ⎤ ⎛ ⎞= + + − ⎜ ⎟⎢ ⎥⎣

⎡ ⎤⎣ ⎦

⎦ ⎝ ⎠

=

=

+

∑ ∑

∑ ∑

L f p

gf

L f p

fL

L

14243 14243

( )

( )

1

1

1

N

loss iii i i

i

i l

l

os

o

s

i

i

ssi i

i i

d d PdP dP dP

dd dP dP d

d ddP dP dP

P

λ λ

λ λ

λ

=

=

⎛ ⎞

⎛ ⎞= − −⎜

+ − ⎜ ⎟

⎟⎝ ⎠

⎝ ⎠

= + −

f

p

fL

L

p

p

14243

(35)

( ) ( ), ,

,loadload

d P PP P

λ=

Lg (36)

o Step #2: Set these derivatives equal to zero. o 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 ***

Page 18: Lecture Notes (Economic Operation)

( )

( )

** *

*,min ,max

*

equations

2 inequality constraints

1 equality con

, 0 straint

i i loss

i i

i i i

load

d P ddP dP

P P P

P P

N

N

λ λ →

⎛ ⎞+ =⎜ ⎟⎝ ⎠

≤ ≤

=

f p

g

(37)

Example 3C: Simple Dispatch of 3 Units with Losses…………………………………………………….................. Step #1: Utilize the definition of power loss defined below: ( )

functionaldescription

of

2 2 21 2 30.00003 0.00009 0.00012

Loss

los

P

s P P P P= + +p14243

(38)

Step #2: Starting from step #2 of Example 3A, state the optimal conditions for dispatch.

( )

( )

( )

this form comes from

1 1

2 2

3 3

1

(37) abo e

2 3

v

7.92 0.003124 1 2*0.00003

7.85 0.00388 1 2*0.00009

7.97 0.00964 1 2*0.00012

load loss

P P

P P

P

RMWhR

MWhR

MWhMW

P

P P P P

λ

λ

λ

/

/

/

+ = −

+ = −

+ = −

+ + = + p

64444444744444448

(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 ( )0P

( )

( )

( )

01

02

03

400

300

150

P

P

P

MW

MW

MW

=

=

=

(40)

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

Page 19: Lecture Notes (Economic Operation)

( )( )( )

( )}

( )( )( )

( )( )( )

( )( ) ( ) ( ) ( )

010

1

0

2

0

3

2 2 20

2*0.00003 400 0.0240

2*0.00009 300 0.0540

2*0.00012 150 0.0360

0.00003 400 0.00009 300 0.00012 150 15.6

loss

loss

loss

loss

Pd P

dP

d P

dP

d P

dP

MWP

= =

= =

= =

= + + =

p

p

p

p

(41)

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

( ) ( )( )

( )

( )

( )

1

2

3

1

0

calcula

2

t

3

7.92 0.003124 1 2*0.00003*400 0.9760

7.85 0.00388 1 2*0.00009*300 0.9460

7.97 0.00964 1 2*0.00012*150 0.9640

85

sampl

0 1

e

6

1

5.loss

lossi

i i

P

d Pd PdP dP

RMW

Ph

RMWh

RMWh

P

P

P P P

λ λ

λ λ

λ λ

λ

+ = − =

+ = − =

+

⎛ ⎞⎜ ⎟→ = −⎜ ⎟⎝

= −

⎠/

/

/=

+ + = +

pf

{

edabove

MW

(42)

Step #5a / Step Ca: Solve for λ.

note that this equation is now linea

2

r

1 1

2

0.9760 7.927.92 0.003124 0.9760 312.420 2535.20.003124

0.9460 7.857.85 0.00388 0.9460 243.8144 2023.20.00388

7.9

7

P P

P P

λλ λ

λλ λ

−+ = → = = −

−+ = → = = −

+

6444447444448

3 20.9640 7.970.00964 0.9640 100 826.7365

0.00964P P λλ λ−= → = = −

(43)

( )

31 2

first iteration of

1

312.420 2535.2 243.8144 2023.2 100 826.736656.2344 5385.1 865.6

5 865.6

9.5251

PP P

RMWhλ

λ λ λ

λ

λ− + −

− =+ − =

=

644474448 644474448 6447448

1442443

(44)

Step #5b / Step Cb: Calculate P .

( ) ( )( )

( ) ( )( ) ( )

1

11

12

13

312.420 9.5251 2535.2 433.94

243.8144 9.5251 2023.2 300.11

100 9.5251 826.7365 131.74

MW

MW

P

MW

P

P

λ

= − =

= − =

= − =

64748

(45)

Page 20: Lecture Notes (Economic Operation)

Step #6 / Step D: Compare first iteration of P1, P2, and P3 to initial condition.

significantenough to

warrant anotheriteration

433.94 400 33.94300.11 300 0.11131.74 150 18.26

P−⎛ ⎞ ⎛ ⎞

⎜ ⎟ ⎜ ⎟∆ = − =⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟− −⎝ ⎠ ⎝ ⎠14243

(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.

Page 21: Lecture Notes (Economic Operation)

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)

( )

( )( )( )

}

0

1 2

pf 1

1 3 1 4example exp

lossi

ii

d Pd P

dPdP

P P

λ

α α α α λ

⎛ ⎞⎜ ⎟−⎜ ⎟⎜ ⎟⎝ ⎠

+ +→ =644474448

(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 ( )0x . 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 ( )kx – refer to (48).

Page 22: Lecture Notes (Economic Operation)

( )( )( ) ( )( ) ( )( ) ( )( )0 0 0 0

0

1 2

T

n

d x x x x

dx x x x

⎛ ⎞∂ ∂ ∂⎜ ⎟∇ = =⎜ ⎟∂ ∂ ∂⎝ ⎠

f f f ff K (48)

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

Note that α is a scaling coefficient • utilize 1α >> to maximize speed • utilize 1α << to maximize stability

( ) ( ) ( )( )1k k kx x α+ = − ∇f (49)

o Step #5: Check for convergence. If method has converged, utilize ( )1kx + 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 .

( ) ( ) ( ) ( )( )

if this relaxed equality our solution ( ) is the value of holds true then... which minimizes the cost function (f)

1 1*0 mink k k

x x

x x x x+ +− ≈ → = =f f1442443 14444244443

(50)

Example #2: Simple Gradient Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Objective: Solve the following equation for x.

( ) ( )22 0.5 0xx e x= + − − =f (51)

Step #1: Solve for x algebraically.

( ) ( )

we cannot solve this

2 22 0.5 2 0.5 2 0.

5 2

5

0.

x x x

x

e x x e x e

x e

+ − = → − = − → − =

= − +

144424443

(52)

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

( ) ( )( ) ( )

( ) ( )

2

0 1

ff 2 0.5 2 2

f 2 1 2 1.8899

x xd x d e x e xdx dxe

∇ = = + − − = + −

∇ = + − ≈ (54)

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

Page 23: Lecture Notes (Economic Operation)

( ) ( ){

( )( )1

1.8899

1 0 0.1 f 0.8110kx x= − ∇ =14243

(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.

0

0.2

0.4

0.6

0.8

1

0 5 10 150

0.2

0.4

0.6

0.8

1

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).

( ){ ( ) ( )

1

for this example, obje

N

1

ctive functionis defined (simply) as total fuel cost

1 $ /

cost_function outpuf f tT

N

ii

i ii

N

i iiF kWh kWh

F

P P

=

= =

= =∑∑6444444447444444448

14424431424314243

(56)

( )

system (equality) constra

1

int

g ,N

load load ii

P P P P=

= −∑64444744448

(57)

( ) ( ) ( ) ( )note that is

Lagrange MultipLagrange

1Function

l er

1

i

L , , f g , fN N

load load i i load ii i

P P P P P P P Pλ

λ λ λ= =

⎛ ⎞+ + −⎡ ⎤ ⎜ ⎟⎣ ⎦⎝ ⎠

= =∑ ∑1442443 1442443 (58)

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

Page 24: Lecture Notes (Economic Operation)

( )

( )

( )

( )

1 2

1 11

1 12

1 1

11

L L L L L L

f

f

f

f

TT

N

N N

i i load ii i

N N

i i load ii i

N N

i i load ii iN

N

i i load ii

LP P P P

P P PP

P P PP

P P PP

d P P PdP

λ λ

λ

λ

λ

λ

= =

= =

= =

=

⎛ ⎞⎛ ⎞∂ ∂ ∂ ∂ ∂ ∂∇ = = =⎜ ⎟⎜ ⎟∂ ∂ ∂ ∂ ∂ ∂⎝ ⎠ ⎝ ⎠

⎛ ⎞∂ ⎛ ⎞+ −⎜ ⎟⎜ ⎟∂ ⎝ ⎠⎝ ⎠⎛ ⎞∂ ⎛ ⎞+ −⎜ ⎟⎜ ⎟∂ ⎝ ⎠⎝ ⎠

=

⎛ ⎞∂ ⎛ ⎞+ −⎜ ⎟⎜ ⎟∂ ⎝ ⎠⎝ ⎠

⎛ ⎞+ −⎜ ⎟⎝ ⎠

∑ ∑

∑ ∑

∑ ∑

K K

K M

( )

( )

( )

1 11

2 22

11

f

f

fN NN

NN

l a i

L

o di

i

d PdPd P

dP

d PdP

P P

λ

λ

λ

==

⎛ ⎞ ⎛ ⎞⎜ ⎟ −⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ −⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟=⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ −⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎛ ⎞⎜ ⎟ −⎜ ⎟⎜ ⎟⎜ ⎟ ⎝ ⎠⎝ ⎠⎝ ⎠∑∑

M

144424443

(59)

o The update equation, however, is relatively unchanged.

( ) ( ) ( )( )1 Lk k kx x α+ = − ∇ (60)

o Note that, for the application of gradient method to economic dispatch problem, the x vector is

defined as in (61). ( )1 2

TNx P P P λ= K (61)

Refer to (62).

( )

( )

( )

( )

( )

( )

( )

( )

( )

( )

( )( ) ( )

( )( ) ( )

( )( ) ( )

( )

( )

1

1 11

11 1

2 212

applicat

2 2

1

ion of gradient

1

1

f

f

f

k k

k

k k

k kk k

k k

k kk kN N

N Nk k N

Nk

loax x

L

d ii

d PdP

P P d PdPP P

dP P PdP

P P

λ

λ

α

λλ λ

+

+

+

+

+

=

⎛ ⎞−⎜ ⎟⎜ ⎟⎛ ⎞ ⎛ ⎞ ⎜ ⎟⎜ ⎟ ⎜ ⎟ −⎜ ⎟⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟ ⎜ ⎟= −⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟ ⎜ ⎟−⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠⎜ ⎟−⎜ ⎟⎝ ⎠

M M M

14243 123

144424443

method to economic dispatch of N generators, neglected power losses6444444447444444448

(62)

What is the problem with this solution / formulation?

o Because we initialize ( )0P , 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 …………………………………………

Page 25: Lecture Notes (Economic Operation)

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 ( )0x .

( ) ( )( ) ( )( )this is a common

0

30

ap

0

proximation

1

300,200,300

1 f 9.44843 i i

i i

P

d PdP

λ=

=

= =∑14444244443

(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 ( )kx – refer to (65).

( )again, note, that we are not

co

11

22

3

nsidering power los

1 2 3

s

3

L 7.92 0.003124

L 7.85 0.00388

L 7.97 0.00964

L load

RPP MWh

RPP MWh

RPP MWh

P P P P MW

λ

λ

λ

λ

∂ /⎛ ⎞= + − ⎜ ⎟∂ ⎝ ⎠∂ /⎛ ⎞= + − ⎜ ⎟∂ ⎝ ⎠∂ /⎛ ⎞= + − ⎜ ⎟∂ ⎝ ⎠

∂ = − + +∂ 144424443

(64)

( )

( ) ( )

( ) ( )

( ) ( )

( ) ( ) ( )

( )( )( )

0 01

0 00 2

0 03

0 0 01 2 3

7.92 0.003124 0.59127.92 0.003124 300 9.44847.85 0.00388 0.827.85 0.00388 200 9.4484

L7.97 0.00964 300 9.44847.97 0.00964

800 300 200 300load

P

P

P

P P P P

λλ

λ

⎛ ⎞+ − −+ −⎛ ⎞⎜ ⎟ ⎜ ⎟⎜ ⎟+ − −+ −⎜ ⎟∇ = = =⎜ ⎟ ⎜ ⎟+ −+ −⎜ ⎟ ⎜ ⎟⎜ ⎟⎜ ⎟ − − −⎝ ⎠− + +⎝ ⎠

241.4136

0

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

(65)

( )( )( ) ( )( ) ( )( ) ( )( )0 0 0 0

0

1 2

f f f ff

T

n

d x x x x

dx x x x

⎛ ⎞∂ ∂ ∂⎜ ⎟∇ = =⎜ ⎟∂ ∂ ∂⎝ ⎠

K (66)

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

( )

( )

( )

( )

( ){ ( )

{

( )0 01 L

11

12

13

1

300 0.5912 300.5912200 0.8224 200.8224

1300 1.4136 298.5864

9.4484 0 9.4484xx

P

P

P α

λ∇

⎛ ⎞ −⎛ ⎞ ⎛ ⎞ ⎛ ⎞⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ ⎟ −⎜ ⎟ ⎜ ⎟ ⎜ ⎟= − =⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎝ ⎠ ⎝ ⎠ ⎝ ⎠⎝ ⎠ 14243 14243

(67)

Step #5: Continue iterations…

Page 26: Lecture Notes (Economic Operation)

050

100150200250300350400450500

0 5 10 15 20 25

x-axis: iteration (k)

y-ax

is: g

ener

atio

n

P1(k)P2(k)P3(k)

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 assumption…let’s try this again…

1

3 1

for example 3Egeneral statem

21

ent

N

N load i loadi

P P P P P P P−

=

= − → = − −∑ 144424443144424443

(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).

( ){

( )( ) ( )

( )1

1

totalcost with assumption of 67we pull

out of this term

1 1

1 1

N N

N

N N N load ii

N N

i i N load ii i

P

P P P

P P P P

=

⎛ ⎞⎜ ⎟→ −⎜

=

=

−⎛ ⎞ ⎛ ⎞= + −⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠

∑ ∑f

f f

F f f14243 1442443

(69)

( )1

incorporated in to cost function , N

load load ii

P P P P=

= −→ ∑g (70)

o Step #2: Define an appropriate Lagrange Function.

( ) ( ) ( ) ( )

1

Lagrange Function note that isLagrange Multiplier because of our assumption

1 1

1

that

1

i

1

,

th s

, ,,

N

N load ii

N N N

load i i N lload oad i load ii i

P

i

P P

P P PP P P PP PPλ

λλ λ

=

− −

= = =

= −

+ ⎡ ⎤⎣ ⎦⎛ ⎞ ⎛ ⎞= = + − + −⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠

∑ ∑ ∑FL f fg1442443 1442443

term is neglected

1442443

(71)

o Step #3: Consequently, we must calculate the gradient of the Lagrange function ( ∇L ), as

shown in (72).

Page 27: Lecture Notes (Economic Operation)

( )

( )

( )

1 1

1 1 11

1 1

1 1 12

1 2

2

2 1

N N N

i i N load i load ii i ii

N N N

i i N load i load ii i ii

i

T

N N

i N load iN

P P P P PP

P P P

dd

P PP

P P P

P P P P

P

P

λ

λ

− −

= = =

= = =

⎛ ⎞⎛ ⎞∂ ⎛ ⎞+ − − −⎜ ⎟⎜ ⎟ ⎜ ⎟∂ ⎝ ⎠⎝ ⎠⎝ ⎠

⎛ ⎞∂ ∂

⎛ ⎞⎛ ⎞∂ ⎛ ⎞+ − − −⎜ ⎟⎜

∂ ∂∇ = = =⎜ ⎟∂ ∂ ∂ ∂⎝ ⎠

=

⎟ ⎜ ⎟∂ ⎝ ⎠⎝ ⎠⎝ ⎠

∂ + −∂

∑ ∑ ∑

∑ ∑ ∑

f f

L L L L LL

f f

f f

K K

K M

( )

( ) ( )

1

1

note that the book ut

1 1

1 1 1

1 1

1 1

ili

1

z

1

e

1

1

2

s

1

1

N N N

load ii i ii

N N N

i i N load i load ii i iiN

d

N

dP

d P d

P P

P P P P

PP d

P

P

P

d

λ

λ

− −

= = =

− −

= = =−

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟

⎛ ⎞⎛ ⎞ ⎛ ⎞⎜ ⎟− −⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟⎝ ⎠⎝ ⎠⎝ ⎠⎜ ⎟⎜ ⎟⎛ ⎞⎛ ⎞∂ ⎛ ⎞+ − − −⎜ ⎟⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟∂ ⎝ ⎠⎝ ⎠⎝ ⎠⎝

=

+

∑ ∑ ∑

∑ ∑ ∑

f

f f

f f

( ) ( )

( ) ( )

( ) ( )

1

3

2 2 2

2 2

2 2

because they take derivativewith res

2

2 2

1

pect t

1

o

1

1

1

NddP

P

N

N N N N

N N

N N N N

N N

d P d PdP dP

d P d PdP dP

d P d PdP dP

⎛ ⎞ ⎛ ⎞−⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟

⎝ ⎠

− − −

− −

− − −

⎝ ⎠

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟+⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟+⎜ ⎟⎜ ⎟⎜ ⎟+⎜ ⎟⎝ ⎠

f

L

f f

f f

f f

M

644474448

144444244 3444

(72)

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

( ) ( ) ( )( )1k k kx x α+ = − ∇L (73)

o Note that, for the application of gradient method to economic dispatch problem, the x vector is

defined as in (74).

( )**note that as well as are not included

1

n

2 2 1

iN

T

x

N N

P

x P P P P

λ

− −=644444744 8

K

4444

(74)

Refer to (75).

( )

( )

( )

( )

( )

( )

( )

( )

( )

( )

( )( ) ( )( )

( )( ) ( )( )

( )( )1

again, note the book util

1 1

1 111 1

2 212 2

2 2

12

izes anopp

2

1 2 2

osite s gn

1

i

1

k k

k kN

k kk k

Nk k

k kN N k

k k N

x x

NN N

d P d P

dP dPP P

d P d PP P

dP dP

P Pd P

P PdP

α

+

+

+

+− −

+ − −− −

+

⎛ ⎞ ⎛ ⎞⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟ +⎜ ⎟ ⎜ ⎟= −⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠

f f

f f

f

64444744448

14

M M

23

M

243 1

( )( )

( )( ) ( )( )( )

2 2

1 1

1 1

k

kN

N N

k kN N N

N N

d P

dP

d P d P

dP dP∇

− −

− −

− −

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟+⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟− +⎜ ⎟⎝ ⎠

L

f

f f

1444442444443

(75)

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

Page 28: Lecture Notes (Economic Operation)

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 ( )0x .

( ) ( )

( )( )( )

this is a common a

0

03

0

1

pproximation

300, 200,300

1 9.44843

i i

i i

P

d P

dPλ

=

=

= =∑f

144424443

(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 ( )kx . Step #3a: Restate the cost functions (f1-3), utilizing (71).

( ) ( )

( ) ( )

( ) ( )

21 1 1 1

22 2 2 2

23 3 3 3

1.1 510.0 7.2 0.00142

1.0 310 7.85 0.00194

1.0 78.0 7.97 0.00482

P P P

P P P

Rh

P P P

RhRh

= + +

= + +

+

/

/= +

/

f

f

f

(77)

Step #3b: Put the Nth, or 3rd in this case, cost function in terms of P1 through PN-1.

( ) ( ) ( )2

33

23 1 2 1 2 1 2, 78.0 7.97 0.00482loa

P

d lo

P

adP P P P P P P P= + − − + − −f64474486447448

(78)

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

( ) ( )

( ) ( )

11

1

22

2

31 1 2

1

32 1 2

2

7.92 2*0.003124

7.85 2*0.00194

7.97 2*0.00482

7.97 2*0.00482

load

load

dP

dPd

PdPd

P P P PdPd

P P P Pd

RMWhR

MWhR

MWhR

MWhP

/

/

/

= +

= +

= − + − −⎡ ⎤⎣ ⎦

= − + − −⎡ ⎤⎣ ⎦/

f

f

f

f

(79)

Step #3d: Calculate ∇L .

Page 29: Lecture Notes (Economic Operation)

( )

( )( ) ( )( )

( )( ) ( )( )

( ) ( )( ) ( ) ( )( )( ) ( )( ) ( ) ( )( )

0 01 1 3

0 1 1

0

0 0 0 01 1 1 2

0 0 0 02 2 1

2

2

02 3

2 2

7.92 2*0.003124 7.97 2*0.00482

7.85 2*0.00194 7.97 2*0.00482

7.92 2*

load

load

P P P P P

P

d P d P

dP dP

d P d P

dP d

P P P P

P

⎛ ⎞⎡ ⎤⎡ ⎤+ − + − −

⎛ ⎞⎜ ⎟−⎜ ⎟

∇ =

⎣ ⎦ ⎣ ⎦⎜ ⎟= =⎜ ⎟⎡ ⎤⎡ ⎤+ − + − −⎜ ⎟⎣ ⎦ ⎣ ⎦

=⎜ ⎟⎜ ⎟⎜ ⎟−

⎝ ⎠

⎜ ⎟

=

+

f f

Lf f

K K

K

K

( ) ( ) ( )( ) ( ) ( )

0.00312 300 7.97 300 2*0.00482 800 300 200

7.85 2*0.00194 200 7.97 200 2*0.00482 800 300 200

1.0624

2.236

⎛ ⎞− + − −⎡ ⎤ ⎡ ⎤⎣ ⎦ ⎣ ⎦⎜ ⎟ =⎜ ⎟+ − + − −⎡ ⎤ ⎡ ⎤⎣ ⎦ ⎣ ⎦

−⎛ ⎞= ⎜ ⎟−⎝

⎠K

K

(80)

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

( )

( )

( ){

( )

{

( )0 01

11

1

L

2

300 1.0624 310.6761

200 2.236 222.36xx

P

P α

⎛ ⎞ −⎛ ⎞ ⎛ ⎞ ⎛ ⎞= − =⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ ⎟ −⎝ ⎠ ⎝ ⎠ ⎝ ⎠⎝ ⎠ 123 14243

(81)

Step #5: Continue iterations…

0

50

100

150

200

250

300

350

400

450

0 20 40 60 80 100

x-axis: iteration (k)

y-ax

is: g

ener

atio

n

P1(k)P2(k)

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

Topic #6: Newton’s Method (3.5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What is the difference between gradient search and Newton’s Method?

o In the gradient search, we drive cost (F) to zero and acknowledge a solution when L 0∇ = . o In Newton’s Method, we drive the gradient ( ∇L ) itself to zero.

How do we drive the gradient of a function g(x) to zero?

Page 30: Lecture Notes (Economic Operation)

o Step #1: Take first order Taylor Series Expansion of g. Refer to (82).

( ) ( ) ( ) ( ) ( ) ( )

first-order Taylor Series Expansion

JacobianMat

22

2

rix

higher order ter .ms..d xd x

xdx

xxdx

x x+ ∆ = + ∆ + ∆ +g g

g g

644444474444448

123

(82)

( )

( )( )

( )

( )

( ) ( ) ( )

( ) ( ) ( )

( ) ( ) ( )

1 1 1

1 2

2 2 2

1 2

1 2

Jacobian Matri

1

2

x

n

n

n nn

n

n

d x d x d xdx dx dx

d x d x d xd x

dx dx dxdx

d x d x d xdx dx d

x

x

xx

x

⎛ ⎞⎜ ⎟⎜ ⎟= →⎜ ⎟

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟

= ⎜ ⎟⎜ ⎟⎜ ⎟⎜⎜ ⎟⎜ ⎟⎜ ⎟⎝

⎟⎜ ⎟⎝ ⎠

g g g

g g gg

g g g

gg

g

g

K

K

M M

1444444244

M

3

M

K

4444

(83)

o Step #2: Calculate g(x). o 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).

( ) ( ) ( ) ( ) ( ) ( )1

d x

x xd

xx

x xdx

xdx

−⎡ ⎤

∆ =+ ∆ = + ∆ → − ⎢ ⎥⎢ ⎥⎣ ⎦

gg g g

g (84)

Adapt this Expression for Lagrange…

1

dxdx

−⎡ ⎤

∆ = − ∇ ∇⎢ ⎥⎣ ⎦

L L (85)

( ) ( )

we inject the iteration number

1k k

k

x x x+ = + ∆1442443

(86)

Where the Lagrange Function is as defined below.

( ) ( ) ( ) ( )Lagrange Function note that is

Lagrange Multiplier

1 1

, ,,N N

load i i loaload d ii i

P P PPP P P Pλ

λ λλ= =

⎛ ⎞= = + −⎜⎡⎣⎠

⎤⎝

+ ⎦ ⎟∑ ∑L F g f1442443 1442443

(87)

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

Page 31: Lecture Notes (Economic Operation)

{

{

{

( )

1

2

g ,

2 2 2 2

21 2 1 1 11

2 2 2 2

22 1 2 2

1

1

1

2

2

2

1

2

N

load

N

N

N

load i

N N

N

x

x

x

P

N

P

i

N

d d d ddx dx dx dx dx dxdx

d d d ddx dx dx dx dx

dd P

dd P

d ddx dx d

d

d

xdx

P

ddx d

P P

λ

λ

λ

=

+

+

⎛ ⎞−⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟

−⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟∇ = ⎜ ⎟⎜ ⎟

−⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟−⎜ ⎟⎜ ⎟⎝

=

=

L L L L

L L L L

L

F

F

LF

K

K

K

K M M M M

1 2

M

4 43

2 2 2

21 2 1

21 1 1 2 1 1

2 2 2 21 1 1 1

21 1 2 2 1 11

2 22 2

22 1 1 2

N N NN

N N N N N

N N

d d dx dx dx dx dxdx

d d d ddx dx dx dx dx dx dx

d d d dd d d ddP dPdP dP dPdP dP dPd ddP

d dd ddP dP dP dPdP

λ λ λ λλ λ

λ λ

+

+ + + +

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟ =⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

− − − −

− −

=

L L L

L L L L

F F F F

F F

K

K

K

K

K

2 22 2

2 2 2 1

2 2 2 2

21 1 2 2 1

1 1 1 12

1 1 1 2 1

N N N

N N N N

N N N N NN

N N N N

i i i ii i i i

N N N N

d dd ddP dP dP dP dP d

d d d dd d d ddP dP dP dP dP dP dP dP dP ddP

d P d P d P d P

dP dP dP dP dP dP d

λ λλ

λ λ λ λλ

λ

+

+

= = = =

+ + +

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟− −⎜ ⎟⎜ ⎟⎜ ⎟ =⎜ ⎟

− − − −⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟−⎜ ⎟⎜ ⎟⎝ ⎠

∑ ∑ ∑ ∑

F F

F F F F

K

M M M MK

K

K

21

21

22

22

2

2

0 0 1

0 0 1

0 0 1

1 1 1 0

N

N

ddP

ddP

ddP

⎛ ⎞−⎜ ⎟

⎜ ⎟⎜ ⎟⎜ ⎟−⎜ ⎟= ⎜ ⎟⎜ ⎟⎜ ⎟

−⎜ ⎟⎜ ⎟⎜ ⎟− − −⎝ ⎠

F

F

F

K

K

KM M M M

K

K

(88)

Why utilize Newton’s Method?

o More computationally intensive, because we will have to invert the Jacobian Matrix.

Page 32: Lecture Notes (Economic Operation)

o Allows much faster convergence. Example 3G: Newton’s 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 ( )0x . (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).

( ) ( )

( ) ( )

( ) ( )

21 1 1 1

22 2 2 2

23 3 3 3

1.1 510.0 7.2 0.00142

1.0 310 7.85 0.00194

1.0 78.0 7.97 0.00482

P P P

P P P

Rh

P P P

RhRh

= + +

= + +

+

/

/= +

/

f

f

f

(90)

Step #3b: Perform all differentiation required to build the Jacobian, as defined in (91).

21 1

1 21 1

22 2

2 22 2

23 3

3 23 2

7.92 2*0.00312 0.00624

7.85 2*0.00194 0.00388

7.97 2*0.00482 0.00964

d dP

dP dP

d dP

dP dP

d dP

dP dP

= + → =

= + → =

= + → =

f f

f f

f f

(91)

Step #3d: Calculate ∇L .

0.00624 0 0 10 0.00388 0 10 0 0.00964 11 1 1 0

ddx

−⎛ ⎞⎜ ⎟−⎜ ⎟∇ =⎜ ⎟−⎜ ⎟

− − −⎝ ⎠

L (92)

Step #4: Calculate the Langrange Function for 0th iteration.

Page 33: Lecture Notes (Economic Operation)

( )

( )( ) ( )

( )( ) ( )

( )( ) ( )

( )

( )( )( )

01 1 0

1

02 2 0

0 2

03 3 0

3

0

1

9.79207.92 2*0.00312 300 08.62607.85 2*0.00194 200 0

10.86207.97 2*0.00482 300 00800 300 200 300

N

load ii

d P

dP

d P

dP

d P

dP

P P

λ

λ

λ

=

⎛ ⎞⎜ ⎟−⎜ ⎟⎜ ⎟⎜ ⎟ + −⎛ ⎞ ⎛ ⎞⎜ ⎟ ⎜ ⎟ ⎜− + −⎜ ⎟ ⎜ ⎟ ⎜∇ = = =⎜ ⎟ ⎜ ⎟ ⎜+ −⎜ ⎟ ⎜ ⎟ ⎜⎜ ⎟− − −−⎜ ⎟ ⎝ ⎠⎝ ⎠⎜ ⎟⎜ ⎟⎜ ⎟−⎜ ⎟⎝ ⎠

f

f

Lf

⎟⎟⎟⎟

(93)

Step #5: Update the control variables.

( ) ( )00

10.00624 0 0 1 9.7920 58.21430 0.00388 0 1 8.6260 206.89250 0 0.00964 1 10.8620 148.67811 1 1 0 0 9.4287

ddx

x

∇∇

−− −⎛ ⎞ ⎛ ⎞ ⎛ ⎞⎜ ⎟ ⎜ ⎟ ⎜ ⎟−⎜ ⎟ ⎜ ⎟ ⎜ ⎟∆ = − =⎜ ⎟ ⎜ ⎟ ⎜ ⎟− −⎜ ⎟ ⎜ ⎟ ⎜ ⎟

− − −⎝ ⎠ ⎝ ⎠ ⎝ ⎠LL

144444424444443 14243

(94)

( )

( )

( )

( )

( ){ ( ) ( )0 0

1

11

12

13

1

300 58.2143 241.78200 206.8925 406.89300 148.6781 151.32

0 9.4287 9.4287x xx

P

P

P

λ∆

⎛ ⎞ −⎛ ⎞ ⎛ ⎞ ⎛ ⎞⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟= + =⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟−⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎝ ⎠ ⎝ ⎠ ⎝ ⎠⎝ ⎠ 123 1442443

(95)

Note: that Newton’s Method converges much more quickly than Gradient / Lamda Iteration Methods, in one iteration…

1 2 3 4 5 6 7 8 9 100

50

100

150

200

250

300

350

400

450

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

Page 34: Lecture Notes (Economic Operation)

% 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) = 7.92 + 2*0.00312*P1(k) - lambda(k); L2(k) = 7.85 + 2*0.00194*P2(k) - lambda(k); L3(k) = 7.97 + 2*0.00482*P3(k) - lambda(k); L4(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:

Page 35: Lecture Notes (Economic Operation)

Stage #I: Foundation

Stage #III:Interior Walls

Stage #IV:Windows

cement (C) wood (H)

plaster (I)

brick (G)brick (D)

Stone (F)

wood (E) 2-layer (K)

3-layer (L)

1-layer (J)dirt (A) brick (B)$20k

$10k

$50k

$35k

$35k

$60k

$10k

$20k

$35k

$35k

$10k

$10k

$30k

$30k

$15k

$20k

Stage Xi:the path to making

your ith choice

Choice Node Set Xi:set of nodes representing

all options for ith stage

X1 = {BC}

fmin.(E) = 10 + 35 < 20 +35

stages represented by roman numerals

Stage #II: Exterior Walls

Value Function V(Xi, Z):represents the cost to travel from stage i to choice node Z

Minimum Cost fi(Z):defines minimal cost to travel to choice node Z

Optimal Policy:the lowest cost route

Figure 15: Example Formulation of Dynamic Programming

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

Figure 16: Dynamic Programming Example

Page 36: Lecture Notes (Economic Operation)

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.

{ }{ }{ }{ }{ }{ }

0

1

2

3

4

5

underline denotes set or a

, ,

, ,

, ,

r y

,

a

,

rX A

X B C D

X E F G

X H I J K

X L M

X N

=

=

=

=

=

=

(96)

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

( )}

( )( ) ( )( ) ( )

minimumvalue from stage 0cost toto choice n

0

0

0

ode Bnode B

, 5

, 2

, 3

B X B

C X C

D X D

= =

= =

= =

f V

f V

f V

64748

(97)

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

Page 37: Lecture Notes (Economic Operation)

( ) ( )}

( )( ) ( ) ( ) ( ) ( ) ( )

( ) { }

( ) ( ) ( )

optimal policy to travel to ,

1 1

1 1

, ,11, 8, 5, 2, 3

min , min 5 11 16, 2 8 10, 3 16 10 , ,

min , min 5

EB B E C C E D D E

E X X E E A C E

F X X F

+ + +∞ ⎡ ⎤⎡ ⎤⎢ ⎥⎢ ⎥= + = + = + = + ∞ = = → =⎢ ⎥⎢ ⎥

⎣ ⎦ ⎣ ⎦

= + =⎡ ⎤⎣ ⎦

f V f V f V

f f V opt

f f V

64748 64447444864748 64748 64748

( ) ( ) ( ) ( ) ( ) ( )

( ) { }

( ) ( ) ( ) [ ] ( ) { }

optimal policy to travel to F, , ,

optima ol

1

l

1

p

, 2 4 6 , 3 6 9 6 , ,

min , min 5 , 2 9 11, 3 6 9 9 , ,

B B F C C F D D F

F A C F

G X X G G A D G

+ + +⎡ ⎤⎢ ⎥+ ∞ = ∞ + = + = = → =⎢ ⎥⎣ ⎦

= + = + ∞ = ∞ + = + = = → =⎡ ⎤⎣ ⎦

f V f V f V

opt

f f V opt

64447444864748 64748 64748

icy to travel to G644474448

(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 nodes f( Xk ) opt( Xk ) 1 B, C, D 5, 2, 3 A, A, A 2 E, F, G 10, 6, 9 AC, AC, AD

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

( ) ( ) ( ) ( ) ( )

( ) ( ) ( ) ( ) ( )

( ) ( )

2 2

2 2

2

min , min 10 3 13,6 8 14,9 13

min , min 10 2 12,6 11 17,9 12

min

GE F

GE F

H X X H H E H

I X X I I E I

J X

⎡ ⎤⎢ ⎥= + = + = + = + ∞ = ∞ = → = +⎡ ⎤⎣ ⎦ ⎢ ⎥⎣ ⎦

⎡ ⎤⎢ ⎥= + = + = + = + ∞ = ∞ = → = +⎡ ⎤⎣ ⎦ ⎢ ⎥⎣ ⎦

= +

f f V opt opt

f f V opt opt

f f V

64748 64748 64748

64748 64748 64748

( ) ( ) ( )

( ) ( ) ( ) ( ) ( )

2

2 2

, min 10 ,6 5 11,9 11

min , min 10 ,6 9 15,9 4 13 13

GE F

GE F

X J J F J

K X X J K G K

⎡ ⎤⎢ ⎥= + ∞ = ∞ + = + ∞ = ∞ = → = +⎡ ⎤⎣ ⎦ ⎢ ⎥⎣ ⎦⎡ ⎤⎢ ⎥= + = + ∞ = ∞ + = + = = → = +⎡ ⎤⎣ ⎦ ⎢ ⎥⎣ ⎦

opt opt

f f V opt opt

64748 64748 64748

64748 64748 64748

(99)

k nodes f( Xk ) opt( Xk ) 1 B, C, D 5, 2, 3 A, A, A 2 E, F, G 10, 6, 9 ACE, ACF, ADG 3 H, I, J, K 13, 12, 11, 13 ACEH, ACEI, ACFJ, ADGK

Step #7: Determine minimum cost (f) and optimal policy to travel to each choice node of set #4

( ) ( ) ( ) [ ] ( ) ( )( ) ( ) ( ) [ ] ( ) ( )

3 3

3 3

min , min 13 9 22, 12 3 15, 11 7 18, 13 15

min , min 13 , 12 6 18, 11 8 19, 13 5 18 18 /

L X X L L I L

M X X M M I K L

= + = + = + = + = + ∞ = ∞ = → = +⎡ ⎤⎣ ⎦= + = + ∞ = ∞ + = + = + = = → = +⎡ ⎤⎣ ⎦

f f V opt opt

f f V opt opt (100)

k nodes f( Xk ) opt( Xk ) 1 B, C, D 5, 2, 3 A, A, A 2 E, F, G 10, 6, 9 ACE, ACF, ADG

Page 38: Lecture Notes (Economic Operation)

3 H, I, J, K 13, 12, 11, 13 ACEH, ACEI, ACFJ, ADGK 4 L, M 15, 18 ACEIL, ACE(I/K)L

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

k nodes f( Xk ) opt( Xk ) 1 B, C, D 5, 2, 3 A, A, A 2 E, F, G 10, 6, 9 ACE, ACF, ADG 3 H, I, J, K 13, 12, 11, 13 ACEH, ACEI, ACFJ, ADGK 4 L ,M 15, 18 ACEIL, ACE(I/K)L 5 N 19 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.

Page 39: Lecture Notes (Economic Operation)

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.

Step #3a: First, examine optimal allocation between ventures #1 and #2 if only one dollar can be spent.

[ ]( )

[ ]

( ) [ ]( )[ ]( ) [ ] [ ]( ) [ ]( ) [ ] [ ]( )

1

0 0 1 0 0 1

choice node 1 rep. that

$1 is investedin combinationof ven

1 0 0

tures #1and #2 0 0 , 1 1 , 1

1

1

1 , 1 0 0.25 0.25 , 0.28 0 0.28 0.28

X

X X X X X X

X X X X+ +⎡ ⎤

⎢ ⎥⎡ ⎤= + = + = + = =⎣ ⎦ ⎢ ⎥⎢ ⎥⎣ ⎦

f V f V

f max f V max64748 6447448 6447448

(102)

Step #3b: Next, examine optimal allocation between ventures #1 and #2 if only two dollars can be spent.

[ ]( ) ( ) [ ]( )[ ]( ) [ ] [ ]( ) [ ]( ) [ ] [ ]( )0 0 1 0 0 1

all in venture #2 split evenly in both ventures all in

0 0 , 2 1

venture #1

1 ,

1 0 0

2

12 , 2

0 0.41 0.41 ,0.28 0.25 0.53, 0.45 0 0.45X X X X X X

X X X X+ +

⎡ ⎤= + =⎣ ⎦

= + = + = + =f V f V

f max f V

max 1442443 14442

6447448 6444744

444

K

K48

3 1 2

[ ]( ) [ ] [ ]( )0 0 12 2 , 2

0.53X X X+⎡ ⎤

⎢ ⎥ =⎢ ⎥⎢ ⎥⎣ ⎦

f V64474 8

4

4

4 443

(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] }

when we have one dollar to spend, the optimal policy is to invest in venture #1… opt(X1[1]) = { X0[0], X1[1] }

Page 40: Lecture Notes (Economic Operation)

o add to, not take away from, previous optimal sub-policies. o 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)

[ ]( )[ ]( )}1 2 incremental increase for fund #1 incremental increase for fun #2

1

d

3 0.53 0.45 0.28 0.17 , 0.41 0.25 0.16 0.70X

X⎡ ⎤⎢ ⎥= + − = − = =⎢ ⎥⎣ ⎦

f

f max644474448 644474448

(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).

[ ]( ) ( ) [ ]( )[ ]( ) [ ] [ ]( ) [ ]( ) [ ] [ ]( )0 0 1 0 0 1

all in venture #2 invest $1 in venture #1, invest $2 irest in #

0 0 ,

2

3 1 1 ,

0 0 1

3

1 3 , 3

0 0.55 0.55 ,0.28 0.41 0.69,0.45 0.25 0.70X X X X X X

X X X X

+ +

⎡ ⎤= + =⎣ ⎦

= + = + = + =f V f V

f max f V

max6447448 6

1442443 1444244

4447444

3

K

8K 4

[ ]( ) [ ] [ ]( ) [ ]( ) [ ] [ ]( )0 0 1 0 0 1

n venture #1, all in venture #1rest in

2 2 , 3 3 3 ,

3

#2

, 0.65 0 0.65 0.70X X X X X X+ +⎡ ⎤

⎢ ⎥+ = =⎢ ⎥⎢ ⎥⎣ ⎦

f V f V

144424443 1442

644474448 6

443

447448 (105)

Step #3: Complete this in a table form.

Table 2: Stage I Allocation Table (S0 vs. F1) Optimal Sub-Policy

k1 .f( X0[k1] ). .V(X0,X1[k1]). f( X0[+1] ) f( X1[+1] ) f( X1[k1] ) opt( S0 ) opt( F1 ) 0 0 0 0 0 0 0 0 1 0.28 0.25 0.28 0.25 0.28 1 0 2 0.45 0.41 0.45 0.53 0.53 1 1 3 0.65 0.55 0.7 0.69 0.7 2 1 4 0.78 0.65 0.9 0.86 0.9 3 1 5 0.9 0.75 1.03 1.06 1.06 3 2 6 1.02 0.8 1.19 1.2 1.2 3 3 7 1.13 0.85 1.33 1.3 1.33 4 3 8 1.23 0.88 1.45 1.43 1.45 5 3 9 1.32 0.9 1.57 1.55 1.57 6 3 10 1.38 0.9 1.68 1.67 1.68 7 3

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

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] }

how much is spent total?

define profit of “previous” funds as function of k.

we can pick next investment based

on incremental costs

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?

Page 41: Lecture Notes (Economic Operation)

[ ]( ) ( ) [ ]( ) [ ]( ) [ ]( ) [ ]( ) [ ]( )

[ ]( ) [ ]( ) [ ]

[ ]( ) ( ) [ ]( ) [ ]( ) [ ]( )

2 1 2

0.15 0.28

1

2 1 1 2 1 1 2 1 1

1 1

2

2 1 1 2 1 1 2

1 , 1 0 , 1 , , 1 0.28

2 , 2 1 , 2

X X X

X X X X X X X X X X

X X X X X X X

= +

⎡ ⎤⎢ ⎥⎡ ⎤= + = + + =⎣ ⎦ ⎢ ⎥⎣ ⎦

⎡ ⎤= + = +⎣ ⎦

opt opt

f max f V max f V f V

f max f V m

1

ax f V

64444744448 64444744448

144444444444444444444424444444444444444444443

[ ]( ) [ ]( )

[ ]( ) [ ]( ) [ ]

[ ]( ) ( ) [ ]( ) [ ]( ) [ ]( ) [ ]( ) [ ]( )

2 1 2

0.45 0.53

2 2 2

1 1 2

2 1 1 2 1 1

0.68

2 1 1

0 7

2

.

, 1 , 2 0.53

3 , 3 2 , 3 , 2 , 3

X X X

X X X

X X X X X X X X X X

= +

⎡ ⎤⎢ ⎥+ =⎢ ⎥⎣ ⎦

⎡ ⎤= + = + +⎣ ⎦

opt opt

f V

f max f V max f V + 1 V

1

f

+64444744448 6444447444448

14444444444444444444444244444444444444444444443

64444744448

[ ]( ) [ ]( ) [ ]

[ ]( ) ( ) [ ]( ) [ ]( ) [ ]( ) [ ]( ) [ ]( )

[ ]( )

2 1 2

2

0

3 3 3

0.8

2 1

5 0.

1 2 1 1 2 1

4

1 2

90

0.70

4 , 4 3 , 4 , 3 , 4 0.90

X X X

X

X X X X X X X X X X

= +

⎡ ⎤⎢ ⎥ =⎢ ⎥⎣ ⎦

⎡ ⎤⎢ ⎥⎡ ⎤= + = + + =⎣ ⎦ ⎢ ⎥⎣ ⎦

opt opt

opt

f max f V ma + 1x f V f V

6444447444448

14444444444444444444444244444444444444444444443

64444744448 6444447444448

[ ]( ) [ ]

[ ]( ) ( ) [ ]( ) [ ]( ) [ ]( ) [ ]( ) [ ]( )

[ ]( ) [ ]( ) [ ]

1 2

2 1 2

4 4

1.05 1.06

5 4 5

2 1 1 2 1 1 2 1 1 25 , 5 4 , 5 , 4 , 5 1.06

X X

X X X

X X X X X X X X X X

= +

= +

⎡ ⎤⎢ ⎥⎡ ⎤= + = + + =⎣ ⎦ ⎢ ⎥⎣ ⎦

opt

opt opt

+f max f V max f V f 1 V

14444444444444444444444244444444444444444444443

64444744448 6444447444448

14444444444444444 2

etc...

444444 44444444444444444444443

(106)

Table 3: Stage II Allocation Table (S1 vs. F2) Optimal Sub-Policy

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

k3 .f( X2[k3] ). .V(X2,X3[k3] ). f( X2[+1] ) f( X3[+1] ) f( X3[k3] ) opt( S2 ) opt( F3 ) 0 0 0 0 0 0 0, 0, 0 0 1 0.28 0.2 0.28 0.2 0.28 1, 0, 0 0 2 0.53 0.33 0.53 0.48 0.53 1, 1, 0 0 3 0.7 0.42 0.7 0.73 0.73 1, 1, 0 1 4 0.9 0.48 0.9 0.86 0.9 2, 1, 0 1 5 1.06 0.53 1.1 1.03 1.1 3, 1, 0 1 6 1.21 0.56 1.26 1.23 1.26 3, 2, 0 1 7 1.35 0.58 1.41 1.39 1.41 3, 2, 1 1

Page 42: Lecture Notes (Economic Operation)

8 1.48 0.6 1.55 1.54 1.55 3, 3, 1 1 9 1.6 0.6 1.68 1.68 1.68 3, 3, 1 2 10 1.72 0.6 1.81 1.77 1.81 4, 3, 1 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.

Page 43: Lecture Notes (Economic Operation)

Figure 19: Economic Dispatch as Application of Dynamic Programming

Note: from this point on we refer to the min function of dynamic programming as (fmin

dp) and cost functions as f1, f2… Step #3: Create a table for optimal economic dispatch for generators #1 and #2 – based of the behavior of (107). ( ) ( )min 1 1 2 2 2( )dp X D P P= − +f f f (107)

D (MW) \ P2 (MW) 0 50 75 100 125 150 f(X2) opt(S1) opt(P2) 0 oo oo oo oo oo oo oo 0 0

50 oo oo oo oo oo oo oo 50 0 75 oo oo oo oo oo oo oo 75 0 100 oo 1560 oo oo oo oo 1560 50 50 125 oo 2105 1965 oo oo oo 1965 50 75 150 oo 2210 2510 2170 oo oo 2170 50 100 175 oo 2522.5 2615 2715 2465 oo 2465 50 125 200 oo 2835 2927.5 2820 3010 2760 2760 50 150 225 oo 3177.5 3240 3132.5 3115 3305 3115 100 125 250 oo 3510 3582.5 3445 3427.5 3410 3410 100 150 275 oo oo 3915 3787.5 3740 3722.5 3722.5 125 150

unlike fund allocation problem above, we must examine all (not just two)

combinations of S1 and P2…

Generation by Unit #2 (P2)

t o t a l d e m a n d

Page 44: Lecture Notes (Economic Operation)

300 oo oo oo 4120 4082.5 4035 4035 150 150 325 oo oo oo oo 4415 4377.5 4377.5 175 150 350 oo oo oo oo oo 4710 4710 200 150

0 50 75 100 125 150 summary of S1 behavior

Step #3: Create a table for optimal economic dispatch for generators #1/#2 and #3.

D (MW) \ P3 (MW) 100 125 150 f(X3) opt(S2) opt(P3) 0 … oo oo oo 0 0

50 … oo oo oo 50 0 75 … oo oo oo 75 0 100 … oo oo oo 100 0 125 … oo oo oo 125 0 150 … oo oo 2366 100 50 175 … oo oo 2668 100 75 200 … oo oo 2971 100 100 225 … 3264.5 oo 3271 175 50 250 … 3669.5 3558 3558 100 150 275 … 3874.5 3963 3868 200 75 300 … 4169.5 4168 4168 150 150 325 … 4464.5 4463 4463 175 150 350 … 4819.5 4758 4758 200 150

summary of S2 behavior

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.

( ) ( )2@125 2@1002

1655 1360110 100 10 118125 100 125 100

high low

high low

y yx x

M MWx

WF FF MW MW

MW MW

⎛ ⎞−⎜ ⎟⎜ ⎟−⎝ ⎠

∆−⎛ ⎞ −⎛ ⎞′ = − = =⎜ ⎟ ⎜ ⎟− −⎝ ⎠⎝ ⎠

64444744448644474448

(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?

Page 45: Lecture Notes (Economic Operation)

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 P’0 = P’1, P’2 … = new dispatch

o λ0 = system cost at base point o Pload = load demand at base point

o P’load = new load demand Step #2: Define change in output of ith generating unit (∆Pi) in terms of change in system cost (∆λ).

12

2i

ii

d FP

dPλ

−⎛ ⎞

∆ = ∆⎜ ⎟⎝ ⎠

(109)

It may applied to the system as a whole.

12

1 2 21

Ni

loadi i

d FP P P

dPλ

=

⎛ ⎞∆ = ∆ + ∆ + = ∆ ⎜ ⎟

⎝ ⎠∑K (110)

Step #3: Define participation factor – a ratio of change in load demand to output of ith generator.

2

21

2

2

Ni

i ii

load i

i

d FdPP

P d FdP

=

⎛ ⎞⎜ ⎟∆ ⎝ ⎠=

∑ (111)

Step #4: Calculate new dispatch.

( )participation

factor

ii i load load

load

PP P P P

P⎛ ⎞∆′ ′= + −⎜ ⎟∆⎝ ⎠14243

(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.

21 1

1 21 1

22 2

2 22 2

23 3

3 23 2

7.92 2*0.00312 0.00624

7.85 2*0.00194 0.00388

7.97 2*0.00482 0.00964

d dP

dP dP

d dP

dP dP

d dP

dP dP

= + → =

= + → =

= + → =

F F

F F

F F

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

Page 46: Lecture Notes (Economic Operation)

( )0 393.2, 334.6, 122.2P = (113) Step #2: Define participation factors.

1

2

3

1/ 0.003124 320.10 0.471/ 0.003124 1/ 0.00388 1/ 0.00964 681.57

0.38

0.15

load

load

load

PPP

PP

P

∆= = =

∆ + +∆

=∆∆

=∆

(114)

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

1

2

3

393.2 0.47*50 416.7334.6 0.38*50 353.6122.2 0.15*50 129.7

PPP

′= + =′ = + =′ = + =

(115)

Topic #11: Economic Dispatch vs. Unit Commitment (3.9) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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.

Page 47: Lecture Notes (Economic Operation)

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

real power injection(P2

Inj)

ZSeries

-line model

ZSh

ZSh

ZSh

ZSh

GeneratorBus

InfiniteBus

real powerflow (P2)

complex power injection(-S3

Inj)

power flow is dependent on system state: x = |Vi|, i

power injection is(generally) constant

objective:find x which satisfies Si

Inj = Si

com

plex power

flow(S 3)

Figure 20: Overview of Power Flow Problem

Sub-Topic #1: Direct Current (DC) Networks (wood 4.1.1) Consider the following example…

Page 48: Lecture Notes (Economic Operation)

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

Inj = 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 (Pi

Inj)– 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.

2 1 221

12

10.25

V V EI

R− −

= = (116)

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

( )222 2 21 2 2 2

14 1.2

0.25E

P V I E E E−⎛ ⎞= = = − =⎜ ⎟

⎝ ⎠ (117)

Step #3: Solve for E2.

( ) ( )

22 2

2

2

4 4 1.2 0

4 4 4*4* 1.2 1.24164 16 19.20.24162*4 8

E E

E

− + =

± − − − ⎛ ⎞± += = = ⎜ ⎟−⎝ ⎠

(118)

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

Page 49: Lecture Notes (Economic Operation)

Step #1: Calculate network currents.

1 31 21 12 13 1 2 3

12 13 12 13 12 13

2 3 2 12 23 21 1 2 3

23 21 12 12 23 23

3 2 3 13 32 31 1

23 13 13 23

1 1 1 1

1 1 1 1

1 1

V VV VI I I V V V

R R R R R R

V V V VI I I V V V

R R R R R R

V V V VI I I V

R R R R

⎛ ⎞ ⎛ ⎞⎛ ⎞−−= + = + = + + − + −⎜ ⎟ ⎜ ⎟⎜ ⎟

⎝ ⎠⎝ ⎠ ⎝ ⎠⎛ ⎞ ⎛ ⎞⎛ ⎞− −

= + = + = − + + + −⎜ ⎟ ⎜ ⎟⎜ ⎟⎝ ⎠ ⎝ ⎠ ⎝ ⎠⎛ ⎞ ⎛ ⎞− −

= + = + = − + −⎜ ⎟ ⎜⎝ ⎠ ⎝

2 313 23

1 1V VR R

⎛ ⎞+ +⎟ ⎜ ⎟

⎠ ⎝ ⎠

(119)

Restate this in a matrix form.

referred to a

12 13 12 131 1

2 212 12 23 23

3 3

13 23 13

or addmittance matrix

14

23

4 104 9 510 5 15

1 1 1 1

1 1 1 1

1 1 1 1

BusY

R R R RI VI V

R R R RI V

R R R R− −⎛ ⎞

⎜ ⎟− −⎜ ⎟⎜ ⎟− −⎝ ⎠

⎛ ⎞+ − −⎜ ⎟

⎜ ⎟⎛ ⎞ ⎛⎜ ⎟⎜ ⎟ = − + −⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟⎝ ⎠ ⎜ ⎟

⎜ ⎟− − +⎜ ⎟⎝ ⎠

644444474444448

144444424444443

⎞⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

(120)

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

Page 50: Lecture Notes (Economic Operation)

2 32 2 12

2 12 23

step #1: declare expression below

this expressions is deriv

222 2 32 2 1

212 23

22 2 1 2

12 23 12 23

ed from

1 1 1 1

V VP V VI

V R R

V V VV V VP

R R

P V VVR R R R

βα γ

−−= = +

−−= +

⎛ ⎞ ⎛ ⎞⎛ ⎞= + + − + −⎜ ⎟ ⎜ ⎟⎜ ⎟

⎝ ⎠⎝ ⎠ ⎝ ⎠

64444744448

14444244443

14243142432 3

22

2 2 2 2 3 we cannot solve for via quadratic equationP V V V V

V

V

V

α β γ+ ←= +

14243

(121)

What about starting from an initial guess (to solve for V3)?

Step #1: Take an initial guess for the system voltages? 1 2 31, 1, 1old old oldV V V= = = (122)

Step #2: Now we solve the system algebraically, as before, to update the system voltages. Step #2a: Solve for V2

New.

2 1 2 3

2

step #1: declare expression below

4 9 5

step #2: re-arrange expression in terms o

2 32 2 12

12 232

22 1

f

32

1 4 59

new

new

newnew

old

newold

I V V V

V

V VP V VIR RV

PV V V

V

=− + −

−−= = +

⎛ ⎞= + +⎜ ⎟

⎝ ⎠

644444474444448

144424443

6444447444448

( ) ( )

step #3: fill in numerical v

2

alues

1 1.2 4 1 5 1 1.139 1

newV ⎛ ⎞= + + =⎜ ⎟⎝ ⎠

644444474444448

(123)

Step #2b: Solve for V3

New.

31 2 3

3

3

step #1: declare expression below

3 3 1

10 5 15

step #2: re-arrange expression in ter

3 23

13 233

33 1 2

m o

3

s f

1 10 515

newold

new

new new

old

ne

PV V

d

V

o

VV

wl

P V V V VI

R RV

PV V V

V

=− − +

− −= = +

⎛ ⎞= + +⎜ ⎟

⎝ ⎠

644444474444448

144424443

6444 7

{( ){

( ){

}

1 23

step #3: fill in numerical values

utilizeupdated

val

3

ue1 1.5 10 1 5 1.13 0.9433

15 1old

ne

VV

w

V

V

⎛ ⎞⎜ ⎟

−⎜ ⎟= + + =⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

44 444448

6444444447444444448

(124)

Page 51: Lecture Notes (Economic Operation)

Step #3: Continue with this process.

0

0.2

0.4

0.6

0.8

1

1.2

0 5 10 15 20

x-axis: iteration (k)

y-ax

is: v

olta

ge in

vol

ts

V2(k)V3(k)

Figure 21: System Voltage vs. Iteration for Example

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.

( ) ( )Re Im

note that complex values are denoted by an arrow hat

cos sini

i i

ji i i

V

i

V

i iV V e V j Vθ θ θ= = +64748 64748

144444442444

r r r r

44443 (125)

o Impedances (zik) / Admittances (yik) – are denoted in terms of resistance, reactance, conductance,

and susceptance.

( ) ( )conductance g susceptance

cos sini

i

k

k

ik

jik ik ik i

b

k ik iky y e y j yφ φ φ= =

= = +6

r r r4748 6

r4748

(126)

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

1 1 2 21

nBus Bus Bus

k i i ik kk

I Y V Y V Y V=

= + + =∑r r r r r r r

K (127)

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

real and reactivepow*

*

1

ern

Busi i i i ik k i i

k

S V I V Y V P jQ=

⎛ ⎞= = = +⎜ ⎟⎝ ⎠∑

r r r r r r 64748 (128)

Page 52: Lecture Notes (Economic Operation)

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

*** VERY IMPORTANT *** THE POWER FLOW EQUATIONS BELOW

}

( )( )( )( )

not

these are generally known as the power-flow equations

1

1

cos

sin

ikn

Bus Busi i k ik i k ik

k

nBus Bus

i i k ik i k ikk

y

P VV Y Y

Q VV Y Y

θ θ

θ θ

=

=

= − −

= − −

r

r r r r

14444444244444443

r r r r

(129)

What is the difference between yik and Yik

Bus ? o yik represents the impedance between buses i and k. o Yik

Bus represents the [i, k] element of the YBus matrix.

} }

} }

} }

11 1312

22 2321

3331 32

12 13 12 13

12 12 23 23

13 23 13 23

Bus BusBus

Bus BusBus

BusBus Bus

Y YY

Y

B

Y

s

Y

YY Y

u

y y y y

Y y y y y

y y y y

⎛ ⎞⎜ ⎟+ − −⎜ ⎟⎜ ⎟⎜ ⎟= − + −⎜ ⎟⎜ ⎟⎜ ⎟− − +⎜ ⎟⎝ ⎠

r rr

r rr

rr r

64748

64748

6474

r r r r

r r r r

r r8

r

r r

(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 (Si

sch) – the expected value of Si, based on available generation / load at bus i. o In this class, we refer to this as Injection (Si

Inj). o Flow Mismatch (∆Si) – the difference between calculated and expected flow…

Page 53: Lecture Notes (Economic Operation)

network bus i

Generator

Pigen

Load

Pidem

power injection

PInj

powerflow

P

Figure 22: Definition of Power Generation (Pi

gen), Demand (Pidem), Injection (PInj), and Flow (P)

( )( )

Inji

Inji

calc gen demi i i i

calc gen demi i i

P

Q

i

P P P P

Q Q Q Q

∆ = − −

∆ = − −

6447448

1442443

(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?

Page 54: Lecture Notes (Economic Operation)

o Slack Bus o Known – |Vi|, θi o Unknown – n/a o Used For – Infinite / Slack Bus

o Voltage Controlled Bus (aka. P|V| Bus) o Known – |Vi|, Pi

Inj o Unknown – θi o Used For – Generator Bus (with or without load)

o Load Bus (aka. PQ Bus) o Known – Pi

Inj, 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 (Pi

dem) 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 (Pi

gen, Pidem)

o Without Slack Bus – system is often overconstrained, and no solution exists.

these can be schedule, approximate

1

ly0

1

n ngen dem

slack i i lossi i

i slack i slack

P P P P= =

⎛ ⎞ ⎛ ⎞⎜ ⎟ ⎜ ⎟+ − =⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠∑ ∑

64444744448

(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

( )( )( )( )

1

1

cos0

sin

i

i

nInj Bus Bus

i i k ik i k ikk

nInj Bus Busi i k ik i k ik

k

P

Q

P VV Y Y

Q VV Y Y

θ θ

θ θ

=

=

⎧ ⎫⎪ ⎪

− − −⎪ ⎪⎪ ⎪= =⎨ ⎬⎪ ⎪− − −⎪ ⎪⎪ ⎪⎩ ⎭

∑g

r r r r

r r r r

644444474444448

144444424444443

(133)

o System Paramateres / Input (u): a set of static parameters which define component and,

consequently, system behavior. o Topology ( BusY

r): defines the manner in which buses are connected to one another.

Page 55: Lecture Notes (Economic Operation)

} } }11 1312 14

112 13 14 12 13 14

212 12 23 24 23 24

313 23 13 23 34 34

414 24 34 14 24 34

Bus

Bus BusBus Bus

Y

Y YY YI y y y y y yI y y y y y yI y y y y y yI y y y y y y

⎛ ⎞⎛ ⎞ ⎜ ⎟+ + − − −⎜ ⎟ ⎜ ⎟⎜ ⎟ − + + − −⎜ ⎟=⎜ ⎟ ⎜ ⎟− − + + −⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎝ ⎠ − − − + +⎝ ⎠

r rr r6 7

644rr r r r r r

rr r r r r r

rr r r r r r

rr

744

r r

8

r r r

1

2

3

4

VVVV

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

r444444444444 44

r

r

444444 4 8

r

44 4

(134)

o System State (x): a set of variables which describe the condition of the system.

( )}

}

{

21

1

2

simple example for2-bus DC syste

22

21

m

,2

, 0 0

x

u

g

uV

PuR

x = → − =g

1442443

(135)

o 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.

Page 56: Lecture Notes (Economic Operation)

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).

( )

( )

{

solve for currentsolve for current flow in flow in termsterms of power injection of line flows

ele

*

*ment,

of

1

*1

bus

Inj Inj Injn ni Busi i

i im im mm mi

i mY

i

S P jQI I Y V

V V= =

−= → = =∑ ∑

r

r r r64748 6

rr r

4748

(136)

Step #2: For Bus i… Step #2a: Categorize Vi as either new (right) or old (left).

( ){

( )updatedguess

previousgues

*1

s

Inj Inj nBus new Busi i

ii i im mold m

i m i

P jQY V Y V

V =≠

−= +∑r r r r

123r (137)

Step #2b: Solve this expression for Vi

new.

( )*

1

1 Inj Inj nnew Busi i

i im mBus old mii i m i

P jQV Y V

Y V =≠

⎡ ⎤−⎢ ⎥= −⎢ ⎥⎢ ⎥⎣ ⎦

∑r r r

r r (138)

Step #3: Replace terms “old” and “new” with iteration numbers (k).

*** VERY IMPORTANT *** GAUSS METHOD BELOW

Page 57: Lecture Notes (Economic Operation)

( )}

( )( )( )

iterationof

( 1)iteration

1

of

1*1

1

th

i

th

i

Inj Inj nk kBusi i

i im mBus k mi

k

V

i i m

k

V

i

P jQV Y V

Y V

− =≠

⎡ ⎤⎢ ⎥⎢ ⎥⎢ ⎥−⎢ ⎥= −⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥⎣ ⎦

∑142

r rr r

43

r (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 statevariables 1 -1 variables 1which have been which have not

updated

updated not

11

*1

updated1 1

1 Inj Inj i nk k kBus Busi i

i im m im mBus k m m iii i

i i n

P jQV Y V Y V

Y V

−−

− = +

→ +

=

−= − −∑ ∑

647r r r r r

r r

48 been

updated

⎡ ⎤⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥⎣ ⎦

6447448

(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.

( )( ) ( )}

( )}

updated notalready up

*1 1, *

date

,

d

1 1 1Im Im

n i nk k kInj calc Bus Inj calc Bus Bus

i i im m i i im m im mm m m i

Q V Y V Q V Y V Y V− −

= = = +

⎧ ⎫⎡ ⎤⎛ ⎞ ⎛ ⎞⎪ ⎪⎢ ⎥⎜ ⎟ ⎜ ⎟⎧ ⎫ ⎪ ⎪= − → = − +⎢ ⎥⎜ ⎟ ⎜ ⎟⎨ ⎬ ⎨ ⎬

⎩ ⎭ ⎢ ⎥⎜ ⎟ ⎜ ⎟⎪ ⎪⎜ ⎟ ⎜ ⎟⎢ ⎥⎪ ⎪⎝ ⎠ ⎝ ⎠⎣ ⎦⎩ ⎭

∑ ∑ ∑r r r r r r r r

(141)

Step #2: Calculate generator reactive power output (Qi

gen). ,gen Inj calc dem

i i iQ Q Q= + (142) Step #3: Check for violation of reactive power output limit (Qi

lim) – if one exists.

,Inj calc limi iQ Q> (143)

Step #4: Update Vi

new utilizing expression below.

( ) ( )( )( )

( ) ( ), 1

1*1 1 1

1Inj Inj calc i n

i ik k kBus Busi im m im mBus k m m iii i

P j QV Y V Y V

Y Vα β

−−

− = = +

⎡ ⎤−⎢ ⎥= − − =⎢ ⎥⎢ ⎥⎣ ⎦

∑ ∑r r r r r

r r (144)

Page 58: Lecture Notes (Economic Operation)

Step #5: If violation “does not exist”, replace the magnitude of Vi

(k) with that defined in the problem statement.

( )}

definedin

problemstate.

essentially, we keep angleand replace magnitude

ki iV V β=r

14

2

r

4 443 (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.

( ) ( )12 13

12 1

13 2

2

/ 2 / 2

4 3

34 4

3.82 19.08 0.05125 0.03875 0.095.17 25.85 0.05125 0.03875 0.095.17 25.85 0.03875 0.06375 0.10253.02 15.11 0.03875

shunt shunt

sh

sh

sh

sh

Y Y

Y j Y j j jY j Y j j jY j Y j j jY j Y j

= − = + == − = + == − = + == − = +

r r

r r

r r

r r

64748 64748

r r0.06375 0.1025j j=

(146)

Page 59: Lecture Notes (Economic Operation)

Step #1: Build the admittance matrix.

12 13 1 12 13

12 12 24 2 24

13 13 34 3 34

24 34 24 34 4

8.99 44.84 3.82 19.08 5.17 25.85 03.82 19.08 8.99 44.84 0 5.1

0

7 25.8

00

0

sh

shbus

sh

s

b s

h

u

y y y y yy y y y y

Yy y y y y

y y y

j j jj j j

Y

y y

+ + − −⎛ ⎞⎜ ⎟− + + −⎜ ⎟=⎜ ⎟− + + −⎜ ⎟

− −

− − + − +− + −

+ +⎝ ⎠

− +=

r r r r r

r r r r rr

r r r r r

r r r r

r

r

55.17 25.85 0 8.19 40.86 3.02 15.11

0 5.17 25.85 3.02 15.11 8.19 40.86j j j

j j j

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟− + − − +⎜ ⎟

− + − + −⎝ ⎠

(147)

Step #2: Define system parameters as well as initialize the system state

1 1 4 2 2

3 3 4 4 4

1, 0, 1.02, , 170, 105.35,

, 200, 123.94, 318, 80, 49.58

busd d

d d g d d

V V Y P Qu

P Q P P Q

θ⎛ ⎞= = = = =⎜ ⎟=⎜ ⎟= = = = =⎝ ⎠

r r rK

K (148)

( ) ( ) ( ) ( ) ( ) ( )}

( )

5 state va

0 0 0 0 0 02 2

riables

gen this is referredload bus load bus bus to as a flat start

23 3 4, , , , , 1,0,1,0,0x V V Vθ θ θ

⎛ ⎞⎜ ⎟

= =⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

644444474444448

64748 64748 6r r 4748r (149)

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

Page 60: Lecture Notes (Economic Operation)

( )

( ) ( )

( )( )( ) ( )

( ) ( )}

( ) ( )

( )

2 2 2 2

2 2

1 0 02 2

12

2 21 1 24 4*022 2

12

1

170 105.35 /1001 1.0 3.82 19.08 1.02 5.17 25.858.99 44.8

0.98

1

36 0

4

g d g d

d d base

sch schbus

P P j

bus

Q Q

P Q S

P jQV Y V Y V

Y V

jV j j

j

j

V

− − −

− +

⎡ ⎤⎢ ⎥−⎢ ⎥= − − =⎢ ⎥⎢ ⎥⎣ ⎦

⎡ ⎤⎢ ⎥− +⎢ ⎥= − − + − − +

− ⎢ ⎥⎢ ⎥⎦

=r

r r r r r64748

644474448

r r

r

0.0328.0323 0.9841 je−=

(150)

( )

( ) ( )

( )( )( ) ( )

( ) ( )}

( )

3 3 3 3

3 3

1 1 03 33 31 1 34

note that weuse upda

4*033 3

13

tedvalue

1

200 123.94 /1001 1.0 5.17 25.85 1.02 3.08.19 40.86 1

g d g d

d d base

P P j Q Q

sch schbus bus

bus

P Q S

P jQV Y V Y V

Y V

V jj

− − −

− +

⎡ ⎤⎢ ⎥

−⎢ ⎥= − −⎢ ⎥⎢ ⎥⎢ ⎥⎣ ⎦

− += − − + − −

647486474r r r r r

r r

8

6447 4r

4 8

( )

( )1 0.04033 0.9712 0.0417 0.9720

2 15.11

jV

j

j e−

⎡ ⎤⎢ ⎥⎢ ⎥+⎢ ⎥⎢

= − =

⎥⎣ ⎦r

(151)

Step #4: Setup Gauss-Seidel update equations for all generator buses. Step #4a: Update Q4.

( )( ) ( ) ( ) ( )

( )( ) ( ) ( )

already updated not updated

already

*0 1 1 04 4 42

upda

2 43 3 4 4

ted

4

4

Im

5.17 25.85 0.9836 0.0323 3.02 15.11 0.9712 0.0417Im 1.02

bus bus busQ V Y V Y V Y V

j j j jQ

⎧ ⎫⎛ ⎞⎪ ⎪⎜ ⎟= − + +⎨ ⎬⎜ ⎟⎜ ⎟⎪ ⎪⎝ ⎠⎩ ⎭

− + − + − + −= −

64474448 64748

6444444444444447

r r r r r r r

8

( )

{ }not update

4

d

8.19 4

Im 1.2582 1.4247 1

0.86 1 2

.3

.

1

0j

Q j

⎧ ⎫⎛ ⎞⎪ ⎪⎜ ⎟+⎪ ⎪⎜ ⎟⎨ ⎬

⎜ ⎟+ −⎪ ⎪⎜ ⎟⎪ ⎪⎝ ⎠⎩ ⎭

= − − =

K

K

44444444444444

1442443

(152)

Step #4b: Update V4

(1).

Page 61: Lecture Notes (Economic Operation)

( )

} }

( )( )( ) ( )

( ) ( )}

( )( )

( )

4 4

4 4 4

wecalculate

this

1 1 14 44 24 2 34 3*0

44 4

14

1

238 131.70 /1001 5.17 25.85 0.9836 0.03238.19 40.86 1.02

3.02 15.11 0

g d

calcg d base

P P

P P jQ S

sch calcbus bus

bus

P j QV Y V Y V

Y V

jV j j

jj

− −

⎡ ⎤⎢ ⎥⎢ ⎥−⎢ ⎥= − −⎢ ⎥⎢ ⎥⎢ ⎥⎣ ⎦

−= − − + − −

−− − +

6447

r r r r rr r

rK

K

448

( )( )1 0.0122

4 1.0227 0.0125 1.022

.9712 0.0

8

417

jV j e

j

=

⎡ ⎤⎢ ⎥⎢ ⎥⎢ ⎥⎢ −

+

⎥⎣ ⎦

=r

(153)

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

( ) ( )( )

( )4 0.01224 4, 4

4

1.02k k k jcorr k

VV V V e

V= = = (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-')

Page 62: Lecture Notes (Economic Operation)

0 2 4 6 8 10 12 14 16 18 200.965

0.97

0.975

0.98

0.985

0.99

0.995

1

1.005

0 2 4 6 8 10 12 14 16 18 20-2.5

-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

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.

( ) ( )( )

( )( )

1 1 2 1 1 2 11 2

2 1 2 2 1 2 2

, , , ,, , 0

, , , ,x x u x x u b

x x ux x u x x u b

⎛ ⎞ ⎛ − ⎞= = =⎜ ⎟ ⎜ ⎟−⎝ ⎠ ⎝ ⎠

g hg

g h (155)

How do we derive a solution? Step #1: Approximate (155) as a Taylor Series Expansion.

( ) ( ) ( )( )

( ) ( )( ) ( )( ) ( )( ) ( )

( ) ( ) ( )( )( ) ( )( ) ( )

( ) ( )( )

Taylor Series Expansio

0 0 0 01 1 2 1 1 20 0 0 0

1

n

1 2 1 1 2 1 21 2

0 0 0 02 1 2 2 1 20 0 0

2 1 2 2 1 2 11 2

, , , ,, , , , 0

, , , ,, , , ,

d x x u d x x ux x u x x u x x

dx dx

d x x u d x x ux x u x x u x

dx dx

⎛ ⎞ ⎛ ⎞⎜ ⎟ ⎜ ⎟= + ∆ + ∆ + =⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠⎛ ⎞⎜ ⎟= + ∆ +⎜ ⎟⎝ ⎠

g gg g

g gg g

6444444444444447444444444444448

K

( )02 0x

⎛ ⎞⎜ ⎟∆ + =⎜ ⎟⎝ ⎠

K

(156)

Step #2: Utilize only first-order approximation.

Page 63: Lecture Notes (Economic Operation)

( )( )

( ) ( )( )( ) ( )( )

( )

( )

( ) ( )( ) ( ) ( )( )

( ) ( )( ) ( ) ( )( )* 01

1*01

2

0 0 0 01 1 2 1 1 2

0 0* *1 1 21 1 2 1 2

* * 0 0 0 0 0 02 1 2 2 1 2 2 1 2 2 1 2

1

0 itera

0

2

, , , ,, ,, ,

, , , , , , , ,

th

d x x u d x x ux x ux x u dx dx

x x u x x u d x x u d x x u

dx dx

=

⎛ ⎞ ⎛ ⎞⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎝ ⎠⎝ ⎠

⎛ ⎞⎜ ⎟⎛ ⎞⎛ ⎞ ⎜ ⎟⎜ ⎟⎜ ⎟ = + ⎜ ⎟⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟⎝ ⎠ ⎝ ⎠ ⎜ ⎟⎜ ⎟⎝ ⎠g g

gg

g ggg

g g g g

6447448

1442443 1442443

( )

( ) ( )

( ) ( )

( )

( )

( )

0

0

0 01 1

1 10 0

2 2

1 2

tion of Jacobian Matrix -

misma

01 1

02 2

tch

J

x

d ddx dx

d ddx dx

x x

x x

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

⎛ ⎞−⎜ ⎟⎜ ⎟−⎝ ⎠

g g

g g

64444444744444448

64748

14444444244444443

(157)

Step #3: Solve (157) for x.

( ) ( )

( ) ( )

( )

( ) ( )( )( ) ( )( )

( )

( )

( )

0

0

10 01 1 0 0 0

1 1 21 21 1

00 0 0 02 22 2 2 1 2

1 2

, ,

, ,

J

d dx x udx dxx x

x xd d x x udx dx

−⎛ ⎞⎜ ⎟ ⎛ ⎞ ⎛ ⎞⎛ ⎞ ⎜ ⎟ ⎜ ⎟= − + ⎜ ⎟⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎜ ⎟ ⎝ ⎠⎜ ⎟ ⎝ ⎠⎜ ⎟⎝ ⎠ g

g gg

g g g1442443

1442443

(158)

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

( )

( )

( )

( ) ( )

( ) ( )

( )

( ) ( )( )( ) ( )( )

( )

( )

( )

( ){

1

1

1 11

1 1 21 21 1

12 22 2 2 1 2

1 2

, ,

, ,kk

k

k

xx

J

k k

k kk k

k kk k k k

d dx x udx dxx x

x xd d x x udx dx+

+

+

⎛ ⎞⎜ ⎟ ⎛ ⎞⎛ ⎞ ⎛ ⎞⎜ ⎟ ⎜ ⎟= − +⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟⎝ ⎠ ⎝ ⎠⎜ ⎟ ⎝ ⎠⎜ ⎟⎝ ⎠ g

g gg

g g g14243 144424443

1442443

(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.

( ) ( ) ( )

( ) ( ) ( ){

( )

1

2

1 1 2 1 1 2 1 2 1

22 1 2 2 1 2 2 2

1

2 1

, , , , 4 sin 0.6 0

, , , , 4 4 cos 0.3 0u

x x u x x u b ux x

x x u x x u b x u x x=

= − = + =

= − = − + =

g

g

g h

g h

644474448

6444447444448 (160)

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

( ) ( )( ) ( )

1 1

1 2 2 1 1

2 1 2 12 2

1 2

4 cos 4 sin4 sin 8 4 cos

d ddx dx ux x u x

ux x x u xd ddx dx

⎛ ⎞⎜ ⎟ ⎛ ⎞⎜ ⎟= = ⎜ ⎟⎜ ⎟ −⎝ ⎠⎜ ⎟⎝ ⎠

g g

Jg g

(161)

Page 64: Lecture Notes (Economic Operation)

Step #2: Use the following expression, derived from (158), to solve this example.

( ) ( )( ) ( )

( )

( )( ) ( )

( )

( )

( )

0 0

1 01 2 1 1 2 1 1

2 02 2 1 2 1 2 2 1 2

4 cos 4 sin 4 sin 0.64 sin 8 4 cos 4 4 cos 0.3

J

x ux x u x ux x xx ux x x u x x u x x x

⎛ ⎞⎛ ⎞ ⎛ + ⎞⎛ ⎞= − + ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟− − +⎝ ⎠ ⎝ ⎠ ⎝ ⎠ ⎝ ⎠

g144444424444443 1444442444443

(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 3 4 5 6 7 8 9 10 11-0.2

0

0.2

0.4

0.6

0.8

1

1.2

Figure 25: Newton-Raphson Solution

Step #3: Plug solution (x) in to (160).

( ) ( )( ) ( )( ) ( ) ( )( ) ( )

1 1 2

22 1 2

0.1669, 0.9031, 1 4 1 0.9031 sin 0.1669 0.6 0.000114

0.1669, 0.9031, 1 4 0.9031 4 1 0.9031 cos 0.1669 0.3 0.000153

x x u

x x u

= − = = = − + = −

= − = = = − − + =

g

g(163)

Page 65: Lecture Notes (Economic Operation)

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 , (right) voltage magnitudes

2 3 1 2

2

2 1n n n

n n

nx V V V Vθ θ θ θ− −

→ →

=6444444444474444

r r r rK

8

K

444444

(164)

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

*** BELOW, A VARIATION ON (133) ***

( ){ }

( )( )

( ){ }

( )( )

2

1

2

R

1

e

Im

cos

sin

calci

Busik

Busik

calci

nInj Bus Bus Bus

i i ii i k ik i k ikkk i

nInj Bus Bus Busi i ii i k ik i k ik

kk i

P

Y

Y

Q

P V G VV Y Y

Q V B VV Y Y

θ θ

θ θ

=≠

=≠

⎛ ⎞⎜ ⎟

− + − −⎜ ⎟⎜ ⎟⎝ ⎠=⎛ ⎞⎜ ⎟

− − + − −⎜ ⎟⎜ ⎟⎝ ⎠

g

r

r

644444444474444

r r r r r

r r r r

444448

678

123

144444444 2

r

0

⎧ ⎫⎪ ⎪⎪ ⎪⎪ ⎪⎪ ⎪⎪ ⎪⎪ ⎪ =⎨ ⎬⎪ ⎪⎪ ⎪⎪ ⎪⎪ ⎪⎪ ⎪⎪ ⎪⎩ ⎭

44 44444444443

(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

( ) ( ) ( ) ( )11 ,k k kx J x u x−+ ⎡ ⎤= − +⎣ ⎦ g (166)

Step #2: Define all arrays, except J.

Page 66: Lecture Notes (Economic Operation)

( )

( )

( )

( )

( )

( )

( )

( )

( )

( )

( ) ( )( )2

2

2 2 22 2 2 2 212

3

12

12

11

1

11

2

13

11

1

cos

calc

k

nInj Bus Bus Bus

k k k kkk

I

k

k

k

P

x

n

kn

kk

k

kn

kn

P V G V V Y Y

P

JV

V

V

V

θ θ

θ

θ

θθ

=≠

+

+

+−

+

−+

+

+−

+

⎛ ⎞⎜ ⎟− + − −⎜ ⎟⎜ ⎟⎝ ⎠

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟

⎡ ⎤= −⎜ ⎟ ⎣ ⎦⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

64444444444744444444448

64748

r r r r r

M

M

( ) ( )( )

( ) ( )( )

( ) ( )( )

2

3 33 3 3 3 313

2

1 1 1, 1 1 1, 1 1,1

1

2

1

cos

cos

cos

nnj Bus Bus Bus

k k k kkk

nInj Bus Bus Bus

n n n n n k n k n k n kkk n

Inj Bus Bus Busn n nn n k nk n k nk

kk

V G V V Y Y

P V G V V Y Y

P V G V V Y Y

θ θ

θ θ

θ θ

=≠

− − − − − − − −=≠ −

=

⎛ ⎞⎜ ⎟− + − −⎜ ⎟⎜ ⎟⎝ ⎠

⎛ ⎞⎜ ⎟− + − −⎜ ⎟⎜ ⎟⎝ ⎠

− + − −

r r r r r

M

r r r r r

r r r r r

( ) ( )( )

( ) ( )( )

( )

2

2 2 22 2 2 2 212

2

3 3 33 3 3 3 313

2

1 1 1, 1 1 1 1

sin

sin

sin

n

n

nInj Bus Bus Bus

k k k kkk

nInj Bus Bus Bus

k k k kkk

Inj Bus Busn n n n n k n k n

Q V B V V Y Y

Q V B V V Y Y

Q V B V V Y

θ θ

θ θ

θ θ

=≠

=≠

− − − − − − −

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠⎛ ⎞⎜ ⎟− − + − −⎜ ⎟⎜ ⎟⎝ ⎠⎛ ⎞⎜ ⎟− − + − −⎜ ⎟⎜ ⎟⎝ ⎠

− − + −

r r r r r

r r r r r

M

r r r r ( )( )

( ) ( )( )

1,1

1

2

1

sin

nBus

k n kkk n

nInj Bus Bus Busn n nn n k nk n k nk

kk n

Y

Q V B V V Y Yθ θ

−=≠ −

=≠

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎛ ⎞⎜ ⎟⎜ ⎟−⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠⎜ ⎟⎜ ⎟⎛ ⎞⎜ ⎟⎜ ⎟− − + − −⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠⎝ ⎠

g6444444444444 7

r

r r r r r

( )

( )

( )

( )

( )

( )

( )

( )

( )

2

3

1

2

3

1

k

k

k

kn

kn

k

k

kn

k

x

n

V

V

V

V

θ

θ

θθ

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟

+ ⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

4 444444444

M

M

44448

678

(167)

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

Page 67: Lecture Notes (Economic Operation)

2 2 2 2 2 2 2 2

2 3 1 2 3 1

3 3 3 3 3 3 3 3

2 3 1 2 3 1

1 1 1 1 1 1 1 1

2 3 1 2 3 1

2 3

n n n n

n n n n

n n n n n n n n

n n n n

n n

P P P P P P P PV V V V

P P P P P P P PV V V V

P P P P P P P PV V V V

P P

J

θ θ θ θ

θ θ θ θ

θ θ θ θ

θ θ

− −

− −

− − − − − − − −

− −

∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂

∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂∂ ∂∂ ∂

=

K K

K K

M M M M M M M M

K K

1 2 3 1

2 2 2 2 2 2 2 2

2 3 1 2 3 1

3 3 3 3 3 3 3 3

2 3 1 2 3 1

1 1 1 1 1

2 3 1

n n n n n n

n n n n

n n n n

n n n n

n n n n n

n n

P P P P P PV V V V

Q Q Q Q Q Q Q QV V V V

Q Q Q Q Q Q Q QV V V V

Q Q Q Q QV

θ θ

θ θ θ θ

θ θ θ θ

θ θ θ θ

− −

− −

− −

− − − − −

∂ ∂ ∂ ∂ ∂ ∂∂ ∂ ∂ ∂ ∂ ∂

∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂

∂ ∂ ∂ ∂ ∂∂ ∂ ∂ ∂ ∂

K K

K K

K K

M M M M M M M M

K 1 1 1

2 3 1

2 3 1 2 3 1

n n n

n n

n n n n n n n n

n n n n

Q Q QV V V

Q Q Q Q Q Q Q QV V V Vθ θ θ θ

− − −

− −

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟∂ ∂ ∂⎜ ⎟

∂ ∂ ∂⎜ ⎟⎜ ⎟∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂⎜ ⎟⎜ ⎟∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂⎝ ⎠

K

K K (168)

How many types elements do we need to define?

o Off-Diagonals

( )( )( )( )

( )( )

( )( )

sin

cos

cos

sin

1

1

Bus Busii k ik i k ik

k

Bus Busii k ik i k ik

k

Bus Busii ik i k ik

k

Bus Busii ik

ik

i k i

ik

ik

kk

k

k ik

PVV Y Y

QVV Y Y

PV Y Y

V

QV Y Y

V

V

V

θ θθ

θ θθ

θ θ

α

β

β

αθ θ

∂∆= − − −

∂∂∆

= − −∂

∂∆=

=

=

= −− − −∂

∂∆= − − − =

r r r r

r r r r

r r r

r r r

r

r

(169)

o Diagonals

( )( ) ( )

( )( ) ( )

( ) ( )( ) ( )1

2

1

1

2

si

1

n

cos

2 1os 2c

nBus Busi

i k ik i k ikkik i

nBus Bu

Busi i ii

Bsiik i k i k ik

kin

Bus Bus Busii ii ik k i k

ii

ii

Busii i iik

ki

us

k i

i

i

i ii

i

PVV Y Y

QY VV Y

PV V

Q V

G Y V YV

B

P V G

GV

γ

η

η

θ θθ

θ θθ

θ θ

=≠

=

=≠

∂= − −

∂= − − −

∂∂

= − − − −

= − −

= =

= =

=

+

r r r r

r

rr r r r

r rrr

r r ( )

( ) ( )( ) ( ) ( )1

2 sin 2 11nBus Bus Busi

i ii iB

k kus

ii i

Busi i ii

i

Busi ii k iii

ik

ki

i ii

QV B Y V

P

V BV

V GV

QY BV

VV

γθ θ=

∂= − − −

+

= −∂

= − −∑r r r r

r

rrr

r

r

(170)

Can we define the Jacobian in terms of α, β …?

J11 dP/dθ

J12 dP/d|V|

J21 dQ/dθ

J22 dQ/d|V|

Page 68: Lecture Notes (Economic Operation)

( )

( )

22 23 2, 1 2 22 2 22 23 2, 1 22 3 1

32 33 3, 1 3 32 33 3 33 3, 1 32 3 1

1,2 1,3 1, 1 1, 1,2 1,3 1,2 3 1

1 1 1 12

1 1 1 12

1 1 1

Busn n n n

n n

Busn n n n

n n

n n n n n n n n n nn

V GV V V V

V GV V V V

V V V

J

γ α α α η β β β

α γ α α β η β β

α α γ α β β η

− −−

− −−

− − − − − − − −−

+ − − −

− + − −

− −

=

rK Kr r r r

rK Kr r r r

M M M M M M M M

K Kr r r ( )

( )

( )

( )

1 1 1, 1 1,

2 3 1, 2 32 3 1

22 23 2, 1 2 22 2 22 23 2, 1 22 3 1

32 33 3, 1 3 32 33 3 332 3

12

1 1 1 1 2, 1

1 1 1 12

1 1 2

Busn n n n n

n

Busn n n n nn n n nn n nn

n n

Busn n n n

n n

Busn n

V GV

V Gn nV V V V

V BV V V V

V BV V

β

α α α γ β β β η

η β β β γ α α α

β η β β α γ

− − − − −

−−

− −−

+ −

− − − +−

− −

− −

rr

rK Kr r r r

rK Kr r r r

rL Kr r

( )

( )

3, 1 31

1,2 1,3 1, 1 1, 1,2 1,3 1, 1 1 1, 1 1,2 3 1

2 3 , 1 2 3 , 12 3 1

1 1

1 1 1 12

1 1 1 1 2

n nn n

Busn n n n n n n n n n n n n n n

n n

Busn n n n nn n n n n nn n nn

n n

V V

V BV V V V

V BV V V V

α α

β β η β α α γ α

β β β η α α α γ

−−

− − − − − − − − − − − − −−

− −−

⎛⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜

− −

− −⎝

r r

M M M M M M M M

rK Kr r r r

rK Kr r r r

⎞⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟

⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟

(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.

( )

( )

( )

( )

( )2

2

3

21

2 2 2 2

2

2 2 22 2 2 21

2 2 2

2 3 312

3 3 31

3 2 3 3

13

2

2 3 2 3

3

2

3 3 3

2 3 3

cosInj Bus Busk

k

k k

k

k

k

P V G V V YP P P

VP P P

V

VQ

PVPV

V Q Q Q QV V

QQV

QV

θ θ

θ θθθ θ θ

θ

θ

θ

θ

+

+

+

+

∂∂∂

∂∂ ∂ ∂ ∂∂

− + −∂ ∂ ∂⎛ ⎞

⎜ ⎟∂ ∂ ∂⎜ ⎟⎛ ⎞ ⎜ ⎟∂ ∂ ∂⎜ ⎟ ⎜ ⎟⎜ ⎟ ∂ ∂ ∂⎜ ⎟⎜ ⎟ = −⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎝ ⎠ ∂ ∂ ∂⎜ ⎟⎜ ⎟∂ ∂ ∂⎝

∂ ∂∂∂ ⎠

r r r r ( )( )

( ) ( )( )

( ) ( )( )

( )

2

2 2 22 2 2 2 21

212

2

3 3 33 3 3 3 313

2

3 3 3 3

2

3 3 3

cos

sin

sin

nBusk

kk

nInj Bus Bus Bus

k k k kkk

Inj Bus Busk

nInj Bus Bus Bus

k k k

k

k

k

k

k

Q V B V V Y

Y

P V G V V Y Y

Q V B V

Y

V Y

θ

θ

θ

θ

θ θ

=≠

=≠

=≠

⎛ ⎞⎜

⎛ ⎞⎜ ⎟−⎜ ⎟⎜ ⎟⎝ ⎠⎛ ⎞⎜ ⎟− + − −⎜

⎟− − + − −⎜ ⎟⎜ ⎟⎝

⎟⎜ ⎟⎝ ⎠

− − + − −

∑r

r r r r r

r r r

r r r r

r

r

r( )( )

( )

( )

( )

( )

delete all ele

2

3

3

3

ments in r

13

ed

2

k

k

k

n

k

Busk

kk

V

V

Y

θθ

=≠

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟ ⎛ ⎞⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟+⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎝ ⎠⎜ ⎟⎜ ⎟⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠⎝ ⎠

6444444444444444444444447444444444444444444444448

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

J11 dP/dθ

J21 dQ/dθ

J12 dP/d|V|

J22 dQ/d|V|

Page 69: Lecture Notes (Economic Operation)

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.

Page 70: Lecture Notes (Economic Operation)

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

o Bus #1: Infinite Bus unknowns = n/a

o Bus #2: Load / PQ Bus unknowns = |V2|, θ2

o Bus #3: Load / PQ Bus unknowns = |V3|, θ3

o 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 constraint

2 2

3 3

2 2

s

3 3

4 4

constraint

constraint

constraint constraint constraint

V Q

V Q

PPP

θθθ

⎛ ⎞→⎜ ⎟⎜ ⎟→⎜ ⎟⎜ ⎟→⎜ ⎟

→⎜ ⎟⎜ ⎟→⎝ ⎠

64444744448r

r

(173)

Note, we will need to utilize the previously calculated YBus matrix.

Page 71: Lecture Notes (Economic Operation)

12 13 1 12 13

12 12 24 2 24

13 13 34 3 34

24 34 24 34 4

8.99 44.84 3.82 19.08 5.17 25.85 03.82 19.08 8.99 44.84 0 5.1

0

7 25.8

00

0

sh

shBus

sh

s

B s

h

u

y y y y yy y y y y

Yy y y y y

y y y

j j jj j j

Y

y y

+ + − −⎛ ⎞⎜ ⎟− + + −⎜ ⎟=⎜ ⎟− + + −⎜ ⎟

− −

− − + − +− + −

+ +⎝ ⎠

− +=

r r r r r

r r r r rr

r r r r r

r r r r

r

r

55.17 25.85 0 8.19 40.86 3.02 15.11

0 5.17 25.85 3.02 15.11 8.19 40.86j j j

j j j

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟− + − − +⎜ ⎟

− + − + −⎝ ⎠

(174)

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

( ) ( )( ) ( )( )( ) ( )( )

2

2

2 2 22 2 1 21 2 1 21 2 4 24 2 4 24

2

3 3 33 3 1 31 3 1 31 3 4 34 3 4 34

sin sin

sin sin

Q

Inj Bus Bus Bus Bus Bus

Inj Bus Bus Bus Bus

Q V B V V Y Y V V Y Y

Q V B V V Y Y V V Y Y

θ θ θ θ

θ θ θ θ

⎡ ⎤− − + − − + − −⎢ ⎥⎣ ⎦

− − + − − + − −

=g

64444444444444444744444444444444r r r r r r r r r

r r r r r r r r r

448

( )( )

( ) ( )( ) ( )( )( ) ( )( )

2

2

2 2 22 2 1 21 2 1 21 2 4 24 2 4 24

2

3 3 33 3 1 31 3 1 31 3 4 34 3 4

cos cos

cos cos

Bus

Inj Bus Bus Bus Bus Bus

Inj Bus Bus Bus Bus

P

P V G V V Y Y V V Y Y

P V G V V Y Y V V Y

θ θ θ θ

θ θ θ θ

⎡ ⎤⎢ ⎥⎣ ⎦

⎡ ⎤− + − − + − −⎢ ⎥⎣ ⎦

− + − − + − −

64444444444444444744444444444444r r r r r r r r r

r r r r r r r r

448

( )( )( ) ( )( ) ( )( )

34

2

4 4 44 4 2 42 4 2 42 4 3 43 4 3 43cos cos

Bus

Inj Bus Bus Bus Bus Bus

Y

P V G V V Y Y V V Y Yθ θ θ θ

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟

⎡ ⎤⎜ ⎟⎢ ⎥⎣ ⎦⎜ ⎟⎜ ⎟⎡ ⎤− + − − + − −⎜ ⎟⎢ ⎥⎣ ⎦⎝ ⎠

r

r r r r r r r r r

(175)

Step #4: Fill in numerical values. Utilize a flat start of V = 1 + j0 at all buses

( ) ( )( ) ( )( )

( ) ( )( ) ( )( )}

load @ bus #2

load @ bus #3

load @bus #2

2

2

1.0535 1 44.84 1*1*19.45 sin 0 0 101.31 1*1.02*26.36 sin 0 0 101.31

1.2394 1 40.86 1*1*26.36 sin 0 0 101.31 1*1.02*15.40 sin 0 0 101.31

1.70

O O

O O

⎡ ⎤− − − − + − − + − −⎣ ⎦

⎡ ⎤− − − − + − − + − −⎣ ⎦

= − −g

64748

64748

( ) ( )( ) ( )( )}

( ) ( )( ) ( )( )

( ) ( )

load @b

2

2us #3

generation - load@ bus #4

2

1 8.99 1*1*19.45 cos 0 0 101.31 1*1.02*26.36 cos 0 0 101.31

2.00 1 8.19 1*1*26.36 cos 0 0 101.31 1*1.02*15.40 cos 0 0 101.31

3.18 0.80 1.02 8.19 1.02*1*2

O O

O O

⎡ ⎤+ − − + − −⎣ ⎦

⎡ ⎤− − + − − + − −⎣ ⎦

− − +6447448

( )( ) ( )( )6.36 cos 0 0 101.31 1.02*1*15.40 cos 0 0 101.31O O

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎡ ⎤⎜ − − + − − ⎟⎣ ⎦⎝ ⎠

(176)

Step #4a: Simplify this expression…

Page 72: Lecture Notes (Economic Operation)

0.450.831.591.93

2.21

−⎛ ⎞⎜ ⎟−⎜ ⎟⎜ ⎟= −⎜ ⎟

−⎜ ⎟⎜ ⎟⎝ ⎠

g (177)

Part C: Calculate the Jacobian Matrix (J) Step #5: Define elements of the Jacobian.

( ) ( )( ) ( )( )2 1

2 111 2 22 1 21 2 1 21 4 24 2 4 242 sin sin 44.74Bus Bus Bus Bus BusJ V B V

QV x

Y Y V Y Yθ θ θ θ= = − − − − − −∂∆ ∂

=∂

=∂

−g r r r r r r r

(178)

2 1

32

21 0

QV x

J∂∆ ∂

=∂ ∂

= =g (179)

( )( ) ( )( )13 2 12 1

21 2 1 21 2 4 24 2 4 242 3

cos c 8. 5os 98 2Bus Bus Bus BusJ V V Y YQ

xV V Y Yθ

θθ θ θ= = − − − − −

∂∆∂

−∂

=∂

=g r r r r r r r r

(180)

2 1

34

41 0

Qx

∂∆ ∂=

∂ ∂= =

g (181)

( )( )15 2 4 242 1

2 44

25

4 5.1696cosBus BusJ V V Y YQ

xθθ θ= = − − = −

∂∆ ∂=

∂ ∂g r r r r

(182)

3 2

21

12 0

QV x

J∂∆ ∂

=∂ ∂

= =g (183)

( ) ( )( ) ( )( )22 3 33 1 31 3 1 33 2

31 4 34 3 4 34

2

2 40.76sin sin 13Bus Bus Bus Bus BusQJ V B V Y Y V Y Y

V xθ θ θ θ= = − − − − −

∂∆− = −

∂=

∂ ∂g r r r r r r r

(184)

3 2

23

32 0

Qx

∂∆ ∂=

∂ ∂= =

g (185)

( )( ) ( )( )24 3 13 2

31 3 1 31 3 4 34 3 4 343 4

cos c 8. 3os 19 3Bus Bus Bus BusJ V V Y YQ

xV V Y Yθ

θθ θ θ= = − − − − −

∂∆∂

−∂

=∂

=g r r r r r r r r

(186)

( )( )25 3 4 343 2

3 44

35

4 3.0237cosBus BusJ V V Y YQ

xθθ θ= = − − = −

∂∆ ∂=

∂ ∂g r r r r

(187)

( ) ( )( ) ( )( )31 2 22 1 21 2 1 21 4 24 2 4 232

24

1

2 cos 8.985c 2osBus Bus Bus Bus BusPxV

J V G V Y Y V Y Yθ θ θ θ= = − − −∂∂∆

= − − −∂

−∂

−=g r r r r r

rr r

(188)

32

22

33 0

PxV

J∂∂∆

=∂∂

= =g

r (189)

( )( ) ( )( )33 2 1 21 2 1 2132

2 32 4 24 2 4 24sin sin 44.9260Bus Bus Bus BusJ V V Y Y V V Y

Px

Yθ θ θθ

θ= = − − +∂∂∆

− − = −=∂ ∂

g r r r r r r r r (190)

32

34

43 0

Px

∂∂∆=

∂ ∂= =

g (191)

( )( )35 2 4 2432

2 44

245

25.847s 8inBus BusJ V V Y YP

xθθ θ= = − − − =

∂∂∆=

∂ ∂g r r r r

(192)

Page 73: Lecture Notes (Economic Operation)

3 4

11

24 0

PxV

J∂∆ ∂

=∂∂

= =g

r (193)

( ) ( )( ) ( )( )42 3 33 1 31 3 1 31 4 34 3 4 33 4

34

2

2 cos 8.193c 3osBus Bus Bus Bus BusPxV

J V G V Y Y V Y Yθ θ θ θ= = − − −∂∆ ∂

= − − −∂

−∂

−=g r r r r r

rr r

(194)

3 4

23

34 0

Px

∂∆ ∂=

∂ ∂= =

g (195)

( )( ) ( )( )44 3 1 31 3 1 313 4

3 43 4 34 3 4 34sin sin 40.9663Bus Bus Bus BusJ V V Y Y V V Y

Px

Yθ θ θθ

θ= = − − +∂∆ ∂

=∂ ∂

− −− =g r r r r r r r r

(196)

( )( )45 3 4 343 4

3 44

345

15.118s 5inBus BusJ V V Y YP

xθθ θ= = − − − =

∂∆ ∂=

∂ ∂g r r r r

(197)

( )( )51 4 42 4 2 4254

12

5.169c 6osBus BusJ V Y YP

xVθ θ= = − − −

∂∂∆=

∂∂=

g r r rr (198)

( )( )52 4 43 4 3 4354

23

3.023c 7osBus BusJ V Y YP

xVθ θ= = − − −

∂∂∆=

∂∂=

g r r rr (199)

( )( )53 4 2 4254

4 22

423

25.847s 8inBus BusJ V V Y YP

xθθ θ= = − − − =

∂∂∆=

∂ ∂g r r r r

(200)

( )( )54 4 3 4354

4 33

434

15.118s 5inBus BusJ V V Y YP

xθθ θ= = − − − =

∂∂∆=

∂ ∂g r r r r

(201)

( )( ) ( )( )55 4 2 42 4 2 4254

4 54 3 43 4 3 43sin sin 40.9663Bus Bus Bus BusJ V V Y Y V V Y

Px

Yθ θ θθ

θ= = − − +∂∂∆

− − = −=∂ ∂

g r r r r r r r r (202)

44.7460 0 8.9852 0 5.16960 40.7613 0 8.1933 3.0237

8.9852 0 44.9260 0 25.84780 8.1933 0 40.9663 15.1185

5.1696 3.0237 25.8478 15.1185 40.9663

J

− −⎛ ⎞⎜ ⎟− −⎜ ⎟⎜ ⎟= − −⎜ ⎟

− −⎜ ⎟⎜ ⎟−⎝ ⎠

(203)

Part D: Perform Newton-Raphson Power Flow in Matlab Step #6: Utilize the update expression below (for first iteration)

( )

1

1

1

44.7460 0 8.9852 0 5.1696 0.450 40.7613 0 8.1933 3.0237 0.83

8.9852 0 44.9260 0 25.8478 1.590 8.1933 0 40.9663 15.1185 1.93

5.1696 3.0237 25.8478 15.1185 40.9663 2.21

J

x

−⎡ ⎤⎦

− − −⎛ ⎞ ⎛ ⎞⎜ ⎟ ⎜ ⎟− − −⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟= − − − −⎜ ⎟ ⎜ ⎟

− − −⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟−⎝ ⎠ ⎝ ⎠

g6 7 ( )

}0

1 0.99171 0.98550 0.00810 0.01560 0.0135

x

⎛ ⎞ ⎛ ⎞⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟+ = −⎜ ⎟ ⎜ ⎟

−⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠

4444444444444 44444444444448

(204)

Step #7: Display Matlab code below.

% Example 9.4S clear all clc

Page 74: Lecture Notes (Economic Operation)

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)));

Page 75: Lecture Notes (Economic Operation)

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.

0 5 10 15 20 250.965

0.97

0.975

0.98

0.985

0.99

0.995

1

1.005

0 5 10 15 20 25-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

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…

Page 76: Lecture Notes (Economic Operation)

Note: the following observation…

44.7460 0 8.9852 0 5.16960 40.7613 0 8.1933 3.0237

8.9852 0 44.9260 0 25.84780 8.1933 0 40.9663 15.1185

5.1696 3.0237 25.8478 15.1185 40.9663

J

− −⎛ ⎞⎜ ⎟− −⎜ ⎟⎜ ⎟= − −⎜ ⎟

− −⎜ ⎟⎜ ⎟−⎝ ⎠

(205) = (203)

o Average Absolute Value of ( )11

dQ

d VJ = r = 42.75

o Average Value of ( )12dP

d VJ = r = 6.33

o Average Value of ( )21dQdJ θ= = 6.33

o Average Value of ( )22dPdJ θ= = 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.

2 2 2 2

2 3 1

3 3 3 3

2 3 1

1 1 1 1

2 3 1

3 3

2 2 1

2 2 2 2

2 3 1

3 3 3 3

3 3 1

1 1

2 3

0

0

n n

n n

n n n n

n n

n n

n n

n n

n n

n n

P P P P

P P P P

P P P P

P P Q Q

J Q Q Q QV V V VQ Q Q QV V V V

Q Q QV V

θ θ θ θ

θ θ θ θ

θ θ θ θ

θ θ θ θ

− − − −

− −

∂ ∂ ∂ ∂∂ ∂ ∂ ∂∂ ∂ ∂ ∂∂ ∂ ∂ ∂

∂ ∂ ∂ ∂∂ ∂ ∂ ∂∂ ∂ ∂ ∂∂ ∂ ∂ ∂

= ∂ ∂ ∂ ∂∂ ∂ ∂ ∂∂ ∂ ∂ ∂∂ ∂ ∂ ∂

∂ ∂ ∂∂ ∂

K

K

M M M M

K

K

K

K

M M M

K 1 1

1

2 3 1

n n

n n

n n n n

n n

QV V

Q Q Q QV V V V

− −

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟∂⎜ ⎟∂ ∂⎜ ⎟⎜ ⎟∂ ∂ ∂ ∂⎜ ⎟⎜ ⎟∂ ∂ ∂ ∂⎝ ⎠

K

(206)

o We divide (166) in two.

*** VERY IMPORTANT ***

DECOUPLED (NEWTON-RAPHSON) POWER FLOW SOLUTION BELOW

J12 = dP/d|V|

J22 = dP/dθ

J21 = dQ/d|V|

J11 = dQ/d|V|

J11 dP/dθ

J12 dP/d|V|

J21 dQ/dθ

J22 dQ/d|V|

Page 77: Lecture Notes (Economic Operation)

( ) ( ) ( ) ( )

( ) ( ) ( ) ( )

1111

1122

,

,

k k kP

k k kQ

J x u

V J x u V

θ θ−+

−+

⎡ ⎤= − +⎣ ⎦

⎡ ⎤= − +⎣ ⎦

g

g (207)

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

( )

( )

( )

( )

( )

( )

( ) ( )( )

( ) ( )( )1

2

2 2 22 2 2 2 212

212 3 3 33 3 3 3 3

1132

1

11

11

1 1

cos

cos

k

nInj Bus Bus Bus

k k k kkk

nk Inj Bus Bus Busk k k k

kkk

k

kn

Injk n

n

P V G V V Y Y

P V G V V Y Y

J

P

θ

θ θ

θ θ θθ

θθ

+

=≠

+

=+≠

+−

+ −

⎛ ⎞⎜ ⎟− + − −⎜ ⎟⎜ ⎟⎝ ⎠⎛ ⎞⎜ ⎟⎛ ⎞ − + − −⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎝ ⎠

⎜ ⎟ ⎡ ⎤= −⎜ ⎟ ⎣ ⎦⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

r r r r r

r r r r r

M

6

4748

M

( ) ( )( )

( ) ( )( )

( )

2

1 1, 1 1 1, 1 ,1

1

2

1

,

1cos

cos

P

nBus Bus Bus

n n n n k n k n k n kkk n

nInj Bus Bus Bus

n n nn n k nk n k nkkk

x u

n

V G V V Y Y

P V G V V Y Y

θ θ

θ θ

− − − − − − −=≠ −

=≠

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎛ ⎞⎜ ⎟⎜ ⎟− + − −⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠⎜ ⎟⎜ ⎟⎛ ⎞⎜ ⎟⎜ ⎟− + − −⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠⎝ ⎠

g

r r r r r

r r r r r

64444444 7

( )

( )

( )

( )

( )}

1

2

2

1

k

k

k

kn

kn

θ

θθ

θθ

+

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟+ ⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

444444 44444444444448

M (208)

( )

( )

( )

( )

( )

( )

( ) ( )( )

( ) ( )( )

1

2

2 2 22 2 2 2 212

122

3 3 33 3 3 3 31 1

3 31

22

11

1

sin

sin

k

nInj Bus Bus Bus

k k k kkk

kn

Inj Bus Bus Busk k k k

k kk

k

kn

V

kn

Q V B V V Y Y

VQ V B V V Y Y

V

J

VQ

V

θ θ

θ θ

+

=≠

+

+ =≠

+−

+

⎛ ⎞⎜ ⎟− − + − −⎜ ⎟⎜ ⎟⎝ ⎠⎛ ⎞⎛ ⎞⎜ ⎟⎜ ⎟ − − + − −⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎝ ⎠

⎜ ⎟ ⎡ ⎤= − ⎣ ⎦⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

r r r r r

r r r

142

r r

M

3

M

4

( ) ( )( )

( ) ( )( )( )

2

1 1 1, 1 1 1 1 1,1

1

2

1

,

sin

sin

Q

nInj Bus Bus Busn n n n n k n k n k n k

kk n

nInj Bus Bus Busn n nn n k nk n k nk

kk n

x u

V B V V Y Y

Q V B V V Y Y

θ θ

θ θ

− − − − − − − −=≠ −

=≠

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎛ ⎞⎜ ⎟⎜ ⎟− − + − −⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠⎜ ⎟⎜ ⎟⎛ ⎞⎜ ⎟⎜ ⎟− − + − −⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠⎝ ⎠

g

r r r r r

r r r r r

1 2

( )

( )

( )

( )

( )

2

3

1

k

k

k

kn

k

V

n

V

V

V

V

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟+ ⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠123

4444444444444 44444444444443

M (209)

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.

Page 78: Lecture Notes (Economic Operation)

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…

( ) ( )( )cos 1

0 sin

i ki k

i k i k

θ θθ θ

θ θ θ θ⎧ − ≈ ⎫⎪ ⎪− ≈ → ⎨ ⎬− ≈ −⎪ ⎪⎩ ⎭

(210)

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

that… ( ) ( )sin cosik i k ik i kG Bθ θ θ θ− << − (211)

o 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…

2 Bus

i i iiQ V B<<r

(212) How do we use these assumptions to simplify the Jacobian? Refer back to (169) and (170).

( )( )( ) ( ) ( ) ( ) ( )

( ) ( ) ( ) ( )

step #1: the identity belowsin sin cos cos sin

step #2: stregroup these terms

sin

sin cos cos sin

a b a b a

Bus Busii k ik i k ik

k

Bus Bus Busi k ik i k ik k

iik

ki

b

P

PVV Y Y

VV Y Y Y

θ θθ

θ θθ

θ θ

+ = +

∂∂

∂= − − −

≈ − − − + − −

64444474444r r r r

r r

4

r r

8

6447 4 r

48

( ) ( ) ( )

ep #2:regroup these terms

step #3: re-equate this to step #3: re-equate this to -

cos sin sin cos

Bus Busik ikG

Bus Bus Bus Busi k ik ik i k i k

ki

ik ik

B

VV Y Y VV Y YPθ

θ θ θ

⎡ ⎤⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥⎣ ⎦

≈ − − − +∂

−∂

644

r r r r r r r

7448

644474448 64447444

8r ( )

( )( )

( )( )

step #4: we assume step #4: we assumesin 0 cos 1

sin cos

Busik i k i k

i k

Bus Busi k ik i k ik

Busii k ik

k

G

ii

kk

VV G B

PV B

P

V

θ θ θ θ

θ

θ θθ

θ

θ

θ− ≈ − ≈

⎡ ⎤∂ ⎢ ⎥

⎢ ⎥≈ − − − −⎢ ⎥⎢ ⎥

∂≈

⎣ ⎦

6447448 6

r r

r r 4748

(213)

Note: in a similar manner…

Page 79: Lecture Notes (Economic Operation)

2 2 22 2 3 23 2 1 2, 1 2 2

3 2 32 3 3 33 3 1 3, 1 3 3

1 2 1,2 1 3 1,3 1 1 1, 1 1 1,

2 2

Bus Bus Bus Busn n n n

Bus Bus Bus Busn n n n

dc

Bus Bus Bus Busn n n n n n n n n n n n

Bun n

V V B V V B V V B V V B

V V B V V B V V B V V B

J

V V B V V B V V B V V B

V V B

− −

− −

− − − − − − − − − −

=

r r r r r r r rK

r r r r r r r rK

M M M Mr r r r r r r r

Kr r

3 3 1 , 1

222 23 2, 1 2

3 32 33 3, 1 3

1

0 0 0

0 0 0

0 0 0

0 0 0

s Bus Bus Busn n n n n n n n nn

Bus Bus Bus Busn n

Bus Bus Bus Busn

V

n

n

n

V V B V V B V V B

VB B B B

V B B B B

V

V

− −

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟ =⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟=⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

K

r r r r r rK

rK

KrK K

K M M M M M M M Mr

K

1444442444443

rK

2

3

1,2 1,3 1, 1 1, 1

2 3 , 1

0 0 0

0 0 0

0 0 0

0 0 0

Bus Bus Bus Busn n n n n n n

Bus Bus Bus Busn n n n n

V

nn

B

V

V

B B B B VB B B B

V

− − − − − −

⎛ ⎞⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠⎜ ⎟

⎝ ⎠1444444

rK

rK

M M M Mr

K KrK

42444444431444442

K444443

(214)

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

}( ) ( ) ( ) ( )( )

( ) ( ) ( ) ( ) ( )( )

ideal

note thedistinction

btw and

1

1 1

0 ,

0 ,

k k kP dc

k k k kQ dc

V V

x u J

x u J V V V

θ θ+

− +

⎡ ⎤− ≈ −⎣ ⎦

⎡ ⎤ ⎡ ⎤− ≈ −⎣ ⎦ ⎣ ⎦

g

g123

(215)

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

( ) ( )}

( ) ( )( )

( ) ( ) ( ) ( ) ( )( )

( ) ( ) ( ) ( )}

( ) ( ) ( )( )

step #1:expand this

matrix

step #2:move this toother side

step #3:move

to other1 side

1

1

1 1 1

1

,

,

,

k k kP dc

k k k kP

k k k k k kP

x u J

x u V B V

V x u V V B V

B V

θ θ

θ θ

θ θ

+

+

− − +

=

⎡ ⎤− ≈ −⎣ ⎦

⎡ ⎤ ⎡ ⎤⎡ ⎤− ≈ −⎣ ⎦⎣ ⎦ ⎣ ⎦

⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤⎡ ⎤− ≈ −⎣ ⎦⎣ ⎦ ⎣ ⎦ ⎣ ⎦ ⎣ ⎦

⎡ ⎤− ⎣ ⎦

g

g

g

678

6447448

( ) ( ) ( ) ( ) ( )( )

( ) ( ) ( ) ( ) ( )

( )

step #4: flip the sides of this equation / rearrange

step #5:set these voltages

equal to 1

1 1 1

111

1

,

,

k k k

k

kP

k k k kP

x u B B V

V V x u

B

B

θ

θ θ

θ θ

+

− − +

−−+

⎡ ⎤ ⎡ ⎤⎡ ⎤ ⎡ ⎤≈

−⎣ ⎦ ⎣ ⎦⎣ ⎦ ⎣ ⎦

⎤≈

⎡ ⎤ ⎡ ⎤⎡ ⎤− ≈ +⎣ ⎦⎣

− ⎣

⎦ ⎦

g

g

6444444444447444444444448

678

( ) ( ) ( )11,k k

PV x u θ−− ⎡ ⎤ +⎣ ⎦ g

(216)

Page 80: Lecture Notes (Economic Operation)

( ) ( )}

( ) ( )( )

( ) ( ) ( ) ( ) ( ) ( )( )( ) ( ) ( ) ( )( )

step #1:expand this

matrix

step #2:move this to

1other side

step #3: flips the sides of this express

1

1 1

11 1

,

,

,

k k kQ dc

k k k k kQ

k k kQ

x u J V V

x u V B V V V V

B V x u V V

+

− +

=

− +

⎡ ⎤− ≈ −⎣ ⎦

⎡ ⎤ ⎡ ⎤ ⎡ ⎤⎡ ⎤− ≈ −⎣ ⎦⎣ ⎦ ⎣ ⎦ ⎣ ⎦

⎡ ⎤⎡ ⎤− ≈ −⎣ ⎦ ⎣ ⎦

g

g

g

644744864748

( ) ( ) ( ) ( )

ion / rearrang

111

e

,k k kQV B V x u V

−−+ ⎡ ⎤⎡ ⎤≈ − +⎣ ⎦ ⎣ ⎦ g

6444444447444444448

(217)

*** VERY IMPORTANT ***

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

( ) ( ) ( ) ( )

( ) ( ) ( ) ( )

111

111

,

,

k k kP

k k kQ

B V x u

V B V x u V

θ θ−−+

−−+

⎡ ⎤⎡ ⎤≈ − +⎣ ⎦ ⎣ ⎦

⎡ ⎤⎡ ⎤≈ − +⎣ ⎦ ⎣ ⎦

g

g (218)

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

( )

( )

( )

( )

( )1

12 22 23 2, 1 2

12 32 33 3, 1 3

11,2 1,3 1, 1 1,1

1 2 3 , 1

k

k Bus Bus Bus Busn n

k Bus Bus Bus Busn n

Bus Bus Bus Buskn n n n n nn

Bus Bus Bus Busk n n

B

n n nnn

B B B BB B B B

B B B BB B B B

θ

θθ

θθ

+

+

−+

+− − − − −−

+ −

⎛ ⎞ ⎛ ⎞⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟= −⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎝ ⎠⎝ ⎠

6474

K

8

K

M M M M M

K

K144 2

( )( )( )

( )( )( )

( )( )( )

( )( )( )

( ) ( )( )

( )

( )

( )

( )

( )

1

1

2 2

2

11 3 32

13 2

111 1

1

1

,

,

,

,

,

k kP

k

kInj

k

kInjk

k k

kkInjnn n

kknn

kInjn n

kn

V x u

P x u

V

P x u

V

P x u

V

P x u

V

θ

θθ

θθ

+

+

⎤⎢ ⎥⎣

+

+−− −

+

⎛ ⎞−⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟− ⎛ ⎞⎜ ⎟

⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟ + ⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟− ⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟ ⎝ ⎠⎜ ⎟

⎜ ⎟−⎜ ⎟

⎜ ⎟⎜ ⎟⎝ ⎠

g

P

P

P

P

644474448

64748

44444 44444443

MM (219)

Page 81: Lecture Notes (Economic Operation)

( )

( )

( )

( )

( )1

12

22 23 2, 1 21

3 32 33 3, 1 3

11,2 1,3 1, 1 1,1

2 3 , 11

k

k

Bus Bus Bus Busn n

kBus Bus Bus Bus

n n

Bus Bus Bus Buskn n n n n nn

Bus Bus Bus Busn

B

n n n

V

n nkn

VB B B B

V B B B B

B B B BVB B B B

V+

+

−+

+− − − − −−

−+

⎛ ⎞⎜ ⎟ ⎛ ⎞⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟= −⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟

⎝ ⎠⎜ ⎟⎜ ⎟⎝ ⎠

K

K

M M M M M

K

K

14243

( )( )( )

( )( )( )

( )( )( )

( )( )( )

( ) ( )( )

( )

( )

( )

( )

( )

1

2 2

2

1 23 3

3 3

11 1

1

,

,

,

,

, k

k kQ

kInj

k

kkInj

k k

kkInjnn n

k kn n

kInjn n

kn

V

V x u

Q x u

V

VQ x u

V V

VQ x u

V V

Q x u

V−

⎡ ⎤⎢ ⎥

−− −

⎣ ⎦

⎛ ⎞−⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟ ⎛ ⎞−⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟+⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟−⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟⎜ ⎟ ⎝ ⎠⎜ ⎟

−⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

g

Q

Q

Q

Q

M

1444444424444444314243

144424443

M (220)

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.

44.84 0 25.85

0 40.86 15.1125.85 15.11 40.86

B−⎛ ⎞⎜ ⎟= −⎜ ⎟⎜ ⎟−⎝ ⎠

(221)

Step #2: Define the initial condition of system state. ( ) ( )0 1, 0i ix V θ= = = (222)

Step #3: Define the ( ) ( )( ) ( ) ( )( )1 1, and ,k k k k

P QV x u V x u− −⎡ ⎤ ⎡ ⎤⎡ ⎤ ⎡ ⎤

⎣ ⎦ ⎣ ⎦⎢ ⎥ ⎢ ⎥⎣ ⎦ ⎣ ⎦g g matrices. Note that we can take

these values from (177).

Page 82: Lecture Notes (Economic Operation)

( ) ( )( )

( ) ( )( )

1

1

1.591.01.93,1.02.211.020.451.0,0.831.0

k kP

k kQ

V x u

V x u

−⎛ ⎞⎜ ⎟⎜ ⎟

−⎜ ⎟⎡ ⎤ =⎣ ⎦ ⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

−⎛ ⎞⎜ ⎟

⎡ ⎤ ⎜ ⎟=⎣ ⎦ −⎜ ⎟⎜ ⎟⎝ ⎠

g

g

(223)

Step #4: Calculate first iteration utilizing solution method outlined in (218).

( )

( )

( )

( ) ( ) ( )( ) ( )}

11,

1 12

13

14

44.84 0 25.85 1.59 0 0.01930 40.86 15.11 1.93 0 0.0370

25.85 15.11 40.86 2.16 0 0.0282

k k kkP

k

V x u

B

k

k

θθ

θθθ

−+

+ −

+

⎡ ⎤⎢ ⎥⎣

+

⎛ ⎞ − − −⎛ ⎞ ⎛ ⎞ ⎛ ⎞ ⎛ ⎞⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ ⎟ = − − − + = −⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟−⎜ ⎟ ⎝ ⎠ ⎝ ⎠ ⎝ ⎠ ⎝ ⎠⎝ ⎠

g64748 64748

1444442444443

(224)

( )

( )

( )( ) ( )( ) ( )

}

11

1 12

13

,

44.84 0 0.45 1 0.98190 40.86 0.83 1 0.9796

kk k k

Q

VV x u

k

V

B

kV

V

+−

⎡ ⎤⎢ ⎥⎣ ⎦

+ −

+

⎛ ⎞ − −⎛ ⎞ ⎛ ⎞ ⎛ ⎞ ⎛ ⎞⎜ ⎟ = − + =⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ ⎟ − −⎜ ⎟ ⎝ ⎠ ⎝ ⎠ ⎝ ⎠ ⎝ ⎠⎝ ⎠

g6474864748

144424443

(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

Page 83: Lecture Notes (Economic Operation)

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-')

0 5 10 15 20 250.965

0.97

0.975

0.98

0.985

0.99

0.995

1

1.005

0 5 10 15 20 25-2.5

-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

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

Page 84: Lecture Notes (Economic Operation)

0 2 4 6 8 10 12 14 16 18 200.965

0.97

0.975

0.98

0.985

0.99

0.995

1

1.005

0 2 4 6 8 10 12 14 16 18 20-2.5

-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

Figure 28: Example Results via Gauss-Seidel

0 5 10 15 20 250.965

0.97

0.975

0.98

0.985

0.99

0.995

1

1.005

0 5 10 15 20 25-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

Figure 29: Example Results via Newton-Raphson

0 5 10 15 20 250.965

0.97

0.975

0.98

0.985

0.99

0.995

1

1.005

0 5 10 15 20 25-2.5

-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

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

Page 85: Lecture Notes (Economic Operation)

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).

( )

1 1

1 only one constraint

N N

i load loss ii i

N

load loss ii

P P P P

P P P

λ= =

=

⎛ ⎞= + + −⎜ ⎟⎝

= − ←

+

∑ ∑

L cost

g (226)

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 (Pi

min < Pi < Pimax). Through consideration of the power flow equations we can

consider many others: o |Vi

max| < Vi < |Vimax|

o MVAikmin < MVAik < MVAik

max 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 |Vi

max| < Vi (with line ik out) < |Vimax|

o MVAikmin < MVAik (with line i,k+1 out) < MVAik

max 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)

Page 86: Lecture Notes (Economic Operation)

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 Newton’s 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).

( ) 0z =g (227)

min maxz z z≤ ≤ (228)

}

( )} }

functionsarray of array ofdescribingall min all maxconstrainedvalues valuesvalue

min ma

s

xh z h≤ ≤h (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).

( ) ( )

cost sum of all function is individual costdefined as function ( )

1

s

Ngen gen

i ii

P P=

=∑

fcost

cost f

6474864748

(230)

Step #1: Define state vector (x).

}

for each PQ bus

for each PV bus

i

i

i

Vxθ

θ

⎛ ⎞⎜ ⎟

= ⎜ ⎟⎜ ⎟⎝ ⎠

⎫⎬⎭ (231)

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

For right now, z is defined as the set of all adjustable controls, states, and fixed parameters. We will split them up later…

Page 87: Lecture Notes (Economic Operation)

1

1

on the reference bus

on each PQ bus

on each PV bus

InjiInji

Inji

i

p

u

V

Py

Q

PV

θ⎧⎪⎪⎨⎪⎪⎩⎧⎪⎨⎪⎩

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟= ⎜ ⎟⎜

⎫⎬⎭⎫⎪⎬⎪⎭

⎫⎪⎬

⎟⎜ ⎟⎜ ⎟⎜ ⎪⎭ ⎟⎝ ⎠

(232)

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

p

yu

⎛ ⎞= ⎜ ⎟⎝ ⎠

(233)

Note: at this point, we are only representing “equality” constraints. Step #4: Define a set of m equations that govern power flow.

( )( )( )( ) }

for PQ buses

for PV buses

,

Inji i

Inji i

Inji i

x Px Qx y

x P

⎫⎛ ⎞−⎜ ⎟

−= ⎜ ⎟⎜ ⎟

⎟⎝

−⎭

PQg

P

(234)

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

( ) ( ) ( ) {

cost for ref. busis dependent oncost for all flow / dispatched generato

10

12

rs

1,N

gen loadi i

i

x

x u P x P=

⎛ ⎞= + +⎜ ⎟⎜ ⎟

⎝ ⎠∑cost f f P

64447444864748

(235)

Step #6: Define the objective / Lagrange function for optimization. ( ) ( ) ( ), , , ,x u p x u x yλ ⎡ ⎤= + ⎣ ⎦L cost g (236)

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.

Note that some parameters are fixed (e.g. PInj, QInj for loads) from point of view of OPF…

But some parameters are adjustable (e.g. PInj for gen)…

Note that we consider PiInj to be

a control variable, but really it is Pi

gen we manipulate. Pi

Inj = Pigen – Pi

load

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

Page 88: Lecture Notes (Economic Operation)

( ) ( ) ( )

( )( )( )

2 2

2 21 2 3

3 3

, , ,

Inj

Inj

Inj

x Px Q

x u p x ux P

λ

λ λ λ

⎛ ⎞−⎜ ⎟−⎜ ⎟= + ⎜ ⎟−⎜ ⎟⎜ ⎟⎝ ⎠

g

PQ

L costP

K

6447448

64447444

M

8 (237)

Step #8: Like in previous chapters, set the gradient of Lagrange function equal to zero. 0∇ =L (238)

Step #9: Define this gradient in three components – } } }respect respect respectto to to

, ,x u

x u λ

λ

∇ ∇ ∇L L L .

( ), ,

T

x

T

u

dd ddx dx dx

dd ddu du du

d x u pdλ

λ

λ

λ

⎛ ⎞∇ = = + ⎜ ⎟

⎝ ⎠

⎛ ⎞∇ = = + ⎜ ⎟

⎝ ⎠

∇ = =

gL costL

gL costL

LL g

(239)

Step #9a: Begin with dcost / dx.

( ) ( )( )

( ) ( )( )

( )( ) ( )

( )( ) ( )

( )( ) ( )

1 1 1

1

1 12

1 12

1 1 1

0

note that x affects costonly at reference

1 1 1

bus

1

1

#1

d

Ngen

i ii

x d xd

Ngen

i i

P dx

i

d x d xdP

dd

d P xdx

d dP xdx dx

d x d xdP dx

ddx

dd

x

x

ddx

=

==

=

⎡ ⎤= +⎢ ⎥⎣ ⎦

=

=

+

=

f P P

cost

cost

c

f f P

f

f P P

cost

f P

f P Post

6447448 6447448

644474448

( )( ) ( )

expand to vector

1

1 1 1

1

f r

1

o m

0

d

d x d xdP d V

θ⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

f P Pr

M

644474448

(240)

Step #9b: Continue with dg/dx.

Non-zero value for reference bus only…

Page 89: Lecture Notes (Economic Operation)

( )

( )

( )1

1

1

1 1 1

11

Inji i

Inji i

Inji

i i i

k k k

i i i

k k k

i i i

k k ki

d d dd d V dd d

d x Pdxd x Qdxd x Pd

dd

d d V d

x

dxd d dd d V d

θ θ

θ θ

θ θ +

+

+

+ + +

++

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟

= ⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜

⎛ ⎞⎡ ⎤−⎜ ⎟⎣ ⎦⎜ ⎟⎜ ⎟⎡ ⎤−⎜ ⎟⎣ ⎦= ⎜ ⎟⎜ ⎟

⎡ ⎤−⎜ ⎟⎣ ⎦⎜ ⎟⎜ ⎟⎝ ⎠⎟

⎝ ⎠

P P P

Q Q Qg

P P

P

P

Q

P

K

K

K

M M M M

(241)

Step #9c: Continue with dcost / du.

( ) ( )( )

( ) ( )( )

( )

( )

( )

reference bus =

1 1

0

2

1 12

2

21

21

Ngen

i ii

Ngen

i ii

Ngen

i iInjiiN

geni iInj

iiN

geni iInj

ii

iInji

d P xdu

d dP xdx dx

d Pd

ddx

ddx

ddx

dd

Pd P

dPd P

dP

dP

x

d

=

=

=

=+

=+

⎡ ⎤= +⎢ ⎥⎣ ⎦

= +

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟

= ⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

=

f f P

f f P

f

f

f

cost

cost

cost

cost

f

644 4

M

748

( ) ( ) ( )

( ) ( ) ( )

( ) ( ) ( )

1 1 2 2

1 1 2 21 1 1

1 1 2 2 2 22 2 2

gen gen geni i i i iInj Inj

i i

gen gen geni i i i i iInj Inj Inj

i i i

gen gen geni iInj Inj Inj

i i i

Inji

d dP P PdP dP

d d dP P PdP dP dP

d d dP P PdP dP

d

dd

P

d

u

d

P

+ + + +

+ + + ++ + +

+ ++ + +

⎛ ⎞+ + +⎜ ⎟⎜ ⎟⎜ ⎟

+ + +⎜ ⎟⎜ ⎟⎜ ⎟

+ + +⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

=

f f

f f f

f f f

f

cost

K

K

K

M

( )

( )

( )

1 11

2 22

geni i

geni iInj

i

geni iInj

i

P

d PdP

d PdP

+ ++

+ ++

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

f

f

M

(242)

Step #9d: Continue with dg / du.

Page 90: Lecture Notes (Economic Operation)

( )

( )

( )

( ) ( ) ( )

( ) ( )

1 1

1 2

1 2

Inji i

Inji i

Inji i

Inj Inj Inji i i i i iInj Inj Inj

i i i

Inj Inji i i iInj Inj In

i i i

d x Pdud x Qdud x P

du

d d dx P x P x PdP d

dd

P dPd d dx

u

ddu

Q x QdP dP dP

+ +

+ +

+ +

⎛ ⎞⎡ ⎤−⎜ ⎟⎣ ⎦⎜ ⎟⎜ ⎟

⎡ ⎤−⎜ ⎟⎣ ⎦= ⎜ ⎟⎜ ⎟

⎡ ⎤−⎜ ⎟⎣ ⎦⎜ ⎟⎜ ⎟⎝ ⎠

⎡ ⎤ ⎡ ⎤ ⎡ ⎤− − −⎣ ⎦ ⎣ ⎦ ⎣ ⎦

⎡ ⎤ ⎡ ⎤− −⎣ ⎦ ⎣ ⎦=

P

Q

P

P P P

g Q Q

g

M

K

( )

( ) ( ) ( )

( )}

( )}

( )

1 1 1 1 1

0

11 2

1 1 2

0 001

Inji ij

Inj Inj Inji i i i i iInj Inj Inj

i i i

Inj Inji i ii i

Inj Inj Inj Inj Inji i i i i

x Q

d d dx P x P x PdP dP dP

d x d x d xdP dPdP dP dP dP dd

du

P

+ + + + + ++ +

+ + +

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟

⎡ ⎤−⎜ ⎟⎣ ⎦⎜ ⎟⎜ ⎟

⎡ ⎤ ⎡ ⎤ ⎡ ⎤− − −⎜ ⎟⎣ ⎦ ⎣ ⎦ ⎣ ⎦⎜ ⎟⎜ ⎟⎝ ⎠

− −

=

Q

P P P

P P

g

P

K

K

647

M

48 6474

M

8

M

}

2

0

1 0 00 0 00 1 0

InjiInj

i

d

d

du

PdP+

⎛ ⎞⎜ ⎟

−⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

−⎛ ⎞⎜ ⎟⎜ ⎟=⎜ ⎟−⎜ ⎟⎝ ⎠

gK

K

K

M M M

K

M M M

M M M

6748

M M M

4

(243)

Step #10: Provide a summary of these matrices below – } } }respect respect respectto to to

, ,x u

x u λ

λ

∇ ∇ ∇L L L .

*** DEFINITION OF PARTIAL LAGRANGE GRADIENTS ***

( )( ) ( )

( )( ) ( )

1 1 11

1 1

1 1 11

1 11 1 1

10

T

Ti i i

k k k

i i i

k k kx

i i i

dd

k

dx

k k

dx

d d dd x d xd d V d

dP dd d d

d x d x d d V ddP d V d d d

d d V d

θ θθ

θ θ

θ θ

⎛ ⎞⎜ ⎟⎜ ⎟

+

+

+

+

+ +

⎛ ⎞⎛ ⎞ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟∇ = + ×⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠

gcost

P P Pf P P

Q Q Qf P P

LP P P

644444744444864447444

K

r

M M

8

K

K

M M

1

2

m

m

m

λ

λλλ

+

+

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠M

678

(244)

If we do not consider any control variables except Pi

Inj, then this matrix is composed of zeroes and ones.

Non-zero value for reference bus only…

Page 91: Lecture Notes (Economic Operation)

( )

( )

( )

1 1 11

2

2 22

1 0 00 0 00 1 0

T

geni iInj

Tik

geni iInj k

i

ddu

ddu

uk

geni iInj

i

d PdPd P

dPd P

dP

λ

λλλ

+ + ++

+

⎛ ⎞⎜ ⎟⎜ ⎟⎝ ⎠

+ ++

⎛ ⎞⎜ ⎟⎜ ⎟ −⎛ ⎞ ⎛ ⎞⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟ ⎜ ⎟∇ = + ×⎜ ⎟ ⎜ ⎟ ⎜ ⎟−⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎝ ⎠ ⎝ ⎠⎜ ⎟⎜ ⎟⎝ ⎠

cost

g

f

fL

f

64447

K

K

K

M

4448

644474

M M M

448

M

678

(245)

( )( )( )1 1

Inji i

Inji i

Inji i

x Px Qx Pλ

+ +

⎛ ⎞−⎜ ⎟−⎜ ⎟∇ = ⎜ ⎟−⎜ ⎟⎜ ⎟⎝ ⎠

g

PQ

LP

6

M

447448

(246)

What solution method (based on Gradient Search) is employed for OPF?

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

Page 92: Lecture Notes (Economic Operation)

1T

d ddx dx

λ−

⎡ ⎤⎛ ⎞= − ⎢ ⎥⎜ ⎟

⎢ ⎥⎝ ⎠⎣ ⎦

g cost (247)

Example #1: The Gradient Method for OPF Applied to Four-Bus (dc) System 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.

( ) ( ) ( ) {

( )

generation at thereference bus isde

1 1 4 4 4

pendent on system state

0

gen lo

x

adu P x P⎛ ⎞

= + +⎜ ⎟⎜ ⎟⎝ ⎠

cost f f P

644474448

(248)

Step #2: Define the algebraic system constraints.

( )( )( )( )

1 1

2 2

3 3

,, ,

,

Inj

Inj

Inj

x u Px u x u P

x u P

⎛ ⎞−⎜ ⎟= −⎜ ⎟⎜ ⎟−⎝ ⎠

Pg P

P (249)

Step #3: Expand this definition.

( )

} ( ) ( )

( )1 12 14

1 1 112 14 12 1

1 2 1 4 1

11 1 1 1 1

1

12 12 24 23 23 2 21 1 1

23

,

2 14

21

232

34 3 3

1 1

0,

0

1Inj

Inj

Inj

Inj

x u P P

B x Px x x P

x u x x x

x x

xx

x Px x x P

θθθ

θ θ θ θ

θ

− − −

− − − − −

− − −

= +

⎛ ⎞ ⎛ ⎞+ − ⎛ ⎞⎜ ⎟ ⎜ ⎟⎜ ⎟= − + + − −⎜ ⎟ ⎜ ⎟⎜ ⎟

⎜ ⎟⎜ ⎟ ⎜ ⎟− + ⎝

− + −

⎠⎝

⎠ ⎝

=

P

g

64444744448

64444444744444448

( ) ( ) ( )

( ) ( )

1 2 4 2 3 224 23

3 2 3 4 323 34

1 1

1 1

Inj

Inj

Px x

Px x

θ θ θ θ θ

θ θ θ θ

⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟− + − + − −⎜ ⎟⎜ ⎟⎜ ⎟− + − −⎜ ⎟⎜ ⎟⎝ ⎠

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

Page 93: Lecture Notes (Economic Operation)

( ) ( ) ( )( )( )

( )( )( )( )

( )

( ) ( ) ( )( ) ( )

}

1 1

1 1 4 4 1 2 3 2

1 1

1 1 4 4 1 2 3

,

,

3

2

2

3

3

2

3

,, ,

,

,

Inj

Inj

g

gen Inj

In

x u

x u

x

j

en Inj

Inj

x u PP x x u P

Px u P x

x u Px

B PP

u

θλ λ λ θ

θ

λ λ λ⎛ ⎞−⎜ ⎟= + + −⎜ ⎟⎜ ⎟

⎡ ⎤⎢ ⎥⎛ ⎞⎛ ⎞⎢ ⎥⎜ ⎟⎜ ⎟′= + + −⎢ ⎥⎜ ⎟⎜ ⎟

⎜ ⎟⎢ ⎥⎜ ⎟⎝ ⎠ ⎝ ⎠⎢ ⎥⎣ ⎦

−⎝ ⎠

g

cost

L f f P

Pf f P PL

P

6447448

644474448

(251)

Step #3: Define the three gradient components. Step #3a: Define λ∇L as well as its inverse (when equal to zero).

1 1

2 2

3 3

0

Inj

Inj

Inj

PB P

θθθ

⎛ ⎞⎛ ⎞⎜ ⎟⎜ ⎟′∇ = − =⎜ ⎟⎜ ⎟

⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠

L (252)

1 1

1

2 2

3 3

Inj

Inj

Inj

PB P

P

θθθ

−⎛ ⎞⎛ ⎞⎜ ⎟⎜ ⎟ ′⎡ ⎤= ⎜ ⎟⎣ ⎦⎜ ⎟

⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠

(253)

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

( )( ) ( )

( )( ) ( )

( )( ) ( )

}

4 4 4

4 1

4 4 4 1

24 2

4 4 4

4 3

0

T

ddx

mx

m

dx

T

dm

d x d xdP d

d x d xB

dP d

d x d xdP d

λ

θ λλλθ

θ

+

+

⎞⎜ ⎟⎜ ⎟⎝ ⎠

⎛ ⎞⎜ ⎟⎜ ⎟ ⎛ ⎞⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟′⎡ ⎤∇ = + =⎣ ⎦⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎝ ⎠⎜ ⎟⎜ ⎟⎝ ⎠

cost

g

f P P

f P PL

f P P M

64444744448

678

(254)

solution to DC power flow…

Page 94: Lecture Notes (Economic Operation)

( ) ( )( )

( )

( )

( )

( ) ( )( )

4

1141

4 1 124

4 1

1

14 1 4

34

4 2

4

3

dx

T

d

T

d xd

d x d xB

dP dd x

xd x

B x

d

dPx

θ

θ

θ

λ

λ

−−

⎡ ⎤⎛ ⎞⎢ ⎥⎜ ⎟⎢ ⎥⎜ ⎟⎢ ⎥⎜ ⎟

⎡ ⎤ ⎢ ⎥⎜ ⎟′= − ⎢ ⎥⎣ ⎦ ⎢ ⎥⎜ ⎟⎢ ⎥⎜ ⎟⎢ ⎥⎜ ⎟

⎜ ⎟⎢ ⎥⎝ ⎠

⎡ ⎤⎛ ⎞−⎢ ⎥⎜ ⎟⎡ ⎤′= − −⎢ ⎥⎜ ⎟⎢ ⎥⎣ ⎦ ⎢ ⎥

⎜ ⎟−⎝ ⎠⎣

cost

P

f P P

f

P

P

64444744448

(255)

Step #3c: Define u∇L .

( ) ( )

}

11 1

21

3

1 0 0

Td

d

gen

u

u

I j

ddu

n

d P

dP

λ

λλλ

⎛ ⎞⎜ ⎟⎜ ⎟⎝ ⎠ ⎛ ⎞

⎜ ⎟∇ = + − ⎜ ⎟⎜ ⎟⎝ ⎠

costg

fL

6474864748

(256)

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

1 0Inju P= → (257) Step #5: Solve a power flow, to ensure that (246) is equal to zero. Refer to (253).

1

11 1 11 12 14 12

1 1 1 1 12 12 12 24 23 23

1 1 13 23 23

2

34

1

3

0 0 00 0

0 0 0

B

Inj

Inj

Inj

PP

x x xx x x x x

x Px x

θθθ

−⎡ ⎤

−− − −

− − − −

⎣ ⎦

− − −

⎛ ⎞ ⎛ ⎞+ −⎛ ⎞ ⎛ ⎞⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟= − + + − =⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟

⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟− +⎝

=

⎠ ⎝ ⎠⎝ ⎠ ⎝

== ⎠

64444444744444448

(258)

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

( )( ) ( ) ( )( )

1141

4 1 124

4 134

4 1

4

111

Tx

d xB x

d xdP dP

−−

⎛ ⎞⎜ ⎟= ⎜ ⎟⎜

⎡ ⎤⎛ ⎞−⎢ ⎥⎜ ⎟⎡ ⎤′= − −⎢ ⎥⎜ ⎟⎢ ⎥⎣ ⎦ ⎢ ⎥⎜ ⎟−⎝⎣ ⎦⎝ ⎠

⎟⎠

f Pf P (259)

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

Page 95: Lecture Notes (Economic Operation)

( ) ( )

}

( ) ( ) ( )( )

( ) ( )( )1 1 4 1

41

11 1

21

3

1 1 4 1

41

1 0 0

11 0 0 1

1

Td

gen

Inj

gen

Inj

gen

u In

u

du

j

du

u

dd P

dP

d P d

d P d xdPd

xPdP

P

d

λ

λλλ

⎛ ⎞⎜ ⎟⎜ ⎟⎝ ⎠ ⎛ ⎞

⎜ ⎟= + − ⎜∇

⎟⎜ ⎟⎝ ⎠⎛ ⎞⎜ ⎟

= +

= −

− ⎜ ⎟⎜ ⎟⎝ ⎠

costg

L

L

fL

f

f f P

f P

6474864748

(260)

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 + jQ3

Inj = (–2.0 – j1.0) per unit P2

Inj = 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 P2

Inj P3Inj Q3

Inj ]

o control variables are voltage magnitude at buses #1 and #2 u = [ |V1| |V2| ]

o state variables will be phase angles at buses #2 and #3 as well as voltage angle at load bus #3.

x = [θ2 θ3 |V3| ]

Page 96: Lecture Notes (Economic Operation)

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 + P3

Inj

Step #1: Define the cost function for the OPF.

cost(u) = Ploss(x, u)

Step #2: Define the algebraic system constraints (g).

( )( )( )( )

2 2

3 3

3 3

,, ,

,

Inj

Inj

Inj

P x u Px u P x u P

Q x u Q

⎛ ⎞−⎜ ⎟= −⎜ ⎟⎜ ⎟−⎝ ⎠

g (261)

Step #3: Construct the YBus matrix.

4 10 0 4 10

0 4 5 4 54 10 4 5 8 15

Bus

j jY j j

j j j

− − +⎛ ⎞⎜ ⎟= − − +⎜ ⎟⎜ ⎟− + − + −⎝ ⎠

(262)

Step #4: Expand the definition of g. Note that “ang” denotes the angle of a complex number.

g1(x, u) = |V2|2 (G22

Bus) + |V2V3Y23Bus| cos(θ2 – θ3 – ang(Y23

Bus)) – P2Inj

g2(x, u) = |V3V1Y13

Bus| cos(θ3 – θ1 – ang(Y13Bus)) + |V3V2Y23

Bus| cos(θ3 – θ2 – ang(Y23Bus)) + |V3|2 (G33

Bus) – P2Inj

g3(x, u) = |V3V1Y13

Bus| sin(θ3 – θ1 – ang(Y13Bus)) + |V3V2Y23

Bus| sin(θ3 – θ2 – ang(Y23Bus)) – |V3|2 (B33

Bus) – 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.

( )

( ) ( )

( ) ( )

,

,,

,,

T

x

T

u

x u

d x ud x udx dx

d x ud x udu du

λ

λ

λ

∇ =

⎡ ⎤∇ = + ⎢ ⎥

⎢ ⎥⎣ ⎦

⎡ ⎤∇ = + ⎢ ⎥

⎢ ⎥⎣ ⎦

L g

gL cost

gL cost

(263)

Step #6a: Define dcost(x, u) / dx.

dPloss(x, u) / dθ2 = 0 dPloss(x, u) / dθ3 = – |V1V3Y13

Bus| sin(θ1 – θ3 – ang(Y13Bus)) * (–1) = – 11

dPloss(x, u) / d|V3| = |V1Y13

Bus| cos(θ1 – θ3 – ang(Y13Bus)) = – 4.4

Page 97: Lecture Notes (Economic Operation)

Step #5b: Define dg(x, u) / dx. dg1(x, u) / dθ2 = – |V2V3Y23

Bus| sin(θ2 – θ3 – ang(Y23Bus))

dg1(x, u) / dθ3 = – |V2V3Y23

Bus| sin(θ2 – θ3 – ang(Y23Bus)) * (–1)

dg1(x, u) / d|V3| = |V2Y23

Bus| cos(θ2 – θ3 – ang(Y23Bus))

dg2(x, u) / dθ2 = – |V3V2Y23

Bus| sin(θ3 – θ2 – ang(Y23Bus)) * (–1)

dg2(x, u) / dθ3 = – |V3V2Y23

Bus| sin(θ3 – θ2 – ang(Y23Bus))

dg2(x, u) / d|V3| = |V1Y13

Bus| cos(θ3 – θ1 – ang(Y13Bus)) + |V2Y23

Bus| cos(θ3 – θ2 – ang(Y23Bus)) + 2|V3| (G33

Bus) dg3(x, u) / dθ2 = |V3V2Y23

Bus| cos(θ3 – θ2 – ang(Y23Bus)) * (–1)

dg3(x, u) / dθ3 = |V3V2Y23

Bus| cos(θ3 – θ2 – ang(Y23Bus))

dg3(x, u) / d|V3| = |V1Y13

Bus| sin(θ3 – θ1 – ang(Y13Bus)) + |V2Y23

Bus| sin(θ3 – θ2 – ang(Y23Bus)) + 2|V3| (B33

Bus)

Step #5c: Define dPloss(x, u) / du. dP1(x, u) / d|V1| = 2|V1| (G11

Bus) + |V3Y13Bus| cos(θ1 – θ3 – ang(Y13

Bus)) = + 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) + |V3Y23

Bus| 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: define YBus (GBus + jBBus) matrix YBus = [ y12+y13 -y12 -y13 ; -y12 y12+y23 -y23 ; -y13 -y23 y13+y23 ]; GBus = [ g12+g13 -g12 -g13 ; -g12 g12+g23 -g23 ; -g13 -g23 g13+g23 ]; BBus = [ b12+b13 -b12 -b13 ; -b12 b12+b23 -b23 ; -b13 -b23 b13+b23 ]; YBus = GBus+j*BBus; % step #3: define cost function of the OPF (to minimize power loss)

Page 98: Lecture Notes (Economic Operation)

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,:) = vpa(subs(x,V1, num_V1 ),5); x(1,:) = vpa(subs(x,V2, num_V2 ),5); x(1,:) = vpa(subs(x,V3, num_V3 ),5); x(1,:) = vpa(subs(x,th1, num_th1 ),5); x(1,:) = vpa(subs(x,th2, num_th2 ),5); x(1,:) = vpa(subs(x,th3, num_th3 ),5); num_g12 = 0.0001; num_b12 = 0.0001; num_g13 = 4; num_b13 = -10; num_g23 = 4; num_b23 = -5; 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));

Page 99: Lecture Notes (Economic Operation)

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,:) = vpa(subs(u,V1, num_V1 ),5); u(1,:) = vpa(subs(u,V2, num_V2 ),5); u(1,:) = vpa(subs(u,V3, num_V3 ),5); u(1,:) = vpa(subs(u,th1, num_th1 ),5); u(1,:) = vpa(subs(u,th2, num_th2 ),5); u(1,:) = 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 = vpa(subs(g,V1, num_V1 ),5); g = vpa(subs(g,V2, num_V2 ),5); g = vpa(subs(g,V3, num_V3 ),5); g = vpa(subs(g,th1, num_th1 ),5); g = vpa(subs(g,th2, num_th2 ),5); g = vpa(subs(g,th3, num_th3 ),5); g = vpa(subs(g,g12, num_g12 ),5); g = vpa(subs(g,b12, num_b12 ),5); g = vpa(subs(g,g13, num_g13 ),5); g = vpa(subs(g,b13, num_b13 ),5); g = vpa(subs(g,g23, num_g23 ),5); g = vpa(subs(g,b23, num_b23 ),5); g = vpa(subs(g,angYBus23, num_angYBus23 ),5); g = vpa(subs(g,angYBus13, num_angYBus13 ),5); g = vpa(subs(g,P2Inj, num_P2Inj ),5); g = vpa(subs(g,P3Inj, num_P3Inj ),5); g = vpa(subs(g,Q3Inj, num_Q3Inj ),5); dg_dx = vpa(subs(dg_dx,V1, num_V1 ),5); dg_dx = vpa(subs(dg_dx,V2, num_V2 ),5); dg_dx = vpa(subs(dg_dx,V3, num_V3 ),5); dg_dx = vpa(subs(dg_dx,th1, num_th1 ),5); dg_dx = vpa(subs(dg_dx,th2, num_th2 ),5); dg_dx = vpa(subs(dg_dx,th3, num_th3 ),5); dg_dx = vpa(subs(dg_dx,g12, num_g12 ),5); dg_dx = vpa(subs(dg_dx,b12, num_b12 ),5); dg_dx = vpa(subs(dg_dx,g13, num_g13 ),5); dg_dx = vpa(subs(dg_dx,b13, num_b13 ),5); dg_dx = vpa(subs(dg_dx,g23, num_g23 ),5); dg_dx = vpa(subs(dg_dx,b23, num_b23 ),5); dg_dx = vpa(subs(dg_dx,angYBus23, num_angYBus23 ),5); dg_dx = vpa(subs(dg_dx,angYBus13, num_angYBus13 ),5); 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 = vpa(subs(dcost_dx,V1, num_V1 ),5); dcost_dx = vpa(subs(dcost_dx,V2, num_V2 ),5); dcost_dx = vpa(subs(dcost_dx,V3, num_V3 ),5); dcost_dx = vpa(subs(dcost_dx,th1, num_th1 ),5);

Page 100: Lecture Notes (Economic Operation)

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