0% found this document useful (0 votes)
76 views33 pages

RK20 Power Flow Sparse

The document discusses sparse matrices in the context of power flow calculations. It defines a sparse matrix as one with a high proportion of zero elements. Most large matrices arising in engineering applications, including those used in power systems, are sparse. Examples given are the Ybus matrix and Jacobian matrix used in power flow calculations. The sparsity of these matrices increases as the system size grows. IEEE test power systems of varying sizes are presented to illustrate this concept visually.

Uploaded by

john smith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views33 pages

RK20 Power Flow Sparse

The document discusses sparse matrices in the context of power flow calculations. It defines a sparse matrix as one with a high proportion of zero elements. Most large matrices arising in engineering applications, including those used in power systems, are sparse. Examples given are the Ybus matrix and Jacobian matrix used in power flow calculations. The sparsity of these matrices increases as the system size grows. IEEE test power systems of varying sizes are presented to illustrate this concept visually.

Uploaded by

john smith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Lecture 20 Power Engineering - Egill Benedikt Hreinsson 1

Sparse Matrices in Power Flow


Calculations
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 2

Sparse Matrices?

Any matrix that has a high proportion of its


elements equal to zero is a sparse matrix.

•Most large matrices that arise


in engineering applications are
sparse.
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 3

The Sparsity of a Matrix - A definition

A sparse matrix: A matrix, where most of the elements


are zero, but a few are different from zero

A full matrix: A matrix, where all the elements are non-


zero

The sparsity = Number of elements =0


⋅ 100 %
of a matrix Total number of elements
Why and What Are Sparse Matrices in
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 4

Power Systems?
• Matrices in power systems are often very large and very sparse!
• A large matrix: is for instance of dimension 100x100,
1000x1000 or 10000x10000!
• A sparse matrix: A matrix where, for instance, 99% of the
elements are zero, but 1% are different from zero.
• Examples of these matrices are the Ybus matrix and the Jacobi-
matrix, which both are used in power flow calculations.
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 5

Ybus Matrix Composition


• The diagonal elements of the Ybus
We review the rule for matrix consist of the sum of the (series and
building the Ybus matrix: shunt) admittances connected to the bus in
question
⎡ y11 y12 y1n ⎤ • These elements are always
⎢y y ⎥ present!
y1n ⎥ • The off-diagonal elements of the Ybus
Ybus = ⎢ 21 22
matrix consist of the negative value of the
⎢ ⎥ series admittances connecting the 2 buses
⎢ ⎥ in question. These elements will be zero
when no direct connection is between
⎣ y n1 y n 2 ynn ⎦
buses. (The Ybus matrix is very sparse!)
• These elements are present
only when there is a link (a line
γ ik or transformer)
yik = yik e
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 6

The Sparsity of a Matrix: Example 1:


An example: Assume, in an electrical power system, each bus is on the
average connected to 1.5 other buses. Further assume that we have a 100 bus
system. We get a 100 by 100 matrix with 100 · 100 elements.

With the above assumption in the Ybus matrix there are 100 diagonal elements ≠ 0 and
150 elements above the diagonal and 150 elements below the diagonal ≠ 0. The
sparsity of this matrix will therefore be:

100 ⋅ 100 − 150 − 150 − 100


Sparsity = 100 ⋅ 100
Sparsity = 96,0 %
We can say that the matrix is 4% full.
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 7

The Sparsity of a Matrix: Example 2:

Similarly for a 1000 bus system we get a matrix with 1000 · 1000 elements. We
have for the same assumption of how each bus is interconnected for the Ybus matrix 1000
diagonal elements ≠ 0 and 1500 elements above the diagonal and 1500 elements
below the diagonal ≠ 0. The sparsity of this matrix will be:

1000 ⋅1000 − 1500 − 1500 − 1000


Sparsity = 1000 ⋅1000
Sparsity = 99, 6%

We can perhaps say that the matrix is 0,4% full.


Lecture 20 Power Engineering - Egill Benedikt Hreinsson 8

The Sparsity of the Jacobi-Matrix


The J1 sub-matrix : The J3 sub-matrix
∂Pi n
∂Qi
= − ∑ Vi Vk yik ⋅ sin (δ i − δ k − γ ik ) Vi V j yij ⋅ cos (δ i − δ j − γ ij )
n

∂δ i k =1, k ≠ i ∂δ i
= ∑
j =1, j ≠ i

∂Pi ∂Qi
= Vi Vk yik ⋅ sin (δ i − δ k − γ ik ) i≠k = − Vi Vk yik ⋅ cos (δ i − δ k − γ ik ) k ≠i
∂δ k ∂δ k

The J2 sub-matrix : The J4 sub-matrix :


∂Pi ∂Qi
= 2 Vi yii ⋅ cos ( −γ ii ) + ∑ V j yij ⋅ cos (δ i − δ j − γ ij ) = 2 Vi yii ⋅ sin ( −γ ii ) + ∑ V j yij ⋅ sin (δ i − δ j − γ ij )
n n

∂ Vi j =1, j ≠ i ∂ Vi j =1, j ≠ i

∂Pi ∂Qi
= Vi yik ⋅ cos (δ i − δ k − γ ik ) k ≠i = Vi yik ⋅ sin (δ i − δ k − γ ik )
∂ Vk k ≠i
∂ Vk

The elements of Ybus are also in the Jacobi matrices


Conclusion: If Ybus is a sparse matrix, the Jacobi matrix is also sparse
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 9

Random Sparse Matrices


A Random Sparse Matrix

Sparse matrices can


be of different nature
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 10

IEEE TEST systems


• IEEE test systems are standardized power systems to test
research theories in power system analysis
• We will look at different sparse Ybus matrices for different
IEEE test systems along with their one-line diagram:
– 14 bus
– 30 bus
– 57 bus
– 118 bus
– 300 bus
• These test systems can be found at:
– http://www.ee.washington.edu/research/pstca/
– (http://www.pserc.cornell.edu/matpower/)
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 11

IEEE 14 BUS
TEST CASE
0

10

150 5 10 15
nz = 54
Use the SPY function in Matlab
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 12

IEEE 30 BUS TEST


CASE
5

10

15

20

25

30

0 5 10 15 20 25 30
nz = 112

Use the “SPY” function in Matlab to obtain the graphical


representation of the sparse matrix
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 13
IEEE 57 BUS TEST
CASE
0

10

20

30

40

50

0 10 20 30 40 50
nz = 213

Use the SPY function in Matlab


Sparsity 93%
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 14

IEEE 118 bus test system


0

20 (Ybus)
40

60

80

100

0 20 40 60 80 100
nz = 476
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 15

IEEE 300 bus test system

0
(Ybus)
50

100

150

200

See details for the one-line 250

diagrams for the 300 bus system


on the following slides 300
0 50 100 150 200 250 300
nz = 1118
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 16

300 bus IEEE test system (1) one line diagram


Lecture 20 Power Engineering - Egill Benedikt Hreinsson 17

300 bus IEEE test


system (2)
one line diagram
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 18

300 bus IEEE test system (3) one line diagram


Lecture 20 Power Engineering - Egill Benedikt Hreinsson 19
Sparsity structure of a 108 bus Icelandic
system Ybus matrix
0

10

20

30

40

50

60

70

80

90

100

0 10 20 30 40 50 60 70 80 90 100
nz = 346
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 20
Solutions to the power system problem with
sparse matrices
• For large systems (and power systems are
large) we need to exploit the sparsity of the
system matrices
• Therefore solutions to power flow problem with Newton’s method
involves solution to a set of linear equations rather than direct
inversion of matrices
• We use Gauss elimination as a standard set of solving large
linear systems of equations where we exploit simultaneously the
sparsity structure of the system matrix (Jacobi)
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 21
Sparse Matrices and Solutions to Sets of Linear
Equations in Power Systems
⎡ a1,1 a1,2 a1, n ⎤ ⎡ x1 ⎤ ⎡ b1 ⎤
⎢a a2,2 ⎥
a2, n ⎥ ⎢ x2 ⎥ ⎢b2 ⎥
⎢ 2,1 ⋅⎢ ⎥ = ⎢ ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢⎣ an ,1 an ,2 an , n ⎥⎦ ⎢⎣ xn ⎥⎦ ⎢⎣bn ⎥⎦

To solve: Find a vector of


unknown x-es. Other quantities
are known or the a-s and b-s are
known
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 22

Matrix Notation in Linear Equations

A⋅x = b
⎡ a1,1 a1,2 a1,n ⎤ ⎡ x1 ⎤ ⎡ b1 ⎤
⎢a a2,n ⎥⎥ ⎢x ⎥ ⎢b ⎥
⎢ 2,1 a2,2
A= x = ⎢ 2⎥ b = ⎢ 2⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢⎣ an ,1 an ,2 an ,n ⎥⎦ ⎣ xn ⎦ ⎣ bn ⎦

A is a known matrix
x is a vector with unknown
variables. b is a known vector.
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 23
Solution methods for linear equations based on
numerical analysis
Direct methods

Gaussian elimination
Gauss-Jordan elimination
LU factorization
Cholesky factorization

Iterative methods

Jacobi iterations
Gauss-Seidel iteration
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 24

Solutions to a Set of Linear Equations


• If we can transform the matrix to a triangular form,
it is possible to solve the equations
• “Elementary Operations” can be carried out
without changing the solution
• Examples of “Elementary Operation”:
– Multiply rows (equations) with a constant
– Add rows (equations) to each other
• This is the Gauss elimination method
Solutions to Linear Equations in Power Systems. A
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 25

Special Case (triangular form)


Assume for a moment that a matrix has the
special triangular form case -- The matrix, A is
triangular with all zeros below the diagonal:

⎡a1,1 a1, 2 a1,n ⎤ ⎡ x1 ⎤ ⎡ b1 ⎤


⎢0 a2 , 2 ⎥
a2 , n ⎥ ⎢ x ⎥ ⎢b ⎥
⎢ ⋅⎢ 2⎥ = ⎢ 2⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎣0 0 an , n ⎦ ⎣ xn ⎦ ⎣bn ⎦

Solution method: Back substitution


Lecture 20 Power Engineering - Egill Benedikt Hreinsson 26

Back Substitution
⎡ a1,1 a1,2 a1, n ⎤ ⎡ x1 ⎤ ⎡ b1 ⎤
⎢0 a2, n ⎥⎥ ⎢ x2 ⎥ ⎢b2 ⎥
⎢ a2,2 an − 2,n − 2 xn − 2 + an − 2,n −1 xn −1 + an − 2,n xn = bn − 2
⋅⎢ ⎥ = ⎢ ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ bn − 2 − an − 2,n xn − an − 2,n −1 xn −1
⎢⎣ 0 0 an , n ⎥⎦ ⎢⎣ xn ⎥⎦ ⎢⎣bn ⎥⎦ xn − 2 =
an − 2 , n − 2
The 3rd line from
an ,n xn = bn The last line n the end

xn =
bn bk − ∑a
j = k +1
k, j xj
an , n The second last line xk =
ak , k
an −1,n −1 xn −1 + an −1,n xn = bn −1
b1 − a1, 2 x2 − a1,3 x3 − … − a1,n xn
bn −1 − an −1,n xn x1 =
xn −1 = a1,1
an −1,n −1
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 27

Solution method
• How do we get any matrix to a triangular form?
• Transform the matrix by Gauss elimination to a lower
triangular form matrix
• Solve such a matrix by back substitution

• We have already checked out back


substitution. Let us look at Gauss
elimination!!
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 28

st
Gaussian Elimination (1 step)
The original matrix: ⎡ a1,1 a1,2 a1,3 a1, n ⎤
⎢a a2,2 a2,3 a2, n ⎥⎥
⎢ 2,1
⎢ a3,1 a3,2 a3,3 ⎥
⎢ ⎥
Multiply the 1st row a2,1 ⎢ ⎥
with a2,1/a1,1 and ⎢ an ,1 an , n ⎥⎥⎦
a1,1 ⎢⎣ an ,2 an ,3
subtract from the 2nd row
⎡ a1,1 a1,2 a1,3 a1, n ⎤
⎢ a2,1 a2,1 a2,1 ⎥
Multiply the 1st row ⎢0 a2,2 − ⋅ a1,2 a2,3 − ⋅ a1,3 a2, n − ⋅ a1, n ⎥
⎢ a1,1 a1,1 a1,1 ⎥
with a3,1/a1,1 and ⎢ ⎥
⎢ a3,1 a3,1 a ⎥
subtract from the 3rd row ⎢0 a3,2 −
a1,1
⋅ a1,2 a3,3 −
a1,1
⋅ a1,3 a3, n − 3,1 ⋅ a1, n ⎥
a1,1
⎢ ⎥
⎢ ⎥
⎢ ⎥
Multiply the 1st row ⎢0 ⋅ a1, n ⎥⎥
an ,1 an ,1 an ,1
⎢ an ,2 − ⋅ a1,2 an ,3 − ⋅ a1,3 an , n −
with an,1/a1,1 and ⎣⎢
a1,1 a1,1 a1,1 ⎥⎦
subtract from the last row
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 29

Gaussian Elimination (2nd step)

⎛ a1,1 a1,2 a1,3 a1, n ⎞


⎜ (1) (1) (1) ⎟
⎜ 0 a 2,2 a 2,3 a2, n ⎟
The matrix after the ⎜ ⎟
1st step: ⎜ ⎟
⎜ 0 an −1, n ⎟
(1) (1) (1)
a n −1,2 a n −1,3
The 1st column ⎜⎜ 0 a (1)
a (1) (1) ⎟
an , n ⎟⎠
is with zeros ⎝ n ,2 n ,3

except at the top row


Lecture 20 Power Engineering - Egill Benedikt Hreinsson 30

nd
Gaussian Elimination (2 step)
The matrix after the 1st step:
⎡ a1,2 a1,2 a1,3 a1, n ⎤
Now the 2nd row plays the same role⎢ ⎢ 0
(1)
a2,2 (1)
a2,3 a2,(1)n ⎥

⎢ ⎥
as the 1st row before: ⎢
⎢ 0 an(1)−1,2 an(1)−1,3 an(1)−1, n ⎥

⎢ 0 an(1),2 an(1),3 an(1), n ⎥⎥⎦
⎢⎣
Multiply the 2nd row
with a3(1, 2)
(1) ⎛ a1,1 a1,2 a1,3 a1, n ⎞
a 2, 2 ⎜ (1) (1) ⎟
⎜ 0 a2,2 a2,3 a2,(1)n ⎟
and subtract from ⎜ (1) (1) ⎟
a3,2 a3,2
the 3rd row ⎜ 0 0 a (1)
− ⋅ a2,3
(1) (1) ⎟
a3, n − (1) ⋅ a2, n
(1)

⎜ ⎟
3,3 (1)
a 2,2 a2,2
⎜ ⎟
Multiply(1the 2 nd row ⎜ ⎟
⎜ an(1),2 an(1),2 (1) ⎟
an , )2
with (1) ⎜ 0 0 a (1)
− ⋅ a2,3
(1)
an , n − (1) ⋅ a2, n ⎟
(1)

⎜ ⎟
n ,3 (1)
a a2,2
a2 , 2 ⎝ 2,2

and subtract from
the last row
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 31

rd
Gaussian Elimination (3 step)

The matrix after the


2nd step:
The 1st column with ⎛ a1,2 a1,2 a1,3 a1, n ⎞
⎜ (1) ⎟
zeros except at the top ⎜ 0
(1)
a2,2 (1)
a2,3 a2, n ⎟
⎜ ⎟
⎜ ⎟
⎜ 0 an(2)−1,3 an −1, n ⎟
(2)
0
The 2nd column with ⎜⎜ 0 0 an(2),3 an(2), n ⎟⎟⎠

zeros, except in the
2 top rows
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 32
Gauss-Elimination Transforms the Matrix to the
Following Form :
⎛ 1 a12′ a1′n ⎞ ⎡ x1 ⎤ ⎡b1′ ⎤
⎜ ⎟⎢ ⎥ ⎢ ′⎥
U⋅x = G ⎜0 1 ′
a2 n ⎟ ⎢ x2 ⎥ ⎢b2 ⎥
=
⎜ ⎟⎢ ⎥ ⎢ ⎥
⎜⎜ ⎟⎟ ⎢ ⎥ ⎢ ⎥
⎝0 0 1 ⎠ ⎢⎣ xn ⎥⎦ ⎢⎣bn′ ⎥⎦
This matrix is U or an “upper” or “unit upper”
triangular matrix. The elements are calculated with
iteration, where each step is an “elementary operation”. It
is possible to solve the equation with a simple “back
substitution”. It is found by dividing each row with the
diagonal element
Lecture 20 Power Engineering - Egill Benedikt Hreinsson 33

Gaussian Elimination

• After n-1 steps the matrix has


become triangular!
• Computer time grows fast with the matrix size
(increasing n)
• Computer time grows in proportion to n3, if the
matrix is not sparse
• We can obtain a “1” on the diagonal by dividing by
the diagonal element in each step

You might also like