Contingency Analysis of Power System Net
Contingency Analysis of Power System Net
By
© Copyright 2006
by
Mohd Hafiz bin Abdul Rauf, 2006
CERTIFICATION OF APPROVAL
by
Approved:
December 2006
HI
CERTIFICATION OF ORIGINALITY
This is to certify that I am responsible for the work submitted in this project, that the
acknowledgements, and that the original work contained herein have not been
IV
ABSTRACT
In this modern power system, planning and construction of the system with outage
minimization as a major design criterion is becoming more important. However,
even with the best possible construction and operating practices, outages still can
occur. Several techniques have been developed to analyze the status of the system
after the real outage occurs. This project presents an alternative way of conducting
power flow analysis in determining the new bus voltages and line currents during
outage occurrence. The algorithms have been accommodated in one complete
program making it an effective tool for contingency analysis. The program has been
tested on an IEEE bus test case and the remarkable results obtained in terms of its
reduced computation time and accuracy showed that this technique could be
implemented, particularly when involving practical work with a lot of calculations.
ACKNOWLEDGEMENTS
This dissertation could not have been written without Dr. Ramiah Jegatheesan who
not only served as my supervisor but also encouraged and challenged me throughout
my academic program as well as this project. He patiently guided me through the
dissertation process, never accepting less than my best efforts.
Finally, I would like to thank my mother and father, who gave me the opportunity and
the spirit to educate myself. Mom, Dad, you are the best. To all my sisters and little
brother, I hope I can serve as inspiration to all of you. If I can do it, so can you.
VI
TABLE OF CONTENTS
References ... 46
Appendices ... 47
vii
LIST OF ILLUSTRATIONS
List of Figures
vin
List of Tables
Table 5: The new voltages at each bus when a line is removed ... 37 - 38
IX
LIST OF ABBREVIATIONS
x
CHAPTER 1
INTRODUCTION
Line outages, whether it is planned or unplanned are the common issue in power
system networks. That is why planning and construction of the system with outage
minimization as a major design criterion is becoming more important and more
common. Of course, the primary requirements of a reliable power system are the
proper line construction and maintenance and proper over-current device placement
and coordination [1]. Nevertheless, even with the best possible construction and
operating practices, outages still can occur.
When a line is switched onto or off the system through the action of circuit
breakers, line currents are redistributed throughout the network and bus voltages
change. These new steady steady-state bus voltages and line currents can be
predicted quickly by what is called the contingency analysis program [6]. The large-
scale network models used for this type of evaluation, like those used for fault
calculations, do not have the be exact because the system planners and operators,
who must undertake hundreds of studies in a short time period, are more concerned
with knowing if overload levels of current and out-of-limit voltages and power flow
exist than with finding the exact values of those quantities [6].
LITERATURE REVIEW
Power system network can be characterized by two methods namely, Bus Impedance
Matrix, Zbus and Bus Admittance Matrix, Ybus, which are inverse of each other.
Practically, it is much easier to construct the bus admittance matrix, rather than bus
impedance matrix.
Bus Impedance Matrix, Zbus of a power network can be obtained by inverting the bus
admittance matrix, Ybm, which is easy to construct. However, when the order of
matrix is large, direct inversion requires more core storage and enormous computer
computation time. Therefore, inversion of Ybus is prohibited for large size network.
Zbus can be constructed by adding the network elements one after another.
Using impedance parameters, performance equations in bus frame of reference can
be written as:
7
E, Zn ~h '
7
'21 '22 ^2N h
(2)
hN Lm ZN2 7
_h_
When constructing Zb„s building algorithm, elements are added one by one.
At any stage, the added element may be a branch or a link. A branch is the added
element which will create a new bus in the network. On the other hand, by adding
link, no new bus will be created.
ifq i+q
7 =7 +7 7 =7
11° PI a 99 a
Added element/?-(/ is
a link
Zj\i —£,pj—/jqj Zli =~Zqi
i - 1, 2, ...., m i = 1, 2, ..... m
7 _ z,z,
^ij(modified) Zijfbefore modification)
Zll
Power flow analysis, also known as load flow, is an important part of power system
analysis. It serves the purpose of planning, control of existing system as well as
planning its future expansion [5]. Unlike traditional circuit analysis, a power flow
study usually uses simplified notation such as a one-line diagram and per-unit
system, and focuses on various forms of AC power (i.e. reactive, real, and apparent)
rather than voltage and current.
1) Slack bus
It also known as slack or swing bus, which will be the reference bus. In
slack bus, voltage magnitude and phase angle are specified.
There are several solutions, or methods introduced to solve for the power flow
analysis problem, namely:
1) Gauss-Seidel Method
2) Newton-Raphson Method
3) Fast Decoupled Method
2.3 Graphical User Interface (GUI)
The GUI components can be menus, toolbars, push buttons, radio buttons, list
boxes, and sliders. In MATLAB, a GUI can also display data in tabular form or as
plots, and can group related components. The following figure illustrates a simple
GUI.
This project will utilize this MATLAB's feature to make the program more
user-friendly and thus make it easier for conducting the analysis.
Surf |
1CU- ••"*"
^^^^k.
Mesh j
0-
Contour |
-10,
W---'~'-
40 ^\^ Select Data
40
20^ 20 peaks *
0 0
METHODOLOGY
In contingency analysis, the network models used do not have to be exact because
the power engineers and system operators are more interested in knowing whether or
not an insecure or vulnerable condition exists in the steady state following any of the
outages.
In many cases, linear models are considered satisfactory and the principle of
superposition is then employed. Methods of contingency analysis which used the
factored Bus Admittance Matrix (Yb,J becomes attractive from computational
viewpoint, especially if the loads can be treated as constant current injections into the
various buses of the system [6]. Hence, the concept of compensating currents is
developed, to allow the use of existing system Zbus without having to modify it
whenever a contingency occurs.
While doing symmetrical short circuit analysis, the bus impedance matrix Zbus is
employed. However, when the system is large, construction of Zbus matrix itself is
tedious. Furthermore, since Zbus matrix is always full, more computer storage is
required to store the matrix. Moreover, modification of the system such as removal
or addition of one link calls for recalculation of all the elements in Zbus matrix.
On the other hand, the bus admittance matrix Ybus can be easily obtained
even for large power system network. The main advantage of this matrix is that, it is
always sparse (having many elements of zero) and thus requires less storage
capacity. For instance, whenever an element a - b is added, only four elements 7^,
Ybb, Yab and Yba need to be modified and the other elements in the Ybus matrix remain
unaltered.
This matrix can be build by adding one element at a time. To start with, all the
elements of bus admittance matrix are assumed to be zero. Then, when a network
element of admittance ya is added between buses p and q, ONLY 4 elements of bus
admittance matrix are to be modified as below.
Even with the orientation is from bus q to /?, the result will be the same.
However, if busq happens to be reference bus,then Ypp alone getsmodified as:
When any fault occurs atpth bus, only the//* column ofthe Zbus matrix and
not the full Zbus matrix is needed. However, it is also possible to obtain the p'h
column of Zbus matrix, Z\P2 from the Ybus matrix. In fault study, the bus at which the
fault occurs (value of/?) may keep changing. Therefore, if the Ybus is factored and the
factored matrices are available, any required column of Zbus matrix can be obtained
easily.
The // column of the Zbus matrix, Z[p] can be obtained from the factor
matrices of Ybus matrix. Previously, we know already that
Thus,
z„ 2a •- ^ ••• 7 -
A yt
7 7 • 7
h v1
" Zl.' ' ^2N
.. 7 •• 7A pN
—
(8)
zu • h y.
zr
7 7 .. 7 •• 7
^Np .V y*
~v "0"
h 0
*bus ~
—
0
Jo.
Thus, by injecting 1 p.u current at bus/?and set the othercurrents to be zero (Ibus=lP)
Z12 is numerically equal to Vbm obtained from (7). The inverse form of (7)
ls,1busrVbus - I
isF 1bus-
In the subsequent chapters, we will see how the Ybus is factorized and how
the factored matrices are used to obtained the//* column ofthe Zbus.
This is the important part of the program. Once the factored matrices of Ybus matrix
are obtained, any required columnof the Zbus can be extracted easily.
D is a diagonal matrix
Z{bll is numerically equal to Vbus obtained from LDLlVbus =Ibus, for Ibus = \p.
If the fault occurs at some other bus, say k, then ZbJk) can be obtained by
solving LDL'Vbus = Ibus for Vbus taking Ibus = \k. This calculation requires only back
substitution as the factor matrices are already available. Thus, only a repeat solution
is carried out with different values for right hand side vector.
Y
"Ml Y
l2\ Y
12\ Y
J41 \y,~ ~h
Y y Y Y
J12 J22 J32 "*42 y2 h
(12)
Y
J13 Y
J23 Y
J33 Y
J43 y, h
Y
/14
Y
J24
Y
J34
Y
J44 k. j,.
The coefficient matrix Ybus can be written as the product of three matrices L, D and
10
Matrix L is a lower triangular matrix of the form
1 0 0 0
*"21 1 0 0
1 = (14)
*3. -L32 1 0
dn 0 0 0
0 d22 0 0
D = (15)
0 0 ^33 0
0 0 0 dA44
1 *- 21 '31 *41
0 1 c32 C42
L' = (16)
0 0 1 •°43
0 0 0 1
Thus, using equation (14) and (15) in equation (13), Ybus can also be written as:
d„ 0 0 0 1 £4 21 F Y Y Y
^31 '41 "Ml J21 J31 J441
11
By looking to the above equations, we can generalize the equations to obtain the
elements of the matrices. The equations are as follows:
dll=rll-fjelt2dkt (18)
k=\
j-\
^rPi-IW*)^ (19)
k=\
The elements of the factor matrices L and D can be obtained using equations (18) and
(19). For matrix of order N, the elements of factor matrices L and D are calculated in
the order:
The L and D matrices are combined into one matrix only, to reduce the computer
storage.
dn 0 0 0
£2l d22 0 0
(21)
f
/Ml fM2 fM3 d
u44
3.1.3 Solving YbmVbus = Ibus for Vbus using the factor matrices [6]
Now the problem is to solve for vector Vbus for a given value of vector Ibus using
LDL'Vbm=Ibm. (22)
V - V (23)
DV = V" (24)
In order to solve for the unknown voltage vector Vbus, the three equations above must
be solved in the order equation (25), (24) and (23).
12
For a 4 bus system, equation (25) is:
du 0 0 0
yl [7,1
Ml <M2 0 0 h
=
(26)
^33 0
M, M2 y;
M! M2 M3 *« k". j*\
The elements of V" vector are calculated using the equation below:
i-i
dn 0 0 0 y[ vl
0 ^22 0 0
=
yi (28)
0 0 d33 0
y; y,"
0 0 0 d<44 y. yt
From this above equation, it is clear that the elements of V vector are calculated
using the equation below:
1 £
Ml
£
Ml M, \y,~ y[
0 1 £ 42
M2 *- y2 yi (30)
0 0 1 M3 y, y,
0 0 0 1
[y*\ y*_
JVl
It is to be noticed that, while calculating elements of vector Vbus, from the above
equation, V, s are computed in the order of i = N, N-\, ,1
13
3.1.4 Summary of formulas
i-i
3.1.5 Calculation of the vector Z[™;n) from factors of Ybus matrix [6]
Let Z[m-n)=
bus
Z[m)-
bus
Z{hn)
bus (35)
1 0
m 1
(m-ri) (36)
0
n -1
N 0
14
In Vbus = ZbusIbus, if Ibus = l(m_n) (1 p.u current is injected at bus mand -1 p.u current
is injected at bus «), then the resultant vector will be the difference of the mih and rih
column of the Zbus, respectively.
Knowing that Ybus can be factored as LDL', we can now state that Z(™~n) can
Consider the original system with voltages Vi, V2, ..., VN due to current
injection//,/^ -, In as illustrated in figure 2 below:
15
We assume that the bus voltages Vj, Vj, ..., Vn produced in the original system by the
current injections I], h, ..., In are known. Suppose that a line of impedance za is
added between buses m and n. The current injections are fixed in value and therefore
are unaffected by the addition of line of impedance za. Let the changed bus voltages
be Vi\ V2', .... Vm', ..., Vn', ..., Vn' a shown in Figure 4 on the next page.
Figure 3 Figure 4
K
m n
v'
16
Defining
m n
we get
Hence, to determine the bus voltages V}', V2', ..., VN' we shall now apply the
Superposition Theorem. When current injections /;, h, ..., In alone are there, bus
voltages will be the same as the bus voltages in the original system (refer Figure 2)
denoted by Vbus- When current injections -Ia at bus m and Ia at bus n are alone there,
bus voltages will be equal to ZbusICOmp where
0 0
-h 1
0 0
0 0
Therefore;
17
Substituting equation (41) into (39),
zJa=AVbus-AcZbusA'Ja (42)
i.=<y.-y.vz (44)
Note that equation (42) and (45) contain Zbus, the bus impedance matrix of the
system, which is not available. Let us now see how this could be overcome.
Calculation of Z
= za+AcZ^n) (47)
Denoting m[Z^;n) ] is the mth element of Z£""} and n[Z^"n) ] is the nth element of
Z{b™~n) the above equation becomes
18
Calculation of/,,
Ia=(Vm-Vn)/Z (49)
Calculation of AV
AV=~ZbusA'Ja (50)
7(m-«) t
yL,=K.+*y (5i)
It isto be noted that for the above calculations we need only the vector Z£"H) and not
the bus impedance matrix ZbHS. We should use the above four equations (48 - 51) to
calculate Z, la, AVand Vbus.
In most cases, line outage is more common due to fault or over loading. Hence it is
more pertinent to study removal of line rather that addition of line. Accommodating
removal of line is not at all difficult. Removal of a line m - n with impedance za is
equivalent to addition of line m - n with impedance - za.
The method discussed can be extended to addition or removal of two lines. Let us
say we have a power system for which the bus voltages are V\\ V2', ..., Vn'. Two
lines of impedance za and zb are added between buses m-n and p-q respectively. It
is required to find the new bus voltages Vj', V2', ..., Vn'. The currents in the added
lines will be Ia and Ib. Then
z.I.=Vm-K<mdzbIt=Vf-V;
i.e.
19
V
v„
m n
V.
Za 0" • 0 1 0 ••• 0 -1 0 •• 0
=
0 ••••0 1 0 0 -1 0 • •• 0
F„
o p 1
V.
Vy
-AKus (52)
m
-h -1 0
P -h 0 -1
~I~
a ~L~ a
comp
0 =-4 c
(53)
1 0
h. h_
n
/.
0 0 0
q h 0 1
0 0 0
i.e.
20
Vm -Vn
+AZbuX = Avbus (56)
0 z. V -V
P M.
V -V
i.e.
V -V
p q
V -V
= Z (58)
V -V
. p 1.
It is noted that equation (57) and (60) contain Zbus, the bus impedance matrix of the
system, which is not available. Let us now show that how this problem can be
overcome.
Calculation of Z
z =
z„a 0"
+
\m~n)[Ztn)] {m-n)[Z£*i (61)
0 V (p~q)[Z(b7n)] (p-q)[Z™]
21
Calculation of
V -V
= Z (62)
V -V
p <t.
Calculation of AV
AV=-Zbll,A'c
— 7,Cm_B) 7iP-<l)
{L
= -z bus 'bus (63)
Vbus=Vbus+AV (64)
It is to be noted that for the above calculations, we need the vectors Z^ w) and
Z^^only and not the bus impedance matrix Zbus- We should use the above four
Figure 5
22
Line current from / ->j is given by
Similarly, the line current1$ measured from busy* to bus / and defined positive in the
direction/ -> / is given by
iJI=-i,+iJo=ys<yJ-y,)+yJyJ (66)
s»=y,n (67)
(68)
1
v, yt vx !
A ) ('
) C
l:a
Figure 6
y,
a
(69)
y, y< vt
a \a\
For the case where a is real, the n model as shown in the figure below
represents the admittance matrix above. In the it model, the left side corresponds to
the non-tap side and right side corresponds to the tap side of the transformers.
23
Figure 7
i '
' '
1 '
Calculate
' '
Display Results
The line data and initial bus voltages are entered in Microsoft Excel spreadsheet
format. Then, the data are imported into MATLAB workspace for further computing.
24
3.7.1 Program Modules
25
3.7.2 Creating MS Excel Data File
Before starting the analysis, the line data as well as the pre-outage voltage are to be
stored inside the MS Excel. The main purpose for this is, the user will find it much
easier to manipulate the data when they are in Excel form, since they can be changed
without having to open the MATLAB.
^.,S'dl "0:' 'tf "-2) ••"' !EEE30bui„SjSdsls,ili 'iCiiiiiiJ.ilrUilUy l.!-:'J< -Mrcicioft E*£ii
• ' Home Insert Page layout Formulas Data Review View iWd-lns
|'V"i] |j Colors ' j hi \~~~i - „_J | ^SLi GfWl*h: Automatic • ,—j Gridlinss Headings
lil^Jt [gfonts " —' "—J '—' -!=*' 1 -'-:,: ~=A £J Htijjht Automalie - •J View J View
Themes r—| Margins Qnerrtation Sue Punt Break; Background Print ., . , Custom
. . 0 Effects ' - Afea „ . Title; a} Scale:. lOOfc . Vlews Print Print
Th*ntcj r-3ae j*t'Jp r-" S«lito Fit r- Sntst Optii-rii
M9 - /< '
A" " 8 c D E F G \
12 i 8 9 0 0.208 0 0,978
13 6 10 0 0,556 0 0,969
ui 9 11 0 0,208 0 1
15! 9 10 0 0,11 0 1
22 16 17 0.0824 0,1923 0 1
23 15 18 0.1073 0,2185 0 1
24 18 19 0,0639 0,1292 0 1
25 19 20 0.034 0,068 0 1
26 10 20 0,0936 0,209 0 1
2? 10 17 0.0324 0.0845 0 1
28 10 21 0,0348 0.0749 0 1
29 10 22 0.0727 0,1499 0 1
30 21 22 0.0116 0,0236 0 1
31 15 23 0.1 0,202 0 1
32 f * \ 24 0,115 0,179 0 1
33 f 23 1 24 0,132 0.27 0 1
h " > • Edata • I k u •..;.«,!
'.. a.. :.:x:--...
Ready V^ J • ! :
" - " - - -
Figure 10: The IEEE 30 bus line data in MS Excel under "Edata" sheet
Figure 10 illustrate how the line data is written in MS Excel. The pre-outage
voltages are to be written, also under the same file name, but different sheet. Please
refer to Figure 11 below.
26
%7V'^%--^V' IEfE30bijs_j,vsdatii.p(l5 ['Lompatibtht/Med?; - Miaosoft Excel
P6 X'.""'
A D H
i*l__^:.. vJ!iC
Ready
Figure 11: The IEEE 30 bus pre-outage bus voltages under "preoutJV" sheet
The line data and the bus voltages can be exported into MATLAB by using a
single command. In order to make it more flexible, the user can choose the desired
file to conduct the analysis. This is achieved by using the command "«/ge(/*/e" in the
program. By using this function, it enablesthe user to select the appropriate data file.
The syntax for this iunction is appended in the appendix.
27
Then, by using another function "xlsread\ MATLAB will read the data in
MS Excel and stored them in the workspace in a matrix. Before the matrix can be
used for the analysis, it has to be modified slightly, as illustrated in the Figure below.
IEE E3Obus^sysdata
By using the Ybas building algorithm as discussed previously, the Ybas matrix
and its factor matrices are constructed. The construction of the matrix also takes the
half line charging admittance (HLCA) and tap setting for transformer into
consideration. Next, the user will be prompt to input which line to be removed. After
the program has obtained all the necessary data required, it will start calculating for
the new bus voltages, line currents as well as power flow in each line in the system.
The final results are then displayed for clearer view.
28
3.7.4 Error Handling
In many cases, it is desirable to take specific actions when different kinds of errors
occur. For example, the program may want to prompt the user for more input, display
extended error or warning information, or repeat a calculation using default values.
The error handling capabilities in MATLAB let the program check for particular
error conditions and execute appropriate code depending on the situation.
^ -laixj
£~2
''warndlg" displays a dialog box named 'Warning Dialog' containing the string 'This
is the default warning string.' The warning dialog box will disappears after you
press the "OK" button.
One of the main aspects upon completing this program is to determine what is the
program computation time and compare it to the existing approaches (Gauss Seidel,
Newton Raphson and Fast Decoupled). Hence, a stopwatch timer has been
implemented in this program to calculate how long it will take to complete the
calculation.
29
The speed of the computer computation is depends on the speed of the CPU
itself. If a fast computer is used, then computation time should be less. On the other
hand, if a slower computer is used, the increase in computation time is expected.
However, when we compares the computation time between these four methods
either by using a faster or slower computer, we should expect the ratio will be the
same for both computers.
3.8 Tools
These tools that are used throughoutthis project are listed below. They are consist if
hardware and software.
About MATLAB
MATLAB
ShowUcense OK
30
CHAPTER 4
The contingency analysis program has been tested on one test system, namely IEEE
30-bus Reliability Test Systems to test its practicality and reliability on real system
implementation. The IEEE 30-bus test case represents a portion of American Electric
Power System (AEP) in the Midwestern US as of December 1961. It is now being
made available to the electric utility industry as a standard case for evaluating
various analytical methods and computer programs for the solution of power system
problems [8], The one line diagram of the test case, its bus data and line data is
illustrated and appended in the Appendix B.
Before the program is run, the power flow analysis is conducted to get the
initial value of the bus voltages on each of the 30 buses. These voltages will be
stored in the MS Excel data file, and become the pre-outage bus voltages. Then, one
element of the line data is removed or in other words, it is open-circuited. Now,
instead of conducting power flow analysis again, the new bus voltages are predicted
using the contingency analysis program.
Then, the computation time for the program is determined and then compared
with the existing method available. In order to verify the results of the contingency
program, its output is compared with the output of the power flow analysis.
The program has been through series of testing of troubleshooting, to ensure the
reliability and the accuracy of the results. During one of the testing of the program
using IEEE 30 bus system, it is observed that the results are not so accurate,
compared to the power flow analysis program. At that time, the line data that are
being used are only inclusive impedance and reactance for each line in the power
31
system. However, it is noticed that they are not sufficient, and therefore the half line
charging admittance (HLCA) and the tap setting of the transformers are included in
the line data. The effects of these two added elements are discussed earlier in the
methodology section.
The Contingency Program will read the line data from MS Excel to construct
the bus admittance matrix for the networks. Once the matrix is constructed, it will
wait for further instruction. The new line data and the pre-outage bus voltages are
appended in the Table 2 and Table 3 below:
32
15 4 12 0.0000 0.2560 0.0000 0.932
33
37 27 28 0.2198 0.4153 0.0000
1 1.060 0.00
2 1.043 -5.497
3 1.022 -8.004
4 1.013 -9.662
5 1.010 -14.381
6 1.012 -11.398
7 1.003 -13.149
8 1.010 -12.115
9 1.051 -14.434
10 1.044 -16.024
11 1.082 -14.434
12 1.057 -15.303
13 1.071 -15.303
14 1.042 -16.198
15 1.038 -16.276
34
16 1.045 -15.881
17 1.039 -16.188
18 1.028 -16.882
19 1.025 -17.051
20 1.029 -16.852
21 1.032 -16.468
22 1.033 -16.454
23 1.027 -16.661
24 1.022 -16.829
25 1.019 -16.423
26 1.001 -16.840
27 1.026 -15.912
28 1.011 -12.057
29 1.006 -17.136
30 0.995 -18.014
Table 3: The initial voltages at each bus after conducting the power flow analysis
>rd
4.1.1 Removal of 33™ element (Bus 24 - Bus 25)
When the 33rd element is removed, the new bus voltages are calculated using the
Contingency Program and tabulated in the Table 5 below. After the bus voltages are
known, the power flows in each line are also calculated and the results can be
observed from Table 6.
Then, the results are compared with the results from Power Flow Analysis.
As illustrated below, both tables show the comparison between the Contingency
Analysis and the Power Flow Analysis results.
35
At the same time, the total time elapsed for the program to complete its
computation is recorded. The program is run for three times and the average time is
taken. Similarly, for the same contingency, three other programs for different
methods of power flow are run and the average computation time is taken. The
results are illustrated both in Table 4 and Figure 15.
Table 4: Comparison of the computation time (in seconds) between four (4) different methods of
power flow, including Contingency Analysis Program in table form
11
12
Average
Figure 15: Comparison of the computation time (in seconds) between four (4) different methods
of power flow, including Contingency Analysis Program whenever line 24 - 25 was removed.
Contingency Analysis program indicates remarkable results in term of its computation time
reduction.
36
From the table and graph above, it is clearly seen that Contingency Analysis
gives remarkable reduced computation time compared to the existing methods for
Power Flow Analysis. This is really useful and beneficial, when dealing with a much
larger system, since it will takes less time to complete its computation.
2 1.0333-0.0982i 1.0378-0.0983i
3 1.0103-0.1424i 1.0111-0.1406i
4 0.9969-0.170H 0.9980-0.1683i
9 1.0174-0.2635i 1.0173-0.260H
11 1.0474-0.27131 1.0473-0.2678i
13 1.0326-0.28421 1.0325-0.2806i
37
14 1.0007-0.2926i 1.0006-0.2887i
16 1.0045-0.2877i 1.0043-0.2838i
26 0.9520-0.279H 0.9583-0.2907i
38
Table 6: Comparison between Power Flow Program and Contingency Program during the
evaluation of line flows on each line whenever line 24 - 25 was removed
39
12 Ift 0.0726+ 0.0323i 0.0719 + 0.0338i -0.07 0.15
24 25 0 0 0 0
40
The percentage of deviation from the Power Flow is calculated by finding the
different between both methods and multiplies it by 100%. This can be done simply
because all the units used have been converted to per unit system (P.U.) and
100MVA is used as the system base.
Programming for integrating Graphical User Interface with the MATLAB program is
complete but it does not stop there. It will be keep improving from time to time, as
the technology changes.
lEIgEJl
CONTINGENCY ANALYSIS
PROGRAM
MAIN MENU
PROGRAM DETAILS
41
The main page of the program consists of three sections, namely HOME, LINE
OUTAGE and OVERLOAD RELIEF. Each has its own functions. To start with
the analysis, click the LINE OUTAGE button. Then, the "CONTINGENCY
ANALYSIS" section will be displayed as illustrated in the Figure 17 below.
cm^"^""1^-
^MM
CONTINGENCY ANALYSIS
PROGRAM
lineuulaye 2
MAFN MENU
Next, the data file is selected properly so that the program will read them.
The element number to be removed is entered in the box by clicking LOCATION
button. After clicking OK and CALCULATE button and the program will start
calculating the power flow in each line. Please refer Figure 18 and Figure 19.
42
^iSlxj
CONTINGENCY ANALYSIS
PROGRAM
„J=J*t
MAIN MENU
CONTINGENCY ANALYSIS
PROGRAM
MAIN MENU
43
In order to see the results, click on the View Results! button, and another
window will appear. This is actually the one - line diagram of the IEEE 30 bus
system. Consequently, by clicking Update! button within the window, the power
flow on each line in the networks can be seen clearly. The displayed results can be
removed just by clicking the Clear! button.
mmm
7r3 0.07S75+0.024281iJ^'
0.83013+0.0185741
0.76067-0.(007611 13 / ^ 0.015387+0.00751721
I u \ 15
I 0.17756+0.070107i-
1 ™4*f»*:l»;075074+0.045505i I fj O.O620D7+0.018616J
sV ' ^ r • 22
\\ 9 _4.2743e-0Q5-0.158B6i -O-'oswe-oloo^oBBi 27 I
25 -H- oU 29
\\ 0.035444+0.0235451 0.t8483+0.052742i
_ 1 _2K
—:±J
0.29808-0.037042^ \ 0.19079-0.098497i . —-^
\ -0.8051563-0.023921!
w G: Generators
C: Synchronous condensers
Cbarl I Bdfl i
44
CHAPTER 5
An alternative way of doing power flow analysis when possible line outage occurs
has been presented in this project. Methods of contingency analysis which used the
factored Bus Admittance Matrix YbUS becomes attractive from computational
viewpoint, especially if the loads can be treated as constant current injections into the
various buses of the system. Even though the program does not give results as
accurate as power flow, it is not so much important because the system planners and
operators, who must undertake hundreds of studies in a short time period, are more
concerned with knowing if overload levels of current and out-of-limit voltages and
power flow exist than with finding the exact values of those quantities.
45
REFERENCES
2. Fast automatic contingency analysis and ranking technique for power system
security assessment
Musirin, I.; Abdul Rahman, T.K.;
Research and Development, 2003. SCORED 2003. Proceedings. Student Conference
on 25-26 Aug. 2003
5. Power System Analysis by Haadi Saadat, McGraw-Hill, Inc. Second Edition 2004.
6. Power System Analysis by J.J. Grainger and W.D. Stevenson, McGraw-Hill, Inc.
International Edition 1994
7. IEEE Explore
http://ieeexplore.ieee.org/Xplore/guesthome.isp
46
APPENDICES
LIST OF APPENDICES
47
APPENDIX A - The MATLAB Code
if nargout
[varargout{1:nargout}] = gui_mainfen(gui_State, varargin{:});
else
gui_mainfcn{gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
scout = imreadf'gears640.jpg');
axes(handles.axesl);
image(scout);
axis off;
yaw_pedals = imread('qO.jpg');
axes(handles.axes3);
image(yaw_pedals);
axis off;
collective_lever = imread('qO.jpg');
axes(handles.axes4);
image(collective_lever);
axis off;
cyclic_stick = imread('qO.jpg');
axes(handles.axes5);
image(cyclic_stick);
axis off;
48
aa = imread('qO.jpg');
axes(handles.axes10);
image(aa);
axis off;
utp_logo = imread('ql.jpg');
axes(handles.axes7);
image (utp__logo) ;
axis off;
%HOME Details
function tabl_ResizeFcn(hObject, eventdata, handles)
% hObject handle to uipanell (see GCBO)
close Contgency_Analysis;
handles = guidata(Contgency_Analysis);
set(handles.tabl,'Visible','on'];
set(handles.tab2,'Visible','off');
set(handles.tab3,'Visible','off');
handles = guidata(Contgency_Analysis);
set(handles.tabl,'Visible','off);
set(handles.tab2,'Visible','on');
set(handles.tab3,'Visible','off);
handles = guidata(Contgency_Analysis);
49
% Executes on button press in VIEW DATA.
function data_Callback(hObject, eventdata, handles}
data; % call to open a new window with the one line diagram
over_relief_lineoutage__2;
data;
if nargout
[varargout{l:nargout}] = gui_mainfen(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
50
% Get default command line output from handles structure
varargout{1} = handles.output;
if ispc
set(hObject,'BackgroundColor1,'white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')) ;
end
filename = getappdata(0,'file')
if filename -= 1
msgbox('No file is selected. Please select the appropriate file','File
Not Found!','warn');
return
end
51
%get the Ybus matrix,Line Data, number of element, number of bus
[Ybus,Y,Edata_new,Nele] = get_admittance_param(Edata);
fprintf('====================================================================
fprintf(['[ Element No |' ' Frm Bus 1' ' To Bus |' ' R j' '
X |* ' hlca |' ' tap |\n'])
fprintf (' =============^=============.========================:====™===
for k = l:Nele
fprintf(' \n'), fprintf(' I %2g', k), fprintf(' | %2g',
Edata_new(k,l) )
fprintf(' | %2g', Edata_new(k,2)), fprintf(' | %1.4f',
real(Edata_new(k,3)))
fprintf(' I %1.4f', imag(Edata_new(k,3))), fprintf(' | %1.4f',
imag(Edata_new(k, 4)))
fprintf(' | %1.4f', Edata_new(k, 5)), fprintf(' I')
end
fprintf (' \n=-======™==-========-====================================-=====
Edata_x = Edata_new;
set(handles.menu,'Visible','off);
set(handles.single,'Visible','on');
set(handles.double,'Visible','off');
set(handles.sing_cont,'Visible','off);
set(handles.multi_cont,'Visible','off);
cleardata;
set(handles.menu,'Visible' , 'off' ) ;
set(handles.single,'Visible', 'off);
set(handles.double,'Visible','on');
set(handles.sing_cont,'Visible','off');
set(handles.multi_cont, 'Visible', 'off');
cleardata;
set(handles.menu,'Visible','on');
set(handles.single,'Visible','off);
set(handles.double,'Visible','off');
set(handles.sing_cont,'Visible','on1);
set(handles.multi_cont,'Visible','on');
cleardata;
52
% Executes on button press in back2.
function back2_Callback(hObject, eventdata, handles}
set(handles.menu,'Visible','on');
set(handles.single,'Visible','off);
set(handles.double,'Visible','off);
set(handles.sing_cont,'Visible','on');
set(handles.multi_cont,'Visible','on');
cleardata;
Nele = handles.Nele;
out = getappdata(0,'outs');
Nele = handles.Nele;
Ybus = handles.Ybus;
Y = handles.Y;
Edata_x = handles.Edata_new;
preout_V = handles.preout_V;
out = getappdata(0,'outs');
53
CJP Tl (D P hh P c*P
I B I I ) J ) I D I D I B I 3 ( l ) ( D ( l ) f f l l D I I I ( l O ( D ( I ) ( I l ( I l l t U ( I ) ( D l l l l l ) ( l ) l l ( D I D ( D I I I ( I I O ( t l D ( l l l D I P ( t l l l l t to O 3 n, o M O
r t r t r t r t t t r t r t t t r t c t r t t t f t r t r t r t r t r t r t r t f t r t t t r t t t r t t t c t r t f t r t r t r t r t r t - r t r t r t r t r t r t rt x a 3 hi P- p
fupi(bpipiplUOiOiiliDi(liDJfu0ip]D>D]lDplDlD0'P'O'IlilliIliQ'IliQJDifT&iDifliQ)(b0i!liQJ o P- 3 h-<
H ii <d r+ (D p- ?«• (D O
^TiT5^^^^^^^^^^Tin3^^Ti^^Tin3^^^^^'0'0'0'0'0'0'0'D'OfOhO'0'0'0 (D p rt h-1 Hi C
aaaap.aaaaaao.aaaQ.aQ.aaao.aao.ao-ao.o-o-ao.aa.ao-ao.aa c/j o P co 11 II M
Q)[l;QJ{l]p^|ljQ;Q>|llpQj|llQ;[Lljl)Qf£l)QjQ)Q!llf(l)il]Qip]Q)P]^[lipjp]Qjp)P}p[}|[ll(U[lipi rt 3 (D ?>" P
r t t t d - f t r t r t r t r l r t r t t t r t r t t t r t r t r t f t t t r t t t r t r t r t r t r t r t r t r f r t t t r t r t r t r t r t r t f t f t r t r t p- ctP W h-t dp r t O P"u< hh a Q cn h-1 H1 rt
(D c, ~ a O P (D P1 ti — — II a> (C
— jr i-h P 13 O II ii ?r W II 3 3
ooooooooooooooooooooooooooooooooooooooooo P *• - P1 < P ll ^^ -—^
HiQ rt
3 ii O II P P3 Kl o P- rt P-
Co • • —-
C P h-> a a II II c 3 cr <d
Q)Q;[U|llQ)Qj|UQ;^[ll^Q]^|^|lj(llQ;|ll[[]pQ))l]QjQIQj|llp|l]p]Q)pQip>[llpp}QfQlfll{lipi S — r 1 p> Cd c II "^ p p rt fD ^—,
* i b U U W W U U U i i l U U M M ( O M M M M M M M P H P I - l P I - 1 l - ' l J l J l - l l C i a ) - J m ( J l i I . U J M P I l(I>
l II ^-^
p a (D Pi r t rt o o Cd 13
HowtD-Jmuiit'UiMFOBro-Joiiji^iiJMMowcc-JoiuiiiiuWHo - - - - - - - - - M II rt p a P P **. <*.
a o
•.»,-.'.i»s»,,'.,,,>,>»»>»>,,»,>,>,.l]Jti|Jlj]li|jigi(jlfJl(JI;J H- m <
S
c
p- r t
3 p
K
a
p
rt
I
>;
1
a
P
rt
s
(D
p
^XiVV^VVV^XiV^V^VX)XSX)XSXiX)^V'i3'T3X)'OrO*OX)XirO O O 0 O O O 0 O O 3 P D- co <o ! rt P ,— .—^ P hi
O00OO0000O00O0000000000000000000SSSSSSSSS tr c --^
N
P
1 pr *• t
ssssssssssssssssssssssssssssssss — CD u en a O — • X X hh
,—..—,,-,^,,-,,-,.-,,-.,-,,-,,^—.^..-,,-..-, toco -j cnui .c ui to H 1
P .—. .—. C ?r .—. K) M -^ h--
^.fcljlWWWUUIWWOJWMMMMMIOIOMMMPPPI-'MPMh'HP-'---'--"-'" 0 w a * hi - ?r ^-- ^--
•• 0
P" —.. -—- >< hj Ln
W
•*. *.. ^.
- s.
•r * n- CD — (-0 M
0 — n \ 3 '• ^— — P-
J^
3 — o rt rt ->»
CD P r 3
-
-.. LJ.
•d l-h CD
O ..—. > hi p
Hi to O 0
a 3 p-
rt hh I
j_j
p- ~—• ^-^ M
(D 1—'
< co P-
>-
tr r t op c*P CtP c*> t*> dP p
hh P •d rt TJ •a •c a (D
•1^ o w cr h- P" H- H- o CD
PJ -~~
c o <C n O s; rt
PJ dp hh co x w ?f fD CD
O <K> a -—
c P c c hi hi
s o P * rt n p. Tl •o 3
P- O h-^< •o dp 3 II H-
P 3 o rt rt •d H- r t rt P
ua •a d \ ho tr p- r t P" p- O CD
h^ p- rt 3 CD n r t (D tD **
<D P p a ?r P rt
,_,
X rt T! rt ri 3 M hh 3*
cd *—'
tr p •0 O P W O CD
•o .—•
d T3 (D a rt hi
!_,
O T3 + w
£ o - w rt O tr tr rt CD
CD S < CD P- hf, c c 3" 3
hi n> tr h- rt (D co co fD iQ
hi c 3 rt rt rt
,—. Co O P- P" O P"
3 hh p. a P" CD c
< t-1 C iQ P rt
a
> o t—'
a h-* P
Hi
— S P- — H-
p- P P P (0
M iQ — |-J (D
n h-1
H-
p I P-
3
>—i tr" 3
ID
>.
o (D
>
0
p P"
3 P
a H
ua
h3 H-
> p
fD iQ
% Executes on button press in viewdata_l.
function viewdata_l_Callback(hObject, eventdata, handles)
data;
Nele = handles.Nele;
outl = getappdata(0,'outl');
out2 = getappdata(0, rout2');
Nele = handles.Nele;
Ybus = handles.Ybus;
Y = handles.Y;
Edata_x = handles.Edata_new;
preout_V = handles.preout_V;
outl = getappdata(0,'outl');
out2 = getappdata(0,'out2');
[L,U] = lu(Ybus);
j = diag(U);
L;
U = diag(j);
outage1 = Edata_x(out1, :) ;
m = outagel(1);
n = outagel (2);
z2 = outagel(3);
outage2 = Edata_x(out2,:);
p = outage2 (1);
q = outage2(2);
z3 - outage2(3);
V = find_voltage(m,n,Y,L,U);
VI = find_voltage(m,n,Y,L,U);
Z = [z2 0; 0 z3] ;
Zadd = [V(m)-V(n) Vl(m)-Vl(n); V(p)-V(q) VI(p)-VI(q)];;
Z = Z+Zadd;
55
for i = 1:30;
x(i,:)=abs(Vbusnew(i)),
y(i,:)=angle(Vbusnew(i[ *180/pi;
ind (i, :) = i;
end
oopa = [ind x y]
%Edata_x(out,:) = [];
nline = length(Edata_x(:,1));
for k = 1:nline
if (k =- outl)|(k == out2)
S(k) = 0;
J(k) = 0;
else
d = Edata_x(k,l);
f = Edata_x(k,2);
yt = 1/Edata_x(k,3);
hlca = Edata_x(k,4);
tap = Edata_x(k,5);
Idf = [(X(d)*yt/taprt2)-(X(f)*yt/tap)]+[X(d)*hlca; ^including HLCA
and TAP setting
S(k, :) = [X(d *conj(Idf)];
J(k,:) - [abs S(k) )];
number(k,1) = k;
end
end
power = [number S J];
pow = power(:,2);
56
setappdatafO, 'a33',pow(33;
setappdata(0, 'a34',pow(34:
setappdata(0, ra35',pow(35:
setappdata(0, 'a36',pow(36;
setappdata(0, 'a37',pow(371
setappdata(0, 'a38',pow(38]
setappdata(0, 'a39',pow(39]
setappdata(0, 'a40',pow(40;
setappdata(0, 'a41',pow(4i;
data;
Other functions
function V = diff_2column(p,q,Y_2,L,U)
for d=l:Y_2
Ibus(d) = 0;
end
Ibus(p) = 1;
Ibus(q) = -1;
Ibus = transpose(Ibus);
for s=l:Y_2
sum = 0;
for t = l:s-l
sum = L(s,t) * V(t) + sum;
end
V(s) = Ibus(s) - sum;
end
for s = 1:Y_2
V(s) = V(s)/U(s,s);
end
for s = Y_2:-l:l
d - s+1;
summ = 0;
if d > Y_2
summ = 0;
else
for t = d:Y_2
summ = L(t,s) * V(t) + summ;
end
end
V(s) = V(s) - summ;
end
V = transpose(V);
57
APPENDIX B - IEEE 30 Bus One Line Diagram
G: Generators
C: Synchronous condensers
FIGURE 6.16
30-bus IEEE sample system.
58
*zs
m
p
o u .^
Q) (0 CO , ,
-n o
£3
£
S3
O O O o o o o o en
tH
o o O O o o O O o CD o o o •
o o o o o o
<r
M
X
85 o o O o o o o o o <r • o sr o o o o O o o o o o o o o o o o o
M S m •r V CM CM
O c3
4J
83 rt o o O o o o o o o <o o o *o o o o o o o o o o o o o o o o o o
^^
H •H <j* <? •rt 1 1
1-1 aj s i i 1
CD a o
•=
ii o o o o o o o o o o o
O o u
a. 65 o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
3 u K
>
rt •H o o o o o o o o o o o
u 3 o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
u S •<*•
s aj
•H
U U
US o V- <M ID o o 01 o o o o IT) o *£} m CO CO Ol T r- CM o UJ ["- o CO o o at en
id TS o cm tH tH en o o o o CM o V- o •rt CM iH m o CO o tH o tH ID o CM o o o •rt
o CO tH rt tH CO iH
•H o
S-i -3 CM
aj 1 o o T \D CM o CO • o CO o >
CM CM m o CM to CM Lfl CM l> m * <a
1 |3 r- •rt o ,
1
•
I 1 s o • CM r- * o CM o o m o •rt (D CO CO m co CJl CM r- o CO CO o co o o CM o
m M co •rt tH
CM
H QJ
w HI cu
H -H u
(n & tn o o O o o o o o o o o
s- d m
Oi «s a o o O o o o o o o o o a o O o o o o o O o o O o o o o o o o
E- «Li
a. m ("ft
w 03 CO CM •rt
H 0 rt CO
a o o o o O o o o o o o o o
ca O <d
& !> R3 •rt •rt tH tH tH 1-1 tH tH T-t 1-1 •rt •rt •<-i •rt •rt tH rt •rt tH •rt iH tH tH •H tH rt tH tH tH •rt
i tb
o m •c
co pi o
m u tH CM o o CM o o CM o o CM a CM o o o o o o o o o O o o o o o o o
W
w «
ki ^ o
H P3 a tH CM co * m <£» r> CO en o •rt CM CO *r LO tD E^ CO CTl o iH CM CO *r m (D r~ CO en o
iH •rt tH T-t tH tH tH •rt tH •rt CM CM CM CM CM CM CM CM CM CM o
11
as
4J
115
73
tn
3
5.1' *v- s'l» J3
APPENDIX D - MATLAB Functions syntax
uigetfile
Syntax
uigetfile
uigetfile('FilterSpec')
uigetfile('FilterSpec','DialogTitle')
uigetfile('FilterSpec','DialogTitle','DefaultNarae')
uigetfile(...,'Location',[x y])
uigetfile(...,'MultiSelect',selectmode)
[FileName,PathName] = uigetfile(...)
[FileName,PathName,Filterlndex] = uigetfile(...)
\Is read
Syntax
nura = xlsread(filename)
nura = xlsreadffilename, -1)
nura = xlsreadffilename, sheet)
num = xlsread(filename, 'range')
num = xlsreadffilename, sheet, 'range')
num = xlsreadffilename, sheet, 'range', 'basic')
num = xlsreadffilename, ..., functionhandle)
[num, txt] = xlsreadffilename, ...)
[num, txt, raw] = xlsreadffilename, ...)
[num, txt, raw, X] = xlsreadffilename, ..., functionhandle)
xlsread filename sheet range basic
warndlg
Syntax
warndlg
warndlg('warningstring')
warndlg('warningstring', 'dlgname')
h = warndlgf'warnstring','dlgname', createmode)
h = warndlg(...)
tic, toe
Synopsis
tic
any statements
toe
t = toe
60