Download as pdf or txt
Download as pdf or txt
You are on page 1of 58

Using MatNetFlow

© Graham Rogers 2000 to 2008 All rights reserved


Contents
1 INTRODUCTION ................................................................................................................................ 3

2 THE NET_C CLASS OBJECT........................................................................................................... 4


2.1 EXAMPLE ........................................................................................................................................ 4
2.2 EXAMINING THE NETWORK ............................................................................................................. 6
3 PERFORMING POWER FLOW ANALYSIS .................................................................................. 9
3.1 EXAMPLE ...................................................................................................................................... 10
3.1.1 Power flow solution with user specified solution options..................................................... 12
3.1.2 Power Flow of a larger case ................................................................................................ 13
3.2 SYSTEM WITH UPFC ..................................................................................................................... 18
3.3 SYSTEM WITH A TWO TERMINAL LINE COMMUTATED HVDC LINK.............................................. 20
3.4 INDUCTION MACHINES .................................................................................................................. 23
3.5 VOLTAGE STABILITY ..................................................................................................................... 27
3.5.1 Examples............................................................................................................................... 28
3.5.2 A larger case......................................................................................................................... 32
3.5.3 The effect of induction motor loads ...................................................................................... 36
4 VIEWING RESULTS ........................................................................................................................ 47
4.1 EXAMPLES ..................................................................................................................................... 47
4.1.1 Comparing voltage magnitude for different cases................................................................ 47
4.1.2 Plotting Line Loss................................................................................................................. 48
5 MATLAB FUNCTIONS IN THE MATNETFLOW DIRECTORY.............................................. 51
5.1 COM_INDEX ................................................................................................................................... 51
5.1.1 Example ................................................................................................................................ 51
5.2 INDUCTION MACHINE FUNCTIONS ................................................................................................. 53
5.2.1 dbcage................................................................................................................................... 53
5.2.2 dbar ...................................................................................................................................... 54
5.2.3 zdc......................................................................................................................................... 54
5.2.4 zdb ........................................................................................................................................ 55
5.2.5 zsc ......................................................................................................................................... 56
6 APPENDIX 1 ...................................................................................................................................... 57
6.1 THE BUS SPECIFICATION MATRIX ................................................................................................... 57
6.2 THE LINE SPECIFICATION MATRIX .................................................................................................. 57
6.3 INDUCTION MACHINE DATA SPECIFICATION MATRICES .................................................................. 58

© Graham Rogers 2000 to 2008 All rights reserved


3 Introduction

1 Introduction
MatNetFlow is a MATLAB tool box for power system steady state power flow analysis. It consists of a
collection of MATLAB m-files which perform power flow analysis in the MATLAB environment.

The code uses MATLAB classes extensively. This results in efficient and flexible code, and which, for the
experienced user, enables extensions to the code to be made to meet specific analysis requirements. The
main class is net_c. A net_c class object contains all variables and data necessary to initialize an ac system
power flow.

Data for the power system's transmission system, loads, generation and controls are used to contruct a
net_c class object. Once this has been constructed, functions which operate on objects of the net_c class
may be used to perform power flow analysis, and examine the system's steady state performance. Data may
be converted into a form suitable for the construction of a net_c class object from the following power flow
data sources:
Power System Toolbox version 2 - bus and line specification matrices
PTI PSS/E version 26 raw data format
IEEE Common Load Flow format 1

The function rdpstv2 is used to convert the specification matrices bus and line to a data structure S, which
is in the required form for input to the net_c class constructor function. The function rdpti26 is used to
convert the raw data to the data structure S 2. The function rdcomf2 converts data in the IEEE Common
Format to the MatNetFlow data structure S.
ASCII Data

Form data input


Structure

Construct
network class
net_c
n us
Examine
network

Power Flow
Save Solution
netflow
ns

Modify network

nmod

Power Flow
Solution
netflow
n mods

Figure 1 MatNetFlow Flow Char

1
IEEE Working Group Paper, 'Common Format for Exchange of Solved Load Flow Data', IEEE PES
Summer Meeting, San Francisco, July 1972
2
See The Network Class for more information about the input data structure

© Graham Rogers 2000 to 2008 All rights reserved


4 net_c

2 The net_c class object


A net_c class object n, is constructed using the net_c constructor function, with the data structure S as
input. Thus

S = rdpstv2; or S=rdpti26('datafilename'); or S=rdcomf2;


n = net_c(S);

will produce a net_c class object (n) from Power System Toolbox v2 bus and line specification matrices,
PTI raw data format, or IEEE Common format respectively.

2.1 Example
The bus and line specification matrices 3 for the two-area system shown in Figure 2 are

bus = [...
1 1.03 18.5 7.00 1.61 0.00 0.00 0.00 0.00 1 5.0 -1.0 22.0 1.1 .9;
2 1.01 8.80 7.00 1.76 0.00 0.00 0.00 0.00 2 5.0 -1.0 22.0 1.1 .9;
3 1.0 -6.1 0.00 0.00 0.00 0.00 0.00 3.00 2 0.0 0.0 230.0 1.5 .5;
4 0.95 -10 0.00 0.00 9.76 1.00 0.00 0.00 3 0.0 0.0 115.0 1.05 .95;
10 1.0103 12.1 0.00 0.00 0.00 0.00 0.00 0.00 3 0.0 0.0 230.0 1.5 .5;
11 1.03 -6.8 7.16 1.49 0.00 0.00 0.00 0.00 2 5.0 -1.0 22.0 1.1 .9;
12 1.01 -16.9 7.00 1.39 0.00 0.00 0.00 0.00 2 5.0 -1.0 22.0 1.1 .9;
13 1.0 -31.8 0.00 0.00 0.00 0.00 0.00 5.00 2 0.0 0.0 230.0 1.5 .5;
14 0.95 -35 0.00 0.00 17.65 1.00 0.00 0.00 3 0.0 0.0 115.0 1.05 .95;
20 0.9876 2.1 0.00 0.00 0.00 0.00 0.00 0.00 3 0.0 0.0 230.0 1.5 .5;
101 1.00 -19.3 0.00 1.09 0.00 0.00 0.00 0.00 3 2.0 0.0 500.0 1.5 .5;
110 1.0125 -13.4 0.00 0.00 0.00 0.00 0.00 0.00 3 0.0 0.0 230.0 1.5 .5;
120 0.9938 -23.6 0.00 0.00 0.00 0.00 0.00 0.00 3 0.0 0.0 230.0 1.5 .5
];

line = [...
1 10 0.0 0.0167 0.00 1.0 0. 0. 0. 0.;
2 20 0.0 0.0167 0.00 1.0 0. 0. 0. 0.;
3 4 0.0 0.005 0.00 1.0 0. 1.2 0.8 0.02;
3 20 0.001 0.0100 0.0175 1.0 0. 0. 0. 0.;
3 101 0.011 0.110 0.1925 1.0 0. 0. 0. 0.;
3 101 0.011 0.110 0.1925 1.0 0. 0. 0. 0.;
10 20 0.0025 0.025 0.0437 1.0 0. 0. 0. 0.;
11 110 0.0 0.0167 0.0 1.0 0. 0. 0. 0.;
12 120 0.0 0.0167 0.0 1.0 0. 0. 0. 0.;
13 101 0.011 0.11 0.1925 1.0 0. 0. 0. 0.;
13 101 0.011 0.11 0.1925 1.0 0. 0. 0. 0.;
13 14 0.0 0.005 0.00 1.0 0. 1.2 0.8 0.02;
13 120 0.001 0.01 0.0175 1.0 0. 0. 0. 0.;
110 120 0.0025 0.025 0.0437 1.0 0. 0. 0. 0.;
];

3
See Appendix 1 for the bus and line specification matrix formats

© Graham Rogers 2000 to 2008 All rights reserved


5 net_c

G1 G3

1 11

10
110
3 101 13

20 120
2 4 14 12

G2 G4

Figure 2 Two area system

The bus and line data specification matrices are contained in the file d2a_sb.m in the MatNetRd directory.

The data structure S for this system is


S =

Header1: 'd2a_sb'
Header2: 'base'
BasMva: 100
Bus: [1x1 struct]
Load: [1x1 struct]
Gen: [1x1 struct]
Line: [1x1 struct]
Tran: [1x1 struct]
Areas: []
Zone: []
DC2: []
Shunt: []
TTab: []
Atd: []
MTDC: []
FACTS: []
IND: []
MSLG: []
Owner: []

Since the system is relatively simple, a number of the fields of S are empty. Only the non-empty fields are
used in the construction of the net_c class object n. The net_c object is formed by calling the net_c class
constructor

n=net_c(S)

n =

ans =

bus_c: [1x1 bus_c]


line_c: [1x1 line_c]
tran_c: [1x1 tran_c]
area_c: [1x1 area_c]
zone_n: [1x1 zone_n]

© Graham Rogers 2000 to 2008 All rights reserved


6 net_c

facts: [1x1 facts]


dcline: [1x1 dcline]
Header1: 'd2a_sb'
Header2: 'base'
TieLineIndex: [0x1 double]
TieFromIndex: [0x1 double]
TieToIndex: [0x1 double]
net_idx: [1x1 struct]

Note: Classes are initialized as empty if the corresponding data structure of S is empty. In an empty
class object, all the object’s data fields are empty.

The fields of the object n, contain all the information necessary to perform power flow analysis on the two
area system. The fields bus_c, line_c, tran_c, area_c , zone_n and facts dcline are parent classes of the
net_c class. The network bus class has four parent classes, gen_c, load_c , shunt_c and imac Objects of
these classes contain the data for the network's generators, loads, and switched shunts and induction
machines respectively. The dcline class contains two converter class objects, one for the dc line’s rectifiers
and the other for the inverters. The structure net_idx contains a number of calculated indexes which are
used in the network power flow solution and other network functions to make their action as completely
vectorized as possible.

2.2 Examining the Network


Once the network object has been constructed, the network data may be examined. For example, the bus
voltage magnitude is stored in the VoltMag field of the network's bus_c parent class and may be accessed
at the MATLAB control line via the class subsref function. Thus, the voltage magnitude at a single bus may
be viewed in the command window using

n.bus_c.VoltMag(5)
ans =
0.99589

The index (5) indicates the 5th entry of the VoltMag vector. To find the bus number, which may not be 5,
use
n.bus_c.BusNum(5)
ans =

10

To find the bus index corresponding to a bus number use


full(n.bus_c.Index(10))
ans =

The Index field is a sparse vector of length equal to the maximum bus number. It is non-zero (equal to the
bus index) at positions equal to the bus number.

© Graham Rogers 2000 to 2008 All rights reserved


7 net_c

To plot a bar chart of bus voltage magnitude use

bar(n.bus_c.VoltMag)
title('bus voltage magnitude for two area system')
xlabel('internal bus number')
ylabel('voltage magnitude PU')

Figure 3 Bus voltage magnitude two area system

The connection between the internal bus number and the bus numbers shown in Figure 2 may be obtained
using

[n.bus_c.BusNum (1:n.bus_c.NumBus)']
ans =
1 1
2 2
3 3
4 4
10 5
11 6
12 7
13 8
14 9
20 10
101 11
110 12
120 13

© Graham Rogers 2000 to 2008 All rights reserved


8 net_c

The maximum bus voltage and the internal bus number at which it occurs is given using

[maxv,maxvi]=max(n.bus_c.VoltMag)
maxv =
1.01
maxvi =
1
The minimum voltage and its bus index are obtained using

[minv,minvi]=min(n.bus_c.VoltMag)

minv =
0.97048
minvi =
9

More detailed information about any bus may be obtained using the function lfreport. This function is a
net_c class function and may be found in the @net_c directory - a subdirectory of MatNetFlow. the
function lfreport gives the bus data, connected generator, load, shunt and induction machine data,
connected line and transformer data, active FACTS data, and active HVDC links associated with a
specified bus number.

To examine bus number 13

lfreport(n,13)
Load Flow Report
d2asb
base
Solved Bus Data
Bus# Voltage(pu) Ang(degrees) BusG(MVa) BusB(MVa)

13 0.9799 -34.2450 0.0000 500.0000

Solved Line Data: P MW and Q MVA


From Bus To Bus FromP FromQ ToP ToQ Losses

13 101 198.5825 -17.9890 -203.1855 -9.2220 4.6030


13 101 198.5825 -17.9890 -203.1855 -9.2220 4.6030
13 14 -1765.0305 -265.9007 1765.0305 99.9831 0.0000
13 120 1367.8994 -178.2658 -1387.7221 -18.2708 19.8227

Solved Transformer Data


From Bus To Bus Cont Bus Tap Phase

13 14 14 1.0000 0.0000

Active power mismatch (MW)-0.034003


Reactive power mismatch (MVa) 0.081701
ans =
Load Flow Report
d2asb
base

It can be seen that bus 13 is connected to four lines, one of which is a transformer.

The high active and reactive power injection mismatches at bus 13, indicate that the input data
does not represent a solved power flow, despite the headings in the report.

© Graham Rogers 2000 to 2008 All rights reserved


9 power flow

3 Performing Power Flow analysis


Power flow analysis may be performed on a net_c class object by using the net_c class function netflow.
The netflow function uses a full Newton-Raphson iterative scheme to solve the power flow anlalysis
problem. This can be briefly stated as finding system state variables which give as small a mismatch as
possible for the active and reactive power injection into each system bus, while satisfying constraints
imposed on the system by the system's controls.

For a net_c class object, the mismatch between the active and reactive power injections and the contraints
is obtained using the net_c class function mismatch. The jacobian of the mismatch vector with respect to
the system's state variables is obtained using the net_c class function fulljac. The state variables are

bus voltage angles (n.bus_c.VoltAngr)


bus voltage magnitudes (n.bus_c.VoltMag)
swing bus active power generation
controlling generator reactive power
controlling switched shunt reactive power
controlling transformer taps or phase
power of generators controlling interarea transfer
shunt and series FACTS controls

At each iteration of the Newton-Raphson solution, the required changes to the states are given by

dx = -acc*Jac\y;

where dx is the change in state, acc is an acceleration factor, Jac is the sparse jacobian matrix , and y is the
mismatch (or residual) vector.

Following the update of the states, range limits are imposed on the voltage magnitude, on generator
reactive power, on switched shunt suceptance and on transformer tap and phase positions. The limits on the
generator reactive power and switched shunt suceptance may be overridden by the user. If the system has
any HVDC lines or induction machine loads, the dc control states, and the induction motor states are
recalculated based on the updated voltages. Both devices are treated as constant loads at each iteration.

Iterations are continued until the maximum mismatch is less than the solution tolerance(default 1e-4), or
the maximum number of oscillations is reached(default 15). During this initial set of iterations the switched
shunt susceptances and transformer tap positions, or phases are treated as continuous variables. If the initial
set of iterations converges, the discrete switched shunts and the transformer taps (or phases for phase
shifting transformers) are set to valid values close to the value calculated in the Newton-Raphson iterative
process in such a way that the control value is maintained within the defined range. The taps, phases and
shunt suceptances are then fixed at these values and a second Newton-Raphson iterative process is initiated.
When this converges, the power flow analysis is completed. Because the shunt values may be limited, in
many cases to a single switched shunt, a number of iterations may be required before the second Newton-
Raphson solution converges.

© Graham Rogers 2000 to 2008 All rights reserved


10 power flow

3.1 Example

For the two-area system a solved net_c class object, ns, may be obtained from the net_c object constructed
from the data specification matrices using

ns=netflow(n);
number of controlling generators 4
iteration number 0
maximum power error at bus 120 is 0.001483 PU
reactive power error at bus 12 is 0.4896 PU
number of controlling generators 4
number of generator controlled buses 4
number of controlling shunts 0
number of controlling transformers 2
iteration number 1
maximum power error at bus 13 is 4.8539e-005 PU
reactive power error at bus 13 is 7.3156e-006 PU
number of Newton-Raphson iterations 1
reset transformer taps to valid tap positions
reset discrete shunts
iteration number 0
maximum power error at bus 13 is 0.11103 PU
reactive power error at bus 13 is 1.2318 PU
number of controlling generators 4
number of generator controlled buses 4
number of controlling shunts 0
number of controlling transformers 0
iteration number 1
maximum power error at bus 14 is 0.0021844 PU
reactive power error at bus 14 is 0.0093696 PU
number of controlling generators 4
number of generator controlled buses 4
number of controlling shunts 0
number of controlling transformers 0
iteration number 2
maximum power error at bus 14 is 9.177e-006 PU
reactive power error at bus 14 is 4.0941e-006 PU
number of Newton-Raphson iterations 2
load flow d2asb
converged in 3 iterations
area reset
transformer Freeze, shunt Mode reset
Elapsed time is 0.697335 seconds.

The record of the solution process, as displayed, by default, in the MATLAB command window, is shown
above.

The power flow converged in a total of 3 iterations, taking 0.697335 s, on a PENTIUM IV, 2.2 MHz
computer. The initial Newton-Raphson iteration process converged in 1 iterations. Following this, the
transformer taps were altered to valid set points ,and a further 2 iterations were required to complete the
power flow solution. In this case, the default solution tolerance (1e-4), and the default maximum number of
iterations (15) were used. The transformer Freeze and switched shunt Mode fields are reset to their original
values after the second Newton Raphson iteration set.

The net_c field Header2 may be changed to indicate that the case has been solved using
ns.Header2 = 'solved ';

This statement invokes the net_c class susbsassgn function.

The net_c class object ns contains all the data and system conditions associated with the solved case. It may
be stored as a MATLAB mat file to archive the result of the analysis.

© Graham Rogers 2000 to 2008 All rights reserved


11 power flow

Details of the solved case at bus 13 may be displayed using


lfreport(ns,13);
Load Flow Report
d2asb
solved
Solved Bus Data
Bus# Voltage(pu) Ang(degrees) BusG(MVa) BusB(MVa)

13 0.9806 -34.2051 0.0000 500.0000

Solved Line Data: P MW and Q MVA


From Bus To Bus FromP FromQ ToP ToQ Losses

13 101 198.5761 -18.0235 -203.1723 -9.0956 4.5963


13 101 198.5761 -18.0235 -203.1723 -9.0956 4.5963
13 14 -1764.9991 -263.5419 1764.9991 99.9996 0.0000
13 120 1367.8474 -181.1725 -1387.6507 -15.1686 19.8033

Solved Transformer Data


From Bus To Bus Cont Bus Tap Phase

13 14 14 0.9938 0.0000

Active power mismatch (MW)-0.00047491


Reactive power mismatch (MVa) -6.1212e-005

The voltage magnitudes and angles of the unsolved and solved cases may be displayed using

Vm = n.bus_c.VoltMag; Vm1 = ns.bus_c.VoltMag;


Va = n.bus_c.VoltAngd; Va1 = ns.bus_c.VoltAngd;

These statements invoke the subsref functions of the net_c class and its parent class bus_c.

[Vm Vm1 Va Va1]


ans =
1.01 1.01 18.5 18.5
1.01 1.01 7.7115 7.7145
0.97757 0.97792 -7.4781 -7.4696
0.97113 0.97769 -10.425 -10.377
0.99589 0.99597 11.573 11.574
1.01 1.01 -9.1323 -9.1055
1.01 1.01 -19.253 -19.224
0.97986 0.98057 -34.245 -34.205
0.97048 0.97749 -39.57 -39.455
0.98386 0.98405 0.95547 0.95982
0.99752 0.99813 -21.151 -21.129
0.9972 0.99736 -15.798 -15.77
0.98574 0.98614 -25.996 -25.964

The generator reactive powers in MVA for the unsolved and solved cases are viewed using

QG1 = n.bus_c.gen_c.QGen*n.bus_c.BasMva;
QG2 = ns.bus_c.gen_c.QGen*ns.bus_c.BasMva;
[QG1 QG2]
ans =
161 128.82
176 198.23
149 117.17
139 185.51

© Graham Rogers 2000 to 2008 All rights reserved


12 power flow

3.1.1 Power flow solution with user specified solution options

To perform a power flow system immediately after a fault on the two area system at bus 3 on line 3 to 101.
Take one tie line between bus 3 and bus 101 out-of service, ignore generator reactive power limits and
freeze the transformer taps.

np = ns; % forms a new net_c class object np


np.Header2 = 'post fault - single line 3 to 101, gen var limits open, tran taps frozen';
np.line_c.Status(5) = 0;% sets the status of line 5 to zero, i.e., out-of-service
np = net_idx(np); % updates the objects net_idx structure
np = netflow(np,'no_tap',1,'no_gvl',1);%load flow with taps frozen and no gen var limits

number of controlling generators 4


iteration number 0
maximum power error at bus 3 is 2.0818 PU
reactive power error at bus 101 is 0.54167 PU
number of controlling generators 4
number of generator controlled buses 4
number of controlling shunts 0
number of controlling transformers 0
iteration number 1
maximum power error at bus 101 is 0.18984 PU
reactive power error at bus 3 is 0.26352 PU
number of controlling generators 4
number of generator controlled buses 4
number of controlling shunts 0
number of controlling transformers 0
iteration number 2
maximum power error at bus 3 is 0.030225 PU
reactive power error at bus 101 is 0.01659 PU
number of controlling generators 4
number of generator controlled buses 4
number of controlling shunts 0
number of controlling transformers 0
iteration number 3
maximum power error at bus 3 is 0.00092568 PU
reactive power error at bus 101 is 0.00044257 PU
number of controlling generators 4
number of generator controlled buses 4
number of controlling shunts 0
number of controlling transformers 0
iteration number 4
maximum power error at bus 3 is 9.1072e-007 PU
reactive power error at bus 101 is 4.4029e-007 PU
number of Newton-Raphson iterations 4
reset discrete shunts
load flow d2asb
converged in 4 iterations
area reset
transformer Freeze, shunt Mode reset
Elapsed time is 0.635544 seconds.

The loadflow report for bus 3 is obtained using


lfreport(np,3);
Load Flow Report
d2asb
post fault - single line 3 to 101, gen var limits open, tran taps frozen
Solved Bus Data
Bus# Voltage(pu) Ang(degrees) BusG(MVa) BusB(MVa)

3 0.9377 -8.9167 0.0000 300.0000

Solved Line Data: P MW and Q MVA


From Bus To Bus FromP FromQ ToP ToQ Losses

3 4 -976.0000 -154.8446 976.0000 100.0000 0.0000

© Graham Rogers 2000 to 2008 All rights reserved


13 power flow

3 20 1409.2738 -32.2318 -1431.8756 -192.2084 22.6018


3 101 -433.2737 -76.6829 408.8795 -150.4466 24.3942

Solved Transformer Data


From Bus To Bus Cont Bus Tap Phase

3 4 4 0.9938 0.0000

Active power mismatch (MW)-9.1072e-005


Reactive power mismatch (MVa) 2.1582e-005

Other solution options are shown in Table 1. The options may appear in any order as a string ,value
combination.

Table 1 Solution option inputs to netflow

Defining string Value


'no_tap' 1 - if taps are frozen; 0 if taps are free
default 0
'no_shunt' 1 - if shunt control to be ignored; 0 for shunt contol
default 0
'no_gvl' 1 - if generator var limits are to be ignored
0 - if generator var limits are to be honoured
default 0
'no_sl' 1 - if shunt limits are to be ignored
0 - if shunt limits are to be honoured
default 0
'tol' power flow solution tolerance - pu
default 1e-4
'iter_max' maximum number of Newton-Raphson iterations
default 15
'acc' iteration acceleration factor
default 1
'no_aic' 1 - if no area interchange control
default 0
'no_facts' 1 - if no facts control
default 0
‘no_dc’ 1 – if no dclines
default 0
'no_print' 1 - if no command line printing required
default 0

3.1.2 Power Flow of a larger case

Using PTI v 26 raw data format stored in the file bench.raw, a net_c class object for a larger system may
be obtained using
S=rdpti26('bench.raw');
n=net_c(S);
n=netflow(n);
number of controlling generators 86
iteration number 0
maximum power error at bus 6606 is 4.76 PU
reactive power error at bus 8104 is 0.069024 PU
maximum mismatch in generator control 0.04462
at generator bus 1933
maximum mismatch in shunt control 0.02791
at shunt bus 6806
number of controlling generators 81

© Graham Rogers 2000 to 2008 All rights reserved


14 power flow

number of generator controlled buses 59


number of controlling shunts 10
number of controlling transformers 156
iteration number 1
maximum power error at bus 5511 is 0.079592 PU
reactive power error at bus 8600 is 0.39669 PU
number of controlling generators 81
number of generator controlled buses 59
number of controlling shunts 10
number of controlling transformers 156
iteration number 2
maximum power error at bus 6219 is 0.015113 PU
reactive power error at bus 6219 is 0.012817 PU
maximum PU mismatch in area interchange control 0.062757
in area number 8
number of controlling generators 81
number of generator controlled buses 59
number of controlling shunts 10
number of controlling transformers 156
iteration number 3
maximum power error at bus 6219 is 0.0020314 PU
reactive power error at bus 6219 is 0.0017267 PU
maximum PU mismatch in area interchange control 0.024852
in area number 8
number of controlling generators 81
number of generator controlled buses 59
number of controlling shunts 10
number of controlling transformers 156
iteration number 4
maximum power error at bus 8919 is 0.00020125 PU
reactive power error at bus 3202 is 0.00027955 PU
number of controlling generators 81
number of generator controlled buses 59
number of controlling shunts 10
number of controlling transformers 156
iteration number 5
maximum power error at bus 8919 is 3.3859e-005 PU
reactive power error at bus 3202 is 6.3702e-005 PU
number of Newton-Raphson iterations 5
reset transformer taps to valid tap positions
reset discrete shunts
iteration number 0
maximum power error at bus 5211 is 0.055566 PU
reactive power error at bus 5211 is 0.77034 PU
maximum mismatch in generator control 0.04561
at generator bus 1933
maximum mismatch in shunt control 0.0013126
at shunt bus 8607
number of controlling generators 81
number of generator controlled buses 59
number of controlling shunts 3
number of controlling transformers 0
iteration number 1
maximum power error at bus 987 is 0.0023675 PU
reactive power error at bus 1933 is 0.10929 PU
number of controlling generators 81
number of generator controlled buses 59
number of controlling shunts 3
number of controlling transformers 0
iteration number 2
maximum power error at bus 987 is 0.0026478 PU
reactive power error at bus 1933 is 0.0064606 PU
number of controlling generators 81
number of generator controlled buses 59
number of controlling shunts 3
number of controlling transformers 0
iteration number 3
maximum power error at bus 987 is 1.3545e-005 PU
reactive power error at bus 1933 is 1.7728e-005 PU
number of Newton-Raphson iterations 3
load flow BENCH TEST CASE

© Graham Rogers 2000 to 2008 All rights reserved


15 power flow

converged in 8 iterations
transformer Freeze, shunt Mode reset
Elapsed time is 5.525748 seconds.

The first Newton-Raphson iteration process converged in 5 iterations. A futher 3 iterations are required
after the transformer taps and the discrete switched shunts have been set to valid values. The total time
taken is 5.526 s, on a Pentium IV, 2.2GHz computer.

The solved power flow report at bus 1201 is obtained using

n.Header2 = 'solved';
lfreport(n,1201);
Load Flow Report
BENCH TEST CASE
solved
Solved Bus Data
Bus# Voltage(pu) Ang(degrees) BusG(MVa) BusB(MVa)

1201 1.0475 -28.0950 0.0000 0.0000

Solved Shunt B at 1pu voltage


BStart 417.7 MVa

Controlled Bus Number 1201

Solved Line Data: P MW and Q MVA


From Bus To Bus FromP FromQ ToP ToQ Losses

228 1201 119.0962 22.0856 -119.6363 51.9725 0.5401


297 1201 179.9011 -7.6363 -180.6482 6.3591 0.7471
1201 1202 171.9692 -51.0088 -172.3233 51.2973 0.3541
1201 1216 21.8606 -57.2271 -21.8883 58.0526 0.0278
1201 1222 -142.0734 -2.0116 142.0182 2.0623 0.0552
1201 1227 -174.0763 -13.1896 173.9930 13.0648 0.0833
1201 1257 -229.8733 -23.7598 229.8003 23.6557 0.0730
1501 1201 -360.2908 79.8569 360.1253 -99.8540 0.1655
1501 1201 -355.2036 78.2175 355.0676 -97.9264 0.1360
1501 1201 -358.4688 79.4373 358.3050 -99.3331 0.1638
1201 1601 -77.1201 -20.9040 76.9220 14.2993 0.1981
1201 1601 -75.6773 -20.5149 75.4831 14.0338 0.1942
1201 1601 -68.4394 -18.2959 68.2637 12.4445 0.1757
1201 1715 -199.7835 -12.6067 199.3189 13.0782 0.4646

Solved Transformer Data


From Bus To Bus Cont Bus Tap Phase

1201 1601 1601 0.9416 0.0000


1201 1601 1601 0.9416 0.0000
1201 1601 1601 0.9419 0.0000

Active power mismatch (MW)-1.8534e-006


Reactive power mismatch (MVa) 7.1807e-007

The area interchange may be calculated using

Pnet1 = area_int(n)
Pnet1 =
(3,1) 2.2503
(8,1) -0.22609
(1,3) -2.2503
(1,8) 0.22609

© Graham Rogers 2000 to 2008 All rights reserved


16 power flow

The export power is calculated using


full(sum(Pnet1,2))
ans =
-2.0242
0
2.2503
0
0
0
0
-0.22609

n.area_c.ExpP/n.bus_c.BasMva
ans =
29.47
2.25
-0.22

The specification for area 1 of an export power of 29.47 PU is ignored since in this case the control is
limited to areas 2 and 3; the swing bus is in area 1.

The PU tolerance in the area interchange is

n.area_c.PTol/n.bus_c.BasMva

0.02
0.02
0.02

The exports from areas 3 and 8 have been controlled to the specified export values, within the specified
tolerance.

If the transformers taps are frozen, the shunts are fixed and the area interchange control disabled, the
second Newton Raphson iteration set is not required, and consequently the solution is considerably faster.
Starting from the unsolved network object (n=net_c(S))

n = netflow(n,'no_aic',1,'no_tap',1,'no_shunt',1);
number of controlling generators 86
iteration number 0
maximum power error at bus 6606 is 4.76 PU
reactive power error at bus 8104 is 0.069024 PU
maximum mismatch in generator control 0.04462
at generator bus 1933
number of controlling generators 82
number of generator controlled buses 60
number of controlling shunts 0
number of controlling transformers 0
iteration number 1
maximum power error at bus 6206 is 0.11624 PU
reactive power error at bus 6206 is 0.85037 PU
number of controlling generators 80
number of generator controlled buses 58
number of controlling shunts 0
number of controlling transformers 0
iteration number 2
maximum power error at bus 987 is 0.0027307 PU
reactive power error at bus 6206 is 0.024149 PU
number of controlling generators 80
number of generator controlled buses 58
number of controlling shunts 0
number of controlling transformers 0
iteration number 3
maximum power error at bus 987 is 1.4671e-005 PU
reactive power error at bus 6206 is 2.2507e-005 PU
number of Newton-Raphson iterations 3
reset discrete shunts

© Graham Rogers 2000 to 2008 All rights reserved


17 power flow

load flow BENCH TEST CASE


converged in 3 iterations
area reset
transformer Freeze, shunt Mode reset
Elapsed time is 1.851908 seconds.

n.Header2='SOLVED No Taps or Shunts'

A report on bus 1201 is


Load Flow Report
BENCH TEST CASE
SOLVED No Taps or Shunts
Solved Bus Data
Bus# Voltage(pu) Ang(degrees) BusG(MVa) BusB(MVa)

1201 1.0383 -36.7875 0.0000 0.0000

Solved Shunt B at 1pu voltage


BStart 307.7 MVa

Controlled Bus Number 1201

Solved Line Data: P MW and Q MVA


From Bus To Bus FromP FromQ ToP ToQ Losses

228 1201 118.9487 22.5542 -119.4958 50.0900 0.5472


297 1201 179.6638 -6.1692 -180.4219 4.7677 0.7581
1201 1202 170.6094 -41.8822 -170.9547 42.1954 0.3453
1201 1216 26.5277 -13.8010 -26.5344 14.7322 0.0067
1201 1222 -141.2893 -2.8008 141.2337 2.8423 0.0556
1201 1227 -173.2903 -14.1160 173.2062 13.9794 0.0841
1201 1257 -228.7242 -24.9434 228.6505 24.8240 0.0737
1501 1201 -357.6889 53.1491 357.5284 -72.5425 0.1605
1501 1201 -352.6031 51.8983 352.4712 -71.0123 0.1319
1501 1201 -355.8790 52.8649 355.7202 -72.1601 0.1589
1201 1601 -77.0649 -21.1132 76.8635 14.3978 0.2014
1201 1601 -75.6231 -20.7202 75.4256 14.1304 0.1975
1201 1601 -68.3199 -17.8370 68.1422 11.9179 0.1777
1201 1715 -198.6274 -13.6635 198.1597 14.0276 0.4677

Solved Transformer Data


From Bus To Bus Cont Bus Tap Phase

1201 1601 1601 0.9411 0.0000


1201 1601 1601 0.9411 0.0000
1201 1601 1601 0.9421 0.0000

Active power mismatch (MW)-7.8633e-006


Reactive power mismatch (MVa) 4.4573e-006

© Graham Rogers 2000 to 2008 All rights reserved


18 power flow

3.2 System with UPFC

A modified WSCC 9 bus system is shown in Figure 4.


8 10 7

G1

G3

G2 2
4
1 5 6

G4

Figure 4 Modified WSCC 9 Bus System

It has two additional lines, one between bus 7 and bus 10, and the second between bus 10 and bus 8. The
system has two generators at bus 1 and a switched shunt at bus 5. The series branch of a UPFC is modelled
by the line between bus 8 and bus 10. The voltage at bus 8 is controlled to 1 PU by the shunt branch of the
UPFC, and the flow at bus 10 in the line 8 to 10 is controlled to -30 MW and -5MVA.
S=rdpti26('9bupfc.raw');
n=net_c(S);
n=netflow(n);
number of controlling generators 4
iteration number 0
maximum power error at bus 7 is 0.8653 PU
reactive power error at bus 7 is 0.11869 PU
maximum mismatch in shunt control 0.01233
at shunt bus 5
maximum mismatch in facts shunt control 0.00504
in facts number 1
maximum mismatch in facts series control 1.1102e-016
in facts number 1
number of controlling generators 4
number of generator controlled buses 3
number of controlling shunts 1
iteration number 1
maximum power error at bus 10 is 0.10341 PU
reactive power error at bus 8 is 0.042289 PU
maximum mismatch in facts shunt control 0.030681
in facts number 1
maximum mismatch in facts series control 0.055347
in facts number 1
number of controlling generators 4
number of generator controlled buses 3
number of controlling shunts 1
iteration number 2

© Graham Rogers 2000 to 2008 All rights reserved


19 power flow

maximum power error at bus 10 is 0.0025211 PU


reactive power error at bus 7 is 0.00051951 PU
maximum mismatch in facts shunt control 0.0068338
in facts number 1
maximum mismatch in facts series control 0.0019007
in facts number 1
number of controlling generators 4
number of generator controlled buses 3
number of controlling shunts 1
iteration number 3
maximum power error at bus 8 is 2.1627e-006 PU
reactive power error at bus 10 is 5.9146e-006 PU
maximum mismatch in facts shunt control 0.00036936
in facts number 1
maximum mismatch in facts series control 5.8544e-006
in facts number 1
number of controlling generators 4
number of generator controlled buses 3
number of controlling shunts 1
iteration number 4
maximum power error at bus 8 is 5.4621e-009 PU
reactive power error at bus 10 is 2.3166e-008 PU
maximum mismatch in facts shunt control 1.4503e-005
in facts number 1
maximum mismatch in facts series control 2.3166e-008
in facts number 1
number of Newton-Raphson iterations 4
reset discrete shunts
iteration number 0
maximum power error at bus 8 is 5.4621e-009 PU
reactive power error at bus 10 is 2.3166e-008 PU
maximum mismatch in facts shunt control 1.4503e-005
in facts number 1
maximum mismatch in facts series control 2.3166e-008
in facts number 1
number of Newton-Raphson iterations 0
load flow WSCC NINE BUS TEST CASE
converged in 4 iterations
area reset
transformer Freeze, shunt Mode reset
Elapsed time is 1.511876 seconds.

The load flow report for bus 10 is

lfreport(n,10);
Load Flow Report
WSCC NINE BUS TEST CASE
LINE 2 OF LOADFLOW TITLE
Solved Bus Data
Bus# Voltage(pu) Ang(degrees) BusG(MVa) BusB(MVa)

10 1.0435 1.0226 0.0000 0.0000

Solved Line Data: P MW and Q MVA


From Bus To Bus FromP FromQ ToP ToQ Losses

7 10 -30.3045 26.5438 30.0000 5.0000 0.3045


8 10 28.9483 3.4002 -30.0000 -5.0000 1.0517
Series FACTS Data
FromBus ToBus PSet QSet Vm2 alpha2
8 10 -30.0000 -5.0000 0.0443 -2.6693

Active power mismatch (MW)-9.0754e-008


Reactive power mismatch (MVa) 2.3166e-006

© Graham Rogers 2000 to 2008 All rights reserved


20 power flow

3.3 System with a Two Terminal Line Commutated HVDC link

The bench system has two loads in zone 200 one positive active power and reactive power and the other
negative active power and positive reactive power. This indicates an unmodelled HVDC link. These loads
were set to zero and a two terminal HVDC link with the rectifier HT bus specified to be the bus with
positive active power load, and the inverter HT bus specified to be the bus with negative active load. The
changed data is stored in benchdc.raw.
S=rdpti26('benchdc.raw');
n=net_c(S);
n.net_c(S);n=netflow(n)
number of controlling generators 81
iteration number 0
maximum power error at bus 987 is 1.3979e-005 PU
reactive power error at bus 1933 is 1.8299e-005 PU
maximum mismatch in shunt control 0.0082586
at shunt bus 5988
maximum mismatch in transformer control 0.00069998
maximum PU mismatch in area interchange control 0.00069998
in area number 8
number of controlling generators 81
number of generator controlled buses 59
number of controlling shunts 9
number of controlling transformers 156
iteration number 1
maximum power error at bus 1201 is 0.010075 PU
reactive power error at bus 1715 is 0.051543 PU
number of controlling generators 81
number of generator controlled buses 59
number of controlling shunts 9
number of controlling transformers 156
iteration number 2
maximum power error at bus 5211 is 0.00034382 PU
reactive power error at bus 1715 is 0.0033108 PU
number of controlling generators 81
number of generator controlled buses 59
number of controlling shunts 9
number of controlling transformers 156
iteration number 3
maximum power error at bus 6219 is 5.3634e-005 PU
reactive power error at bus 1715 is 0.00021444 PU
number of controlling generators 81
number of generator controlled buses 59
number of controlling shunts 9
number of controlling transformers 156
iteration number 4
maximum power error at bus 6219 is 8.5065e-006 PU
reactive power error at bus 3202 is 4.3781e-005 PU
number of Newton-Raphson iterations 4
reset transformer taps to valid tap positions
reset discrete shunts
iteration number 0
maximum power error at bus 5111 is 0.059051 PU
reactive power error at bus 5111 is 0.81694 PU
maximum mismatch in shunt control 2.1435e-006
at shunt bus 8607
number of controlling generators 81
number of generator controlled buses 59
number of controlling shunts 2
number of controlling transformers 0
iteration number 1
maximum power error at bus 5111 is 0.00048544 PU
reactive power error at bus 5111 is 0.0092982 PU
number of controlling generators 81
number of generator controlled buses 59
number of controlling shunts 2
number of controlling transformers 0

© Graham Rogers 2000 to 2008 All rights reserved


21 power flow

iteration number 2
maximum power error at bus 1970 is 9.2198e-007 PU
reactive power error at bus 2516 is 0.0005442 PU
number of controlling generators 81
number of generator controlled buses 59
number of controlling shunts 2
number of controlling transformers 0
iteration number 3
maximum power error at bus 8678 is 3.285e-011 PU
reactive power error at bus 2516 is 1.6453e-007 PU
number of Newton-Raphson iterations 3
load flow BENCH DC TEST CASE
converged in 7 iterations
transformer Freeze, shunt Mode reset
Elapsed time is 4.791734 seconds.

The dcline class for the modified solved system is

n.dcline

ans =

ans =
Error: 0
LineNum: 1
rectifier: [1x1 converter]
inverter: [1x1 converter]
rdc: 0.78
Mode: 1
SetPoint: 0.41
VSet: 135
Kvs: 0
CurMarg: 0.17
VDCMax: 137.7
VDCMin: 132.3
Idc: 0.41
Irated: 0.41

The contained converter object (rectifier) is


n.dcline.rectifier

ans =

ans =
Error: 0
Type: 1
Mode: 1
LineNum: 1
HTBaseVolts: 315
LTBaseVolts: 60.008
NumBridge: 2
Alpha: 0.31066
EquSoVolts: 0.88764
VDC: 135.32
AngMax: 0.32289
AngMin: 0.30543
XC: 2.12
Xaceq: 0.016996
Rc: 4.0489
Tap: 0.8475
TapMax: 1.16
TapMin: 0.8
TapStep: 0.0085
HTBusName: {'BUS1215'}
HTBusIndex: 231
LTBusName: {[]}
LTBusIndex: 0
K: 162.08

© Graham Rogers 2000 to 2008 All rights reserved


22 power flow

And the contained converter object(inverter) is

n.dcline.inverter

ans =

ans =
Error: 0
Type: 2
Mode: 1
LineNum: 1
HTBaseVolts: 120
LTBaseVolts: 60
NumBridge: 2
Alpha: 2.7395
EquSoVolts: 0.8941
VDC: 135
AngMax: 0.41888
AngMin: 0.31416
XC: 2.12
Xaceq: 0.017
Rc: 4.0489
Tap: 0.86
TapMax: 1.2
TapMin: 0.7
TapStep: 0.01
HTBusName: {'BUS2201'}
HTBusIndex: 439
LTBusName: {[]}
LTBusIndex: 0
K: 162.06

In this case, the rectifier is controlling the HVDC line power and the inverter is controlling the inverter
voltage.

© Graham Rogers 2000 to 2008 All rights reserved


23 power flow

3.4 Induction Machines

Induction machines, either motors or generators may be modelled in MatNetFlow. Induction generators are
treated as induction machines with negative active power load, and should be initialized by supplying a
negative load at the induction generator bus. The data for the induction motors is supplied in the IND
substructure of S. The rdpstv2 function allows data in the Power System Toolbox format to be transformed
to S. In this case the induction motor data is specified by two matrices, ind_con and mld_con. The first
specifies the machines’ equivalent circuit data and rating, and the second specifies the machines’ load
torque slip characterisics. The data for the 9 bus test system with induction machines added at buses 5, 7
and 9 are
% A 3-machine 9-bus system from Chow's book pp.70
% induction machines at buses 5, 7 and 9
% bus data format
% bus: number, voltage(pu), angle(degree), p_gen(pu), q_gen(pu),
% p_load(pu), q_load(pu),G shunt,B shunt, bus_type
% bus_type - 1, swing bus
% - 2, generator bus (PV bus)
% - 3, load bus (PQ bus)

bus = [ 1 1.04 0.00 0.00 0.00 0.00 0.00 0.00 0.00 1;


2 1.02533 0.00 1.63 0.00 0.00 0.00 0.00 0.00 2;
3 1.02536 0.00 0.85 0.00 0.00 0.00 0.00 0.00 2;
4 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3;
5 1.00 0.00 0.00 0.00 1.90 0.00 0.00 0.00 3;
6 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3;
7 1.00 0.00 0.00 0.00 1.0 0.00 0.00 0.00 3;
8 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3;
9 1.00 0.00 0.00 0.00 1.0 0.00 0.00 0.00 3];

% line data format


% line: from bus, to bus, resistance(pu), reactance(pu),
% line charging(pu), tap ratio

line = [1 4 0.0 0.0576 0. 1. 0. ;


4 5 0.017 0.092 0.158 1. 0. ;
5 6 0.039 0.17 0.358 1. 0. ;
3 6 0.0 0.0586 0. 1. 0. ;
6 7 0.0119 0.1008 0.209 1. 0. ;
7 8 0.0085 0.072 0.149 1. 0. ;
8 2 0.0 0.0625 0. 1. 0. ;
8 9 0.032 0.161 0.306 1. 0. ;
9 4 0.01 0.085 0.176 1. 0. ];

% Machine data format


% Machine data format
% 1. machine number,
% 2. bus number,
% 3. base mva,
% 4. leakage reactance x_l(pu),
% 5. resistance r_a(pu),
% 6. d-axis sychronous reactance x_d(pu),
% 7. d-axis transient reactance x'_d(pu),
% 8. d-axis subtransient reactance x"_d(pu),
% 9. d-axis open-circuit time constant T'_do(sec),
% 10. d-axis open-circuit subtransient time constant
% T"_do(sec),
% 11. q-axis sychronous reactance x_q(pu),
% 12. q-axis transient reactance x'_q(pu),
% 13. q-axis subtransient reactance x"_q(pu),
% 14. q-axis open-circuit time constant T'_qo(sec),
% 15. q-axis open circuit subtransient time constant
% T"_qo(sec),
% 16. inertia constant H(sec),

© Graham Rogers 2000 to 2008 All rights reserved


24 power flow

% 17. damping coefficient d_o(pu),


% 18. dampling coefficient d_1(pu),
% 19. bus number
%
% note: all the following machines use electro-mechanical model
mac_con = [ ...
1 1 100 0.000 0.000 0. 0.0608 0 0 0 0 0 0 0 0 23.64 13.64 0 1 0 0;
2 2 100 0.000 0.000 0. 0.1198 0 0 0 0 0 0 0 0 6.4 6.4 0 1 0 0;
3 3 100 0.000 0.000 0. 0.1813 0 0 0 0 0 0 0 0 3.01 3.01 0 1 0 0];

% induction motor data


% 1. Motor Number
% 2. Bus Number
% 3. Motor MVA Base
% 4. rs pu
% 5. xs pu - stator leakage reactance
% 6. Xm pu - magnetizing reactance
% 7. rr pu
% 8. xr pu - rotor leakage reactance
% 9. H s - motor plus load inertia constant
% 10. rr1 pu - second cage resistance
% 11. xr1 pu - intercage reactance
% 12. dbf - deepbar factor
% 13. isat pu - saturation current
% 15. fraction of bus power drawn by motor
% with positive load: positive indicates a motor and negative a generator
% with negative load: positive indicates a generator and negative a
% motor
ind_con = [ ...
1 5 28.6 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .2; % motor
%1 5 28.6 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 -.2; % gen
2 7 120 .0229 .1153 3.469 .0102 .0877 1.0 0 0 7.469 3 0 1;
3 9 120 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 1;
];
% Motor Load Data
% format for motor load data - mld_con
% 1 motor number
% 2 bus number
% 3 stiction load pu on motor base (f1)
% 4 stiction load coefficient (i1)
% 5 external load pu on motor base(f2)
% 6 external load coefficient (i2)
%
% load has the form
% tload = f1*slip^i1 + f2*(1-slip)^i2
mld_con = [ ...
1 5 .1 1 .8 2;% motor
%1 5 .1 1 0 0;% generator
2 7 .1 1 .8 2;
3 9 .1 1 .8 2;
];
exc_con = [];pss_con=[];hgt_con=[];tgt_con=[];svc_con=[];tcsc.con=[];upfc_con = [];
dcl_con = [];dcr_con = [];dci_con = [];
dcld_con = [];dcrc_con = [];dcic_con = []

The ind_con data matrix specifies motors’ parameters. Machines 1 and 3 have deep bar rotors and motor 2
has a double cage rotor. Their leakage inductances begin to saturate at 3 PU current. Induction motors 2
and 3 pick up 100% of the active load at their terminal buses. Machine 1 picks up 20% of the load as a
motor, and generates 20% of the negative of the load as a generator.

The mld_con data matrix specifies the torque speed characteristic of the load for the motors to be

T = 0.1s + 0.8(1 − s) 2
where T is the motor torque in PU on the motor base and s is the motor’s PU slip. The first term represents
stiction, and the second is the main load variation with speed. The characteristic is shown in Figure 5.

© Graham Rogers 2000 to 2008 All rights reserved


25 power flow

where T is the motor torque in PU on the motor base and s is the motor’s PU slip. The first term represents
stiction, and the second is the main load variation with speed. The characteristic is shown in Figure 5.

Figure 5 Induction Motor Load Torque with speed

The generator has only stiction load.

In MatNetFlow, the load speed coefficient is recalculated to ensure that the motor power initially produces
the specified motor active power. The motor reactive power is not specified but calculated within the
initialization routine.

For the data set da3m9bst.m, the induction machine object, a parent of bus_c, is

n.bus_c.imac

ans =

ans =
NumMac: 3
MacNum: [3x1 double]
Type: [3x1 double]
BusNum: [3x1 double]
BusIndex: [3x1 double]
Status: [3x1 double]
BasMva: [3x1 double]
BasSpd: 376.99
BasRat: [3x1 double]
rs: [3x1 double]
xs: [3x1 double]
Xm: [3x1 double]
rr: [3x1 double]
xr: [3x1 double]
rr1: [3x1 double]
xr1: [3x1 double]
isat: [3x1 double]
H: [3x1 double]
dbf: [3x1 double]
slip: [3x1 double]
TermVolt: [3x1 double]
TermCur: [3x1 double]
Torque: [3x1 double]
P: [3x1 double]

© Graham Rogers 2000 to 2008 All rights reserved


26 power flow

Q: [3x1 double]
kst: [3x1 double]
tsti: [3x1 double]
kspd: [3x1 double]
tspdi: [3x1 double]
Error: 0

The load torque is given by


T = kst *s tsti + kspd *(1 − s) tspdi

where s is the slip PU.

On inititialization, the coefficient kspd is calculated to give the specified motor power.

The induction machines steady state characteristics with speed may be obtained by using

[t,p,q,pfact,rre,xre,is,spd]=imtspeed(n.bus_c.imac,mac_idx);

The second input mac_idx is an optional index of the machines for which the starting characteristics are to
be deterimined. If mac_idx is not supplied, the characteristics of all motors are calculated.

For the example system

[t,p,q,pfact,rre,xre,is,spd]=imtspeed(n.bus_c.imac,2);
plot(spd,t)
xlabel('speed PU')
ylabel('torque PU')
title('torque speed machine 2')

Figure 6 Torque speeed induction machine 2

The induction motors’ active and reactive powers following a power flow solution are
n.bus_c.imac.P
ans =
0.38001
1
1
n.bus_c.imac.Q
ans =
0.17736
0.60126
0.46548

© Graham Rogers 2000 to 2008 All rights reserved


27 power flow

With an induction generator at bus 5


n.bus_c.imac.P
ans =
-0.37992
1
1.0001
n.bus_c.imac.Q
ans =
0.19361
0.60126
0.46538

In a power flow solution, the induction machines may be converted to constant active and reactive power
loads by using the option pair (‘no_im’,1). Alternatively, setting a machine’s status to zero, sets the
corresponding machine’s load to zero.

3.5 Voltage Stability

It is normal to test for voltage stability by running multiple power flows with increasing load and
generation. Eventually the power flow will fail to converge. If the last solved case has been saved, one can
restart from that and make a smaller increment in load and generation. The process may be repeated so that
the system gets closer and closer to its point of collapse. If the bus voltage magnitudes are plotted against
total load increase, they will be seen to drop, slowly at first and then more rapidly, until the slope of the
voltage/power curve tends to -∞. By using a continuation technique, the load flow may be extended to trace
the solution for lower voltages, and the voltage power curve extended beyond the normal limitation of a
standard power flow program. Such a technique is used in the net_c class function vstab.

The program is called using

[n_c,V,A,PL,QL,PG,QG,BS,PIM,QIM,SIM,J_c,p] = ...
vstab(n,p_inc,q_inc,n_step,nmax,varargin);

The output variables are:


n_c - a net_c class object which represents the system loaded to the nose of the voltgae/power characteristic
V - the bus voltage magnitudes at each load level
A - the bus voltage angles at each load level
PL - the active power loads
QL - the reactive power loads
PG - the active power generation
QG - the reactive power generation
BS - the shunt susceptance
PIM - induction machine power
QIM - induction machine reactive power
SIM - induction motor slip
J_c - the loadflow jacobian at the critical loading
p - a vector of power increments

The input variables are:


n - the original net_c class object
p_inc - the starting fractional increment in active power
q_inc - the starting fractional increment in reactive power load
n_step - the number of increments - this is extended within the program if necessary
nmax - the maximum number of increments
varargin - provides options to be used in the power flow solution.

© Graham Rogers 2000 to 2008 All rights reserved


28 power flow

3.5.1 Examples
The bus and line data for the two area system are
bus = [...
1 1.01 18.5 7.00 1.61 0.00 0.00 0.00 0.00 1 5.0 -2.0 22.0 1.1 .9;
2 1.01 8.80 7.00 1.76 0.00 0.00 0.00 0.00 2 5.0 -2.0 22.0 1.1 .9;
3 1.0 -6.1 0.00 0.00 0.00 0.00 0.00 3.00 3 0.0 0.0 230.0 1.5 .5;
4 1.0 -10 0.00 0.00 9.76 1.00 0.00 0.00 3 0.0 0.0 115.0 1.05 .95;
10 1.0103 12.1 0.00 0.00 0.00 0.00 0.00 0.00 3 0.0 0.0 230.0 1.5 .5;
11 1.01 -6.8 7.00 1.49 0.00 0.00 0.00 0.00 2 5.0 -2.0 22.0 1.1 .9;
12 1.01 -16.9 7.00 1.39 0.00 0.00 0.00 0.00 2 5.0 -2.0 22.0 1.1 .9;
13 1.0 -31.8 0.00 0.00 0.00 0.00 0.00 5.00 3 0.0 0.0 230.0 1.5 .5;
14 1.0 -35 0.00 0.00 17.65 1.00 0.00 0.00 3 0.0 0.0 115.0 1.05 .95;
20 1.0 2.1 0.00 0.00 0.00 0.00 0.00 0.00 3 0.0 0.0 230.0 1.5 .5;
101 1.00 -19.3 0.00 0.00 0.00 0.00 0.00 1.27 3 0.0 0.0 230.0 1.5 .5;
110 1.0 -13.4 0.00 0.00 0.00 0.00 0.00 0.00 3 0.0 0.0 230.0 1.5 .5;
120 1.0 -23.6 0.00 0.00 0.00 0.00 0.00 0.00 3 0.0 0.0 230.0 1.5 .5;
];

line = [...
1 10 0.0 0.0167 0.00 1.0 0. 0. 0. 0.;
2 20 0.0 0.0167 0.00 1.0 0. 0. 0. 0.;
3 4 0.0 0.005 0.00 1.0 0. 1.2 0.8 0.00625;
3 20 0.001 0.0100 0.0175 1.0 0. 0. 0. 0.;
3 101 0.011 0.110 0.1925 1.0 0. 0. 0. 0.;
3 101 0.011 0.110 0.1925 1.0 0. 0. 0. 0.;
10 20 0.0025 0.025 0.0437 1.0 0. 0. 0. 0.;
11 110 0.0 0.0167 0.0 1.0 0. 0. 0. 0.;
12 120 0.0 0.0167 0.0 1.0 0. 0. 0. 0.;
13 101 0.011 0.11 0.1925 1.0 0. 0. 0. 0.;
13 101 0.011 0.11 0.1925 1.0 0. 0. 0. 0.;
13 14 0.0 0.005 0.00 1.0 0. 1.2 0.8 0.00625;
13 120 0.001 0.01 0.0175 1.0 0. 0. 0. 0.;
110 120 0.0025 0.025 0.0437 1.0 0. 0. 0. 0.;
];

There is a capacitor at bus 101, which keeps the voltage close to 1 PU. There are tap changers in the lines 3
to 4, and 13 to 14, which control the load bus voltages.

The characteristic of Figure 7, was obtained using the following

S=rdpstv2;
n=net_c(S);
n=netflow(n);
[n_c,V,A,PL,QL,PG,QG,BS,PIM,QIM,SIM,J_c,p]=...
vstab(n,0.03,0.03,10,150,'iter_max',15,’no_print’,1);
plot(sum(PG,1),V);

The tap changing transformers hold the voltage at the load buses to within the transormer tap changer
control limits. The generator bus voltages are controlled to 1.01 PU . The other system voltages drop
rapidly.

© Graham Rogers 2000 to 2008 All rights reserved


29 power flow

Figure 7 Voltage stability characteristic for two-area system

Figure 8 Variation of generator reactive power with total generator power

With the transformer taps frozen and the generator var limits ignored, the voltage magnitude variation with
total generator power as the loads are increased becomes continuous, as shown in Figure 8.
[n_c,V,A,PL,QL,PG,QG,BS,PIM,QIM,J_c,p] =...
vstab(n,0.03,0.03,15,150,’iter_max’,15,'no_tap',1,'no_gvl',1);

© Graham Rogers 2000 to 2008 All rights reserved


30 power flow

Figure 9 The effect of freezing taps and opening generator VAR limits on voltage stability

The bus and svc data for the two-area system with an svc at bus 101, and with tap changing and generator
var limits enabled are
bus = [...
1 1.01 18.5 7.2638 1.61 0.00 0.00 0.00 0.00 1 5.0 -2.0 22.0 1.1 .9;
2 1.01 7.7115 0.00 1.76 0.00 0.00 0.00 0.00 2 5.0 -2.0 22.0 1.1 .9;
3 0.97757 -7.4781 0.00 0.00 0.00 0.00 0.00 3.00 3 0.0 0.0 230.0 1.5 .5;
4 0.97113 -10.425 0.00 0.00 9.76 1.00 0.00 0.00 3 0.0 0.0 115.0 1.05 .95;
10 0.99589 11.573 0.00 0.00 0.00 0.00 0.00 0.00 3 0.0 0.0 230.0 1.5 .5;
11 1.01 -9.1323 7.00 1.49 0.00 0.00 0.00 0.00 2 5.0 -2.0 22.0 1.1 .9;
12 1.01 -19.253 7.00 1.39 0.00 0.00 0.00 0.00 2 5.0 -2.0 22.0 1.1 .9;
13 0.97986 -34.245 0.00 0.00 0.00 0.00 0.00 5.00 3 0.0 0.0 230.0 1.5 .5;
14 0.97048 -39.57 0.00 0.00 17.65 1.00 0.00 0.00 3 0.0 0.0 115.0 1.05 .95;
20 0.98386 0.95547 0.00 0.00 0.00 0.00 0.00 0.00 3 0.0 0.0 230.0 1.5 .5;
101 0.99752 -21.151 0.00 0.00 0.00 0.00 0.00 1.27 3 0.0 0.0 230.0 1.5 .5;
110 0.9972 -15.798 0.00 0.00 0.00 0.00 0.00 0.00 3 0.0 0.0 230.0 1.5 .5;
120 0.98574 -25.996 0.00 0.00 0.00 0.00 0.00 0.00 3 0.0 0.0 230.0 1.5 .5;
];

svc_con = [...
3 101 500 1 -1 10 0.05 0 0 0;
];

As the load increases, the system becomes voltage unstable when the svc reaches it’s maximum
susceptance limit of 500 MVA. Figure 9 shows the variation of the susceptance. In figure 10, it can be seen
that the transformer taps are operating to keep the load buses (4 and 14) within the specified voltage range,
and the svc is controlling the voltage at bus 101 until it reaches its maximum VAR limit. The generators hit
their maximum reactive power limits at the collapse point.

© Graham Rogers 2000 to 2008 All rights reserved


31 power flow

Figure 10 Shunt susceptance variation with total generator power

Figure 11 Bus voltage magnitude variation with SVC at bus 101

© Graham Rogers 2000 to 2008 All rights reserved


32 power flow

Figure 12 Variation in generator rective power with totao generator power

In larger systems, the loads and generator powers may be increased in selected parts af the system, and the
influence of various controls may require investigation. The full range of options which may be specified
in vstab are as follows:

l_index - index of loads to be increased


g_index - index of generators for increased power
no_tap - freezes taps - 1 for no taps
no_shunt - freezes switched shunts - 1 for no shunts
no_gvl - opens generator var limits - 1 for open generator var limits
no_shl - opens the shunt limits - 1 for open shunt limits
tol - tolerance for convergence - default 1e-4 PU
iter_max - maximum number of iterations- default 8
acc - acceleration factor - default 1
no_aic - no area interchange control - 1 for no interarea interchange control
no_facts - disable facts controls - 1 to disable facts control
no_dc - disable Two Term HVDC - 1 to disable Two Terminal HVDC
no_im - sets induction machines to constant impedance loads - 1 to fix induction machine loads
no_print - suppresses command line printing - default printing on

3.5.2 A larger case


The 1024 bus case, Max30a.cf is analysed. The network object is formed by the following
S=rdcomf2;
n=net_c(S);
n=netflow(n,’no_print’,1);

The voltage stability of Zone 1 is to be assessed. The loads associated with Zone 1, may be identified using
l_idx = find(n.bus_c.load_c.Zone==1);

The generators in Zone 1 may be determined using


gz=n.bus_c.Zone(n.bus_c.gen_c.BusIndex);
g_idx = find(gz==1);

The voltage stability program is run using

© Graham Rogers 2000 to 2008 All rights reserved


33 power flow

[n_c,V,A,PL,QL,PG,QG,BS,PIM,QIM,SIM,J_c,p]...
=vstab(n,0.05,0.05,15,200,'iter_max',15,'l_index',l_idx,'g_index',g_idx,'no_print',1);

To plot the voltages of the buses in Zone 1 as the load is increased use
bz1=find(n.bus_c.Zone==1);
plot(sum(PG(g_idx,:),1),V(bz1,:))

The result is shown in Figure 12

Zone 1 voltage variation with total generation


1.2

1.1

1
Voltage PU

0.9

0.8

0.7

0.6

0.5
23 24 25 26 27 28 29 30 31 32
Total Generation Zone 1

Figure 13 Voltage Magnitude of buses in Zone 1

© Graham Rogers 2000 to 2008 All rights reserved


34 power flow

The Zone 1 generator reactive power is shown in Figure 13.


Zone 1 reactive power variation with total generation
12

10

8
Reactive Power PU

-2
23 24 25 26 27 28 29 30 31 32
Total Generation Zone 1

Figure 14 Generator Reactive Power, Zone 1

In this data set the generator reactive power limits are not given. With the reactive power limits are set to be
equal to ±abs(PGen + iQGen) , Figure 14 shows that the collapse point occurs at the same power level, but
the characteristic is not smooth.
Zone 1 voltage variation with total generation
1.2

1.1

1
Voltage PU

0.9

0.8

0.7

0.6

0.5
23 24 25 26 27 28 29 30 31 32
Total Generation Zone 1

Figure 15 The variation of voltage in Zone 1 with reactive power limits set

© Graham Rogers 2000 to 2008 All rights reserved


35 power flow

Zone 1 reactive power variation with total generation


10

6
Reactive Power PU

-2
23 24 25 26 27 28 29 30 31 32
Total Generation Zone 1

Figure 16 Generator Reactive Power, Zone 1 with limits set

© Graham Rogers 2000 to 2008 All rights reserved


36 power flow

3.5.3 The effect of induction motor loads


The 16 machine system has induction motor loads. The data file is shown below.

% data16m.m (16 Machine System Data)


% This is a 16-machine system with 86 transmission lines and
% 68 buses. Data are extracted from the GE final report
% entitled "Singular Perturbations, Coherency and
% Aggregation of Dynamic Systems," pp.6-42, July 1981.
% generator data modified - base changed to make xd = 1.8
% dc exciters on all generators
% thermal governors on all generators
%

% Bus data format


% bus:
% col1 number
% col2 voltage magnitude(pu)
% col3 voltage angle(degree)
% col4 p_gen(pu)
% col5 q_gen(pu),
% col6 p_load(pu)
% col7 q_load(pu)
% col8 G shunt(pu)
% col9 B shunt(pu)
% col10 bus_type
% bus_type - 1, swing bus
% - 2, generator bus (PV bus)
% - 3, load bus (PQ bus)
% col11 q_gen_max(pu)
% col12 q_gen_min(pu)

bus = [...
1 1.00 0.00 0.00 0.00 2.527 1.1856 0.00 0.00 3 0 0;
2 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;
3 1.00 0.00 0.00 0.00 3.22 0.02 0.00 0.00 3 0 0;
4 1.00 0.00 0.00 0.00 5.00 1.840 0.00 0.00 3 0 0;
5 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;
6 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;
7 1.00 0.00 0.00 0.00 2.34 0.84 0.00 0.00 3 0 0;
8 1.00 0.00 0.00 0.00 5.22 1.77 0.00 0.00 3 0 0;
9 1.00 0.00 0.00 0.00 1.04 1.25 0.00 0.00 3 0 0;
10 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;
11 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;
12 1.00 0.00 0.00 0.00 0.09 0.88 0.00 0.00 3 0 0;
13 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;
14 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;
15 1.00 0.00 0.00 0.00 3.200 1.5300 0.00 0.00 3 0 0;
16 1.00 0.00 0.00 0.00 3.290 0.32 0.00 0.00 3 0 0;
17 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;
18 1.00 0.00 0.00 0.00 1.58 0.30 0.00 0.00 3 0 0;
19 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;
20 1.00 0.00 0.00 0.00 6.800 1.03 0.00 0.00 3 0 0;
21 1.00 0.00 0.00 0.00 1.740 1.15 0.00 0.00 3 0 0;
22 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;
23 1.00 0.00 0.00 0.00 1.480 0.85 0.00 0.00 3 0 0;
24 1.00 0.00 0.00 0.00 3.09 -0.92 0.00 0.00 3 0 0;
25 1.00 0.00 0.00 0.00 2.24 0.47 0.00 0.00 3 0 0;
26 1.00 0.00 0.00 0.00 1.39 0.17 0.00 0.00 3 0 0;
27 1.00 0.00 0.00 0.00 2.810 0.76 0.00 0.00 3 0 0;
28 1.00 0.00 0.00 0.00 2.060 0.28 0.00 0.00 3 0 0;
29 1.00 0.00 0.00 0.00 2.840 0.27 0.00 0.00 3 0 0;
30 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;
31 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;
32 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;
33 1.00 0.00 0.00 0.00 1.12 0.00 0.00 0.00 3 0 0;
34 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;
35 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;

© Graham Rogers 2000 to 2008 All rights reserved


37 power flow

36 1.00 0.00 0.00 0.00 1.02 -0.1946 0.00 0.00 3 0 0;


37 1.00 0.00 0.00 0.00 60.00 3.00 0.00 0.00 3 0 0;
38 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;
39 1.00 0.00 0.00 0.00 2.67 0.126 0.00 0.00 3 0 0;
40 1.00 0.00 0.00 0.00 0.6563 0.2353 0.00 0.00 3 0 0;
41 1.00 0.00 0.00 0.00 10.00 2.50 0.00 0.00 3 0 0;
42 1.00 0.00 0.00 0.00 11.50 2.50 0.00 0.00 3 0 0;
43 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3 0 0;
44 1.00 0.00 0.00 0.00 2.6755 0.0484 0.00 0.00 3 0 0;
45 1.00 0.00 0.00 0.00 2.08 0.21 0.00 0.00 3 0 0;
46 1.00 0.00 0.00 0.00 1.507 0.285 0.00 0.00 3 0 0;
47 1.00 0.00 0.00 0.00 2.0312 0.3259 0.00 0.00 3 0 0;
48 1.00 0.00 0.00 0.00 2.4120 0.022 0.00 0.00 3 0 0;
49 1.00 0.00 0.00 0.00 1.6400 0.29 0.00 0.00 3 0 0;
50 1.00 0.00 0.00 0.00 2.00 -1.47 0.00 0.00 3 0 0;
51 1.00 0.00 0.00 0.00 4.37 -1.22 0.00 0.00 3 0 0;
52 1.00 0.00 0.00 0.00 24.70 1.23 0.00 0.00 3 0 0;
53 1.011 0.00 2.50 0.00 0.00 0.00 0.00 0.00 2 999 -999;
54 1.011 0.00 5.45 0.00 0.00 0.00 0.00 0.00 2 999 -999;
55 1.011 0.00 6.50 0.00 0.00 0.00 0.00 0.00 2 999 -999;
56 1.011 0.00 6.32 0.00 0.00 0.00 0.00 0.00 2 999 -999;
57 1.011 0.00 5.052 0.00 0.00 0.00 0.00 0.00 2 999 -999;
58 1.011 0.00 7.00 0.00 0.00 0.00 0.00 0.00 2 999 -999;
59 1.011 0.00 5.60 0.00 0.00 0.00 0.00 0.00 2 999 -999;
60 1.011 0.00 5.40 0.00 0.00 0.00 0.00 0.00 2 999 -999;
61 1.011 0.00 8.00 0.00 0.00 0.00 0.00 0.00 2 999 -999;
62 1.011 0.00 5.00 0.00 0.00 0.00 0.00 0.00 2 999 -999;
63 1.011 0.00 10.000 0.00 0.00 0.00 0.00 0.00 2 999 -999;
64 1.011 0.00 13.50 0.00 0.00 0.00 0.00 0.00 2 999 -999;
65 1.011 0.00 35.91 0.00 0.00 0.00 0.00 0.00 2 999 -999;
66 1.011 0.00 17.85 0.00 0.00 0.00 0.00 0.00 2 999 -999;
67 1.011 0.00 10.00 0.00 0.00 0.00 0.00 0.00 2 999 -999;
68 1.011 0.00 40.00 0.00 0.00 0.00 0.00 0.00 1 999 -999];

% Line data format


% line: from bus, to bus, resistance(pu), reactance(pu),
% line charging(pu), tap ratio, phase shift(deg)

line = [ ...
1 2 0.0070 0.0822 0.3493 0 0.;
1 30 0.0008 0.0074 0.48 0 0.;
2 3 0.0013 0.0151 0.2572 0 0.;
2 25 0.007 0.0086 0.146 0 0.;
2 53 0. 0.0181 0. 1.025 0.;
3 4 0.0013 0.0213 0.2214 0. 0.;
3 18 0.0011 0.0133 0.2138 0. 0.;
4 5 0.0008 0.0128 0.1342 0. 0.;
4 14 0.0008 0.0129 0.1382 0. 0.;
5 6 0.0002 0.0026 0.0434 0. 0.;
5 8 0.0008 0.0112 0.1476 0. 0.;
6 7 0.0006 0.0092 0.1130 0. 0.;
6 11 0.0007 0.0082 0.1389 0. 0.;
6 54 0. 0.0250 0. 1.07 0.;
7 8 0.0004 0.0046 0.078 0. 0.;
8 9 0.0023 0.0363 0.3804 0. 0.;
9 30 0.0019 0.0183 0.29 0. 0.;
10 11 0.0004 0.0043 0.0729 0. 0.;
10 13 0.0004 0.0043 0.0729 0. 0.;
10 55 0. 0.02 0. 1.07 0.;
12 11 0.0016 0.0435 0. 1.06 0.;
12 13 0.0016 0.0435 0. 1.06 0.;
13 14 0.0009 0.0101 0.1723 0. 0.;
14 15 0.0018 0.0217 0.366 0. 0.;
15 16 0.0009 0.0094 0.171 0. 0.;
16 17 0.0007 0.0089 0.1342 0. 0.;
16 19 0.0016 0.0195 0.3040 0. 0.;
16 21 0.0008 0.0135 0.2548 0. 0.;
16 24 0.0003 0.0059 0.0680 0. 0.;
17 18 0.0007 0.0082 0.1319 0. 0.;

© Graham Rogers 2000 to 2008 All rights reserved


38 power flow

17 27 0.0013 0.0173 0.3216 0. 0.;


19 20 0.0007 0.0138 0. 1.06 0.;
19 56 0.0007 0.0142 0. 1.07 0.;
20 57 0.0009 0.0180 0. 1.009 0.;
21 22 0.0008 0.0140 0.2565 0. 0.;
22 23 0.0006 0.0096 0.1846 0. 0.;
22 58 0. 0.0143 0. 1.025 0.;
23 24 0.0022 0.0350 0.3610 0. 0.;
23 59 0.0005 0.0272 0. 0. 0.;
25 26 0.0032 0.0323 0.5310 0. 0.;
25 60 0.0006 0.0232 0. 1.025 0.;
26 27 0.0014 0.0147 0.2396 0. 0.;
26 28 0.0043 0.0474 0.7802 0. 0.;
26 29 0.0057 0.0625 1.0290 0. 0.;
28 29 0.0014 0.0151 0.2490 0. 0.;
29 61 0.0008 0.0156 0. 1.025 0.;
9 30 0.0019 0.0183 0.29 0. 0.;
9 36 0.0022 0.0196 0.34 0. 0.;
9 36 0.0022 0.0196 0.34 0. 0.;
36 37 0.0005 0.0045 0.32 0. 0.;
34 36 0.0033 0.0111 1.45 0. 0.;
35 34 0.0001 0.0074 0. 0.946 0.;
33 34 0.0011 0.0157 0.202 0. 0.;
32 33 0.0008 0.0099 0.168 0. 0.;
30 31 0.0013 0.0187 0.333 0. 0.;
30 32 0.0024 0.0288 0.488 0. 0.;
1 31 0.0016 0.0163 0.25 0. 0.;
31 38 0.0011 0.0147 0.247 0. 0.;
33 38 0.0036 0.0444 0.693 0. 0.;
38 46 0.0022 0.0284 0.43 0. 0.;
46 49 0.0018 0.0274 0.27 0. 0.;
1 47 0.0013 0.0188 1.31 0. 0.;
47 48 0.0025 0.0268 0.40 0. 0.;
47 48 0.0025 0.0268 0.40 0. 0.;
48 40 0.0020 0.022 1.28 0. 0.;
35 45 0.0007 0.0175 1.39 0. 0.;
37 43 0.0005 0.0276 0. 0. 0.;
43 44 0.0001 0.0011 0. 0. 0.;
44 45 0.0025 0.073 0. 0. 0.;
39 44 0. 0.0411 0. 0. 0.;
39 45 0. 0.0839 0. 0. 0.;
45 51 0.0004 0.0105 0.72 0. 0.;
50 52 0.0012 0.0288 2.06 0. 0.;
50 51 0.0009 0.0221 1.62 0. 0.;
49 52 0.0076 0.1141 1.16 0. 0.;
52 42 0.0040 0.0600 2.25 0. 0.;
42 41 0.0040 0.0600 2.25 0. 0.;
41 40 0.0060 0.0840 3.15 0. 0.;
31 62 0. 0.026 0. 1.04 0.;
32 63 0. 0.013 0. 1.04 0.;
36 64 0. 0.0075 0. 1.04 0.;
37 65 0. 0.0033 0. 1.04 0.;
41 66 0. 0.0015 0. 1. 0.;
42 67 0. 0.0015 0. 1. 0.;
52 68 0. 0.0030 0. 1. 0.;
1 27 0.032 0.32 0.41 1. 0.];

% Machine data format


% 1. machine number,
% 2. bus number,
% 3. base mva,
% 4. leakage reactance x_l(pu),
% 5. resistance r_a(pu),
% 6. d-axis sychronous reactance x_d(pu),
% 7. d-axis transient reactance x'_d(pu),
% 8. d-axis subtransient reactance x"_d(pu),
% 9. d-axis open-circuit time constant T'_do(sec),
% 10. d-axis open-circuit subtransient time constant
% T"_do(sec),
% 11. q-axis sychronous reactance x_q(pu),

© Graham Rogers 2000 to 2008 All rights reserved


39 power flow

% 12. q-axis transient reactance x'_q(pu),


% 13. q-axis subtransient reactance x"_q(pu),
% 14. q-axis open-circuit time constant T'_qo(sec),
% 15. q-axis open circuit subtransient time constant
% T"_qo(sec),
% 16. inertia constant H(sec),
% 17. damping coefficient d_o(pu),
% 18. dampling coefficient d_1(pu),
% 19. generator type
% 1 - classical
% 2 - salient pole
% 3 - round rotor
% 20. saturation factor S(1.0)
% 21. saturation factor S(1.2)
% note: all the following machines use subtransient reactance model
disp('subtransient generator models ratings modified to make xd=1.8')
mac_con = [...
1 53 500 0.0125 0 1.8 0.558 0.45 10.2 0.05 ...
1.242 0.504 0.45 1.5 0.035 ...
2.3333 0 0 2 0.0654 0.5743;
2 54 800 0.035 0 1.8 0.42529 0.30508 6.56 0.05 ...
1.7207 0.3661 0.30508 1.5 0.035 ...
4.9494 0 0 3 0.0654 0.5743;
3 55 900 0.0304 0 1.8 0.38309 0.32465 5.7 0.05 ...
1.7098 0.36072 0.32465 1.5 0.035 ...
4.9623 0 0 3 0.0654 0.5743;
4 56 800 0.0295 0 1.8 0.29954 0.24046 5.69 0.05 ...
1.7725 0.27481 0.24046 1.5 0.035 ...
4.1629 0 0 3 0.0654 0.5743;
5 57 700 0.027 0 1.8 0.36 0.27273 5.4 0.05 ...
1.6909 0.32727 0.27273 0.44 0.035 ...
4.7667 0 0 3 0.0654 0.5743;
6 58 900 0.0224 0 1.8 0.35433 0.28346 7.3 0.05 ...
1.7079 0.3189 0.28346 0.4 0.035 ...
4.9107 0 0 3 0.0654 0.5743;
7 59 800 0.0322 0 1.8 0.29898 0.24407 5.66 0.05 ...
1.7817 0.27458 0.24407 1.5 0.035 ...
4.3267 0 0 3 0.0654 0.5743;
8 60 800 0.028 0 1.8 0.35379 0.27931 6.7 0.05 ...
1.7379 0.31034 0.27931 0.41 0.035 ...
3.915 0 0 3 0.0654 0.5743;
9 61 1100 0.0298 0 1.8 0.48718 0.38462 4.79 0.05 ...
1.7521 0.42735 0.38462 1.96 0.035 ...
4.0365 0 0 3 0.0654 0.5743;
10 62 700 0.0199 0 1.8 0.48675 0.42604 9.37 0.05 ...
1.2249 0.47929 0.42604 1.5 0.035 ...
2.9106 0 0 2 0.0654 0.5743;
11 63 1300 0.0103 0 1.8 0.25312 0.16875 4.1 0.05 ...
1.7297 0.21094 0.16875 1.5 0.035 ...
2.0053 0 0 3 0.0654 0.5743;
12 64 1900 0.022 0 1.8 0.55248 0.44554 7.4 0.05 ...
1.6931 0.49901 0.44554 1.5 0.035 ...
5.1791 0 0 3 0.0654 0.5743;
13 65 12000 0.003 0 1.8 0.33446 0.24324 5.9 0.05 ...
1.7392 0.30405 0.24324 1.5 0.035 ...
4.0782 8 0 3 0.0654 0.5743;
14 66 10000 0.0017 0 1.8 0.285 0.23 4.1 0.05 ...
1.73 0.25 0.23 1.5 0.035 ...
3 3 0 3 0.0654 0.5743;
15 67 10000 0.0017 0 1.8 0.285 0.23 4.1 0.05 ...
1.73 0.25 0.23 1.5 0.035 ...
3 3 0 3 0.0654 0.5743;
16 68 11000 0.0041 0 1.8 0.35899 0.27809 7.8 0.05 ...
1.6888 0.30337 0.27809 1.5 0.035 ...
4.45 8 0 3 0.0654 0.5743;
];

© Graham Rogers 2000 to 2008 All rights reserved


40 power flow

disp('identical ac4a exciters set up for simple static exciter model')

exc_con = [...
7 1 0.0 0.0 0.0 100 0.01 0.0 0.0 0 0 0 0 10 ...
-10 0 0 5.64 -4.53 0 0 0 0 0 0 0 0 0 ...
0 0 0;
7 2 0.0 0.0 0.0 100 0.01 0.0 0.0 0 0 0 0 10 ...
-10 0 0 5.64 -4.53 0 0 0 0 0 0 0 0 0 ...
0 0 0;
7 3 0.0 0.0 0.0 100 0.01 0.0 0.0 0 0 0 0 10 ...
-10 0 0 5.64 -4.53 0 0 0 0 0 0 0 0 0 ...
0 0 0;
7 4 0.0 0.0 0.0 100 0.01 0.0 0.0 0 0 0 0 10 ...
-10 0 0 5.64 -4.53 0 0 0 0 0 0 0 0 0 ...
0 0 0;
7 5 0.0 0.0 0.0 100 0.01 0.0 0.0 0 0 0 0 10 ...
-10 0 0 5.64 -4.53 0 0 0 0 0 0 0 0 0 ...
0 0 0;
7 6 0.0 0.0 0.0 100 0.01 0.0 0.0 0 0 0 0 10 ...
-10 0 0 5.64 -4.53 0 0 0 0 0 0 0 0 0 ...
0 0 0;
7 7 0.0 0.0 0.0 100 0.01 0.0 0.0 0 0 0 0 10 ...
-10 0 0 5.64 -4.53 0 0 0 0 0 0 0 0 0 ...
0 0 0;
7 8 0.0 0.0 0.0 100 0.01 0.0 0.0 0 0 0 0 10 ...
-10 0 0 5.64 -4.53 0 0 0 0 0 0 0 0 0 ...
0 0 0;
7 9 0.0 0.0 0.0 100 0.01 0.0 0.0 0 0 0 0 10 ...
-10 0 0 5.64 -4.53 0 0 0 0 0 0 0 0 0 ...
0 0 0;
7 10 0.0 0.0 0.0 100 0.01 0.0 0.0 0 0 0 0 10 ...
-10 0 0 5.64 -4.53 0 0 0 0 0 0 0 0 0 ...
0 0 0;
7 11 0.0 0.0 0.0 100 0.01 0.0 0.0 0 0 0 0 10 ...
-10 0 0 5.64 -4.53 0 0 0 0 0 0 0 0 0 ...
0 0 0;
7 12 0.0 0.0 0.0 100 0.01 0.0 0.0 0 0 0 0 10 ...
-10 0 0 5.64 -4.53 0 0 0 0 0 0 0 0 0 ...
0 0 0;
7 13 0.0 0.0 0.0 100 0.01 0.0 0.0 0 0 0 0 10 ...
-10 0 0 5.64 -4.53 0 0 0 0 0 0 0 0 0 ...
0 0 0;
7 14 0.0 0.0 0.0 100 0.01 0.0 0.0 0 0 0 0 10 ...
-10 0 0 5.64 -4.53 0 0 0 0 0 0 0 0 0 ...
0 0 0;
7 15 0.0 0.0 0.0 100 0.01 0.0 0.0 0 0 0 0 10 ...
-10 0 0 5.64 -4.53 0 0 0 0 0 0 0 0 0 ...
0 0 0;
7 16 0.0 0.0 0.0 100 0.01 0.0 0.0 0 0 0 0 10 ...
-10 0 0 5.64 -4.53 0 0 0 0 0 0 0 0 0 ...
0 0 0;
];

pss_con = [...
1 1 10 10 0.1 0.02 0.08 0.02 0.2 -0.05 0 0 0 0 0 0;
1 2 10 10 0.08 0.02 0.08 0.02 0.2 -0.05 0 0 0 0 0 0;
1 3 10 10 0.08 0.02 0.08 0.02 0.2 -0.05 0 0 0 0 0 0;
1 4 10 10 0.08 0.02 0.08 0.02 0.2 -0.05 0 0 0 0 0 0;
1 5 10 10 0.08 0.02 0.08 0.02 0.2 -0.05 0 0 0 0 0 0;
1 6 10 10 0.1 0.02 0.1 0.02 0.2 -0.05 0 0 0 0 0 0;
1 7 10 10 0.08 0.02 0.08 0.02 0.2 -0.05 0 0 0 0 0 0;
1 8 5 10 0.08 0.02 0.08 0.02 0.2 -0.05 0 0 0 0 0 0;
1 9 10 10 0.08 0.02 0.05 0.01 0.2 -0.05 0 0 0 0 0 0;
1 10 10 10 0.1 0.02 0.1 0.02 0.2 -0.05 0 0 0 0 0 0;
1 11 5 10 0.08 0.03 0.05 0.01 0.2 -0.05 0 0 0 0 0 0;
1 12 11 10 0.1 0.02 0.1 0.02 0.2 -0.05 0 0 0 0 0 0;
];

© Graham Rogers 2000 to 2008 All rights reserved


41 power flow

tgt_con = [...
1 .04 0.1 0.2 0.2 -0.5 0.025 3 0.1 0.1 -0.2 600 0.42 4.2 0.1 0.7 0.25 0.25 0.5;
2 .04 0.1 0.2 0.2 -0.5 0.025 3 0.1 0.1 -0.2 900 0.42 4.2 0.1 0.7 0.25 0.25 0.5;
3 .04 0.1 0.2 0.2 -0.5 0.025 3 0.1 0.1 -0.2 1000 0.42 4.2 0.1 0.7 0.25 0.25 0.5;
4 .04 0.1 0.2 0.2 -0.5 0.025 3 0.1 0.1 -0.2 900 0.42 4.2 0.1 0.7 0.25 0.25 0.5;
5 .04 0.1 0.2 0.2 -0.5 0.025 3 0.1 0.1 -0.2 850 0.42 4.2 0.1 0.7 0.25 0.25 0.5;
6 .04 0.1 0.2 0.2 -0.5 0.025 3 0.1 0.1 -0.2 1000 0.42 4.2 0.1 0.7 0.25 0.25 0.5;
7 .04 0.1 0.2 0.2 -0.5 0.025 3 0.1 0.1 -0.2 900 0.42 4.2 0.1 0.7 0.25 0.25 0.5;
8 .04 0.1 0.2 0.2 -0.5 0.025 3 0.1 0.1 -0.2 900 0.42 4.2 0.1 0.7 0.25 0.25 0.5;
9 .04 0.1 0.2 0.2 -0.5 0.025 3 0.1 0.1 -0.2 850 0.42 4.2 0.1 0.7 0.25 0.25 0.5;
10 .04 0.1 0.2 0.2 -0.5 0.025 3 0.1 0.1 -0.2 900 0.42 4.2 0.1 0.7 0.25 0.25 0.5;
11 .04 0.1 0.2 0.2 -0.5 0.025 3 0.1 0.1 -0.2 1500 0.42 4.2 0.1 0.7 0.25 0.25 0.5;
12 .04 0.1 0.2 0.2 -0.5 0.025 3 0.1 0.1 -0.2 2000 0.42 4.2 0.1 0.7 0.25 0.25 0.5;
13 .04 0.1 0.2 0.2 -0.5 0.025 3 0.1 0.1 -0.2 14000 0.42 4.2 0.1 0.7 0.25 0.25 0.5;
14 .04 0.1 0.2 0.2 -0.5 0.025 3 0.1 0.1 -0.2 12000 0.42 4.2 0.1 0.7 0.25 0.25 0.5;
15 .04 0.1 0.2 0.2 -0.5 0.025 3 0.1 0.1 -0.2 12000 0.42 4.2 0.1 0.7 0.25 0.25 0.5;
16 .04 0.1 0.2 0.2 -0.5 0.025 3 0.1 0.1 -0.2 13000 0.42 4.2 0.1 0.7 0.25 0.25 0.5;
];

% non-conforming load
% col 1 bus number
% col 2 fraction const active power load
% col 3 fraction const reactive power load
% col 4 fraction const active current load
% col 5 fraction const reactive current load

load_con = [...
1 0 0 .5 0;
3 0 0 .5 0;
4 0 0 .5 0;
7 0 0 .5 0;
8 0 0 .5 0;
9 0 0 .5 0;
15 0 0 .5 0;
16 0 0 .5 0;
18 0 0 .5 0;
20 0 0 .5 0;
21 0 0 .5 0;
23 0 0 .5 0;
24 0 0 .5 0;
25 0 0 .5 0;
26 0 0 .5 0;
27 0 0 .5 0;
28 0 0 .5 0;
29 0 0 .5 0;
33 0 0 .5 0;
37 0 0 .5 0;
39 0 0 .5 0;
40 0 0 .5 0;
41 0 0 .5 0;
42 0 0 .5 0;
44 0 0 .5 0;
45 0 0 .5 0;
46 0 0 .5 0;
47 0 0 .5 0;
48 0 0 .5 0;
49 0 0 .5 0;
50 0 0 .5 0;
51 0 0 .5 0;
52 0 0 .5 0
];
%load_con(:,[2 4])=repmat([1 0],size(load_con,1),1); % const power
%load_con(:,[2 4])=repmat([0 1],size(load_con,1),1); % const current
%load_con(:,[2 4])=repmat([0 0],size(load_con,1),1); % const impedance

%active and reactive load modulation enabled


lmod_con = [...
1 100 1 -1 1 0.05 0 0;
3 100 1 -1 1 0.05 0 0;
4 100 1 -1 1 0.05 0 0;

© Graham Rogers 2000 to 2008 All rights reserved


42 power flow

7 100 1 -1 1 0.05 0 0;
8 100 1 -1 1 0.05 0 0;
9 100 1 -1 1 0.05 0 0;
15 100 1 -1 1 0.05 0 0;
16 100 1 -1 1 0.05 0 0;
18 100 1 -1 1 0.05 0 0;
20 100 1 -1 1 0.05 0 0;
21 100 1 -1 1 0.05 0 0;
23 100 1 -1 1 0.05 0 0;
24 100 1 -1 1 0.05 0 0;
25 100 1 -1 1 0.05 0 0;
26 100 1 -1 1 0.05 0 0;
27 100 1 -1 1 0.05 0 0;
28 100 1 -1 1 0.05 0 0;
29 100 1 -1 1 0.05 0 0;
33 100 1 -1 1 0.05 0 0;
37 100 1 -1 1 0.05 0 0;
39 100 1 -1 1 0.05 0 0;
40 100 1 -1 1 0.05 0 0;
41 100 1 -1 1 0.05 0 0;
42 100 1 -1 1 0.05 0 0;
44 100 1 -1 1 0.05 0 0;
45 100 1 -1 1 0.05 0 0;
46 100 1 -1 1 0.05 0 0;
47 100 1 -1 1 0.05 0 0;
48 100 1 -1 1 0.05 0 0;
49 100 1 -1 1 0.05 0 0;
50 100 1 -1 1 0.05 0 0;
51 100 1 -1 1 0.05 0 0;
52 100 1 -1 1 0.05 0 0;
];
lmod_con = [];
rlmod_con = [...
1 100 1 -1 1 0.05 0 0;
3 100 1 -1 1 0.05 0 0;
4 100 1 -1 1 0.05 0 0;
7 100 1 -1 1 0.05 0 0;
8 100 1 -1 1 0.05 0 0;
9 100 1 -1 1 0.05 0 0;
15 100 1 -1 1 0.05 0 0;
16 100 1 -1 1 0.05 0 0;
18 100 1 -1 1 0.05 0 0;
20 100 1 -1 1 0.05 0 0;
21 100 1 -1 1 0.05 0 0;
23 100 1 -1 1 0.05 0 0;
24 100 1 -1 1 0.05 0 0;
25 100 1 -1 1 0.05 0 0;
26 100 1 -1 1 0.05 0 0;
27 100 1 -1 1 0.05 0 0;
28 100 1 -1 1 0.05 0 0;
29 100 1 -1 1 0.05 0 0;
33 100 1 -1 1 0.05 0 0;
37 100 1 -1 1 0.05 0 0;
39 100 1 -1 1 0.05 0 0;
40 100 1 -1 1 0.05 0 0;
41 100 1 -1 1 0.05 0 0;
42 100 1 -1 1 0.05 0 0;
44 100 1 -1 1 0.05 0 0;
45 100 1 -1 1 0.05 0 0;
46 100 1 -1 1 0.05 0 0;
47 100 1 -1 1 0.05 0 0;
48 100 1 -1 1 0.05 0 0;
49 100 1 -1 1 0.05 0 0;
50 100 1 -1 1 0.05 0 0;
51 100 1 -1 1 0.05 0 0;
52 100 1 -1 1 0.05 0 0;
];
rlmod_con = [];

© Graham Rogers 2000 to 2008 All rights reserved


43 power flow

ind_con = [ ...
1 1 150 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
2 3 200 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
3 4 350 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
4 7 150 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
5 8 325 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
6 9 60 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
7 12 5 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
8 15 200 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
9 16 200 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
10 18 100 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
11 20 400 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
12 21 100 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
13 23 100 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
14 24 175 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
15 25 150 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
16 26 100 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
17 27 200 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
18 28 120 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
19 29 200 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
20 33 75 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
21 36 75 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
22 40 50 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
23 45 120 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
24 46 100 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
25 47 120 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
26 48 200 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
27 49 110 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
28 50 130 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
29 51 300 .03274 .08516 3.7788 .06164 .06005 1.0 0.01354 0.07517 0 3 0 .5;
];
mld_con = [ ...
1 1 .1 1 .7 2;
2 3 .1 1 .7 2;
3 4 .1 1 .7 2;
4 7 .1 1 .7 2;
5 8 .1 1 .7 2;
6 9 .1 1 .7 2;
7 12 .1 1 .7 2;
8 15 .1 1 .7 2;
9 16 .1 1 .7 2;
10 18 .1 1 .7 2;
11 20 .1 1 .7 2;
12 21 .1 1 .7 2;
13 23 .1 1 .7 2;
14 24 .1 1 .7 2;
15 25 .1 1 .7 2;
16 26 .1 1 .7 2;
17 27 .1 1 .7 2;
18 28 .1 1 .7 2;
19 29 .1 1 .7 2;
20 33 .1 1 .7 2;
21 36 .1 1 .7 2;
22 40 .1 1 .7 2;
23 45 .1 1 .7 2;
24 46 .1 1 .7 2;
25 47 .1 1 .7 2;
26 48 .1 1 .7 2;
27 49 .1 1 .7 2;
28 50 .1 1 .7 2;
29 51 .1 1 .7 2;
];
hgt_con = [];
uel_con = [];
oel_con = [];
svc_con = [];
tcsc_con = [];
upfc_con = [];
dcl_con = [];dcr_con = [];dci_con = [];
dcld_con = [];dcrc_con = [];dcic_con = [];

© Graham Rogers 2000 to 2008 All rights reserved


44 power flow

g14 g1 g8

66 53 60 29

41 47 2 25 26 28 61
40 48

g9
42 3 27
1 18 17
67 38 30
31 32
4 15
9
g15 63 16 21 24
62
8 5 14 19 22 23
46 13
g10 g11 58 59
12 56
7 6 11 20
33
54 10
49 34 36 g4 g6 g7
57
64 55
35 g2
51 45
g12 g3 g5
50 37
52 44 39
43
68
65

g16
g13

Figure 17 16 machine system showing coherent bus systems and tie lines

The load and generation in the magenta area will be increased in the voltage stability program.
g_idx = [1:9]';
l_idx = [3 4 7:9 12 15 16 18 20 21 23:29]';
[n_c,V,A,PL,QL,PG,QG,BS,PIM,QIM,SIM,J_c,p]=...
vstab(n,0.1,0,30,200,'l_index',l_idx,'g_index',g_idx,'iter_max',15);

The variation in the system’s bus voltages is shown in Figure 15.

© Graham Rogers 2000 to 2008 All rights reserved


45 power flow

Figure 18 Variation of bus voltage

Close to the collapse point, the some induction motors draw considerably increased reactive power, as
shown in Figure 19.

Figure 19 Induction motor reactive power

The motors’ slips are shown in Figure 20

© Graham Rogers 2000 to 2008 All rights reserved


46 power flow

Figure 20 Induction motor slip

It can be seen that as the system reaches its maximum loadability, some induction motors stall and their slip
and reactive power increase.

© Graham Rogers 2000 to 2008 All rights reserved


47 Functions

4 Viewing Results
There are a number of net_c class functions which may be used to examine the results of power flow
analysis. The basic net_c class subsref function gives access to all of the fields of a net_c class object -
subsref functions for the parent classes give access to their fields. This enables the results to be plotted with
MATLAB graphics functions such as plot and bar.

4.1 Examples

4.1.1 Comparing voltage magnitude for different cases


Since the data about area and zone are included in the net_c objects fields, the power flow results may be
viewed by zone or area. For example, to plot a bar chart of voltage magnitudes of the the bench system
cases at the buses in Zone number 10, one may use

bus_idx = find(n1.bus_c.Zone == 10);


Vm = n.bus_c.VoltMag(bus_idx);
Vm1 = n1.bus_c.VoltMag(bus_idx);
Vm 2= n2.bus_c.VoltMag(bus_idx);
subplot(3,1,1);bar(Vm),axis([0 90 0.9 1.1]);
title('voltage magnitudes zone 10')
subplot(3,1,2);bar(Vm1),axis([0 90 0.9 1.1]);
subplot(3,1,3);bar(Vm2),axis([0 90 0.9 1.1]);
xlabel('zone bus index')

The text was added using the MATLAB graphics edit facility.

Figure 21 Voltage Magnitudes in Zone 10

© Graham Rogers 2000 to 2008 All rights reserved


48 Functions

4.1.2 Plotting Line Loss


To plot the losses for the solved case associated with the lines in Zone 10, it is first necessary to find the
lines which are included in the zone loss report. This is done by calling the net_c class function allzone,
i.e.,

line_idx = allzone(n1,10);

Then the losses in the lines specified by line_idx are determined using the net_c class function line_flow,
i.e.,
[P_f,Q_f,P_t,Q_t,cur_f,cur_t,losses]=line_flow(n1,line_idx,1);
bar(losses*n1.bus_c.BasMva);
ylabel('line losses (MW)')
xlabel('Zone 10 line index')
title('Line Losses Zone 10')

Figure 22 Line Losses for Zone 10

It can be seen from Figure 22 that one line has very high losses compared to the other lines in Zone 10. To
find the line number

[ml,mli] = max(losses); lnum = line_idx(mli);

The line data for lnum (in this case mli = 80 and lnum = 151) may then be examined

R = n1.line_c.R(151); X = n1.line_c.X(151);

The line is at 500 Kv, which may be determined from


fbi = n1.line_c.FromIndex(151);tbi = n1.line_c.ToIndex;
Vbf = n1.bus_c.BaseVolts(fbi); Vbi = n1.bus_c.BaseVolts(tbi);

© Graham Rogers 2000 to 2008 All rights reserved


49 Functions

Both Vbf and Vbi are 500.

R = 0.00248 PU and X = 0.0165 PU

These indicate that the line about 220 Km long, which is not improbable. Thus the high loss does not
indicate bad data in this case.

To check the line current against the line's current rating, the current rating may be extracted using

crat = n1.line_c.CurRat(151,:)
ans =

(1,1) 1836

Three current ratings may be specified for each line. In this case there is only one. The rating is in MVA at
the rated voltage. This should be compared to the absolute value of the from and to bus currents multiplied
by the system MVA base. For this line, at the from bus it is 1699.3 MVA and at the to bus 1738.4 MVA.
The line is highly loaded, but not over loaded.

Power and reactive power interchange between areas may be calculated using the net_c class function
area_int.

[P_net,Q_net]= area_int(n1)

P_net =

(3,1) 2.2503
(8,1) -2.3742
(1,3) -2.2503
(1,8) 2.3742

Q_net =

(3,1) -2.2513
(8,1) 2.356
(1,3) 2.2513
(1,8) -2.356

subplot(2,1,1);bar(P_net(1,:));subplot(2,1,2);bar(Q_net(1,:));

© Graham Rogers 2000 to 2008 All rights reserved


50 Functions

Figure 23 Area interchange from Area 1

© Graham Rogers 2000 to 2008 All rights reserved


51 Functions

5 MATLAB Functions in the MatNetFlow Directory


There is one general function, which augments the normal complement of MATLAB functions, contained in
the MatNetFlow Directory. It is a derivative of the MATLAB set theory function intersect, and is used to
avoid time consuming for loops.

5.1 com_index
Purpose
Finds common index values.

Syntax
[Indexc1,Indexc2] = com_index(Index1,Index2)

Inputs
Index1 - First index vector
Index2 - Second index vector

Outputs
Indexc1 and Indexc2 such that Index1(Indexc1) = Index2(Indexc2) are the common indexes.

Algorithm
Uses unique to eliminate multiple entries in Index1 and Index2. Then intersect is used repeatedly to obtain
an index containing all common entries in the two indexes Index1 and Index2.

Calls
intersect

Called by
net_c, net_idxud, allarea, allzone, jacline, lfreport, line_flow

5.1.1 Example
With the two index vectors
index1 = index2 =

1 1
3 2
3 2
5 3
7 3
7 4
9 4
5
5
8
8
8
9
9
9

© Graham Rogers 2000 to 2008 All rights reserved


52 Functions

[indexc1,indexc2]=com_index(index1,index2)

gives

indexc1 = indexc2 =

1 1
3 4
3 5
4 8
4 9
7 13
7 14
7 15

[index1(indexc1) index2(indexc2)]

ans =

1 1
3 3
3 3
5 5
5 5
9 9
9 9
9 9

For comparison, the intersection of index1 and index2 is the vector of common values, i.e.,

intersect(index1,index2)

ans =

1
3
5
9

© Graham Rogers 2000 to 2008 All rights reserved


53 Functions

5.2 Induction Machine Functions

5.2.1 dbcage
Purpose
Used to calculate the equivalent rotor resistance and reactance of a double cage induction machine at a
particular value of slip.

Syntax
[r,x]=dbcage(r1,x1,r2,x2,s);

Inputs
r1 - first rotor cage resistance PU on machine base
x1 - first rotor cage reactance PU on machine base
r2 - second rotor cage resistance PU on machine base
x2 - second rotor cage reactance PU on machine base
s - fractional slip

Outputs

r - equivalent rotor resistance


x - equivalent rotor reactance

xr1 xr2
rre/s+ixre
rr1/s rr2/s

Figure 24 Double cage rotor model

r = rre; x = xre

© Graham Rogers 2000 to 2008 All rights reserved


54 Functions

5.2.2 dbar
Purpose
Used to calculate the equivalent rotor resistance and reactance of a deep bar induction machine at a
particular value of slip.

Syntax
[r,x]=deepbar(rro,dbf,s);

Inputs
rro - deep bar resistance at zero slip PU on machine base
dbf - deep bar factor
s - fractional slip

Outputs
r - equivalent rotor resistance
x - equivalent rotor reactance

ωr μ o σ
2(1+ i) d
r r ω μ σ [e 2
+ 1]
+ ix = ro (1 + i)d r o ωr μ o σ
s s 2 2(1+ i) d
[e 2
− 1]

Where, ωr = sωo ,d is the depth of the rotor bar, and σ is the conductivity of the rotor bar.
The deep bar factor is defined as
dbf = d 2ωoμ o σ

5.2.3 zdc

Purpose

Calculates the impedances currents of a double cage induction machine for a given terminal voltage and
slip.

Syntax
[zr,zi,xss,xrs,rre,xre,is1,ir1,eflag]=zdc(rs,xs,Xm,xr1,xr2,rr1,rr2,v,s,isat);

Inputs

rs - stator resistance PU on machine base


xs - stator leakage reactance PU on machine base
Xm - magnetizing reactance PU on machine base
xr1 - first rotor leakage reactance PU on machine base
xr2 - second rotor leakage reactance PU on machine base
rr1 - first rotor resistance PU on machine base
rr2 - second rotor resistance PU on machine base
v - terminal voltage PU

© Graham Rogers 2000 to 2008 All rights reserved


55 Functions

s - fractional slip
isat - current at which leakage inductances saturate PU

Outputs
zr - real part of motor impedance at the stator terminals PU
zi - imaginary part of motor impedance at the stator terminals PU
xss - saturated value of stator leakage reactance PU
xrs - saturated value of rotor leakage reactance PU
rre - effective rotor resistance
xre - effective rotor reactance
is1 - stator current magnitude
ir1 - rotor current magnitude
eflag - set to 1 if algorithm does not converge, otherwise 0

5.2.4 zdb

Purpose

Calculates the impedances currents of a deep bar induction machine for a given terminal voltage and slip.

Syntax
[zr,zi,xss,xrs,rre,xre,is1,ir1,eflag]=zdb(rs,xs,Xm,xr,rr,dbf,v,s,isat);

Inputs

rs - stator resistance PU on machine base


xs - stator leakage reactance PU on machine base
Xm - magnetizing reactance PU on machine base
xr - rotor leakage reactance PU on machine base
rr - rotor resistance at s=0 PU on machine base
v - terminal voltage PU
s - fractional slip
isat - current at which leakage inductances saturate PU

Outputs
zr - real part of motor impedance at the stator terminals PU
zi - imaginary part of motor impedance at the stator terminals PU
xss - saturated value of stator leakage reactance PU
xrs - saturated value of rotor leakage reactance PU
rre - effective rotor resistance
xre - effective rotor reactance
is1 - stator current magnitude
ir1 - rotor current magnitude
eflag - set to 1 if algorithm does not converge, otherwise 0

© Graham Rogers 2000 to 2008 All rights reserved


56 Functions

5.2.5 zsc
Purpose

Calculates the impedances currents of a single cage induction machine for a given terminal voltage and
slip.

Syntax
[zr,zi,xss,xrs,is1,ir1,eflag]=zsc(rs,xs,Xm,xr,rr,v,s,isat);

Inputs

rs - stator resistance PU on machine base


xs - stator leakage reactance PU on machine base
Xm - magnetizing reactance PU on machine base
xr - rotor leakage reactance PU on machine base
rr - rotor resistance at s=0 PU on machine base
v - terminal voltage PU
s - fractional slip
isat - current at which leakage inductances saturate PU

Outputs
zr - real part of motor impedance at the stator terminals PU
zi - imaginary part of motor impedance at the stator terminals PU
xss - saturated value of stator leakage reactance PU
xrs - saturated value of rotor leakage reactance PU
is1 - stator current magnitude
ir1 - rotor current magnitude
eflag - set to 1 if algorithm does not converge, otherwise 0

© Graham Rogers 2000 to 2008 All rights reserved


57 Appendix 1

6 Appendix 1
The bus and line specification matrices used in the Power System Toolbox version 2.0 are defined in this
appendix.

6.1 The bus specification matrix

Table 1 Bus Specification Matrix Format

column variable unit


1 bus number
2 voltage pu
3 angle degrees
4 P generation pu on system base
5 Q generation pu on system base
6 P load pu on system base
7 Q load pu on system base
8 G shunt pu on system base
9 B shunt pu on system base
10 bus type 1, swing bus
2, generator (PV) bus
3, load (PQ) bus
11 Q gen max pu on system base
12 Q gen min pu on system base
13 rated bus voltage kV
14 Maximum bus voltage pu
15 Minimum bus voltage pu

6.2 The line specification matrix

Table 2 Line Specification Matrix Format

column variable unit


1 from bus
2 to bus
3 resistance pu
4 reactance pu
5 line charging pu
6 tap ratio 0 - no tap changing
7 phase shifter angle degrees
8 maximum tap ratio
9 minimum tap ratio
10 tap step

It is assumed that the tap and the phase shifter are located at the from bus. There is no need to input tap and
phase shifter data if there are none.

© Graham Rogers 2000 to 2008 All rights reserved


58 Appendix 1

6.3 Induction machine data specification matrices

Table 3 ind_con specification format


column variable unit
1 machine number
2 bus number
3 rs - stator resistance PU on machine base
4 xs - stator leakage reactance PU on machine base
5 Xm - magnetizing reactance PU on machine base
6 rr - rotor resistance PU on machine base
7 xr - rotor leakage reactance PU on machine base
8 H - inertia constant s
9 rr1 - second rotor cage resistance PU on machine base
10 xr1 - second rotor cage reactance PU on machine base
11 dbf - deep bar factor
12 isat - saturation current level PU on machine base
15 fraction of bus active power load
drawn by induction machine

Table 4 mld_con specification format

Column variable unit


1 induction machine number
2 induction machine bus number
3 stiction torque coefficient kst PU
5 stiction index tsti
6 speed torque coefficient kspd PU
7 speed index tspdi

Note:
Tload = k st s tsti + k spd (1 − s) tspdi

© Graham Rogers 2000 to 2008 All rights reserved

You might also like