Professional Documents
Culture Documents
Mat Net Flow
Mat Net Flow
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
Construct
network class
net_c
n us
Examine
network
Power Flow
Save Solution
netflow
ns
Modify network
nmod
Power Flow
Solution
netflow
n mods
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
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
G1 G3
1 11
10
110
3 101 13
20 120
2 4 14 12
G2 G4
The bus and line data specification matrices are contained in the file d2a_sb.m in the MatNetRd directory.
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 =
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.
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
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.
bar(n.bus_c.VoltMag)
title('bus voltage magnitude for two area system')
xlabel('internal bus number')
ylabel('voltage magnitude PU')
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
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.
lfreport(n,13)
Load Flow Report
d2asb
base
Solved Bus Data
Bus# Voltage(pu) Ang(degrees) BusG(MVa) BusB(MVa)
13 14 14 1.0000 0.0000
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.
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
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.
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 ';
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.
13 14 14 0.9938 0.0000
The voltage magnitudes and angles of the unsolved and solved cases may be displayed using
These statements invoke the subsref functions of the net_c class and its parent class bus_c.
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
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.
3 4 4 0.9938 0.0000
Other solution options are shown in Table 1. The options may appear in any order as a string ,value
combination.
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
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.
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)
Pnet1 = area_int(n)
Pnet1 =
(3,1) 2.2503
(8,1) -0.22609
(1,3) -2.2503
(1,8) 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.
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
G1
G3
G2 2
4
1 5 6
G4
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
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)
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
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.
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
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
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.
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)
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.
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.
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]
Q: [3x1 double]
kst: [3x1 double]
tsti: [3x1 double]
kspd: [3x1 double]
tspdi: [3x1 double]
Error: 0
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.
[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')
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
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.
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.
[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);
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.
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.
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);
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.
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:
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);
[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,:))
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
10
8
Reactive Power PU
-2
23 24 25 26 27 28 29 30 31 32
Total Generation 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
6
Reactive Power PU
-2
23 24 25 26 27 28 29 30 31 32
Total Generation Zone 1
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;
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.;
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;
];
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
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 = [];
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 = [];
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);
Close to the collapse point, the some induction motors draw considerably increased reactive power, as
shown in Figure 19.
It can be seen that as the system reaches its maximum loadability, some induction motors stall and their slip
and reactive power increase.
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
The text was added using the MATLAB graphics edit facility.
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')
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
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);
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,:));
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
[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
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
xr1 xr2
rre/s+ixre
rr1/s rr2/s
r = rre; x = xre
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
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
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.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
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
6 Appendix 1
The bus and line specification matrices used in the Power System Toolbox version 2.0 are defined in this
appendix.
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.
Note:
Tload = k st s tsti + k spd (1 − s) tspdi