
Учебники / 0841558_16EA1_federico_milano_power_system_modelling_and_scripting
.pdf
6.3 Nonlinear Programming Solvers |
147 |
where σ(i+1) (0, 1) is the centering parameter that can be evaluated as σ(i+1) = min{0.99σ(i)}, with σ(0) = 0.2.3 For the Mehrotra’s predictor step,
the barrier parameter μˆ(pi) is computed in a similar way as for the Newton’s direction-based method. Firstly, the predictor complementarity gap is computed as:
ˆ(i) = [s + αp |
sp]T (π + αp |
πp) |
(6.59) |
|
p |
P |
Q |
|
|
where αpP and αpQ are the primal and dual predictor step lengths, respectively. Then the predictor barrier parameter is given by:
μˆp(i) = min |
|
|
(i) |
||
|
|
ˆ |
|
|
ˆp(i) |
|
|
|
, 0.2 |
ˆp(i) |
(6.60) |
|
2 |
|
|
|
|
|
|
nh |
|
||
|
|
|
|
Finally, the barrier parameter following the Mehrotra’s corrector step is computed using (6.57) and (6.58).
Convergence Test
The convergence test has to satisfy primal feasibility, dual feasibility and complementarity conditions:
max{max{h(z)}, g(z) ∞} ≤ 1 |
(6.61) |
|||||
|
ϕz + ρT gz + πT hz ∞ |
≤ |
|
1 |
|
|
|
1 + z 2 + ρ 2 + π 2 |
|
||||
|
|
|
||||
|
|
ˆ |
≤ 2 |
|
||
|
|
|
|
|||
|
|
1 + z 2 |
|
where the index i is omitted for simplicity. Alternative convergence conditions are:
|
μˆ(i) ≤ μ |
|
|
|
(6.62) |
|
z(i) ∞ ≤ 2 |
|
|
|
|
||
g(z(i)) ∞ ≤ 1 |
|
|
|
|
||
Finally, a convergence test on the objective function is as follows: |
|
|||||
Δϕ(z(i)) = |
|ϕ(z(i)) − ϕ(z(i−1))| |
≤ |
|
2 |
(6.63) |
|
1 + |ϕ(z(i))| |
||||||
|
|
|
If all convergence tests are satisfied, the current point z(i) is a local minimizer of (6.41). Typical tolerances are 1 = 10−4, 2 = 10−2 1 and μ = 10−12.
3If σ(i) = 1, the first-order optimality conditions define a centering direction, i.e., a step towards a point at the barrier trajectory. If σ(i) = 0, the direction is a
pure Newton’s one.

148 |
6 Optimal Power Flow Analysis |
Script 6.1 Interior Point Method
The following Python code implement the IPM described above including both Newton’s direction method and the Mehrotra’s predictor-corrector step. As usual, the system.Device class provides the interface between the IPM algorithm and system devices as discussed in Script 3.2 of Chapter 3. The matrices system.DAE.Oz and system.DAE.Hes are ϕz and Lzz , respectively.
import system
from cvxopt.base import matrix, spmatrix, sparse, spdiag, div, mul, log from cvxopt.umfpack import solve, symbolic, numeric
from cvxopt.blas import dotu
def opf():
#setup dimensions, variables, vectors and matrices exec system.Device.setup opf
Zz = spmatrix([], [], [], (system.DAE.ng, system.DAE.ng), ’d’)
#parameters
iteration = 1
mui = system.OPF.sigma/system.DAE.nh
msg = ’Iter. = %3d, mui = %s, |dz| = %s, |g(z)| = %s, |dOF| = %s’
#initial guess of primal, dual and slack variables exec system.Device.call opfguess
exec system.Device.call obj
system.DAE.s += 1e-6 # avoid zero slack variables system.DAE.pi = div(mui, system.DAE.s)
system.DAE.rho[:system.Bus.n] = matrix(1, (system.Bus.n, 1), ’d’)
#primal dual interior-point method
while 1:
# compute g(z), h(z, s), and Jacobian and Hessian matrices exec system.Device.call opf
system.DAE.h += system.DAE.s
s = mul(system.DAE.pi, system.DAE.s) - mui
Lz = system.DAE.Oz + (system.DAE.Gz.T)*system.DAE.rho + \
(system.DAE.Hz.T)*system.DAE.pi
Hp = spdiag(div(system.DAE.pi, system.DAE.s))
# reduced system
Lr = sparse([[system.DAE.Hes + system.DAE.Hz.T*(Hp*system.DAE.Hz), \ system.DAE.Gz], [system.DAE.Gz.T, Zz]])
if iteration <= 2: F = symbolic(Lr) try:
C = numeric(Lr, F) except ValueError:
# unexpected refactorization of Langragian Jacobian matrix F = symbolic(Lr)
C = numeric(Lr, F)

6.3 Nonlinear Programming Solvers |
149 |
if system.OPF.method == ’Newton’:
Hs = spdiag(div(1.0, system.DAE.s)) |
- Hs*s), \ |
|
Dz = -matrix([Lz + |
system.DAE.Hz.T*(Hp*system.DAE.h |
|
system.DAE.g]) |
|
|
solve(Lr, C, Dz) |
|
|
Ds = -system.DAE.h |
- system.DAE.Hz*Dz[:system.DAE.nz] |
|
Dp = -Hs*s - Hp*Ds |
|
|
elif system.OPF.method |
== ’Mehrotra’: |
|
# predictor step |
|
- \ |
Dz = -matrix([Lz + |
system.DAE.Hz.T*(Hp*system.DAE.h |
|
system.DAE.pi), system.DAE.g]) |
|
|
solve(Lr, C, Dz) |
|
|
Ds = -system.DAE.h |
- system.DAE.Hz*Dz[:system.DAE.nz] |
|
Dp = -system.DAE.pi |
- Hp*Ds |
|
# centering correction
alpha P, alpha D = step length(Ds, Dp) cgap p = dotu(system.DAE.s + alpha P*Ds, \
system.DAE.pi + alpha D*Dp)
cgap = dotu(system.DAE.s, system.DAE.pi)
mui = min((cgap p/cgap)**2, 0.2)*cgap p/system.DAE.nh
s = system.DAE.pi + div(mul(Ds, Dp) - mui, system.DAE.s)
# corrector step
Dz = -matrix([Lz + system.DAE.Hz.T*(Hp*system.DAE.h - s), \
system.DAE.g])
solve(Lr, C, Dz)
Ds = -system.DAE.h - system.DAE.Hz*Dz[:system.DAE.nz] Dp = -s - Hp*Ds
# update primal and dual variables alpha P, alpha D = step length(Ds, Dp)
system.DAE.z |
+= alpha P*Dz[:system.DAE.nz] |
system.DAE.s |
+= alpha P*Ds |
system.DAE.rho |
+= alpha D*Dz[system.DAE.nz:] |
system.DAE.pi |
+= alpha D*Dp |
#objective function obj old = system.DAE.obj
exec system.Device.call obj
system.DAE.obj -= mui*sum(log(system.DAE.s + system.OPF.eps mu))
#centering parameter, complementarity gap and barrier parameter system.OPF.sigma = max(0.99*system.OPF.sigma, 0.1)
cgap = dotu(system.DAE.s, system.DAE.pi)
mui = min(abs(system.OPF.sigma*cgap/system.DAE.nh), 1.0)
#convergence tests
test1 = mui <= system.OPF.eps mu
norma2 = max(abs(Dz))

150 |
|
|
6 Optimal Power Flow Analysis |
test2 |
= |
norma2 <= |
system.OPF.eps2 |
norma3 = |
system.Settings.error = max(abs(system.DAE.g)) |
||
test3 |
= |
norma3 <= |
system.OPF.eps1 |
norma4 = |
abs(system.DAE.obj - obj old)/(1 + abs(system.DAE.obj)) |
||
test4 |
= |
norma4 <= |
system.OPF.eps2 |
print msg % (iteration, mui, norma2, norma3, norma4) |
|||
if test1 |
and test2 |
and test3 and test4: break |
iteration += 1
if iteration > system.OPF.max iter: break
def step length(Ds, Dp):
ratio1 = [1.0/system.OPF.gamma] + \
[-s/d for s, d in zip(system.DAE.s, Ds) if d < 0] ratio2 = [1.0/system.OPF.gamma] + \
[-s/d for s, d in zip(system.DAE.pi, Dp) if d < 0]
alpha P = system.OPF.gamma*min(ratio1) alpha D = system.OPF.gamma*min(ratio2)
return alpha P, alpha D
Example 6.4 Optimal Power Flow Analysis for the IEEE 14-Bus System
This example shows the results of the primal-dual nonlinear IPM applied to the IEEE 14-bus system. The demand is considered inelastic and equal to the base case while generator costs are quadratic and, in order to provide more “freedom degrees”, also synchronous compensators are assumed to be standard generators with an active power output. The cost function data and variable limits are taken from [363] and are given in Appendix D. At the local minimizer, the objective function is 8081.55 e/h. Tables 6.1, 6.2, 6.3 and 6.4 show generator active and reactive powers, bus voltages and power flow results, respectively. As expected, dual variables are positive only if a limit is binding. Transmission line limits are not imposed.
Table 6.1 Optimal power flow results for the IEEE 14-bus system: power supplies
Bus |
πpmin |
pGmin |
pG |
pGmax |
πpmin |
||||
# |
|
G |
[MW] |
[MW] |
[MW] |
G |
|||
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
1 |
|
0.0000 |
|
0.0000 |
194.3276 |
|
200.0000 |
|
0.0000 |
2 |
|
0.0000 |
|
0.0000 |
36.7192 |
|
140.0000 |
|
0.0000 |
3 |
|
0.0000 |
|
0.0000 |
28.7453 |
|
100.0000 |
|
0.0000 |
6 |
|
0.2663 |
|
0.0000 |
0.0000 |
|
100.0000 |
|
0.0000 |
8 |
|
0.0000 |
|
0.0000 |
8.4948 |
|
100.0000 |
|
0.0000 |

6.3 Nonlinear Programming Solvers |
151 |
Table 6.2 Optimal power flow results for the IEEE 14-bus system: generator reactive powers
Bus |
π |
min |
qmin |
qG |
qmax |
π |
min |
||
|
q |
G |
G |
|
|
G |
q |
G |
|
# |
|
|
[MVAr] |
[MVAr] |
[MVAr] |
|
|
||
|
|
|
|
|
|
|
|
||
1 |
0.0938 |
0.0000 |
|
0.0000 |
|
10.0000 |
0.0000 |
||
2 |
0.0000 |
−40.0000 |
|
23.6860 |
|
50.0000 |
0.0000 |
||
3 |
0.0000 |
0.0000 |
|
24.1265 |
|
40.0000 |
0.0000 |
||
6 |
0.0000 |
−6.0000 |
11.5448 |
|
24.0000 |
0.0000 |
|||
8 |
0.0000 |
−6.0000 |
8.2719 |
|
24.0000 |
0.0000 |
Table 6.3 Optimal power flow results for the IEEE 14-bus system: bus voltages
Bus |
πvmin |
vmin |
v |
vmax |
πvmin |
θ |
# |
|
[pu] |
[pu] |
[pu] |
|
[rad] |
|
|
|
|
|
||
1 |
0.0000 0.9400 |
1.0600 |
1.0600 5.8375 |
0.0000 |
||
2 |
0.0000 0.9400 |
1.0408 |
1.0600 0.0000 −0.0702 |
|||
3 |
0.0000 0.9400 |
1.0156 |
1.0600 0.0000 −0.1732 |
|||
4 |
0.0000 0.9400 |
1.0145 |
1.0600 0.0000 −0.1512 |
|||
5 |
0.0000 0.9400 |
1.0164 |
1.0600 0.0000 −0.1296 |
|||
6 |
0.0000 0.9400 |
1.0600 |
1.0600 0.5522 −0.2215 |
|||
7 |
0.0000 0.9400 |
1.0464 |
1.0600 0.0000 −0.1953 |
|||
8 |
0.0000 0.9400 |
1.0600 |
1.0600 0.7107 −0.1818 |
|||
9 |
0.0000 0.9400 |
1.0437 |
1.0600 0.0000 −0.2268 |
100.0000 0.9400 1.0391 1.0600 0.0000 −0.2309
110.0000 0.9400 1.0460 1.0600 0.0000 −0.2285
120.0000 0.9400 1.0448 1.0600 0.0000 −0.2362
130.0000 0.9400 1.03995 1.0600 0.0000 −0.2371
140.0000 0.9400 1.0239 1.0600 0.0000 −0.2491
In the OPF report, the LMP (Locational Marginal Prices) column are dual variables ρp, while the NCP column indicates Nodal Congestion Prices that are computed as follows. Using the decomposition formula for LMPs proposed in [353], one has:
NCP = g−1hˆT |
(π |
y |
max |
− |
π |
min ) |
(6.64) |
|
y |
y |
|
|
y |
|
|
ˆ
where h represents the inequality constraints as defined in (6.44), and πymax and πymin are the dual variables associated with the lower and upper limits of such inequality constraints.
Figure 6.2 shows the behavior of the convergence tests of the IPM method during the 8 iterations required to find the local minimizer with the given tolerance. The quantities used for the convergence tests are μˆ(i), z(i) ∞,g(z(i)) ∞, and Δϕ(z(i)). Each quantity is normalized with respect to the

152 6 Optimal Power Flow Analysis
Table 6.4 Optimal power flow results for the IEEE 14-bus system: bus power injections
|
Bus |
p |
q |
ρp |
ρq |
|
NCP |
|
|
|||
|
# |
[MW] |
[MVAr] |
[$/MWh] |
[$/MVArh] |
|
[$/MWh] |
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
194.3276 |
|
0.0000 |
36.7238 |
−0.0938 |
0.0000 |
|
|
|||
|
2 |
15.0192 |
|
10.9860 |
38.3596 |
0.00005 |
|
0.6220 |
|
|
||
|
3 |
−65.4547 |
|
5.1265 |
40.5749 |
0.00005 |
|
1.5524 |
|
|
||
|
4 |
−47.8000 |
|
3.9000 |
40.1902 |
0.1199 |
|
1.3823 |
|
|
||
|
5 |
−7.6000 |
−1.6000 |
39.6608 |
0.2076 |
|
1.1809 |
|
|
|||
|
6 |
−11.2000 |
|
4.0448 |
39.7337 |
0.00002 |
|
1.9533 |
|
|
||
|
7 |
0.0000 |
|
−0.0000 |
40.1715 |
0.1197 |
|
1.7654 |
|
|
||
|
8 |
8.4948 |
|
8.2719 |
40.1699 |
0.00002 |
|
1.6526 |
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
−29.5000 |
|
4.0968 |
40.1662 |
0.1961 |
|
2.0468 |
|
|
||
|
10 |
−9.0000 |
−5.8000 |
40.3178 |
0.3089 |
|
2.1032 |
|
|
|||
|
11 |
−3.5000 |
−1.8000 |
40.1554 |
0.2282 |
|
2.0627 |
|
|
|||
|
12 |
−6.1000 |
−1.6000 |
40.3791 |
0.2124 |
|
2.1386 |
|
|
|||
|
13 |
−13.5000 |
|
−5.8000 |
40.5755 |
0.3535 |
|
2.1729 |
|
|
||
|
14 |
−14.9000 |
|
−5.0000 |
41.1974 |
0.5710 |
|
2.3410 |
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fig. 6.2 Convergence behavior of IPM for the IEEE 14-bus system. The upper plot is obtained using the Newton’s direction method, the lower plot using the Mehrotra’s predictor-corrector method
value of the first iteration. As expected, the Mehrotra’s predictor-corrector method converges in less iterations than the Newton’s direction method.

6.4 Summary of IPM Parameters |
153 |
6.4Summary of IPM Parameters
This section summarizes most relevant parameters related to the interior point method.
Solver method: The methods described in this chapter are the GRG and the IPM. Of course, several other methods for nonlinear programming are available [24]. It is important to note that, since the OPF problem is non-convex,4 in general only local minima can be found. Furthermore, due to idiosyncrasies of nonlinearity, it is di cult to say a priori if a solver method performs well for a given NLP problem.
Tolerance 1: Tolerance used for checking the convergence of equalities g(z(i)). Typical value is 1 = 10−4.
Tolerance 2: Tolerance used for checking the convergence of variable increments z(i). Typical value is 2 = 10−2 1.
Tolerance μ: Threshold of the barrier parameter μˆ(i) used for defining the convergence of the IPM. Typical value is μ = 10−12.
Initial guess type: The initial guess can be obtained as a solution of a preliminary power flow analysis or as a flat start (e.g., middle value between the upper and lower limits).
Safety factor γ: The safety factor γ (0, 1) is used for estimating a good step length and ensuring the strict positivity condition. A typical value for the safety factor is 0.99995.
Maximum number of iterations: The maximum number of iterations before stopping the solver method if convergence is not reached. For IPM, a reasonable iteration limit is 50.
Method used for computing variable directions: Various methods are available for computing variable directions for the IPM. The most common is the Newton’s direction. The Mehrotra’s predictor-corrector method provides more precise directions with a negligible additional computational e ort. Higher order methods (such as composite Newton’s method) can be also used [312].
Centering parameter σ(i): The centering factor σ(i) (0, 1). The initial value of the centering factor can be fixed to σ(0) = 0.2.
4 |
ˆ |
max |
ˆ |
min |
is concave, and vice |
|
In fact, if h(z) ≤ h |
|
is convex, then −h(z) ≤ −h |
|
versa.
Chapter 7
Eigenvalue Analysis
This chapter describes various aspects of eigenvalues analysis. Section 7.1 provides the background of modal analysis using a simple one-machine infinite-bus example. Section 7.2 describes the small signal stability analysis for dynamical power systems and outlines the properties of equilibrium points, including bifurcation points commonly shown by power systems, participation factors and the Z-domain transformation. Section 7.3 describes a variety of methods for computing a reduced set of eigenvalues and introduces the singular value decomposition. Section 7.4 describes the modal analysis applied to the power flow Jacobian matrix. Finally, Section 7.5 summarizes most relevant concepts related to eigenvalue analysis.
7.1Background
Consider the one-machine infinite-bus system of Figure 7.1. Assuming that the machine dynamics are described by the classical model, system equations are as follows:
˙ |
|
|
(7.1) |
δ = Ωb(ω − ωs) |
|||
ω˙ = |
1 |
(pm − pe(δ)) |
(7.2) |
2H |
where Ωb is the synchronous frequency in rad/s, ωs is the synchronous speed (ωs = 1 pu), H is the rotor inertia constant, pm is the mechanical power, pe(δ) is the electrical power defined as:
pe = |
ev |
sin δ |
(7.3) |
|
|||
|
xeq |
|
and xeq is the equivalent series reactance composed of the internal machine reactance, of the transmission line reactance and of the Thevenin reactance of the infinite bus, i.e., xeq = xd + xL + xTh.
F. Milano: Power System Modelling and Scripting, Power Systems, pp. 155–178. springerlink.com c Springer-Verlag Berlin Heidelberg 2010

156 |
|
7 Eigenvalue Analysis |
1 |
|
0 |
xd |
xL |
xTh |
e δ |
|
v 0 |
Fig. 7.1 |
OMIB system |
|
Fig. 7.2 Equilibrium points of the OMIB system
As it is well known, for δ [0, π], the dynamical system (7.1)-(7.2) has two equilibrium points. Figure 7.2 shows these equilibrium points assuming e = v = pm = 1.0 pu and xeq = 0.5 pu.
Given the vector of state variables x = (δ, ω), the equilibrium points are:
xA = (0.5236, 1) xB = (2.6180, 1)
The most important property of an equilibrium point is whether it is stable or unstable. For the simple OMIB system, the stability of the points xA and xB can be easily determined using virtual variations, as follows.
Point xA: Assume that the system is steady-state at the equilibrium point xA and that the angle δ is perturbed by a small positive quantity, say
7.1 Background |
157 |
∂δ > 0. Then, pe(δA + ∂δ) > pm and, from (7.1), ω˙ |
< 0, which leads |
˙
to decrease ω. If ω decreases, ω < ωA = 1 and, from (7.2), δ < 0 that leads to decrease δ. In conclusion, the system responds to an increase of δ by decreasing it. Similarly, the system responds to a decrease of δ by increasing it. Hence, the point xA is a sink as it attracts the trajectories of the system that are su ciently close to it. Such point is also commonly called a stable equilibrium point.
Point xB : A specular reasoning can be done for the equilibrium point xB . Assume that the system is steady-state at the equilibrium point xB and that the angle δ is perturbed by a small positive quantity, say ∂δ > 0. Then, pe(δB + ∂δ) < pm and, from (7.1), ω˙ > 0, which leads to increase
˙
ω. If ω increases, ω > ωB = 1 and, from (7.2), δ > 0, which leads to increase δ. In conclusion, the system responds to an increase of δ by further increasing it. Similarly, the system responds to a decrease of δ by further decreasing it. Hence, the point xB is a source as it repulses the trajectories of the system that are su ciently close to it. Such point is also commonly called an unstable equilibrium point.
Unfortunately, the procedure above cannot be applied to a system with hundreds of state variables. There is thus the need of a systematic procedure that allows defining the stability of an equilibrium point. This systematic approach is the eigenvalue analysis.
Assume a continuous, nonlinear and smooth ODE system:
x˙ = f (x) |
(7.4) |
where x Rnx and f : Rnx → Rnx . An equilibrium point of (7.4) is a point x0 that satisfies f (x0) = 0. Then, the solution λ of the following system:
det(f x|0 − λInx ) = 0 |
(7.5) |
are the eigenvalues (or characteristic roots [132] or latent roots [185]) of the state matrix f x|0.
An equilibrium point (or stationary solution) x0 is called hyperbolic or non-degenerate when the state matrix f x|0 has no eigenvalue with zero real part. Otherwise the equilibrium is called non-hyperbolic or degenerate. The well-known Lyapunov’s first stability method states that the properties of the eigenvalues λ can describe the behavior of the nonlinear system (7.4) around a hyperbolic equilibrium point x0 [178]. In particular one has:
1.If {λh} < 0, h = 1, 2, . . . , nx, then the equilibrium point x0 is stable.
2.If {λh} > 0 for some h = 1, 2, . . . , nx, then the equilibrium point x0 is unstable.
If the equilibrium is non-hyperbolic, i.e., {λh} = 0 for some h = 1, 2, . . . , n, the eigenvalues are not adequate to define the properties of the equilibrium point x0 and further analysis is needed. The latter statement