Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Учебники / 0841558_16EA1_federico_milano_power_system_modelling_and_scripting

.pdf
Скачиваний:
72
Добавлен:
08.06.2015
Размер:
6.72 Mб
Скачать

66

4 Power Flow Analysis

artificial problem. Determining the bus voltage profile based on bus power injections (positive or negative) is the correct approach only if one knows power injections. Actually, when scheduling the power productions based on forecasted load demand, generator powers and voltage are not known. On the other hand, during normal operations, bus voltages magnitudes as well as power injections can be measured. However, the power flow problem is the starting point for a variety of important further analysis such as, for example, those discussed in the following chapters of this part. For this reason, the solution of power flow problem is a crucial step in power system analysis.

4.2Taxonomy of Power Flow Problems

The origins of the formulation of the power flow problem and the solution based on the Newton’s method date back to the late sixties [310]. Since then, a huge variety of studies have been presented about the solution of the power flow problem, addressing starting initial guess [296], computational e ciency [54, 97, 176, 275, 297, 299, 324], ill-conditioned cases and robustness [27, 29, 94, 149, 150, 270, 304, 315, 317], multiple solutions [135, 221], and unsolvable cases [219, 220].

It is relevant to classify the power flow problems into the following categories:

1.Well-conditioned case. The power flow solution exists and is reachable using a flat initial guess (e.g., all load voltage magnitudes equal to 1 and all bus voltage angles equal to 0) and a standard Newton’s method. This case is the most common situation.

2.Ill-conditioned case. The solution of the power flow problem does exist, but standard solvers fail to get this solution starting from a flat initial guess. This situation is due to the fact that the region of attraction of the power flow solution is narrow or far from the initial guess. In this case, the failure of standard power flow procedure is due to the instability of the numerical method, not of the power flow equations. Robust power flow methods have proved to be e cacious for solving ill-conditioned cases.

3.Bifurcation point. The solution of the power flow exists but it is either a saddle-node bifurcation or a limit-induced bifurcation [39].

a.Saddle-node bifurcations are associated with the maximum loading condition of a system. The solution cannot be obtained using standard or robust power flow methods, since the power flow Jacobian matrix is singular at the solution point.

b.Limited-induced bifurcations are associated with a physical limit of the system, such as the shortage of generator reactive power. Although limit-induced bifurcation can in some cases lead to the voltage collapse of the system, the solution point is typically a well-conditioned case and does not show convergence issues.

4.3 Classical Power Flow Equations

67

Several continuation techniques [5, 39] and optimal power flow problems [36, 112, 148] have been proposed for determining bifurcation points (for additional references see also Chapters 5). These methods allow defining the distance between the present power flow solution and the bifurcation points and thus are useful for assessing the voltage stability of the system [39]. However, encountering a case study whose solution is exactly a bifurcation point is quite uncommon in practice.

4.Unsolvable case. The solution of the power flow problem does not exist. Typically, the issue is that the loading level of the network is too high. As in the case of the bifurcation points, a continuation method or an optimal power flow problem allow defining the maximum loading level that the system can supply. An alternative method to analyze unsolvable cases is given in [219, 220]. As shown in [219], robust power flow methods provide a solution close to the feasibility boundary rather than diverge.

The continuation power flow analysis discussed in Chapter 5 provides a general and powerful approach to both assess bifurcation points and handle unsolvable cases. Thus, this chapter only focuses on solvable and ill-conditioned cases.

4.3Classical Power Flow Equations

As discussed in the previous section, there is no particular reason (but historical ones) for reducing the power flow model to power flows in transmission lines, constant PQ loads and constant PV or slack generators. Generally speaking, the power flow problem consists in finding the zero of a set of nonlinear equations starting from an adequate initial guess. Thus, the most general form of the power flow equations is a set of DAE in steady-state, as follows:

0 = f (x, y)

(4.7)

0 = g(x, y)

where di erential equations f model dynamic devices such as, for example, under load tap changers,6 and algebraic equations g define the power balance at network buses.

However, in general, most dynamic devices are initialized after solving the power flow problem (e.g., synchronous machines and regulators).7 Thus, the most common formulation of the power flow equations is reduced to the algebraic part of (4.7):

0 = g(y)

(4.8)

6A discussion about regulating transformers is given in Subsection 11.2.2 of Chapter 11.

7Subsection 9.1.1 of Chapter 7 discusses in detail this topic.

68

4 Power Flow Analysis

Equations (4.8) can be written in several ways. However, the classical formulation of power flow equations, which is intuitively introduced in Section 4.1, is as follows. The vector of currents injected at each node is:

¯ ¯

(4.9)

i = Y v¯

which leads to write (4.8) as the complex power injections at buses:

s¯

¯ ¯

¯ ¯

v¯

(4.10)

= V i

= V Y

¯

 

 

is the number of network buses. In

where V = diag(¯v1, v¯2, . . . , v¯nb ) and nb

tensorial form, (4.10) becomes:

 

 

 

s¯

¯

 

(4.11)

h

= v¯hih = v¯h

y¯hkv¯k , h B

 

 

kB

 

 

where B = {1, 2, . . . , nb} and y¯hk

is the element (h, k) of the admittance

¯

 

 

 

 

matrix Y . From (4.11), one obtains:

 

 

 

 

 

 

s¯h = ph + jqh = v¯h

(ghk − jbhkvk , h B

(4.12)

kB

where y¯hk = ghk + jbhk.

In (4.12), ph and qh are neat power injections at the bus h. If at the same bus there is both a PV generator and a PQ load, then the bus is considered a PV whose power injection ph is defined as the di erence of generator and

load powers connected to that bus:

 

ph = pG − pL

(4.13)

The reactive power generated by the PV can be computed only after solving the power flow as

qG = qh + qL

(4.14)

Similar considerations can be done if a PQ load is connected at the same bus as a slack generator.

The product of voltage phasors can be written in polar form as:

v¯hv¯k = vheh vk e−jθk = vhvk ej(θh −θk )

 

(4.15)

Thus, using (4.15), (4.12) becomes:

 

 

 

 

h B

 

ph = vh

vk (ghk cos θhk + bhk sin θhk),

(4.16)

 

kB

 

 

qh = vh vk (ghk sin θhk − bhk cos θhk),

h B

 

kB

4.3 Classical Power Flow Equations

69

where θhk = θh − θk . In the classical power flow formulation, the variables are voltage amplitudes and phases at load buses, reactive powers and voltage phases at generator PV buses and active and reactive power at the slack bus [310]. A synoptic summary of variables and data for each bus type is shown in Table 4.1.

Table 4.1 Variables and parameters for each bus type in the classical power flow problem formulation

Bus type

Variables

Data

 

 

 

 

 

 

Slack generator

p, q

v, θ

PV generator

q, θ

p, v

PQ load

v, θ

p, q

 

 

 

Alternatively, the product of voltage phasors in (4.12) can be written in rectangular form as:

v¯hv¯k = (vd,h + jvq,h)(vd,k − jvq,k )

(4.17)

Thus, using (4.17), (4.12) becomes:

ph = [vd,h(ghk vd,k − bhk vq,k ) + vq,h(ghk vq,k + bhkvd,k)], h B (4.18)

kB

qh = [vq,h(ghk vd,k − bhk vq,k ) − vd,h(ghk vq,k + bhkvd,k)], h B

kB

In (4.18), bus voltage magnitudes of PV generators do not appears explicitly. Thus, it is necessary to add a set of equations for imposing such voltage magnitudes:

0 = vd,h2 + vq,h2 − vh,2 PV, h BPV

(4.19)

where BPV is the set of PV generator buses and vh,PV is the desired PV generator voltage. As for the slack generator, (4.19) is not necessary since at the slack generator imposes both the magnitude and the phase angle of the bus voltage. For example, if θslack = 0, one has:

0 = vd,slack − vslack,

0 = vq,slack

(4.20)

From the mathematical viewpoint, equations (4.16) and equations (4.18)- (4.20) are equivalent. From the computational viewpoint, the polar form involves the relatively costly sine and cosine functions while the rectangular form needs the additional equations (4.19). Both formulations show advantages and drawbacks. In some cases, as it is discussed later in the chapter, the solution method drives the choice of the polar or of the rectangular form.

70

4 Power Flow Analysis

Both (4.16) and (4.18)-(4.20) are nonlinear and have no analytical explicit solution. Not even the simple loss-less system (4.5) can be solved by hand. Actually, the analytical solution of the power flow problem can be found only for a loss-less two-bus system. Thus, one has to use a numerical iterative technique for solving the power flow problem.

4.4Power Flow Solvers

4.4.1Jacobi and Gauss-Seidel’s Method

The Jacobi’s and Gauss-Seidel’s methods are iterative techniques for solving a set of linear equations in the form:

Ay = b

(4.21)

Especially the Gauss-Seidel’s method has been widely used in the last decades for solving the power flow problem since it do not require factorizing the matrix A. Nowadays, computational constraints are less binding and other methods are preferred. However, both Jacobi’s and Gauss-Seidel’s methods still have a didactic value.

Decomposing A in a diagonal component D and a remainder R,

A = D + R

where:

 

0 a22

·· ·· ··

 

0

 

 

a11

0

 

 

0

D =

.. .. . . . ..

 

. .

 

 

.

 

0

0

 

a

nn

 

 

 

 

· · ·

 

 

 

 

 

 

 

Thus, (4.21) can be rewritten as:

 

 

a21

0 ··

·· ··

a2n

 

 

0

a12

 

 

a1n

 

, R =

.. .. . . .

..

 

a

. .

 

 

.

 

 

n1

a

n2

 

 

0

 

 

 

 

· · ·

 

 

 

 

 

 

 

 

 

 

(4.22)

(4.23)

Dy = b − Ry

(4.24)

The Jacobi’s method consists in solving iteratively the left-end side of (4.24) using the current values of the elements of the vector y in the right-end side:

 

 

 

y(i+1) = D1(b − Ry(i))

(4.25)

or, in tensorial form:

 

 

 

 

 

 

(i+1)

(i)

1

 

n

(i)

 

 

 

 

yh

= yh

+

 

(bh

ahkyk ), h = 1, 2, . . . , n

(4.26)

ahh

k=1

 

 

 

 

 

 

 

4.4 Power Flow Solvers

71

The Gauss-Seidel’s method is very similar to the Jacobi’s one. In this case, A is decomposed in a lower triangular component L and a strictly upper triangular one U ,

 

 

 

 

 

 

 

A = L + U

 

 

 

 

 

 

where:

a21

a22 ··

·· ··

 

0

 

 

0

0

·· ·· ··

a2n

 

a11

0

 

 

 

0

 

 

 

0 a12

 

a1n

 

L =

.. .. . . .

 

..

, U =

.. .. . . .

..

a

. .

 

 

 

.

 

 

. .

 

.

 

 

n1

a

n2

 

 

a

nn

 

0

0

 

0

 

 

 

· · ·

 

 

 

 

 

 

· · ·

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Thus, (4.21) can be rewritten as:

(4.27)

(4.28)

Ly = b − U y

(4.29)

The Gauss-Seidel’s method consists in solving iteratively the left-end side of (4.29) using the current values of the elements of the vector y in the right-end side:

 

 

 

y(i+1) = L1(b − U y(i))

(4.30)

or, in tensorial form:

 

 

 

 

 

(i+1)

1

n

(i)

h−1

(i+1)

 

 

yh

=

 

(bh

ahk yk

ahk yk

), h = 1, 2, . . . , n

(4.31)

ahh

 

 

 

=h+1

 

k=1

 

 

 

 

 

 

k

 

 

 

 

 

Both methods stop if the maximum equation mismatch:

 

 

 

 

max{|Ay(i+1) − b|} <

(4.32)

or the maximum variable variation:

max{|y(i+1) − y(i)|} <

(4.33)

where is a given tolerance, or the number of iterations is greater than a given limit imax. The main di erences between the Jacobi’s method and the Gauss-Seidel’s one are twofold:

1.In the Gauss-Seidel’s method, each variable yh(i+1) is updated using the previously updated variables yk(i+1), for all k < h. This allows accelerating the convergence of the algorithm. This is why the Gauss-Seidel’s method is more used than the Jacobi’s one for solving the power flow problem.

2.The previous point yields another relevant di erence. Since the Gauss-

Seidel’s method uses updated variables yk(i+1) with k < h for computing yh(i+1), (4.30) cannot be computed using vectorial operations, but has to be necessarily implemented element by element in a for-loop. On the other

72

4 Power Flow Analysis

hand, (4.25) can be implemented using vectors. This di erence is clearly not relevant if using programming languages such as C or FORTRAN. However, in case of using scripting languages, such as Matlab and Python, for-loops are always less e cient than vector algebra. The rationale for this di erence in performance is the following. In scripting languages, forloops implies working on arrays element by element, which is generally not very e cient. On the other hand, vector algebra internally calls e cient C-based routines (e.g., BLAS library), which generally leads to reduce the computing time.

Thus, the choice of the method depends in some measure on the programming language. For system languages, the Gauss-Seidel’s method is the best option. For scripting languages, The Jacobi’s method can lead to save time in case the time spent in solving extra iterations (with respect to the Gauss-Seidel’s method) is compensated by the time saved using vectorial code.

Equation (4.21) is linear, thus is not directly applicable to power flow equations. However, from (4.11), one can write:

 

 

 

 

 

 

 

v¯

= s¯

/v¯

 

 

 

 

 

 

 

 

(4.34)

 

 

 

 

 

 

 

y¯

,

 

 

 

h

B

 

 

 

 

 

 

 

 

hk

k

 

h

 

h

 

 

 

 

 

 

 

 

 

 

 

 

kB

 

 

 

 

 

 

 

 

 

 

 

 

 

 

or, in vectorial form:

 

 

 

¯

 

¯

 

]

 

 

s¯

 

 

 

 

(4.35)

 

 

 

 

 

 

 

 

1

 

 

 

 

 

 

 

 

 

 

 

Y v¯

= [V

 

 

 

 

 

 

 

where

 

¯

, v¯2

, . . . , v¯nb ). Imposing

 

 

 

 

¯

= v¯ and b =

 

V = diag(¯v1

 

A = Y , y

¯

]

1

s¯ , the Jacobi’s and Gauss-Seidel’s methods can be straightforwardly

[V

 

implemented.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The convergence criterion generally used for the power flow problem is:

 

 

 

max

 

 

s¯

 

v¯

 

Y

 

v¯

,(i+1)

 

<

(4.36)

 

 

 

 

 

{|

(i+1)

 

(i+1)

¯

 

 

|}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

which is generally referred to as power mismatch. In common practice, equation (4.36) is split into its real and imaginary components. This convergence criterion is generally preferred to (4.32) due to its direct physical meaning. For example, = 0.001 means a 0.1% power mismatch that, on a 100 MVA base, corresponds to a 0.1 MVA.

According to the classical power flow model, there are only two kinds of devices that update variables v¯, namely PQ loads and PV generators, as follows.

PQ loads: The ith iteration of the Jacobi’s method is:

v¯h

= v¯h

+ y¯hh

v¯ ,h(i)

− y¯hkv¯k

(i+1)

(i)

1

 

s¯

 

(i)

 

 

 

 

h

kB

 

, h B

(4.37)

4.4Power Flow Solvers

The ith iteration of the Gauss-Seidel’s method is:

v¯h

= y¯hh

v¯ ,h(i)

− y¯hk v¯k

− y¯hkv¯k

(i+1)

1

 

s¯

 

(i)

 

(i+1)

 

 

 

h

 

 

 

 

 

 

k>h

 

k<h

 

73

, h B, k B

(4.38) PV generator : Equations (4.37) and (4.38) hold also for PV generators for the Jacobi’s and Gauss-Seidel’s method, respectively. However, since reactive power injections are not known at PV generator buses, s¯h is estimated as follows:

s¯(i)

(i)

 

,(i)

 

h

= ph + j {v¯h

y¯hkv¯k }, h B

(4.39)

 

kB

Equations (4.37) and (4.38) provide both the new magnitude and the new phase of voltage v¯h(i+1). Since the PV generator imposes the voltage magnitude, only the voltage angle has to be updated.

Script 4.1 Jacobi’s and Gauss-Seidel’s Methods

The following code fragments implement (4.37) and (4.38) in Python language. It is assumed that these methods are part of a class that implements the PQ load.

from cvxopt.base import matrix, spdiag, mul, div, log, exp from cvxopt.blas import dotu # scalar product

import cmath

def gauss(self, dae, line, pinj, qinj):

for item in range(self.n): a = self.a[item]

v = self.v[item]

vy = mul(dae.y[line.v], exp(dae.y[line.a]*1j)) vl = vy[a]

k1 = dotu(matrix(line.Y[a, :]), vy)

k3 = (pinj[a] + qinj[a]*1j)/vl

vl += (k3.conjugate() - k1)/line.Y[a, a] dae.y[v] = abs(vl)

dae.y[a] = cmath.log(vl/abs(vl)).imag

def jacobi(self, dae, line, pinj, qinj):

vl = mul(dae.y[self.v] + 0j, exp(dae.y[self.a]*1j)) vy = mul(dae.y[line.v] + 0j, exp(dae.y[line.a]*1j)) k1 = div(pinj[self.a] + qinj[self.a]*1j, vl)

u = matrix(1, (self.n, 1), ’z’)

y = mul(spdiag(u), line.Y[self.a, self.a])*u vl += div(k1.H.T - line.Y[self.a, :]*vy, y) mod = abs(vl)

ang = log(div(vl, mod))

74

4 Power Flow Analysis

dae.y[self.v] = mod

dae.y[self.a] = ang.imag()

In the code above, self.a and self.v represent the PQ bus voltage angle and magnitude indexes, respectively, of the algebraic variable vector dae.y. Other variable names are self-explicative. For example, line.Y is the admittance

¯

matrix Y defined as a sparse matrix cvxopt.base.spmatrix. The statement k1.H.T means the transpose of the Hermitian (e.g., conjugate transpose) of k1 and thus yields the transpose of k1 (see also Appendix A). As discussed above, the Jacobi’s iteration does not need a for-loop, while the Gauss-Seidel’s iteration does. Thus, it has to be expected that the Jacobi’s iteration is executed faster than the Gauss-Seidel’s one, especially for large networks with several PQ loads (see Example 4.3).

4.4.2Newton’s Method

The Newton’s method (also known as Newton-Raphson’s or Newton-Fourier’s method) for solving the power flow problem is described in many books and papers (e.g., [310]). It is nowadays the most commonly used algorithm for solving the power flow problem (along with the fast decoupled power flow). However, in the seventies it was considered very computationally expensive due to the need of computing and factorizing the Jacobian matrix at each iteration.

The i-th iteration of the classical Newton’s method for (4.8) is as follows:

y(i)

= [gy(i)]1g(i)

(4.40)

y(i+1)

= y(i) + y(i)

 

where g(i) = g(y(i)), g(yi) = gy (y(i)), and gy = Ty g is the Jacobian matrix of the power flow equations. The geometrical interpretation of the Newton’s method is well-known. For the actual value y(i), one computes the tangent of g(i) as:

τ (y) = g(i) + gy(i)(y − y(i))

(4.41)

Then imposing τ (y) = 0 yields the value y(i+1) defined in (4.40). Figure 4.3.a illustrates the Newton’s method for a scalar function g(y).

The algorithm ends if the maximum equation mismatch or variable increment satisfies:

max{|g|} < , or max{| y|} <

(4.42)

or if the number of iterations is greater than a given limit imax. In the latter case, the algorithm has likely failed to converge.

4.4 Power Flow Solvers

75

g(y)

g(y)

gy

gy

gy

y

y

(b)

(a)

g(y)

g(y)

gy

gy

y

y

gy

gy

(c)

(d)

Fig. 4.3 Geometrical interpretation of the Newton’s method for a scalar function g(y). (a) well-conditioned case, (b) unsolvable case, (c) and (d) ill-conditioned cases

Script 4.2 Newton’s method

The following Python code implements a basic Newton’s routine.

import system

from cvxopt.base import matrix, spmatrix, sparse, div from cvxopt.umfpack import symbolic, numeric, solve from cvxopt.blas import dotu

F = None

def calcInc():

global F

exec system.Device.call pf A = sparse(system.DAE.Gy) inc = matrix(system.DAE.g)