Electrcity Primer for Energy Economist

download Electrcity Primer for Energy Economist

of 83

Transcript of Electrcity Primer for Energy Economist

  • 7/29/2019 Electrcity Primer for Energy Economist

    1/83Electronic copy available at: http://ssrn.com/abstract=2216338

    An Electricity Primer for Energy Economists:

    Basic EE to LMP Calculation

    Richard M. Benjamin

    Round Table Group

    January 23, 2013

  • 7/29/2019 Electrcity Primer for Energy Economist

    2/83Electronic copy available at: http://ssrn.com/abstract=2216338

    Chapter 1

    Basic EE and PTDFs

    1.1 Introduction

    This manuscript provides a technical primer for the energy economist wishing to study theoptimal power flow problem and locational marginal pricing (LMPP), but, who like thispapers author, finds it difficult to simply plow through Schweppe et al. (1988). This workaims to provide the reader with sufficient technical background to calculate power transferdistribution factors (PTDFs, or network shift factors) for a more complicated model thanthe simple 3-node model common to energy economics studies.1 The point of departurefor this work is basic electrical engineering fundamentals. We start off Section 1.2 with asimple direct current (DC) circuit analysis, demonstrating Ohms law and Kirchhoffs laws.As these are captured by very basic equations, we quickly move on to alternating current(AC) analysis. Here, we spend quite a bit of effort manipulating fairly straightforward(i.e. sinusoidal) AC voltage equations to derive equations for average voltage, current,and power in an AC circuit. We delve next into phase angles, showing how electricalcomponents such as inductors and capacitors bring voltage and current out of phase. Wethen demonstrate both graphically and algebraically the effect of non-zero phase angles onresistance and power relations in an AC circuit. The goal of Section 1.2 is to familiarize thereader with concepts that economists and operations researchers generally take for granted,but are quite foreign to those of us who are self-taught.

    Getting this background under our belts, we move on to DC network analysis, taking thisintermediate step to demonstrate circuit concepts to the reader in the simple setting of a DC

    network. We then introduce the reader to the linearized version of the AC network modelin Section 1.3. In this section we demonstrate a methodology for linearizing the real-power

    1See e.g. Bushnell and Stoft (1997) for a detailed analysis of the three-node model.

    1

  • 7/29/2019 Electrcity Primer for Energy Economist

    3/83Electronic copy available at: http://ssrn.com/abstract=2216338

    AC network equations (the latter of which we derive in Appendix A). After linearizingthe AC network equations, we quickly demonstrate DC sensitivity analysis in section 1.4.We conclude Chapter 1 by demonstrating the calculation of the PTDFs for the linearized(DC) version of the AC network in section 1.5. Sections 1.2, 1.3, and 1.5 of this chapter

    aim to provide the reader with sufficient technical background to understand basic powerequations, as presented in energy economics papers, along with deriving PTDFs. Section1.4 offers a conceptual preview of locational marginal price calculation, as demonstratedin chapter 3.

    In Chapter 2, we present the AC power flow model and a powerful method for solving theAC power flow problem, the Newton-Rhapson Method. Chapter 2 serves two purposes.First, it familiarizes the energy economist with the type of problems setup that one seesin electricity papers written by operations research analysts. The economist spendingany time at all in the study of electricity will almost certainly run into such, and thischapter provides some nice background material. Second, the method we use to solve

    the DC optimal power flow algorithm corresponds to a single run of the Newton-Rhapsonalgorithm for solving nonlinear equations. Thus, this serves as valuable material for theeconomist wishing to place our solution method in its proper context.

    In Chapter 3 we demonstrate LMP calculations. Fortunately, chapters 1 and 2 do most ofthe heavy lifting of AC optimal power flow setup, allowing the reader to focus on thespecifics of LMP derivation, while simply reviewing OPF principles.

    1.2 Electrical Engineering Fundamentals

    We begin our power flow analysis with a DC series circuit.2 In a basic series circuit, asource of electromagnetic force (emf) is connected to one or more sources of resistance(e.g. light bulbs), which form a circuit, as shown below:

    Battery

    RaRb

    +

    Figure 1.1: A Basic DC Circuit

    2Other DC circuits include paralled circuits, where current flow splits at junctures into parallel paths.

    2

  • 7/29/2019 Electrcity Primer for Energy Economist

    4/83

    In a DC circuit current flows in one direction only: from negative to positive (as opposedto AC, where current alternates direction several times per second). Thus, current flowsin a counterclockwise direction in the example above. The mathematics of this circuitare governed by three laws: Ohms Law, Kirchhoffs Current Law (KCL), and Kirchhoffs

    Voltage Law (KVL). These three laws are as follows: Ohms law: current, resistance andvoltage in a circuit are related as follows:

    V = I R. (1.1)

    where:

    V is voltage, or emf, measured in volts, I is current, measured in amperes, and R is resistance, measured in ohms.Applied to our analysis, Ohms law reveals that the voltage drop across resistors a and

    b is equal to the resistors resistance value times the current flowing through the resistor.

    Kirchhoffs voltage law (KVL): The directed sum of the electrical potentialdifferences (voltage) around any closed circuit is zero.

    Kirchhoffs current law (KCL): At any node in an electrical circuit, the sum ofcurrents flowing into that node is equal to the sum of currents flowing out ofthat node.

    Kirchhoffs laws are both conservation laws. KVL states that the sum of the voltagedropped across the two resistors is equal to the voltage produced by the current source(battery). KCL is likewise the law of conservation of current. For a circuit with only

    one path, KCL implies that current is constant throughout the circuit. Given these threelaws and sufficient values for the circuit, we may solve for the remaining unknown values.Assume that we have a 9-volt battery, the value of the first resistor, Ra, is 3 ohms(), andan ammeter yields a measurement of 2 amps. We are tasked with finding the remainingvalues. The easiest, most organized, answer is to fill in these numbers on a table, as shownbelow:

    Table1.1: V, I, and R Calculations

    Ra Rb Total

    V 6 3 9

    I 2 2 2R 3 1.5 4.5

    (numbers in bold are given)

    3

  • 7/29/2019 Electrcity Primer for Energy Economist

    5/83

    By KCL, current at all points in the circuit is equal to 2 amps.3 Since we are givenRa = 3, Ohms law allows us to solve for the voltage drop across this resistor as 6 volts.That is, running 2 amps through a 3 ohm resistor produces 6 volts of force. Next, KVLtells us that the 9 volts produced by the battery dissipate across the two resistors. Since

    the first resistor dissipates 6 volts of force, the second one must dissipate 3 volts, or Vb = 3.Further application of Ohms law reveals that the second resistor is a 3/2 = 1.5 resistor.Ohms law also applies to the circuit as a whole. So, if a 9-volt battery produces 2 ampsof current, total resistance in the circuit is 9/2 = 4.5. This reveals another law of seriescircuits. Resistance, as well as voltage, is additive.4

    While batteries are a DC voltage source, most electrical devices run on AC. An AC gener-ator, or alternator, produces alternating current as a magnetic field rotates around a set ofstationary wire coils. When the magnet starts its rotation, at the reference angle of zerodegrees, it is completely out of alignment with the coil. It moves closer into alignmentuntil it reaches an angle of 90, and moves further out of alignment again. Because the

    electromagnetic force, or voltage, created in this operation varies directly with the degree ofalignment between the magnet and the coil, we may (for the present) express instantaneousvoltage mathematically as:

    (t) = Vmax sin(t), (1.2)

    where:

    Vmax is maximum instantaneous voltage, or voltage amplitude, is angular frequency, in radians per second,5 and t is time, in seconds.

    Multiplying (radians per second) times t, (seconds), gives us the angle covered by themagnet in t seconds. Thus, we may write (1.2) as either (t) = Vmax sin(t), or

    (t) = Vmax sin(), (1.3)

    where is the familiar symbol for measuring angles (e.g.: An alternator with an amplitudeof 100 volts, produced by a magnet turning one radian per second, has an instantaneousvoltage of (1) = 100 s in(1) = 84.15 volts at t = 1 second). Note that voltage is

    3When we look at multiple lines across which current flows (known as parallel circuits), this relationwill no longer hold because current will split along parallel paths. KCL then implies that the sum of thecurrents along parallel paths is equal to current running through a single path (so that current is preserved).

    4This rule does not hold for parallel circuits (although it does hold for parallel components in series).

    See, e.g. Dale (1995).5For those of us who have long since forgotten, there are 2 radians in a circle, so a radian equals

    approximately 57.3. Thus we may also write (t) = Vmax sin(2f t) , where f is frequency, in rotations persecond.

    4

  • 7/29/2019 Electrcity Primer for Energy Economist

    6/83

    important in the study of optimal power flow because it is a determining factor of thepower a generator produces, that is,

    P = I

    V. (1.4)

    where:

    P is power, measured in Watts.6

    From Ohms law, we can substitute for either V or I, giving us two alternative expressionsfor power:

    P = I2R and P =V2

    R.

    As resistance is a many-headed beast, for now we will focus on the derivation of power givenby (1.4). The most basic resistance source (the resistor) has a fixed resistance. Ohms law

    tells us that in a purely resistive circuit, voltage and current will vary only by a constantof proportionality (the fixed resistance). Therefore, since the formula for voltage is givenby (1.2), the formula for current is given by:

    i(t) = Imax sin(t), (1.5)

    where:

    Imax is maximum current, or current amplitude.

    Using (1.4), we combine (1.2) and (1.5) to yield the formula for instantaneous AC power:

    p(t) = Vmax sin(t)

    Imax sin(t). (1.6)

    Using trigonometric identities, we may write sin2(x) as 12 (1 cos2x). Thus we rewrite(1.6) as:

    p(t) =1

    2VmaxImax 1

    2VmaxImax(cos2t). (1.7)

    Of course, when examining a generators power output, we are not concerned with itsinstantaneous value, which varies continuously, but rather its average value. Lookingat (1.7), we see that instantaneous power has both a fixed ( 12 VmaxImax) and a variable( 12 VmaxImax cos(2t)) component. Since, like that of sin x, the average value of cos x iszero over one full cycle, the average value of power reduces to the first component:

    Pavg = 12

    VmaxImax. (1.8)

    6We get the much more familiar expression, P = I E, by denoting voltage as E rather than V

    5

  • 7/29/2019 Electrcity Primer for Energy Economist

    7/83

    Alternately, we may calculate the average value of power directly from the formulas foraverage values of voltage and current, which we do below. By inspection, we will not getvery far using either (1.2) or (1.5) directly, because we run into the same phenomenon ofzero average value for a sinusoidal signal. This is unimportant, however, as the sign of the

    voltage or current in question is altogether arbitrary.7 Intuitively, one will feel the sameshock whether a voltmeter registers 50V or +50V (dont try this at home). We get aroundthe sign problem for voltage and current by squaring the instantaneous values of each andintegrating to arrive at their respective averages. Starting with (1.3), (t) = Vmax sin(),we are reminded that the magnet travels 2 radians per complete rotation. Therefore, theaverage value for voltage-squared over one complete cycle is:

    V2max2

    20

    sin2 d =V2max

    2

    20

    1 cos(2)2

    d.

    Since the integral of cos(2x) is 12 sin(2x), the average value of voltage-squared over a com-

    plete cycle is V2

    max/2.8

    Taking the square root of this value, we find that the average valuefor voltage is:

    Vavg = |V| = Vmax2

    .9 (1.9)

    Going through the same steps, we find that the average value for current is:

    Iavg = |I| = Imax2

    . (1.10)

    Multiplying (1.9) and (1.10), we again find that Pavg is given by (1.8).

    If electrical systems contained only voltage sources, wires, and resistance sources (e.g.,resistors and load), the world would be a happy place for the energy economist, with currentand voltage always and everywhere in phase. Unfortunately (for us) though, electricaldevices contain capacitors and inductors, casting us out of the Eden of synchronous voltageand current.10

    Let us begin by demonstrating how inductors bring voltage and current out of phase, thuscreating a non-zero phase angle. Inductors (typically an inductor is a conducting wireshaped as a coil) oppose changes in current, as expressed by the formula:

    V = LdI

    dt= L Imax cos(t), (1.11)

    7In a DC circuit, for example, a voltmeter may register a positive or negative value, depending on the

    reference point.8See, e.g. Mittle and Mittal (2006), Section 6.4.1 6.4.2.10Inductors and capacitors, of course, do serve useful purposes, such as storing electrical energy and

    filtering out specific signal frequencies, but that is beside the point.

    6

  • 7/29/2019 Electrcity Primer for Energy Economist

    8/83

    where:

    L is inductance, measured in Henrys.

    (1.11) states that the voltage drop across an inductor is equal to the inductors inductancetimes the rate of change of current over time. To see how this creates a phase shift betweencurrent and voltage, we must refer to the latter twos sinusoidal nature.11

    time

    V, I

    Instantaneous voltage

    Instantaneous current

    Figure 1.2: Instantaneous AC Current and Voltage Perfectly in Phase

    SincedI

    dtat a maximum or a minimum, from (1.11) instantaneous voltage, (t), is equal to

    zero when I = (Imax, Imax). Thus, voltage and current are 90 out of phase for an purelyinductive current, as shown below:

    time

    V, I

    Instantaneous voltage

    Instantaneous current

    Figure 1.3: Instantaneous AC Current and Voltage in a Purely Inductive Circuit

    Note that in this case we have set R = 1, simply for aesthetics. Note further that we maydemonstrate the phase shift for an inductor by recognizing that instantaneous voltage is

    11Note that V > I in Figure(1.2). Therefore, from (1.1), it must be the case that R > 1.

    7

  • 7/29/2019 Electrcity Primer for Energy Economist

    9/83

    at its maximum or minimum synchronously withdI

    dt.

    dI

    dtreaches its extrema at its points

    of inflection, which occur at i(t) = 0.

    While we may still write i(t) = Imax sin , it is no longer the case that v(t) = Vmax sin .Taking advantage of the fact that cos = sin + 90 , we write:

    i(t) = Imax sin ,

    v(t) = Vmax sin( + 90).

    In this instance we say that voltage leads current by 90 , or equivalently, current lagsvoltage by 90 . More generally, we write:

    v(t) = Vmax sin( + ),

    where (0 , 90 ] is commonly known as the phase angle between voltage and current.

    Like inductors, capacitors also introduce phase angles between current and voltage. Acapacitor contains two conductors separated by an insulator. Current flow through acapacitor is directly related to the derivative of voltage with respect to time, as follows:

    i(t) = CdV

    dt, (1.12)

    where:

    C is capacitance, measured in Farads.

    Capacitance will depend on the materials composing the insulator. From (1.12), we seethat instantaneous current will be zero when voltage is at its maximum or minimum values,

    and will reach its maximum and minimum values at the inflection points for voltage.Graphically, the relationship between voltage and current in a capacitor is as shown below:

    time

    V, I

    Instantaneous voltage

    Instantaneous current

    Figure 1.4: Instantaneous AC Current and Voltage in a Purely Capacitive Circuit

    8

  • 7/29/2019 Electrcity Primer for Energy Economist

    10/83

    In a capacitor, current lags voltage by 90 , and thus we may write:

    (t) = Vmax sin( 90 ).

    Note the difference between a resistor versus an inductor or capacitor. A resistor simplyopposes the flow of current, like sand opposes the flow of water. An inductor or capacitor,however, does not oppose a constant flow of current. Inductors oppose changes in currentflow, while capacitors oppose changes in voltage, both at angles of |90| . The name forthe opposition exerted created by inductors and capacitors is reactance, denoted by thesymbol X and measured in ohms. For an inductor, we denote reactance by a vector |90| out of phase with current, creating a |90| phase angle between voltage and current, asshown in Figure 1.5.

    RectanceV

    I

    90

    Figure 1.5: Geometric Representation of Reactance

    In general, electrical circuits will not simply contain inductors or capacitors or resistors,but some combination of the three. Therefore, real-world electricity systems will usuallybe characterized by phase angles of other than 0 or 90 . To determine the angles forsuch systems, we add the vectors for reactance and resistance, arriving at a quantity calledimpedance, denoted by Z and measured in ohms. We demonstrate a circuit with a 4 ohmresistor and a 3 ohm inductor, in Figure 1.6, below:

    9

  • 7/29/2019 Electrcity Primer for Energy Economist

    11/83

    R = 4

    X = 3

    Z = 5

    Figure 1.6: Geometric Representation of Impedance

    Impedance is the vector sum of resistance and reactance. A circuit with a 4 resistor anda 3 inductor will thus have total impedance equal to 5.

    While we have correctly calculated impedance as 5, it is more common to denote impedancenot only by its magnitude, but also its direction as well. We can do this by referring toeither polar or rectangular notation. Polar notation uses the vector compass to express the

    variable of interests quantity in terms of magnitude and direction (that is, phase angle).To compute the phase angle for impedance, we simply calculate the angle correspondingto this quantity. We express impedance in this case as:

    Z =

    42 + 32 at phase angle , or Z = 5 at [cos1(0.8)] = 5 at 36.87.

    Thus, we would express this examples impedance in polar notation as:

    Z = 536.87 (1.13)

    (alternatively, the combined effect of the resistor and inductor is to produce an impedanceof 5 at 36.87).

    Notice that no information is lost in switching to polar notation. We may go the otherway to calculate the resistive and reactive components of impedance as follows:

    Resistance = 5 cos(36.87) = 4,

    Reactance = 5 sin(36.87) = 3.

    This yields a second way to express impedance: in terms of resistance plus reactance. We dothis using rectangular notation. To switch from polar to rectangular notation graphically,we switch from using the vector compass to representing the horizontal axis as real units,and the vertical axis as imaginary units. In doing so, we place resistance (to real power)on the horizontal axis and reactance on the vertical, as shown below:

    10

  • 7/29/2019 Electrcity Primer for Energy Economist

    12/83

    R = 4

    X = 3j

    Z = 5

    Imaginary

    Axis

    Real Axis

    Figure 1.7: Impedance in Rectangular Form

    Thus, we write Z = 4 + 3j in rectangular form.12

    Having introduced impedance, we may compute power in a mixed resistive/reactive circuit.Let us then draw a circuit with a 4-ohm resistor (R) and a 3-ohm inductor (L) (alternatively,reactor):

    InductorResistor

    R = 40 L = 390

    Figure 1.8: AC Circuit with Resistance and Reactance

    The symbol, , represents an AC voltage source. As is standard, we will assign a phaseangle of 0 to the voltage source, with the phase angle and magnitude of impedance givenby (1.13). Given total voltage and impedance, we apply Ohms law as applied to AC

    12In electrical engineering,1 is commonly denoted as j, instead of i. The change in axes accounts

    for the (initially) confusing switch in the formulas for voltage and current from v(t) = Vmax

    sin to v(t) =Vmax cos . The real quantity is now the adjacent, not the opposite.

    11

  • 7/29/2019 Electrcity Primer for Energy Economist

    13/83

    circuits (V = IZ) to calculate current.13

    I =V

    I=

    20V0

    536.87= 4A 36.87

    From here, calculating the remaining voltages is straightforward (answers in Table 1.2,below).

    Table 1.2: V, I, and Z Calculations

    R L Total

    V 16 36.87 12+ 53.13 200I 4 36.87 4 36.87 4 36.87Z 40 390 5 36.87

    Finally, let us move on to AC power calculation. Real power is the rate at which energyis expended. According to Grainer and Stevenson (1994), reactive, or imaginary power,expresses the flow of energy alternately toward the load and away from the load. 14

    Intuitively, we can divide a power generators (or simply, generators) output into powercapable of doing work (real power), and power not capable of doing work (reactive power).Reactive power is the result of current moving out of phase with voltage. The greaterthe phase angle between voltage and current, the less efficient is power output in terms ofcapability to do work, and the greater is reactive power. Apparent, or complex, power isthe (geometric) sum of real and reactive power. Thus, we derive the power triangle in thesame manner as we derived the relationship between resistance, reactance, and impedance:

    13Again, since there is only one pathway for current, the amount amperage is constant across the entirecircuit. The angle, 36.87, is the amount by which current lags voltage.

    14p. 8. The exact nature of reactive power is not well understood.

    12

  • 7/29/2019 Electrcity Primer for Energy Economist

    14/83

    Real Power P = P +j0

    Reactive Power Q = 0 +jQ

    Complex Power S = P +jQImaginary

    Axis

    Real Axis

    Figure 1.9: Complex Power (the Power Triangle)

    Calculating complex power in rectangular notation is straightforward: Simply take realpower plus reactive power equals complex power, or S = P +jQ.

    Calculating complex power in polar form is a bit more complicated. Taking the phasorsfor voltage and current as V = |V| and I = |I| the formula for complex power is:

    V I = |V I| ,

    where denotes the complex conjugate (as we will demonstrate shortly). Note that theangle, , is once again the phase angle between voltage and current, as may be verifiedby designating voltage as the reference phasor.

    To see why we take the complex conjugate of current (i.e., we switch the sign on the angle

    for current), let us turn to Appendix A eqs.(1A.5) and (1A.6) for reactive and complexpower:

    Q = |I|2 X,S = |I|2 Z.

    Dividing (1A.5) by (1A.6):

    Q

    S=

    Q

    Z.

    That is, the cosine of the phase angle for impedance is equal to that of the power triangle,and thus the phase angles themselves are equal. Since the phase angle for impedance is, the phase angle for the power triangle is this quantity as well. But we have to switchthe sign on the current phasor to maintain this result.

    13

  • 7/29/2019 Electrcity Primer for Energy Economist

    15/83

    Eulers identity: ej = cos + j sin offers further insight into both rectangular andpolar representation of electrical quantities such as impedance and power. Resistance isequal to |Z| cos , and reactance is equal to |Z| sin . If we denote the horizontal axis asthe real number line, and the vertical axis as the imaginary number line, we may express

    impedance as:

    Z = |Z| cos +j|Z| sin = |Z|ej ,and complex power as:

    S = |I|2|Z|ej .

    1.3 DC Network Calculations

    1.3.1 Nodal Voltages and Current Flows

    Having demonstrated the basics of voltage, current, resistance, and power, we may demon-strate the calculation of these values in circuit analysis. We start with a DC circuit, thenmove on to its AC counterpart. First let us specify the network itself. We will examine anelementary circuit, called a ladder network, as shown below:15

    I4

    RfRdRb

    I1 RgReRcRa

    0

    Figure 1.10: A Five-node Ladder Network

    A network is composed of transmission lines, or branches. The junctions formed when twoor more transmission lines (more generally, circuit elements) are connected with each other

    15Taken from Baldick (2006, p. 163 et. seq.)

    14

  • 7/29/2019 Electrcity Primer for Energy Economist

    16/83

    are called nodes (e.g., in the figure above, line 12 connects node 1 with node 2). In theabove example, then, there are seven transmission lines [12, 23, 34, 01, 02, 03, and 04]connecting five nodes [0, 1, 2, 3, 4].

    Denote:

    N = Number of nodes in a transmission system,k = Number of lines in a transmission system,Rij = Resistance of transmission line connecting nodes i and j; orR = Resistance of transmission line ,Y = Admittance of transmission line ,Ij = Current source, located at node j,Iij = Current flowing over line ij,Vj = Voltage at node j,

    Vij = Voltage differential between nodes i and j(also known as the voltage drop across line ij).

    Note that all of the above networks N = 5 nodes are interconnected, directly or indirectly,by transmission lines and are subject to Kirchhoffs laws. Since the (directional) voltagedrops across the system must sum to zero, satisfaction of KVL takes away one degree offreedom in the system. Thus we need write voltage equations for only N 1 nodes to fullyidentify an N-node network. KVL also allows us to choose one node as the datum (orground) node, and set voltage at this node equal to zero. The researcher is free to chooseany node as datum. To minimize computational cost, one generally chooses as datum thenode with the most transmission lines connected to it. It is customary to denote the datum

    node as node 0.

    There are two current sources in this circuit, I1 and I4. The current sources are generatorslocated at nodes 1 and 4. These generators are connected to the transmission grid bylines 01 and 04, or, alternatively, lines a and g. These lines are generally denoted limitedinterconnection facilities.16 In the electrical engineering literature, such lines are knownas shunt elements.17 The ladder network above might represent, say, a transmission

    16Generally, limited interconnection facilities sole purpose is to interconnect power plants to the grid.Such facilities are not required to provide open access to customers wishing to transmit power over theformer. However, the distinction between a limited interconnection facility and a transmission line whichmust provide open access (that is, a facility which must submit an Open Access Transmission Tariff tothe FERC) can become blurry when the limited interconnection facility is, say, a 40+ mile long line.

    This was the case with the Sagebrush line (see, e.g. the case filings before the Federal Energy RegulatoryCommission in docket numbers ER09-666-000 and its progeny (e.g. ER09-666-001). Two relevant ordersin these cases are found in 127 FERC 61,243 (2009) and 130 FERC 61,093 (2010).

    17See, e.g., Glover et al. (2012), section 4.11, and Grainger and Stevenson (1994), chapter 6.

    15

  • 7/29/2019 Electrcity Primer for Energy Economist

    17/83

    line stretching across New York State, where node 1 represents Buffalo, node 2 representsRochester, node 3 represents Syracuse, and node 4 represents Albany. Node 0 then, actuallyrepresents four physically distinct locations, where generators at or around these four citiesare connected to the transmission grid by limited transmission interconnection facilities.

    Again, in standard electrical engineering parlance, node 0 is the ground node.

    Note that one may label the resistance associated with a particular transmission line bynaming the nodes the line connects, or simply assigning the line its own, alternative,subscript. Resistance in transmission lines is the opposition to current as current bumpsinto the material composing the transmission lines. Good conductors, or materials thatoffer relatively little resistance, are ideal candidates for transmission lines. Metals withfree electrons, like copper and aluminum, make good conductors as they provide littleresistance.

    Before we analyze the equations corresponding to Kirchhoffs Laws, let us introduce theconcept of admittance. Admittance measures the ease with which electrons flow through a

    circuits elements, and is the inverse of impedance.18 Since there are no reactive componentsin our example, though, impedance and resistance are equivalent. We thus loosen ourterminology and let admittance denote the inverse of resistance. Labeling admittance by

    Y, we thus have Y =1

    R. Ohms Law is then:

    I =1

    RV = Y V.

    Ohms Law allows us to write current flow along a particular line as a product of thevoltage drop between the two nodes that the line connects and the admittance of the line.It thus yields the flow of current across the k = 7 transmission lines in our example. To

    start, we write current flow along line 10, I10, as:

    I10 = V10Y10 = (V1 V0)Y10 = V1Y10 (1.14)

    (since V0 = 0). We write current flow across the other six lines analogously:

    I12 = (V1 V2)Y12, (1.15)I20 = V2Y20, (1.16)

    I23 = (V2 V3)Y23, (1.17)I30 = V3Y30, (1.18)

    I34 = (V3

    V4)Y34, (1.19)

    I40 = V4Y40. (1.20)

    18The inverse of resistance is actually conductance.

    16

  • 7/29/2019 Electrcity Primer for Energy Economist

    18/83

    KCL expresses the conservation of current at the (N 1) = 4 nodes. That is, KCL statesthat the sum of the currents entering a node equals the sum of currents exiting that node.We will use the convention that only current sources (generators) produce current enteringa node, while all transmission lines carry current away from that node. Let us begin with

    node 1. Current I1 enters node 1, while transmission lines 10 and 12 carry current awayfrom this node. Thus KCL implies that I1 = I10 +I12. Note that Iij denotes flow of currentfrom node i to node j. If the actual current flow is in the opposite direction i.e., from nodej to node i, we write Iij < 0. Otherwise, Iij 0. The important point is that we specifythe assumed direction of current flow by the ordering of the subscripts.

    Because we do not incorporate load in this example,19 we will have I1 0. I1 = 0iff the current source is not currently operational, as when a generator is shut down formaintenance. I10 and I12 may be either positive or negative, depending on the directionof current flow. Substituting (1.14) and (1.15) for I10 and I12, respectively, yields:

    I1 = V1Y10 + (V1

    V2)Y12.

    Grouping the voltage terms yields:

    I1 = (Y10 + Y12)V1 Y12V2. (1.21)There is no current source at node 2, simply three transmission lines which, by convention,carry current away from this node. Our three current equations for lines 21, 20, and 23are then, respectively:

    Y21(V2 V1) = I21,Y20(V2) = I20,

    Y23(V2

    V3) = I23.

    Let us remark at this point that Yij = Yji , i.e., admittance is not a directional value.20

    Applying KCL to node 2 yields I21 + I20 + I23 = 0,21 or:

    Y21V1 + (Y21 + Y20 + Y23)V2 Y23V3 = 0. (1.22)The alert reader will notice that node 3 is similar to node 2, in that there is no currentsource and three branches emanating there. Thus KCL generates:

    Y32V2 + (Y32 + Y30 + Y34)V3 Y43V4 = 0. (1.23)19If there were a load located at node 1, then current flow from node 1 would be negative (i.e., net current

    would flow to node 1, rather than away from it) whenever node 1 load is greater than node 1 generation.20This is a likely explanation for the single-subscript notation for resistance and admittance common in

    EE texts.21Note that this equation does not imply that no current flows through node 2. It states that current

    traveling toward node two, which takes on a negative sign, equals the amount of current flowing out of node2 (which has a positive sign), and thus the principle of conservation of current.

    17

  • 7/29/2019 Electrcity Primer for Energy Economist

    19/83

    Finally, our treatment of node 4 is symmetric to node 1, producing:

    Y43V3 + (Y43 + Y40)V4 = I1. (1.24)

    Note that (1.21) (1.24) form a system of four equations in four unknowns, which weexpress in matrix form below (after switching to single subscript notation for line admit-tances, for expositional ease):

    Ya + Yb Yb 0 0Yb Yb + Yc + Yd Yd 0

    0 Yd Yd + Ye + Yf Yf0 0 Yf Yf + Yg

    V1V2V3V4

    =

    I100I4

    . (1.25)

    The LHS matrix is known as the admittance matrix. The (square) admittance matrix is

    usually denoted as A Rnn, with generic element Aij . V Rn and I Rn are thevectors of unknown voltages and known current injections at each of the networks nodes,respectively.

    Given values for admittances and current injections, we may solve for nodal voltages andcurrent flows over each line. As the simplest example, consider resistances of one unit foreach resistor in the circuit and current injections of one unit at both nodes 1 and 4. In thiscase,

    Yi =1

    Ri= 1 i = a , b , . . . , g .

    The system to be solved is given in matrix form below:

    2 1 0 01 3 1 0

    0 1 3 10 0 1 2

    V1V2V3V4

    =

    1001

    , (1.26)

    yielding V

    =

    2

    3

    1

    3

    1

    3

    2

    3

    .

    18

  • 7/29/2019 Electrcity Primer for Energy Economist

    20/83

    We may now solve for current flows across all lines in the network, using (1.14) (1.20).

    I10 = YaV1 =2

    3,

    I12 = Yb(V1 V2) = 13

    ,

    I20 = YcV2 =1

    3,

    I23 = Yd(V2 V3) = 0,

    I30 = YeV3 =1

    3,

    I34 = Yf(V3 V4) = 13

    ,

    I40 = YgV4 =2

    3

    .

    (all currents in amps). The negative sign on I34 means that current is flowing in theopposite direction than we assumed (i.e., current is flowing from node 4 to node 3, notfrom node 3 to node 4). One may easily check that KCL is indeed satisfied at the fournodes.

    1.4 A Quick DC Sensitivity

    Sensitivity analysis is the study of how the value of a problems solution, or some functionof that solution, changes as we tweak the value(s) of either the solution (vector) or some

    other model parameter. As a quick introduction to sensitivity analysis, we examine thesensitivity of the vector of voltages in the ladder circuit problem when we change thecurrent injected at a single node. We do this analysis to demonstrate a basic method forcalculating sensitivities (e.g. a locational marginal price is an example of a sensitivity).

    To calculate the sensitivity of a solution to a change in a variable , we start with a squaresystem of equations Ax = b (in our example, A R44, x R41, and b R41).22Since we are examining the sensitivity of the solution of this system, we assume such asolution exists, and denote it as x(0), or the base case solution. We denote the amountby which we wish to change a given variable as R1. At the base case solution, none ofthe problem inputs have changed at all. Therefore, the base case corresponds to = 0.23

    A non-zero value for will refer to a change case. For example, we may change an22We assume the reader is familiar with matrix algebra, so we do not go into details such as conditions

    for matrix invertibility.23The notation is, admittedly, a bit squirrelly, since we change only one variable when performing a

    19

  • 7/29/2019 Electrcity Primer for Energy Economist

    21/83

    admittance from Yi to Yi + , or change a current source from Ij to Ij + . Let us denotethe change-case equation as:

    A()x() = b(). (1.27)

    That is to say, the coefficient matrix and right hand side vector are now dependent on (orfunctions of) .

    We calculate a sensitivity for x(0) as the partial derivative of the original solution vector(i.e., the base case) to a change in a specific variable, the latter of which we denote as j .First, since the base case corresponds to no change in any variable, we will denote the basecase equation as:

    A(0)x(0) = b(0).

    To calculate the sensitivity of the original solution to a change in a variable, solve for the

    derivative of the base-case solution with respect to the variable in question. To evaluatethis derivative, start by totally differentiating (1.27):

    A(0)

    jx(0) dj + A(0)

    x(0)

    jdj =

    b(0)

    jdj .

    Since the dj terms all cancel, we solve the remaining equation forx(0)

    j, obtaining:

    x

    j(0) = [A(0)]1

    b

    j(0) A

    j(0)x

    .

    Let us return to the example shown in (1.25) - the ladder network with current injectionsI1 and I4 equal to one amp each, and admittances Ya Yg equal to one unit each. We

    wish to calculate the sensitivities of the voltages obtained, (x) =

    2

    3

    1

    3

    1

    3

    2

    3

    , to a

    change in the node 1 current source from I1 to I1 + j . We show this change in (1.28),below:

    Ya + Yb Yb 0 0

    Yb Yb + Yc + Yd Yd 00 Yd Yd + Ye + Yf Yf0 0 Yf Yf + Yg

    V1V2V3V4

    =

    I1 + j00I4

    . (1.28)

    sensitivity analysis. And yet we alternatively speak of A(0) andA(). Perhaps the best explanation isthat as soon as we perturb one variable, designated as , the original solution vector no longer holds.

    20

  • 7/29/2019 Electrcity Primer for Energy Economist

    22/83

    Notice thatA

    = 0 and bj

    = [1 0 0 0]. Finally, inverting the matrix, as foundon the lhs of (1.26), and multiplying, we obtain:

    x

    j(0) = [A(0)]1

    b

    j(0)

    =

    0.61910.23810.09520.0476

    .

    1.5 The DC Approximation to the AC Network: Calculating

    PTDFs

    We started with DC network calculations to familiarize the reader with concepts used in theanalysis of an AC Network. Electrical engineers, intrepid folks that they are, will actually

    set up and solve AC power flow problems as systems on non-linear equations.24 Energyeconomists generally study linearized versions of the AC power equations, though. Theobvious advantage of linearizing these systems is that one need not run iterative algorithmsto find the critical points for systems of non-linear equations.

    This section focuses on only one element of linearized AC analysis, the calculation ofPTDFs. Doing so, we will present the reader important concepts such as the Jacobian ofpower balance equations (as derived in Appendix A), noting the similarity between thismatrix and the admittance matrix of the linearized AC system (derived in Appendix B).We believe that the advantage of this approach is that it is incremental. We introduce thereader to these important concepts in the context of the evaluation of a single system ofequations, rather than throwing the reader the several derivations necessary to solve theoptimal power flow problem all at once.

    1.5.1 Linearizing AC Power Equations

    We derive the equations for power balance and power flow across transmission lines inAppendix A. (1A.8) and (1A.9), shown below:

    P =n

    k=1

    uuk[Gk cos( k) + Bk sin( k)],

    Q =

    nk=1

    uuk[Gk sin( k) Bk cos( k)],

    24Well, perhaps they are not that intrepid, since available computer packages solve the problems for them!

    21

  • 7/29/2019 Electrcity Primer for Energy Economist

    23/83

    are called power flow equality constraints,25 and must be satisfied at each bus in order forthe power system to maintain a constant frequency.26 (1A.12) and (1A.13) display powerflow across transmission lines as:

    pk = ()2G + uuk[Gk cos( k) + Bk sin( k)],qk = ()2B + uuk[Gk sin( k) Bk cos( k)].

    The linearized AC model is generally known as the DC approximation to the AC network.Thus, in this model terms such as reactive power and impedance are assumed away. Wemake two simplifying assumptions to transform the complex admittance matrix to its DCapproximation: we set its real terms, Gk, equal to zero and ignore the shunt elements(i.e., the terms corresponding to node 0, or the ground). This reduces (1A.8) and (1A.12)to:

    P =n

    k=2

    uuk[Bk sin(

    k)],

    27 (1.29)

    pk = uuk[Bk sin( k)]. (1.30)

    We finish linearizing these equations by assuming that the base-case solution (the point ofreference for our derivatives) involves zero net power flow at nodes 2 n, and all voltagemagnitudes equal to one per unit, so that u(0) = 1. This reduces (1.29) and (1.30) to:

    P =n

    k=2

    Bk sin( k), (1.31)

    pk = Bk sin( k). (1.32)

    At this point we deviate from the standard methodology by linearizing these equationsabout the base-case solution for (real) power. As per Baldick (2006, p. 343), we define aflat start as the state of the system corresponding to phase angles equal to zero at all nodesand all voltage magnitudes equal to one (which, in fact, is the base-case solution to theproblem when we ignore the circuits shunt elements).28 As we will see shortly, the model

    is now linear at the base-case solution, becausesin

    =0

    = 1.

    25The power flow equality constraints express the relationship that complex power generated at bus isequal to voltage times (the complex conjugate of) current.

    26We derive these equations in Appendix A by dividing the term for the amount of complex power injectedinto a generic node, , as the sum of its real P and reactive Q

    1 components.28The traditional interpretation of DC power flow emphasizes small angle approximation to sine and

    cosine (i.e. cos(i k) 1, sin(i k) (i k)), and the solution of DC power flow being thesame as the solution of an analogous DC circuit with current sources specified by the power injections andvoltages specified by the angles (see Schweppe et al.(1988), Appendix D). While our presentation differsfrom the standard, the reader should be able to digest the traditional method once they have solved ours.

    22

  • 7/29/2019 Electrcity Primer for Energy Economist

    24/83

    1.5.2 Calculating PTDFs

    The term PTDF, or shift factor, means the change in the flow of power across a particulartransmission line, k, induced by an incremental increase in power output at a given node.The alert reader will note that there exist N shift factor matrices, each one correspondingto the change in power flow across all lines in the system as the result of an increase inpower generation at one of the systems N nodes. Mathematically, we calculate a real-

    power shift factor aspkPj

    . We denote this matrix as Lj =pk

    P(m)j. This is the matrix

    of incremental line flows across all of a systems lines due to an injection of power at nodej and withdrawal of that power at node m, for each of the systems other nodes. Powerinjected and withdrawn at the same node has PTDF(j)j = 0, trivially.

    We cannot take the desired partial derivative directly, because there is no explicit term forPj in (1.32). Therefore, we incorporate the chain rule to solve for the desired term basedon a variable common to both (1.31) and (1.32), finding that:

    pkPj

    =pki

    iPj

    .

    We obtain the second term, of course, by inverting the Jacobian corresponding toPji

    .

    Differentiating these equations is now fairly straightforward. First, we shorthand equation(1.31) to express net power flow from node as a function of phase angles and voltageinjections, and the vector of net power flows as:

    P = p,

    P = p

    ,

    respectively. As alluded to earlier, there are (n1) degrees of freedom in the power balanceequations, because power balance indicates that one cannot specify the power balanceequation at the nth node independently of the power balance in the rest of the system.Therefore, we subtract a row and column of the power-balance Jacobian. It is customaryto denote the node corresponding to the omitted row and column as the reference node.As shown below, we calculate shift factors by treating the reference node as the node atwhich power is withdrawn. As is also customary, we denote the reference node as node 0.29.

    29the only drawback of this approach is that we have already denoted the ground node as node 0, andthe ground node and the reference node are not the same thing. However, since we have assumed awaythe shunt elements, we are not examining the ground node any longer. Thus, there should be no furtherconfusion regarding denoting the reference node as node 0

    23

  • 7/29/2019 Electrcity Primer for Energy Economist

    25/83

    We will demonstrate the calculation of two different Jacobians for expositional clarity.Denote the power-balance Jacobian (nodal Jacobian) for all of the systems nodes (the fullnodal Jacobian) as Jp, and the Jacobian for all the systems nodes, excepting the reference

    node, (the reduced nodal Jacobian) as Jp, respectively. The term p indicates that weare taking the derivatives of real power flows with respect to phase angles. When solvingfor PTDFs, we will use the reduced nodal Jacobian because the power-balance equationshave (n 1) degrees of freedom. Remembering that we are evaluating the linearized powerbalance equations, we write the reduced nodal Jacobian for our calculation of network shiftfactors as:

    J(0)p = Jp

    0

    1

    =

    p

    0

    1

    30 (1.33)

    (that is, we evaluate this Jacobian at a flat start).

    Next we examine the Jacobian for the equations of real-power flow over the transmission

    lines (branch Jacobian): K Rkn1. This matrix has k rows, one for each of the equationsfor the systems transmission lines (ignoring shunt elements). Again, because the systembehaves differently when power is withdrawn at each of the systems non-reference nodes,there are (n 1) of these matrices, one every node at which we may withdraw power whenpower is injected at a set node. We denote the branch Jacobian, evaluated at the base-caseof a flat start, as:

    K(0) = K

    0

    1

    =

    pk

    0

    1

    .31 (1.34)

    For expositional simplicity, let us now solve (1.33) and (1.34) and the resulting shift fac-tors for a sample network before introducing the general notation corresponding to these

    equations. Consider the 5-node model shown below. The value shown between each nodepair is the impedance of the transmission line connecting the two nodes. Let us choosenode 1 as the reference node, so that we will replace the notation 1 with 0 wheneverwe refer to this node.

    24

  • 7/29/2019 Electrcity Primer for Energy Economist

    26/83

    Figure 1.10: A Sample Network

    Node 5 Node 30 +j0.004

    Node 4 Node 20 +j0.004

    0 +j0.001 0 +j0.001

    0 +j0.001

    0 +j0.001

    Node 0

    Each line, k, has Rk = 0. That is, the real part of impedance (i.e. resistance) is zerofor all lines. This corresponds to the assumption that the real component of conductance(i.e. the inverse of impedance) is zero as well. The complex component of impedance(i.e. reactance) is given by Xk

    1. Invert each lines impedance to derive its admittance,denoted Yk:

    Y02 = Y03 = Y23 = Y45 =1

    0 +j0.001= j1, 000,

    Y24 = Y35 =1

    0 +j0.004= j250.

    Note that Yk = Bk1.For any node , we write sin( j), for all nodes j connected to node by a transmissionline. We may thus express (1.31) for each of the five nodes in this example as:

    P0 = 1, 000 sin(0 2) + 1, 000 sin(0 3),P2 = 1, 000 sin(2 0) + 1, 000 sin(2 3) + 250 sin(2 4),P3 = 1, 000 sin(3 0) + 1, 000 sin(3 2) + 250 sin(3 5),P4 = 250 sin(4 2) + 1, 000 sin(4 5),P5 = 250 sin(5 3) + 1, 000 sin(5 4).

    Deriving the full nodal Jacobian for this example is straightforward, nonetheless, we show

    25

  • 7/29/2019 Electrcity Primer for Energy Economist

    27/83

    explicitly the elements corresponding to the first row of this matrix:32

    J(0)11 =

    P00 =0

    = 1, 000 cos(0 2) + 1, 000 cos(0 3) = 2, 000,

    J(0)12 = P0

    2

    =0

    = 1, 000 cos(0 2)(1) = 1, 000,

    J(0)13 =

    P03

    =0

    = 1, 000 cos(0 3)(1) = 1, 000.

    Since neither 4 nor 5 are arguments of P1, their corresponding terms are obviously zero.Taking the remaining partial derivatives yields the matrix:

    2, 000 1, 000 1, 000 0 01, 000 2, 250 1, 000 250 01, 000 1, 000 2, 250 0 250

    0

    250 0 1, 250

    1, 000

    0 0 250 1, 000 1, 250

    .

    A couple of characteristics of this matrix stand out immediately. First, notice the diagonalterms are equal to the sum of the off-diagonal elements times minus one. Recognizing that

    the off-diagonal term, J(0)k = Bk, this allows us to shorthand the terms of this Jacobian

    as:

    Pk

    0

    1

    =

    jJ() Bj if k = ,

    Bk if k J(),0 otherwise.

    Second, notice that the full nodal Jacobian is symmetric (this fact makes calculation of thefull AC model less computationally expensive).

    As mentioned above, we omit the power flow equality constraint and partial derivativescorresponding to the base node in order to derive the reduced nodal Jacobian. Thus, thereduced system of equations is:

    P2 = 1, 000 sin(2 0) + 1, 000 sin(2 3) + 250 sin(2 4),P3 = 1, 000 sin(3 0) + 1, 000 sin(3 2) + 250 sin(3 5),P4 = 250 sin(4 2) + 1, 000 sin(4 5),P5 = 250 sin(5 3) + 1, 000 sin(5 4).

    32We could really use some different subscript/superscript/parenthetical notation for the entries in thisJabobian, but what we have will have to do for now.

    26

  • 7/29/2019 Electrcity Primer for Energy Economist

    28/83

    We take the derivatives of these equations with respect to 2, 3, 4 and 5, obtaining:

    J(0) =

    2, 250 1, 000 250 01, 000 2, 250 0 250

    250 0 1, 250 1, 0000 250 1, 000 1, 250

    .

    with inverse:

    J(0)

    1=

    0.000655 0.000345 0.000517 0.0004830.000345 0.000655 0.000483 0.0005170.000517 0.000483 0.002724 0.0022760.000483 0.000517 0.002276 0.002724

    .

    Notice that we do not remove the terms in power flow equality constraints P2 P5corresponding to the base node, because these terms capture the physical characteristics ofthe network (i.e. the transmission lines between the node in question and the base node).

    To calculate the branch Jacobian, K, remember that this matrix is of dimension k(n1).Accordingly, we will take derivatives of flows on the k = 6 transmission lines with respectto the N 1 nodes at which power is injected.Before taking these derivatives, however, we must determine the (reference) direction ofpower flow across all k lines. That is, we know that the equation for power flow across agiven line is pk = Bk sin( k), where this equation indicates that power flows fromnode to node k. We just have to figure out whether, for any given node pair, power flowsfrom node k to , or vice-versa. There is no one right answer to this question, though,because the direction of power flow will change whenever one changes the node at whichpower flows into the network (e.g., the direction of flow across line 45 will be different if

    one injects power at node 2, versus injecting it at node 3).

    Fortunately, this observation leads us to the correct method for assigning power flow di-rection. We simply designate both the node at which power is withdrawn and the nodeat which power is injected. Since we withdraw power at the reference node, we need onlychoose an additional, arbitrary, node at which to inject power. From here, we assign powerflows such that no physical laws (First Law of Thermodynamics, Kirchhoffs laws) are vio-lated. So, let us arbitrarily designate node 2 as the injection node. Having specified theinjection node, one may follow two shortcuts to power flow direction:

    1. Power flows to the reference node along the lines directly connected to it;

    2. Power flows away from the injection node along the lines directly connected to it.33

    33These rules of thumb no longer hold with multiple points of injection and withdrawl, but that obser-vation is not relevant to the present analysis.

    27

  • 7/29/2019 Electrcity Primer for Energy Economist

    29/83

    Following these two shortcuts, we may assign directional power flows as follows:

    Figure 1.11: Directional Power Flows

    Node 5 Node 3

    Node 4 Node 2

    Node 0

    The first observation tells us that power flows from nodes 2 and 3 to node 0. Load atnode 0 draws power along lines 20 and 30. The second observation tells us that powerflows away from node 2, to nodes 0, 3, and 4. All that remains is to determine directionalflows along the lines connected to node 5. Kirchhoffs Current Law tells us that the sumof currents entering a node equals the sum of currents exiting that node. Since no current(or the power corresponding to it) is being withdrawn at node 4, all of the power enteringnode 4 will flow to node 5, indicating the direction of flow on this line. The same reasoningapplies at node 5, so power flows from node 5 to node 3. Note that KCL also tells us that

    the current flowing from node 3 to node 0 is equal to the sum of currents flowing fromnodes 2 and 5 to node 3.

    Using the directional power flows indicated above, we write the six equations for powerflow as:

    p20 = 1, 000(2 0),p30 = 1, 000(3 0),p23 = 1, 000(2 3),p24 = 250(2 4),p53 = 250(5

    3),

    p45 = 1, 000(4 5).

    28

  • 7/29/2019 Electrcity Primer for Energy Economist

    30/83

    Taking the required derivatives across all equations yields:

    K0

    1

    =

    1, 000 0 0 00 1, 000 0 0

    250 0 250 00 250 0 2500 0 1, 000 1, 000

    .

    We shorthand this matrix as:

    K(ij) =

    Bij if = i,

    Bij if = j.

    Multiplying the two matrices yields the shift factor matrix (H) below:

    P2 P3 P4 P5

    H

    0

    1

    =

    line 20line 30line 31line 24line 35line 45

    0.6552 0.3448 0.5172 0.48280.3448 0.6552 0.4828 0.51270.3103 0.3103 0.0345 0.03450.0345 0.0345 0.5517 0.44830.0345 0.0345 0.4483 0.55170.0345 0.0345 0.4483 0.4483

    .

    To interpret this matrix, observe that column values indicate the source of the power, thatis, the node at which power is generated (as well at the phase angle corresponding to thisnode).34 The row value corresponds to the line over which this power flows. Therefore,the columns of the matrix yield the PTDFs for every line in the network when power isinjected at the node corresponding to that column and withdrawn at the reference node.Reading down the first column, then, 65.52 percent of the power generated at node 2 flowsdirectly to node 0. The remaining 34.48 percent flows in a more circuitous fashion alongthe networks other lines. 31.03 percent flows from node 2 through node 3 to node 0, while3.45 percent flows around the horn, from node 2 to node 4 to node 5 to node 3 and on tonode 1. As mentioned above, the amount exiting node 3, 34.48 percent of the increment ofpower generated, is equal to the sum of the flows entering that node: 31.03 percent, plus3.45 percent.

    34Even though we assume that no power is generated at nodes 1-3, we may, in principle, calculate shiftfactors for any node in a transmission system.

    29

  • 7/29/2019 Electrcity Primer for Energy Economist

    31/83

    1.A Power Equation Derivation

    When current and voltage are in phase, an electrical system is producing its maximum

    efficiency of (real) power output. A graphical analysis is illustrative. Consider first rela-tionship between power, current, and voltage for a purely resistive system.

    time

    P , I , E

    Instantaneous Voltage

    Instantaneous Current

    Instantaneous Power

    Figure 1A.1: Current, Voltage, and Power in a Purely Resistive System

    As shown in Figure 1A.1, above, when current and voltage are in phase, power is strictlynonnegative because voltage is never positive when current is negative, and vice-versa.As voltage and current move out of phase, though, this synchronicity vanishes. Considerthe inductor example from Figure 1A.2, with instantaneous power added to instantaneouscurrent and voltage.

    time

    P , I , E

    Instantaneous Voltage

    Instantaneous CurrentInstantaneous Power

    Figure 1A.2: Current, Voltage, and Power in a Purely Inductive System

    Since voltage and current are 90

    out of phase for a purely inductive current, half of thetime voltage and current will be of the same sign, while they will be of opposite sign theother half of the time. This causes power in this circuit to alternate in cycles of positiveand negative values. Positive power means that load in the system is receiving (absorbing)

    30

  • 7/29/2019 Electrcity Primer for Energy Economist

    32/83

    power from the generation source(s), while negative power means that power is actuallybeing returned to the generation source. This means that reactive components (inductorsand capacitors) dissipate zero power, as they equally absorb power from, and return powerto, the rest of the circuit.35

    Adding capacitance into the picture, of course, means that the circuits phase angle willdecrease, moving voltage and current closer into phase and allowing for positive poweroutput, as shown graphically in Figure 1A.3 below:

    time

    P , I , E Instantaneous Voltage

    Instantaneous Current

    Instantaneous Power

    Figure 1A.3: Current, Voltage, and Power in a Resistive/Reactive Circuit

    In a circuit characterized by both resistance and reactance, voltage and current are out ofphase by less than |90|, and power cycles between positive and negative values, but netpower output is positive.

    When calculating power in circuits with reactive and resistive elements, we apply Ohms

    law. Once again denoting reactance by X, resistance by R, impedance by Z, current by I,and voltage by E, we have the following three expressions for Ohms law:

    E = I R (circuit with resistive elements only),E = I X (circuit with reactive elements only),E = I Z (circuit with resistive and reactive elements).

    Note that the basic relationship, voltage equals current times resistance, is unchanged. Thepoint is simply that the nature of resistance varies with the different resistance sources.Since the basic relationship for power is unchanged as well, power for resistive, reactive,

    35For further reading, see Rau(2003), Appendix A, and Mittle and Mittal, Ch. 6 - 8.

    31

  • 7/29/2019 Electrcity Primer for Energy Economist

    33/83

    and resistive plus reactive circuits is, respectively:

    P = |I|2 R,Q =

    |I

    |2

    X,

    S = |I|2 Z, (1A.1)where:

    P is real power, measured in Watts, Q is reactive power, measured in volt-amperes reactive (VAR), and S is apparent power, measured in volt-amperes (VA).

    Just as we expressed the relationship between resistance, reactance, and impedance witha right triangle, we express the relationships between different power elements with thepower triangle. Consider a circuit containing a 60 volt power source, a capacitor rated at

    30 farads, and a 20 resistor. In order to calculate P, Q, and S for this circuit, we mustcalculate the current flowing through it. Impedance is simply:

    Z =

    R2 + X2 = 36.06.

    Therefore, current is:

    I =E

    Z= 1.66 amps.

    Real Power is:

    P = I2R = 55.1 watts,

    reactive power is:

    Q = I2X = 82.7 VAR,

    and complex power is:

    S = I2Z = 99.4VA.

    The power triangle is shown graphically as:

    P

    Q

    S

    Figure 1A.4: The Power Triangle

    32

  • 7/29/2019 Electrcity Primer for Energy Economist

    34/83

    It is straightforward to verify that P/S = R/Z, and so one may derive the phase angleeither through either power or impedance manipulations. The former expression is com-monly known as the power factor. The ability to reduce a systems phase angle is knownas reactive power supply. Only generators with this ability may compete in the reactive

    power market.

    Like we calculated instantaneous power for purely resistive circuits in (1A.1), we may alsocalculate instantaneous power for a purely inductive circuit, a purely capacitive circuit,and a combined resistive-reactive circuit. For a purely inductive load, current lags voltageby 90. Therefore, we have:

    i(t) = Imax cos( 90),v(t) = Vmax cos .

    Instantaneous power is then:

    p(t) = VmaxImax cos cos( 90),= VmaxImax cos sin ,

    = |V||I| sin(2).

    Integrating over [0, 2], we find that instantaneous power for a purely inductive circuit doesindeed have an average value of zero, as argued above. One may also show that averagepower for a purely capacitive circuit is zero, as found by integrating |V||I| sin(2). Finally,for mixed resistive/reactive circuits, we may write:

    p(t) = VmaxImax cos cos( ),

    =VmaxImax

    2[cos2 cos sin2 cos + cos + 2 sin cos sin ].

    The first three terms inside the parentheses reduce to (cos )(1 + cos 2), while the fourthreduces to (sin )(sin2). Thus, we may express instantaneous power in a single-phase ACcircuit as:

    s(t) =VmaxImax

    2(cos )(1 + cos 2) +

    VmaxImax2

    (sin )(sin 2).

    Alternatively, since |V| = Vmax/

    2 and |I| = Imax/

    2, we have

    s(t) = |V||I|(cos )(1 + cos 2) + |V||I|(sin )(sin 2). (1A.2)The first term is once again real power, while the second term is reactive power. Note thatwhen the phase angle is equal to zero, reactive power is equal to zero, as expected. These

    33

  • 7/29/2019 Electrcity Primer for Energy Economist

    35/83

    equations give us an alternative method for calculating average real, reactive, and complexpower in AC circuits. We calculate average real power as:

    1

    22

    0 |V||I|(cos )(1 + cos 2)d = |V||I| cos . (1A.3)By inspection, (1A.3) is at a maximum when = 0. Notice that since k

    20 sin2d = 0,

    the average value of reactive power from (1A.2) is always zero.

    We will also find it useful to express power in terms of the systems admittance matrix. Todo this, we note that complex power injected into the network at bus is given by:

    S = VI

    . (1A.4)

    Post-multiplying the admittance matrix, given by Eq. (36), by the voltage vector V onceagain yields AX = I, with individual elements:

    I = AV

    kJ()

    AkVk. (1A.5)

    Substituting (1A.5) into (1A.4) yields

    S = V

    AV +

    kJ()

    AkVk

    = |V|2A +

    kJ()

    AkVVk.

    We may break down complex power into real and reactive power, starting by dividingthe admittance terms into their real and imaginary components. Let us start with the

    expression for admittance as the inverse of impedance. That is, given Zk = Rk +jXk,

    Yk =1

    Zk=

    1

    Rk +jXk=

    1

    Rk +jXk Rk jXk

    Rk jXk =Rk jXk

    (Rk)2 + (Xk)2. (1A.6)

    Using Eq. (1A.6), we define the real and imaginary parts of resistance, Gk and Bk,respectively, as follows:

    Gk =Rk

    (Rk)2 + (Xk)2

    Bk =Xk

    (Rk)2 + (Xk)2.

    Therefore,

    Yk = Gk jBk. (1A.7)

    34

  • 7/29/2019 Electrcity Primer for Energy Economist

    36/83

    When writing the equations for complex power, the notation Vmax gets cumbersome. So atthis point we replace Vmax with u.

    36 We employ Eulers identity to write complex voltageat node as:

    V = uej ,

    and complex power as:

    P +jQ =

    kJ()

    uuk(Gk jBk)ej(k

    =

    kJ()

    uuk

    Gk cos( k) + Bk sin k)

    +juuk

    Gk sin( k) Bk cos k)

    ,

    where:

    P =

    kJ()

    uuk

    Gk cos( k) + Bk sin k)

    , (1A.8)

    Q =

    kJ()

    uuk

    Gk sin( k) Bk cos k)

    . (1A.9)

    (1A.8) and (1A.9) are known as power flow equality constraints, and must be satisfied ateach bus of the power system. Note that the lhs of this equation represents net power flowout of node . If real/reactive power generation at this node is greater than real/reactivepower consumption, then P

    , Q

    > 0, respectively. The rhs of the equation represents

    the fact that this net power flow travels across the transmission network, from the givennode, , to the nodes with which it is connected k J(). Summing up all of these positive(indicating net power flow from node to node k) and negative (vice-versa) power flows, wearrive at the net real/reactive power flow out of node . Finally, the KCL implies that netpower flow out of node is equal to the sum of the power flows along each line connectedto that node, so we write the power balance constraints as:

    p(x) =

    kJ()

    uuk

    Gk cos( k) + Bk sin k) P = 0, (1A.10)

    q(x) = kJ()uuk

    Gk sin( k) Bk cos k) Q = 0. (1A.11)

    36We use alternate notations because electrical engineering texts do, and we wish to expose the readerto these stylistic differences. Our exposition is closest to that of Baldick (2006, Ch. 6.2).

    35

  • 7/29/2019 Electrcity Primer for Energy Economist

    37/83

    We also derive the formulas for power flow across a given line k, connecting buses andk, in the direction of to k. For a simple circuit with no shunt elements, the flow of poweracross line k would be equal to:

    uuk

    Gk cos( k) + Bk sin( k).37This equation simply refers to the drop in voltage (and thus power flow) moving acrossnodes in a series circuit. Once we take explicit account of the elements connecting genera-tion to the transmission system (the shunt elements), we have to take into the considerationthe power sourcing at these elements. We derive this element of the power flow equationby setting k = in equations (1A.10) and (1A.10). Doing so yields the quantities:

    uuk

    G cos( k) + B sin( k)

    = (u)2G,

    and, in the same manner, (u)2B. Therefore, denoting real power flow across line k inthe direction of k as pk (and doing so analogously for reactive power flow), we have:

    pk = (u)2G + uuk

    Gk cos( k) + Bk sin( k)

    , (1A.12)

    qk = (u)2B + uuk

    Gk sin( k) Bk cos( k)

    . (1A.13)

    Likewise, we may rewrite (1A.10) and (1A.11) as:

    P = u2G +

    kJ()

    uuk[Gk cos( k) + Bk sin( k)], (1A.14)

    Q = u2B +

    kJ()

    uuk[Gk sin( k) Bk cos( k)]. (1A.15)

    36

  • 7/29/2019 Electrcity Primer for Energy Economist

    38/83

    1.B Admittance Matrix for the DC Approximation to the

    AC Circuit

    For convenience, we return to the admittance matrix for the ladder circuit from (1.25).For clarity, however, we now denote the admittances with double subscript notation Yk,to denote the admittance of the line connecting nodes and k (e.g., Ya now becomes Y01,because line a connects nodes 0 and 1). We may thus express the admittance matrix from(1.25) as:

    Y02 + Y12 Y12 0 0Y12 Y12 + Y02 + Y23 Y23 00 Y23 Y23 + Y30 + Y34 Y340 0 Y34 Y34 + Y40

    ,

    From (1A.7) we have Yk = Gk

    jBk, which we could plug in for each value in the

    matrix above. However, at this point we simplify the matrix by setting the real componentof admittance equal to zero. Electrical engineers justify this assumption by noting that|Gk| |Bk|. Further, we neglect the shunt elements in the line models. The electricalengineering justification for this is that shunt components sometimes have values such thattheir effect on the circuit is negligible. This reduces the admittance matrix to:

    jB12 jB12 0 0jB12 j(B12 + B23) jB23 00 jB23 j(B23 + B34) jB340 0 jB34 jB34

    .

    37

  • 7/29/2019 Electrcity Primer for Energy Economist

    39/83

    Chapter 2

    The Newton-Rhapson Method and

    AC OPF

    Having tackled the basic concepts of AC power flow and linearization of AC power flowequations and related shift factor calculations, we are ready to move on to the optimal powerflow problem itself. At this point, even though most energy economists will not delve intosolutions of systems of nonlinear equations (rather, the energy economist will normallyjust skip directly to the DC approximation of the AC optimal power flow problem), inthis chapter we tackle the nonlinear AC system to present the reader with additionalbackground material for the presentation of the DC approximation.

    2.1 The Newton-Rhapson Method

    AC power flow is captured by a system of nonlinear equations. Thus, before moving to thesolution of the AC optimal power flow problem (OPF), we must first introduce a methodfor solving systems of nonlinear equations. Except in relatively simple cases, analyticalsolutions to systems of nonlinear equations will not exist. Therefore, our best hope is toapproximate the solution to this system of equations with a high degree of accuracy (tobe specified by the researcher). One uses an iterative algorithm to find this answer. In aniterative algorithm, the researcher makes an initial estimate as to a problems solution andtries to improve upon this conjecture with successive iterates of the algorithm. The Newton-Rhapson method is quite popular in electrical engineering texts, so we will demonstrate

    it.

    38

  • 7/29/2019 Electrcity Primer for Energy Economist

    40/83

    The general form for the iterates created by an iterative algorithm is:

    xv+1 = xv + vxv v = 1, 2, 3 . . . ,

    where:

    x0 is initial estimate of the solution, v is iteration counter, xv is the value of the iterate at the v-th iteration, v is step size, usually 0 < 1, xv is the step direction, and vxv is the update to xv to obtain xv+1.Let us consider a function g() : Rn Rn and suppose we wish to solve the systemof simultaneous nonlinear equations g(x) = 0. We start with an initial estimate to thesolution, x0 Rn. We may think of this guess as our predicted answer, based on ourunderstanding of the problem. Except in the rare circumstance that our first conjecture

    is exactly correct, we will have g(x) = 0, and will wish to find an updated vector x1 =x0 + x0 such that:

    g(x1) = g(x0 + x0) = 0.

    A first-order Taylor approximation of g() about x0 yields:

    g(x1) = g(x0 + x0) g(x0) + gx

    x0x0. (2.1)

    For a square system of equations we may write g(x0 + x0) g(x0) + J(x0)x0. There-fore:

    g(x1) = g(x0 + x0)

    g(x0) + J(x0)x0. (2.2)

    Since we seek an x1 such that g(x1) = 0, and the rhs of (2.2) approximates g(x1), we willchoose a value for x0 such that:

    g(x0) + J(x0)x0 = 0. (2.3)

    Solving (2.3) for x0 yields x0 =

    J(x0)1

    g(x0). The stage zero update is thus:

    x0 =

    J(x0)1

    g(x0), (2.4)

    x1 = x0 + x0. (2.5)

    Equations (2.4) and (2.5) constitute the stage zero Newton-Rhapson update, and x0 isthe stage zero Newton-Rhapson step direction. More generally, at any stage v we have:

    xv =

    J(xv)1

    g(xv), (2.6)

    xv+1 = xv + xv. (2.7)

    39

  • 7/29/2019 Electrcity Primer for Energy Economist

    41/83

    Example 2.1: Newton-Rhapson method

    Consider the system of simultaneous non-linear equations g(x) = 0, where g() : R2 R2is defined by:

    x R2, g(x) =

    12 (x1)

    2 + x2 4x1 +

    12 (x2)

    2 7

    .

    We expect that the pair of quadratic equations will have multiple roots. Let us focus on thepositive root pair. Since x2 is of larger power in the expression with larger absolute value(i.e. 7), our initial estimate will have x2 greater than x1. One method for an initial choiceis to solve one of the equations exactly, while eyeballing the other. Let us start, then,with an initial guess of (x0) =

    1 3.5

    . This conjecture yields [g(x)0] =

    0 0.125

    . To

    calculate the Newton-Rhapson update, x0, we must find, and then invert, the JacobianJ(x0). By inspection,

    J(x0) =

    x1 11 x2

    .

    Inverting this matrix, we find that:

    J(x)

    1=

    x2x1x2 1

    1x1x2 1

    1x1x2 1

    x1x1x2 1

    . (2.8)

    Therefore,

    J(x)1 g(x0) = 1.4 0.40.4 0.4 00.125 , (2.9)or,

    x0 =

    0.05

    0.05

    .

    Thus we have that:

    x1 =

    1.053.45

    .

    Next we must decide if we wish to stop here, or perform another iteration. There are threebasic rules for determining when to stop iterating: (1) the step size, xv, is sufficientlysmall; (2) the error term, g(xv), is sufficiently small (where small is determined by ametric of the researchers choosing); or (3) after a fixed number of iterations. Since we

    40

  • 7/29/2019 Electrcity Primer for Energy Economist

    42/83

    are simply demonstrating the method, we will stop after two iterations. Given the update,(x1) =

    1.05 3.45

    , we compute g(x1) =

    0.00125 0.00125

    . To perform the second

    iteration, we insert the values x1 into (2.8) and iterate on (2.9), finding:

    J(x1)1 g(x1) = 1.31554 0.381320.38132 0.40038

    0.001250.00125

    ,

    or,

    x1 =

    0.001170.00002

    .

    Therefore, (x2) =

    1.049998 3.44883

    , and g(x2) =

    0.00006 0.00281 . Noticethat we haveovershot the value of x2, in that |g(x22)| is greater than |g(x12)|. This iswhere the issue of step size comes in. We wish to decrease absolute values of the errors forall elements of x from one repetition to the next. Therefore, one would generally perform

    a new stage 2 iteration to obtain:

    x2 = x1 + 1x1, 1 < 1.

    It is common to iterate using vi = (12 )

    i, i = 0, 1, 2, . . . , where vi is the ith iterate of

    at stage v of the Newton-Rhapson update, and to stop iterating on when the error termhas fallen by the desired amount, as specified by the researcher.

    Having demonstrated (if briefly) the Newton-Rhapson method, the next step in solving anAC optimal power flow problem is to set up the problem using this method. To do this,we return to equations (1A.14) and (1A.15)for real and reactive power flow, respectively:

    P = u2G +

    kJ()

    uuk[Gk cos( k) + Bk sin( k)],

    Q = u2B +

    kJ()

    uuk[Gk sin( k) Bk cos( k)].

    41

  • 7/29/2019 Electrcity Primer for Energy Economist

    43/83

    Example 2.2: 2-node power-flow problem

    Let us examine the power flow equations in a simplistic two-node network, as illustratedbelow:

    X12

    21

    X12 = j0.25

    Pg1 = 0.6

    Qg1 = 0.3

    u1 = 1.0

    1 = 0.0

    Pd2 = 0.6

    Qd2 = 0.3

    u2 = ?

    2 = ?

    Figure 1: The 2-Node Network

    As discussed in Chapter 1, we will solve this power-flow problem by designating a node(node 1) as the reference node (not bothering to denote it as 0). By convention, weset the phase angle at the reference node, 1, equal to 0.0 (radians). We will also set thereference voltage, u1, equal to one per unit (1 p.u.). In this example, the generator at node1 produces 0.6 units of real power and 0.3 units of reactive power, consumed by load atnode 2 (thus, we assume line 12 is lossless). As above, we also assume that line 12 exertsno resistance, but only impedance, equal to j0.25, where again, j =

    1. We also ignorethe impedance of any ground (shunt) elements. Our problem is now to solve for the twounknowns, voltage angle and magnitude at node 2. Applying the power-flow equations forreal and reactive power at node 2 to this example, we have:

    0.6 = (u2)2 0 + 1 u2[4 sin(2)],0.3 = 4 (u2)2 u2 [4 cos(2)].

    That is, we have a system of two nonlinear equations in two unknowns, which we will(approximately) solve using the Newton-Rhapson method. Carrying all terms over to thelhs, we have:

    u2[4 sin(2)] + 0.6 = 0,

    4(u2)2 u2[4 cos(2)] + 0.3 = 0.

    To use the Newton-Rhapson method, we make initial estimates for the two unknowns as

    x0 =

    02

    u02

    =

    01

    .

    42

  • 7/29/2019 Electrcity Primer for Energy Economist

    44/83

    This estimate yields initial errors,

    g(x0) =

    0.60.3

    .

    Next, we partially differentiate the equations wrt the unknowns, yielding:

    J(x) =

    p22

    p2u2

    q22

    q2u2

    =

    4u2 cos(2) 4 sin(2)

    4u2 sin(2) 8u2 4cos(2)

    .

    The stage zero update, from (2.6) and (2.7), is the solution to:4 cos(0) 4 sin(0)4 sin(0) 8 4 cos(0)

    02u02

    =

    0.60.3

    .

    Inverting and multiplying, we obtain:

    x0 =

    0.150.075

    ,

    12 = 02 +

    02 = 0.0 0.15 = 0.15 rad,

    u12 = u02 + u

    02 = 1.0 0.075 = 0.925 p.u.

    The new errors are

    g(x1) = g(x11)

    g(x12) =

    4(0.925) sin(0.15) + 0.6

    4(0.925)2

    + 4(0.925)cos(0.15) + 0.3 = 0.047079

    0.064047 .

    Stopping Criterion: We will stop when each of the errors are less than 3 103. The first-iteration errors do not satisfy this criteria, so we perform another iteration. The stage oneupdate is then:

    3.658453 0.597753

    0.552921 3.4449161 0.047079

    0.064047

    =

    0.0163350.021214

    .

    The updated values are:

    22 = 0.15 0.016335 = 0.16635 rad, andu22 = 0.925 0.021214 = 0.903786 p.u.,

    43

  • 7/29/2019 Electrcity Primer for Energy Economist

    45/83

    and the new errors are:

    [g(x2)] = [0.001391, 0.002077].

    Since these errors satisfy the stopping criterion, the procedure ends here.

    Electrical engineers use circuit-flow studies to predict the behavior of a power systemunder such contingencies as lightning strikes that cause short-circuits to occur betweentransmission lines. Power-flow studies allow system operators to control the transmissionsystem so as to keep line flows within operating limits even if the most important elementin the system fails (known as the N-1 Criterion). We have introduced the power flowproblem simply to aid our understanding of optimal power flow, though, and will notconsider such issues as contingency analysis.

    Looking forward to the AC optimal power flow problem, our next step is to use the Newton-Rhapson method to solve nonlinear optimization problems. First, we introduce a generic

    nonlinear optimization problem. After solving the basic problem, we then add constraintsonto it and finally address the optimal power flow problem itself. Since the optimal powerflow problem involves cost minimization, we will illustrate the Newton-Rhapson methodfor a minimization problem. We will work with a strictly convex function, so as to find aunique global minimum and minimizer.

    Example 2.3: Minimization of a convex nonlinear function

    Using the Newton-Rhapson method, find the minimizers of the function:

    x R2, f(x) = 0.01(x1 1)4 + 0.01(x2 3)4 + (x1 2)2 + (x2 1)2,

    The FOSC for a minimum are:

    f

    x1= 0.04(x1)

    3 + 2(x1 2 ) = 0, (2.10)f

    x2= 0.04(x2)

    3 + 2(x2 1 ) = 0. (2.11)

    As the alert reader has already guessed, since this is a minimization problem, the FOCsconstitute the set of equations which we wish to set equal to zero. Notice that the value ofthe iterate, xv, thus represents the error function. This is a system of nonlinear equations(a square system, with two variables in two unknowns), which we may solve using theNewton-Rhapson method. More formally, we have that:

    g(x) = f(x), (2.12)

    where () is the gradient function.

    44

  • 7/29/2019 Electrcity Primer for Energy Economist

    46/83

    Applying (2.1):

    g(x1) = g(x0 + x0) g(x0) + gx

    x0x0

    to (2.12) yields:

    (f(x1)) = f(x0 + x0) fx0 + 2f(x0)x0. (2.13)Setting the last term in (2.13) equal to zero, solving for x, and generalizing to genericstep v, the Newton-Rhapson update is:

    xv = [2(f(xv)]1[f(xv)]. (2.14)Therefore, in setting up the Newton-Rhapson update, we must take the Jacobian of thesystem of first-derivatives(the Hessian of the original system). Doing so for this example,we obtain:

    2f(x0) = 0.12(x1 1)2 + 2 00 0.12(x2 3)2 + 2

    .

    A sensible initial estimate is [x0] = [2, 1], as the contribution of the second rhs terms ismuch larger than that of the first in the error functions, (2.10) and (2.11). Using thisestimate, our initial update is:

    [x0] =

    2.12 00 2.96

    1 0.04 0

    0 0.32

    =

    0.0189 00 0.1081

    ,

    and the first iterate is:

    (x0) = (1.981132, 1.108108).

    The error is then (0.000042, 0.054647). Performing another iterate yields:

    [x0] =

    2.1155 00 2.4295

    1 0.000042 0

    0 0.054647

    =

    0.00002 00 0.022493

    .

    The second iterate is thus:

    [x1] = [1.981112, 1.1306],

    with associated error [2 108, 0.000114]. We deem this close enough for our purposes.Since the OPF problem is one of constrained minimization of a nonlinear function, wemust determine how to incorporate constraints into the Newton-Rhapson method. Thoughdemonstrating this problem based on examination of the null space of the coefficient matrix,A, is quite intuitive, we will stick with the Lagrange multiplier approach since economistsare generally more familiar with it.

    45

  • 7/29/2019 Electrcity Primer for Energy Economist

    47/83

    Example 2.4: Minimization of a convex objective with linear constraints

    Let us apply the Newton-Rhapson method to minimize the objective function:

    f(x) = 0.01(x1 1)4

    + 0.01(x2 3)4

    + (x1 1)2

    + (x2 3)2

    1.8(x1 1)(x2 3)s.t. x1 x2 = 8.

    We may set up the Lagrangian as:

    L = 0.01(x11)4 +0.01(x23)4 +(x11)2 +(x23)21.8(x11)(x23)+(x1x28).

    The first-order necessary (and sufficient) conditions for a minimum are:

    Lx1

    = 0.04(x1 1)3 + 2(x1 1) 1.8(x2 3) + = 0, (2.15)

    Lx2 = 0.04(x2 3)3

    + 2(x2 3) 1.8(x1 1) = 0, (2.16)L

    = (x1 x2 1.8 ) = 0. (2.17)

    From (2.7) and (2.14), the Newton-Rhapson update is:

    xv = [2(f(xv)]1[f(xv)],xv+1 = xv + xv.

    Once again the values that the Jacobian and error term take on are determined by the initialestimates for x and , and the sequence of iterates generated therefrom. For purposes of

    illustration, let us choose [x0]

    = [5.5 2.5]. Without any intuition regarding the valuethe Lagrange multiplier will take (other than that it will be non-positive), we set 0 = 0.We may now calculate the components of the Newton-Rhapson update as:

    L(x0) = 22.54525.755

    0.000

    ,

    x01x02

    =

    0.497

    0.497

    23.852

    .

    It might seem obvious, but the addition of the Lagrangian multiplier adds a third com-ponent to the system of FONC, yielding a 3 3 Jacobian, as opposed to a 2 2 matrix.The errors: L(x1) = 0.138 0.158 0 indicate that we are in the ballpark of the

    46

  • 7/29/2019 Electrcity Primer for Energy Economist

    48/83

    solution.1

    Since the OPF problem has nonlinear constraints, as opposed to simply linear ones, wemove from the Newton-Rhapson method for solving nonlinear problems with linear restric-

    tions to solving nonlinear problems with nonlinear restrictions. Doing so is analyticallystraightforward, though the presence of nonlinear constraints is problematic because theconstraint set is no longer convex. Once a set of nonlinear restrictions is introduced, in-stead of simply searching for the minimizer of the objective function by moving aroundthe hyperplane in n-dimensional space that corresponds to the affine restrictions, we mustadjust our search by tracing out the constraint function as best we can while scoping out adescent direction for the objective function. Formally, we address a problem of the form:

    minxRn

    {f(x)|g(x) = 0}, (2.18)

    where f() : Rn Rm. The problem is non-affine, both in the n variables and the mconstraints.

    For a general physical problem, several functions may approximate the feasible set (electricenergy being an exception, since it itself operates according to well-defined mathematicalfunctions). In the case that we do have such choice, however, we will choose a functiong() that satisfies the following definition:Definition 1: Let g() : Rn Rm. We say that x is a regular point of the equalityconstraints g(x) = 0 if:

    1. g(x) = 0,2. g() is partially differentiable with continuous partial derivatives at x, and3. the m rows of the Jacobian J(x) of g() evaluated at x are linearly independent.For g() to have any regular points, it must be the case that m n, since otherwise them rows of J(x) cannot be linearly independent. Also, if g() has a regular point, then wecan find an invertible m m submatrix: g

    (x). This last observation is important, of

    course, because the Newton-Rhapson method uses the inverse of the relevant Jacobian.

    Next, we define the tangent plane to the feasible set as follows:

    Definition 2: Let g() : Rn Rm be partially differentiable and let x Rn. Further,let J() : Rn Rmn be the Jacobian of g(). Suppose that x is a regular point of theconstraints g(x) = 0. Then the tangent plane to the set S = {x Rn| g(x) = 0} at thepoint x is the set:

    T = {x Rn| J(x)(x x) = 0}.1We leave reiteration of the Newton-Rhapson method as an exercise to the reader.

    47

  • 7/29/2019 Electrcity Primer for Energy Economist

    49/83

    The tangent plane at x is the set of points such that the first-order Taylor approximationof g(x) about x is 0. The alert reader will recognize that the set T corresponds to anaffine constraint set with its Jacobian J(x) passing through the point x. A little math(Baldick (2006 Ch. 13) demonstrates that the set T is the null space of the affine system

    of constraints Ax = b.

    Therefore, if we had an affine system of constraints, we could simply scan the null spaceof A in search of the minimizer of f(x). Since this is not the case, the best we can hopefor is to move along the tangent plane T of S, evaluated at the regular point x. As wemove away from x along T, we will necessarily move out of the feasible set S. Because thetangent plane is generally a better approximation of the constraint set for small values of(x x) = x, we will keep our step sizes small to avoid straying far from S. Using thisupdate, we arrive at a new (hopefully) regular point, x, and perform another update.

    Having made the first update, however, we will have necessarily moved out of the feasibleset. This creates a certain tension in the analysis. At the next update we will at the same

    time, wish to: (1) move back toward the constraint set, S, and; 2) reduce the value of theobjective function. Focusing on the first point, we will have chosen our initial value, x0

    such that g(x0) = 0. As we have just argued, though, taking a linear approximation tothe constraint set in making our initial iterate implies that g(x1) = 0. Therefore, we willtry to make the next update, x2 bring us back to the constraint set (i.e., we will try tochoose x2 such that g(x2) = 0). Note that the Newton-Rhapson update at x1 is simplyx1 = [J(x1)]1g(x1). This update is consistent with the definition of the tangent plane,above, except that now we are no longer on the constraint set (i.e. g(x1) = 0). Moving onto the second point, we once again will set up the FONC to solve for the minimizer of theobjective function. However, since the constraint set is no longer convex, the first-orderconditions are no longer sufficient. Formally, the SOSC for a local minimizer are given by

    the following theorem:

    Theorem 1 Suppose thatf() : Rn R andg() : Rn Rm are twice partially differentiablewith continuous second partial derivatives. LetJ() : Rn Rmn be the Jacobian of g().Consider problem (2.18) and points x Rn and Rm. Suppose that:

    f(x) + J(x) = 0, (2.19)

    g(x) = 0,and (2.20)

    2f(x) +m

    =12g(x) is positive definite on the null space :

    N = {x Rn|J