Sie sind auf Seite 1von 202

Transient Stability Calculations Using DCPS-TS

- Modeling, Analysis and Computation

Postgraduate Course - 1 Semester

By Sallehhudin Yusof, APS, Malaysia


2008, 2009, Revised Jan – May 2010
1
Contents

PREFACE ...........................................................................................................................................................................6
1. OVERVIEW OF EXECUTING DCPS-TS STEP-BY-STEP..................................................................................................7
1.1 INTRODUCTION ................................................................................................................................................................7
1.2 STARTING DCPS-TS....................................................................................................................................................... 11
1.3 SETTING PARAMETERS FOR CALCULATIONS ............................................................................................................................ 13
1.4 READ THE SOLVED LOAD FLOW CASE ................................................................................................................................... 14
1.5 READ DYNAMIC DATA FILE ................................................................................................................................................ 15
1.6 ORDER THE NETWORK MATRIX ........................................................................................................................................... 16
1.7 ESTABLISH THE NETWORK ADMITTANCE MATRIX ..................................................................................................................... 17
1.8 CALCULATE BUS POWERS .................................................................................................................................................. 18
1.9 INITIALIZE MACHINE STATES ............................................................................................................................................. 19
1.10 INITIALIZE EXCITATION SYSTEM STATES ............................................................................................................................... 20
1.11 INITIALIZE TURBINE-GOVERNOR SYSTEM STATES .................................................................................................................... 20
1.12 MODIFY ADMITTANCE MATRIX TO INCLUDE MACHINE IMPEDANCE ................................................................................................ 21
1.13 MODIFY ADMITTANCE MATRIX TO INCLUDE LOAD ADMITTANCE .................................................................................................... 22
1.14 CALCULATE CURRENT INJECTIONS ....................................................................................................................................... 23
1.15 FACTORISE ADMITTANCE MATRIX ........................................................................................................................................ 24
1.16 SPECIFY STATES AND CONTROLS TO BE RECORDED .................................................................................................................. 26
1.17 PERFORM SIMULATION RUN WITHOUT DISTURBANCE ............................................................................................................... 30
1.18 APPLY DISTURBANCE/REMOVE DISTURBANCE ......................................................................................................................... 31
1.19 RUN SIMULATION TO THE END ........................................................................................................................................... 32
1.20 PLOTTING RESULTS ......................................................................................................................................................... 33
1.21 ANALYSING RESPONSE OF STATES AND CONTROLS ................................................................................................................... 40
2. DETAILED CALCULATIONS FOR TRANSIENT STABILITY..........................................................................................45
2.1 SOLVED LOAD FLOW CASE ................................................................................................................................................ 45
2.1.1 Exercise 2.1 (Assignment #1)................................................................................................................................... 51
2.2 UNDERSTANDING DYNAMIC DATA AND READING INTO DCPS ...................................................................................................... 55
2.2.0 General .................................................................................................................................................................. 55

2
2.2.1 Machine Electrics..................................................................................................................................................... 56
2.2.2 Excitation Controls................................................................................................................................................... 60
2.2.3 Turbine-Governor Control......................................................................................................................................... 63
2.2.4 Power System Stabiliser Data ................................................................................................................................... 64
2.2.5 Frequency-Based Load-Shedding Relays.................................................................................................................... 64
2.2.6 Load Dynamic Model Data........................................................................................................................................ 64
2.3 NETWORK ORDERING, SPARSITY AND ADMITTANCE MATRIX ....................................................................................................... 65
2.3.1 General .................................................................................................................................................................. 65
2.3.2 Sparse Storage........................................................................................................................................................ 66
2.3.3 Sparsity Arithmetics................................................................................................................................................. 69
2.3.4 Network Ordering.................................................................................................................................................... 71
2.4 CALCULATION OF BUS POWER ............................................................................................................................................ 76
2.5 INITIAL CONDITIONS CALCULATIONS FOR MACHINE STATES........................................................................................................ 78
2.5.1 General .................................................................................................................................................................. 78
2.5.2 Gen0 – Classical Model ............................................................................................................................................ 79
2.5.3 gen 2 – Transient Level Model.................................................................................................................................. 83
2.5.4 gen5 – Sub-Transient Level Model ............................................................................................................................ 86
2.6 INITIAL CONDITION CALCULATIONS FOR EXCITATION SYSTEM ..................................................................................................... 88
2.6.1 General .................................................................................................................................................................. 88
2.6.2 Exc10, Excitation system with a simple gain .............................................................................................................. 88
2.6.3 Exc1, IEEE Type 1 Excitation Control......................................................................................................................... 91
2.7 INITIAL CONDITION CALCULATIONS FOR TURBINE-GOVERNOR ..................................................................................................... 93
2.7.1 General .................................................................................................................................................................. 93
2.7.2 gov10, Simple Turbine-Governor .............................................................................................................................. 93
2.7.3 gov2, PSS/E TGOV1 Model with Deadband Added ...................................................................................................... 96
2.7.3 gov2, PSS/E TGOV1 Model with Deadband Added ...................................................................................................... 96
2.8 MODIFY ADMITTANCE MATRIX TO INCLUDE MACHINE IMPEDANCE ................................................................................................ 98
2.9 MODIFY ADMITTANCE MATRIX TO INCLUDE LOAD ADMITTANCE ................................................................................................. 102
2.10 CALCULATE CURRENT INJECTIONS ..................................................................................................................................... 105
2.10.1 Static Load Current Injection............................................................................................................................... 105
2.10.2 Generating Unit Current Injection ........................................................................................................................ 105
2.11 FACTORISE ADMITTANCE MATRIX ...................................................................................................................................... 106
2.12 STATES AND CONTROLS TO BE CAPTURED FOR OUTPUT ........................................................................................................... 108
3
2.13 NUMERICAL SOLUTIONS OF FIRST-ORDER DIFFERENTIAL EQUATIONS .......................................................................................... 110
2.13.1 One-Step Method ............................................................................................................................................... 110
2.13.2 Multi-Step Methods ............................................................................................................................................ 116
2.14 DYNAMIC SOLUTION APPROACHES AND METHODS .................................................................................................................. 119
2.15 NEWTON-BASED METHOD FOR SOLUTION OF POWER SYSTEM DYNAMIC EQUATIONS........................................................................ 120
2.15.1 Newton-Raphson Method for Solutions of Non-Linear Equations............................................................................. 120
2.15.2 Newton Method for Power System Dynamics ........................................................................................................ 121
3. SMALL SIGNAL STABILITY ANALYSIS USING DCPS-AACG ....................................................................................122
4. APPENDICES ..........................................................................................................................................................123
4.1 APPENDIX A – DCPS-LF LOAD FLOW TUTORIAL ................................................................................................................... 124
A.1 Introduction.......................................................................................................................................................... 124
A.2 Starting DCPS ....................................................................................................................................................... 125
A.3 Preparing Load Flow File ........................................................................................................................................ 128
A.4 Solving Load Flow ................................................................................................................................................. 133
A.5 Load Flow Outputs ................................................................................................................................................ 138
Assignment #A4.1........................................................................................................................................................... 142
4.2 APENDIX B - EXCEL VBA AS A CALCULATION TOOL ................................................................................................................ 143
B.1 Introduction.......................................................................................................................................................... 143
B.2 Visual Basic and Control Toolbox Toolbars ............................................................................................................... 145
B.3 Referencing to Cells and Range of Cells................................................................................................................... 147
B.4 Program Controls .................................................................................................................................................. 148
B.5 Searching a Particular Data Item from a List............................................................................................................ 151
4.3 APPENDIX C – PER UNIT SYSTEM ...................................................................................................................................... 153
4.4 APPENDIX D – DIFFERENTIAL EQUATIONS FOR CONTROL BLOCKS AND THEIR NUMERICAL SOLUTIONS .................................................. 155
D.1 Integrator............................................................................................................................................................. 155
D.2 First-Order Lag...................................................................................................................................................... 156
D.3 Washout............................................................................................................................................................... 158
4.5 APPENDIX E – POWER-ANGLE CURVE AND STEADY-STATE STABILITY .......................................................................................... 159
4.6 APPENDIX F – A GUIDELINE FOR ADDING MODELS IN DCPS-TS................................................................................................ 164
F.1 Excitation Controller Model..................................................................................................................................... 164
F.2 Power System Stabiliser ......................................................................................................................................... 169

4
F.3 Turbine-Governor .................................................................................................................................................. 177
APPENDIX G – COURSE PROJECT ................................................................................................................................................ 189
G.1 Project Requirements............................................................................................................................................. 189
G.2 Excitation Systems ................................................................................................................................................ 190
G.3 Turbine-Governor System ...................................................................................................................................... 196
G.4 Dynamic Load Models and Load-Shedding Relays..................................................................................................... 199
G.5 Protective Relay Model........................................................................................................................................... 200
G.6 SVC Model ............................................................................................................................................................ 201

5
Preface

Application aspects of power system dynamics and controls can usually be acquired or learnt through industry experience and
professional courses – work in utility planning, operation, consulting, as well as in power plants. In utility practices, power system
dynamic calculations are carried out using commercial software packages and the two most important aspects of such applications
are:
ƒ to ensure that the input data and assumptions are correct; and
ƒ the outputs are reasonable/practical and can be analysed and understood.

In utility practices, aspects of dynamic computational methods are not normally the concern. Therefore, there is a gap in the
understanding of computational methods, limitations, applications, future trends and innovations. This course intends to fill the
gap and a postgraduate course like this would present a good opportunity for students as well as practicing engineers to explore
and understand power system dynamic computations and perhaps to take up the subject as research area/interest.

On completion of this course, students should be able to:


ƒ Perform fundamental modelling and computation related to power system dynamics;
ƒ Acquire skills in modelling of dynamic devices that can be incorporated in power system dynamic simulations;
ƒ Identify and predict dynamic behaviour of power systems subject to various disturbances from the aggregated behaviour of
the many dynamic devices; and
ƒ Identify and evaluate current trends in power system dynamics and security analysis for further research.

The first part of the course would be for students to familiarize themselves with the applications of DCPS-TS transient stability
program through several assignments. The second part of the course will be to explore how dynamic computations are carried out
and most of the time with reference to the implementation in DCPS-TS.

Also included in this booklet are several appendices comprising among others, load flow tutorial, per unit system, solutions of first-
order differential equations, power-angle curve, using VBA, etc..

Sallehhudin Yusof, Bukit Sentosa, Hulu Selangor, 2009, 2010

6
1. Overview of Executing DCPS-TS Step-by-Step
1.1 Introduction

The objective of this tutorial document is to explain the step-by-step procedure of performing transient stability calculations
using DCPS-TS. It is assumed that the reader is already familiar with the load flow modeling, calculations and examination of
the results using DCPS-LF (see Appendix A for Load Flow Tutorial). In this tutorial, we will use a four bus network as shown in
Figure 1.

3000
1000 load 2000
Slack 50MW
bus 30MVAR j0.2 50MW
j0.1
G G
j0.2
1.0 p.u.
genpv
20MVAR j0.4
1.0 p.u.
genslk

4000
All line impedances in
industry
Per unit on 100MVA base
20MW
10MVAR
Figure 1: Four bus network

7
The network in Figure 1 comprises of 2 generating units. Bus 1000 is the slack bus in load flow and modeled in dynamic as an
infinite bus (i.e. a unit with large inertia). There are two buses with loads, i.e., 3000 and 4000. The load flow data in DCPS
format is shown in Table 1.

Table 1: Load flow data for network in Figure 1

4 4
100.0
1000 3 1.00 0.00 0.20 0.12 0.00 0.00 0.00 0.00 1 0.0 0.0 100.0 132.0 0.0 0.2 'genslk '
2000 2 1.00 0.03 0.50 0.14 0.00 0.00 0.00 0.00 1 0.0 0.0 100.0 132.0 0.0 0.2 'genpv '
3000 0 0.99 -.02 0.00 0.00 0.50 0.30 0.00 0.20 1 0.0 0.0 0.0 132.0 0.0 0.0 'load '
4000 0 0.94 -.11 0.00 0.00 0.20 0.10 0.00 0.00 1 0.0 0.0 0.0 132.0 0.0 0.1 'industry '
0 1 1000 3000 0.000 0.100 0.000 200.0 0.000 0.000 0 0 0.000 0.000 0.000 0.000 1
0 1 2000 3000 0.000 0.200 0.000 200.0 0.000 0.000 0 0 0.000 0.000 0.000 0.000 1
0 2 2000 3000 0.000 0.200 0.000 200.0 0.000 0.000 0 0 0.000 0.000 0.000 0.000 1
0 1 3000 4000 0.000 0.400 0.000 200.0 0.000 0.000 0 0 0.000 0.000 0.000 0.000 1
FORMAT
------
No.of Buses No. of Branches
System Base MVA
BUS DATA FOLLOWS
----------------
Bsno BsTyp VMag VAng Pg Qg Pl Ql Psh Qsh ArNo Qmin Qmax McBase BskV Zrp Zxp Bsname
BRANCH DATA FOLLOWS
-------------------
BrTyp CktNo FromBs ToBs Rpu Xpu Bpu BrchBase Tpr Tpa CtrlBs Tpstp Tpsz Tpmin Tpmax VoltSet Status

To prepare for transient stability calculations, the network load flow must be solved and command scripts as shown in Table 2
can be used to solve and save the load flow case in a new file.

8
Table 2: Script for load flow using decoupled Netwon Method (DNLF) in DCPS-LF

'DNLF.APS: Sequence to run decoupled Newton Load flow


chco,0.00005,,,,,,0.7,0.7,1.0
redn,FOUR0.sol,dcps
ord1;
ybus;
ybpo;
vbpo;
bpow;
dnlf,100,5.0
svlf,FOUR1.SOL,dcps

To ensure that the load flow is properly solved, one can execute command BPOW to calculate mismatch at each bus. Output of
BPOW for the four bus network is shown in Table 3.

Table 3: Buspower (BPOW) mismatch for the four bus network after load flow

dsa>bpow
Calculated, actual bus powers and mismatches
============================================================
Bus Ty Pcal Qcal Pactual Qactual Pmis Qmis
------------------------------------------------------------
1000 3 20.00 12.46 0.00 0.00
2000 2 50.00 13.52 50.00 0.00 0.00
4000 0 -20.00 -10.00 -20.00 -10.00 0.00 0.00
3000 0 -50.00 -30.00 -50.00 -30.00 0.00 0.00
Absolute Total power mismatch MW & MVAr = 0.000741 0.000915
Total load power MW & MVAr = -70.00 -40.00
Slack bus power MW & MVAr = 20.00 12.46

With the good mismatch, the solved load flow (FOUR1.SOL) case can now be used for transient stability calculations.

9
The process of performing transient stability calculation in DCPS-TS comprises the following steps:

(1) Set parameters for the calculations;


(2) Read the solved load flow case;
(3) Read dynamic data file;
(4) Order the network matrix;
(5) Establish the network admittance matrix;
(6) Calculate bus powers;
(7) Initialize machine states;
(8) Initialize excitation system states;
(9) Initialize turbine-governor system states;
(10) Modify admittance matrix to include machine impedance;
(11) Modify admittance matrix to include load admittance;
(12) Calculate current injections;
(13) Factorise admittance matrix;
(14) Specify states and controls to be recorded;
(15) Perform simulation run without disturbance;
(16) Apply disturbance/remove disturbance;
(17) Run simulation to the end.

The rest of this document will explain the principle of each of the above steps. The details of each of the above step will be
discussed in Section 2 and during the course lectures.

10
1.2 Starting DCPS-TS

You should obtain the latest version of DCPS-TS from your lecturer and it should contain the source codes and executables. In
this course, you’re not only supposed to become familiar with performing transient stability simulations using DCPS-TS but also
to model equipment and controls from first principle and putting it to work in DCPS-TS.

It is recommended that you create DCPS-TS shortcut on your computer desktop and point it out to start-in your working folder
(see Figure 2).

Figure 2: Create DCPS-TS shortcut on the Desktop and set the working folder (Start in)

11
By double-clicking on the the DCPS-TS Shortcut the DCPS-TS console will appear (see Figure 3). DCPS-TS is now ready to
accept instructions from the User. Instructions are keywords with parameters understood by DCPS-TS.

Figure 3: DCPS-TS Console Interface

12
1.3 Setting Parameters for Calculations

Certain calculation parameters can be changed by the User. This is facilitated by command CHCO (Change Constants) with
parameters separated by commas. If one enters CHCO without any parameter, the default parameters are displayed as shown
below.

ts>chco
ts>chco,acf ,pv ,qv ,tolx ,tolv ,tolg ,tolw , pfrq, qfrq,maxiter
ts>chco,1.20000,1.50000,1.50000,0.01000,0.00010,0.00010,0.01000,0.02000,0.02000, 50

The parameters are described below:

(1) acf – acceleration factor used in network iterative solution (normally set to 1.0);
(2) pv and qv – are exponents in the following equations for voltage and frequency dependencies of loads:

P = (Kp Vpv) x (1.0 + pfrq x )freq) ….. (1.3.1)


Q = (Kq Vqv) x (1.0 + qfrq x )freq) ….. (1.3.2)

(3) tolx – tolerance (not currently used)


(4) tolv – voltage tolerance in network solution
(5) tolg – tolerance (not currently used)
(6) tolw – tolerance (not currently used)
(7) pfrq and qfrq – per unit change in load due to per unit change in bus frequency used in equations 1.3.1 and 1.3.2
(8) maxiter – maximum iteration allowed in network iterative solution

At this point the user should find out how different type of loads is dependent on voltage and frequency variation [1]. In the
course, the modeling of load dependency on voltage and frequency will be discussed including its impacts.

[1] “Load Representation for Dynamic Analysis”, IEEE Task Force on Load Representation for Dynamic Performance, IEEE Trans. On Power Systems,
Vol 8, No. 2, May 1993

13
1.4 Read the Solved Load Flow Case

Before carrying out any transient stability calculation, the load flow case must be properly solved and the load flow data should
be written to a file (*.sol). The solved load flow case will have with it the resulting voltage magnitude and angle that are used
during the initialization process.

The command to read load flow file is:

ts>redn,four1.sol,dcps
dcps format:
->Read: 4 buses, 2 load buses, 2 generator buses
->Read: 4 branches, 4 lines, 0 transformers
ts>

The command is REDN (read network) to be followed by the file name (four1.sol) and format (dcps). If the file is correctly read,
the number of items in the network is summarized. One way to check for solved load flow is to use command BPOW (bus
powers) to check the mismatch between scheduled and calculated powers at each bus as shown in Table 4.

Table 4: BPOW results – bus power mismatch

ts>orde;
ts>ybus;
ts>bpow
===========================================================
BUS TY Pc Qc Pa Qa Pa-Pc Qa-Qc
-----------------------------------------------------------
2000 2 0.5000 0.1352 0.5000 0.0000 -0.0000 0.0000
1000 3 0.2000 0.1246 0.0000 0.0000 0.0000 0.0000
4000 0 -0.2000 -0.1000 -0.2000 -0.1000 0.0000 -0.0000
3000 0 -0.5000 -0.3000 -0.5000 -0.3000 0.0000 0.0000
ts>

To do BPOW one needs to order the network matrix (ORDE) and establish the admittance matrix (YBUS).

14
1.5 Read Dynamic Data File

To carry out transient stability calculations, the load flow case must be complemented with the dynamic data file containing the
parameters of each dynamic device. List below (Table 5) shows an example dynamic data file (*.mac) for the 4-bus network.
Each dynamic device is identified by a model name followed by its constant parameters.

Table 5: Dynamic data file


//generator electric & mach
//gen0,imn,iunit, h, xd, xdp, ra, damp
gen0, 1000, 1, 9999999.0, 1.3, 0.2, 0.0, 0.0
//gen2,imn ,iunit, h, xd, xdp, tdop, xq, xqp, tqop, ra,damp,xleak, sat1, sat2 ,isat
gen2 ,2000, 1, 6.40, 0.9, 0.12, 6.0, 0.85, 0.12, 0.54, 0.0, 0.0, 0.0, 0.12, 0.49,0
//exc#,bsno,ieunit, Tr, Ka , ta ,ke/tb,te/tc, aex , bex , kf , tf , vrmax , vrmin, efdmin,efdmax
exc10, 2000, 1 , 0.01, 20.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -10 , 10
//turbine-governor data
//ty,busno,igunit,turb MW, Pmax, Pmin, ddbnd, droop, T1 , T2 , T3 , KT , Vmax , Vmin ,Dturb
gov6, 2000, 1, 100.0, 0.7, 0.00, 300.0, 0.050, 5.000, 2.000, 8.000, 0.000, 0.6, -0.6, 0.0
//ldshdfrq1, bus , freq, fraction, relay time, breaker time
ldshdfrq1 , 3000, 49.0, 0.2, 0.1, 0.25
ldshdfrq1 , 4000, 49.0, 0.2, 0.1, 0.25

If the dynamic data file is prepared properly in the required format, DCPS-TS will indicate the list of dynamic models and
parameters read as shown in Table 6.

Table 6: Reading dynamic data file


ts>redm,fourl.mac
Machine electrics
->Read: 2 machine(s), 1 classical, 1 detailed, 0 motor(s)
Machine Controllers
->Read: 1 excitation controller(s)
->Read: 0 power system stabilizer(s)
->Read: 1 turbine-governor controller(s)
Relays
->Read: 2 frequency-based load-shedding relay(s)
Dynamic Load Models
->Read: 0 load dynamic model(s)
ts>
By using command SHMD (show machine data), the list of the machine models and parameters will be displayed.

15
1.6 Order the Network Matrix

In DCPS-TS, network sparsity is exploited in order to efficiently solve network equation. Sparsity is exploited in the factorization
of the admittance matrix Y into LU factors by arranging the admittance matrix with zeros in the upper part and occupied
elements at the lower part. DCPS-TS only employ simple ordering method by counting the number of branches connected to
each bus. Those buses are then arranged with ascending number of connected branches. ORDE reports on index location of
each bus in the admittance matrix as shown below (Table 6).

Table 6: Network ordering using ORDE

ts>orde
index Bus Number Bus Type Bus Name Mac Base
----------------------------------------------------
1 2000 2 genpv 100.00
2 1000 3 genslk 100.00
3 4000 0 industry 0.00
4 3000 0 load 0.00
----------------------------------------------------
ts>

16
1.7 Establish the Network Admittance Matrix

Network admittance matrix is established to facilitate the necessary network solutions for determining the voltage magnitude
and angles at all non voltage-controlled buses at each time step. The admittance matrix is established based on the ordered
bus numbers as determined during network ordering. Command YBUS establishes the admittance matrix as shown in Table 7.

Table 7: Network admittance matrix using YBUS

ts>ybus
2000 0.00 0 0 0.00
...... -10.00i 0i 0i 10.00i
1000 0 0.00 0 0.00
...... 0i -10.00i 0i 10.00i
4000 0 0 0.00 0.00
...... 0i 0i -2.50i 2.50i
3000 0.00 0.00 0.00 0.00
...... 10.00i 10.00i 2.50i -22.30i
ts>

Please take note that the admittance matrix is arranged to achieve minimum fill-ins during factorization process.

17
1.8 Calculate Bus Powers

BPOW (bus powers) calculates bus power at each bus based on the voltage magnitude, angle and admittance at the bus and
determines the mismatch with the scheduled power. It is only for the purpose of checking that the load flow file read is a
solved loadflow. This command produces results as in Table 8.

Table 8: Buspower mismatches calculated using BPOW

ts>bpow
===========================================================
BUS TY Pc Qc Pa Qa Pa-Pc Qa-Qc
-----------------------------------------------------------
2000 2 0.5000 0.1352 0.5000 0.0000 -0.0000 0.0000
1000 3 0.2000 0.1246 0.0000 0.0000 0.0000 0.0000
4000 0 -0.2000 -0.1000 -0.2000 -0.1000 0.0000 -0.0000
3000 0 -0.5000 -0.3000 -0.5000 -0.3000 0.0000 0.0000
ts>

Pc and Qc are the calculated active and reactive powers at the bus while Pa and Qa are the scheduled powers at the bus. The
mismatches (Pa-Pc and Qa-Qc) provide indication to the solution degree of the load flow.

18
1.9 Initialize Machine States

Before doing transient stability simulations, it is necessary to initialize states based on the terminal conditions as found in the
solved load flow calculations. INIV is the command to initialize all synchronous generators based on its terminal condition as
shown below (Table 9).

Table 9: Initialisation calculations for machines

ts>iniv
TY MACNO Iq Id Vq Vd Eqp Edp Eqpp Edpp Efd Del Speed Pm/Pag
dEqpdt dEdpdt dEqppdt dEdppdt dDeldt dWdt
--------------------------------------------------------------------------------------------------------
5 100 0.815 -1.016 0.980 -0.198 1.035 -0.110 1.017 -0.169 1.236 0.265 314.159 1.0000
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
5 110 0.815 -1.016 0.980 -0.198 1.035 -0.110 1.017 -0.169 1.236 0.265 314.159 1.0000
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
5 120 0.815 -1.016 0.980 -0.198 1.035 -0.110 1.017 -0.169 1.236 0.265 314.159 1.0000
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
5 130 0.815 -1.016 0.980 -0.198 1.035 -0.110 1.017 -0.169 1.236 0.265 314.159 1.0000
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
0 2000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 -0.000 314.159 -0.0001
0.0000 0.0000 0.0000 0.0000 0.0000 -0.0088
--------------------------------------------------------------------------------------------------------
ts>

Based on the terminal conditions and machine impedances, the equivalent direct and quadrature axes currents and voltages
are calculated. Depending on the model the corresponding internal direct and quadrature axes transient and subtransient
voltages are also calculated together with their derivatives. The steady-state field voltage is also calculated for each machine
and it is important to ensure it is of reasonable value.

19
1.10 Initialize Excitation System States

Command INIE initializes all excitation system controllers based on the field voltage (efd) determined in the initialization of
machines. All excitation states are displayed (see Table 10).

Table 10: Initialisation calculations for excitation systems

ts>inie
Bus Exty ev eiv eiv2 es eiii dEfddt Vso
------------------------------------------------------------------------
100 10 1.0000 0.0062 0.0000 1.0062 0.0000 0.00000 0.00000
110 10 1.0000 0.0062 0.0000 1.0062 0.0000 0.00000 0.00000
120 10 1.0000 0.0062 0.0000 1.0062 0.0000 0.00000 0.00000
130 10 1.0000 0.0062 0.0000 1.0062 0.0000 0.00000 0.00000
------------------------------------------------------------------------
ts>

1.11 Initialize Turbine-Governor System States

INIG initializes turbine-governor states based on the turbine mechanical power as calculated during initialization of machines.
The states of the turbine governor controls are displayed (see Table 11).

Table 11: Initialisation calculations for turbine-governors

ts>inig
Bus Govtype Gpref Gs1 dGs1dt Gs2 dGs2dt Gs3 dGs3dt dPmdt
---------------------------------------------------------------------------------
100 6 0.4000 0.2000 0.00000 0.0000 0.00000 0.0000 0.00000 0.00000
110 6 0.4000 0.2000 0.00000 0.0000 0.00000 0.0000 0.00000 0.00000
120 6 0.4000 0.2000 0.00000 0.0000 0.00000 0.0000 0.00000 0.00000
130 6 0.4000 0.2000 0.00000 0.0000 0.00000 0.0000 0.00000 0.00000
---------------------------------------------------------------------------------
20
1.12 Modify Admittance Matrix to Include Machine Impedance

MOYM adds admittance equivalent to unadjusted current injection for a machine, from Iunadj = YoE". Yo is calculated using,
Yo = (Ra - jXdq)/(Ra2 + Xd"Xq") where Xdq = 0.5(Xd" + Xq"). Yo is added to the admittance matrix as shown below (see
Table 12).

Table 12: Modification of Admittance Matrix to Include Machine Impedance

ts>moym
Bus_no Mac_no Area Yrold Yxold Yrnew Yxnew
---------------------------------------------------------
100 1 2 0.00 -40.00 0.00 -67.75
110 1 2 0.00 -40.00 0.00 -67.75
120 1 2 0.00 -40.00 0.00 -67.75
130 1 2 0.00 -40.00 0.00 -67.75
2000 1 1 0.00 -136.11 0.00 -308.53
---------------------------------------------------------
0.00 0 0 0 0 0 0 0 0 0.00
-67.75i 0i 0i 0i 0i 0i 0i 0i 0i 40.00i
0 0.00 0 0 0 0 0 0 0 0.00
0i -67.75i 0i 0i 0i 0i 0i 0i 0i 40.00i
0 0 0.00 0 0 0 0 0 0 0.00
0i 0i -67.75i 0i 0i 0i 0i 0i 0i 40.00i
0 0 0 0.00 0 0 0 0 0 0.00
0i 0i 0i -67.75i 0i 0i 0i 0i 0i 40.00i
0 0 0 0 0.00 0 0.00 0 0 0.00
0i 0i 0i 0i 14.88i 0i -62.50i 0i 0i 47.62i
0 0 0 0 0 0.00 0.00 0.00 0 0
0i 0i 0i 0i 0i -308.53i 47.62i 88.50i 0i 0i
0 0 0 0 0.00 0.00 0.00 0 0 0
0i 0i 0i 0i -62.50i 47.62i 14.88i 0i 0i 0i
0 0 0 0 0 0.00 0 0.00 0.00 0
0i 0i 0i 0i 0i 88.50i 0i 36.50i -125.00i 0i
0 0 0 0 0 0 0 0.00 0.00 0.00
0i 0i 0i 0i 0i 0i 0i -125.00i 36.50i 88.50i
0.00 0.00 0.00 0.00 0.00 0 0 0 0.00 0.00
40.00i 40.00i 40.00i 40.00i 47.62i 0i 0i 0i 88.50i -296.11i
ts>

21
1.13 Modify Admittance Matrix to include Load Admittance

CINJ calculates equivalent load admittance into the admittance matrix as shown below (see Table 13).

Table 13: Inclusion of load admittances

ts>cinj
Bus_no Pload Qload Vmag Kp Kq Kp2 Kq2
----------------------------------------------------------------
120 0.00 0.00 1.0000 0.000 0.000 0.000 0.000
2000 4.00 2.00 0.9500 4.432 2.216 4.432 2.216
21 0.00 0.00 0.9737 0.000 0.000 0.000 0.000
.
1000 0.00 0.00 0.9795 0.000 0.000 0.000 0.000
----------------------------------------------------------------
120 0.00 0 0 0 0 0 0 0 0 0.00
...... -67.75i 0i 0i 0i 0i 0i 0i 0i 0i 40.00i
110 0 0.00 0 0 0 0 0 0 0 0.00
...... 0i -67.75i 0i 0i 0i 0i 0i 0i 0i 40.00i
100 0 0 0.00 0 0 0 0 0 0 0.00
...... 0i 0i -67.75i 0i 0i 0i 0i 0i 0i 40.00i
130 0 0 0 0.00 0 0 0 0 0 0.00
...... 0i 0i 0i -67.75i 0i 0i 0i 0i 0i 40.00i
20 0 0 0 0 0.00 0 0.00 0 0 0.00
...... 0i 0i 0i 0i 14.88i 0i -62.50i 0i 0i 47.62i
2000 0 0 0 0 0 4.43 0.00 0.00 0 0
...... 0i 0i 0i 0i 0i -310.74i 47.62i 88.50i 0i 0i
21 0 0 0 0 0.00 0.00 0.00 0 0 0
...... 0i 0i 0i 0i -62.50i 47.62i 14.88i 0i 0i 0i
11 0 0 0 0 0 0.00 0 0.00 0.00 0
...... 0i 0i 0i 0i 0i 88.50i 0i 36.50i -125.00i 0i
10 0 0 0 0 0 0 0 0.00 0.00 0.00
...... 0i 0i 0i 0i 0i 0i 0i -125.00i 36.50i 88.50i
1000 0.00 0.00 0.00 0.00 0.00 0 0 0 0.00 0.00
...... 40.00i 40.00i 40.00i 40.00i 47.62i 0i 0i 0i 88.50i -296.11i
ts>

22
1.14 Calculate Current Injections

GINJ calculates current injection vector due to equivalent current source such as machines and loads (see Table 14).

Table 14: Calculations of current injection vector

>ginj
Bus No Area Cur_Inj_R Cur_Inj_X
-------------------------------------
120 2 2.87535 -28.45676
110 2 2.87535 -28.45676
100 2 2.87535 -28.45676
130 2 2.87535 -28.45676
20 2 0.00000 0.00000
2000 1 -0.00006 -162.83160
21 2 0.00000 0.00000
11 2 0.00000 0.00000
10 2 0.00000 0.00000
1000 2 0.00000 0.00000
-------------------------------------
ts>

23
1.15 Factorise Admittance Matrix

FAC2,SYB factorises the admittance matrix to L and U factors as shown below (see Table 15).

Table 15: Factorise admittance matrix

ts>fac2,syb,1
->New fill-ins = 6
L-Factor
1.0 0 0 0 0 0 0 0 0 -1.0
0.0i 0i 0i 0i 0i 0i 0i 0i 0i 0.0i
0 1.0 0 0 0 0 0 0 0 -1.0
0i 0.0i 0i 0i 0i 0i 0i 0i 0i 0.0i
0 0 1.0 0 0 0 0 0 0 -1.0
0i 0i 0.0i 0i 0i 0i 0i 0i 0i 0.0i
0 0 0 1.0 0 0 0 0 0 -1.0
0i 0i 0i 0.0i 0i 0i 0i 0i 0i 0.0i
0 0 0 0 1.0 0 0 -3.4 0 2.4
0i 0i 0i 0i 0.0i 0i 0i 0.0i 0i 0.0i
0 0 0 0 0 1.0 -4.2 0 3.2 0
0i 0i 0i 0i 0i 0.0i 0.0i 0i 0.0i 0i
0 0 0 0 0 0 1.0 0 -0.8 -0.2
0i 0i 0i 0i 0i 0i 0.0i 0i 0.0i 0.0i
0 0 0 0 0 0 0 1.0 -0.2 -0.8
0i 0i 0i 0i 0i 0i 0i 0.0i 0.0i 0.0i
0 0 0 0 0 0 0 0 1.0 -1.0
0i 0i 0i 0i 0i 0i 0i 0i 0.0i 0.0i
0 0 0 0 0 0 0 0 0 1.0
0i 0i 0i 0i 0i 0i 0i 0i 0i 0.0i

24
Table 15: Factorise admittance matrix – cont’d

U-Factor
0 0 0 0 0 0 0 0 0 0
-37i 0i 0i 0i 0i 0i 0i 0i 0i 0i
0 0 0 0 0 0 0 0 0 0
0i -37i 0i 0i 0i 0i 0i 0i 0i 0i
0 0 0 0 0 0 0 0 0 0
0i 0i -37i 0i 0i 0i 0i 0i 0i 0i
0 0 0 0 0 0 0 0 0 0
0i 0i 0i -37i 0i 0i 0i 0i 0i 0i
0 0 0 0 0 0 0 0 0 0
0i 0i 0i 0i 37i 0i 0i 0i 0i 0i
0 0 0 0 0 0 0 0 0 0
0i 0i 0i 0i 0i 15i 0i 0i 0i 0i
0 0 0 0 0 0 0 0 0 0
0i 0i 0i 0i 0i -62i -248i 0i 0i 0i
0 0 0 0 0 0 0 0 0 0
0i 0i 0i 0i -125i 0i 0i -392i 0i 0i
0 0 0 0 0 0 0 0 0 0
0i 0i 0i 0i 0i 48i 200i 88i -107i 0i
0 0 0 0 0 0 0 0 0 0
37i 37i 37i 37i 88i 0i 48i 303i 107i -0i
ts>

25
1.16 Specify States and Controls to be Recorded

In order to analyse the response of the system to a disturbance it is necessary to monitor and record the excursions of states
and controls during the simulations. In DCPS-TS the states and controls must be specified before the simulation is carried out.
CAPS is used to capture one state or control and a time. There are several states and controls that can be recorded as
described below. CAPS has the following format:

Caps,idevno,item_quantity

For bus quantity,

//caps,1, for bus quantity (idevno = 1)


//caps,1,ibusno,istateno - istateno = 1, voltage
// - istateno = 2, frequency

For machine quantity,

//caps,2 for machine quantity (ideveno = 2)


//caps,2,ibusno (machine bus no), istateno
// - istateno = 1, eqp
// - istateno = 2, edp
// - istateno = 3, efd
// - istateno = 4, del, rotor angle
// - istateno = 5, speed deviation
// - istateno = 6, pm
// - istateno = 7, edpp
// - istateno = 8, eqpp
// - istateno = 9, pe
// - istateno = 10, ??

26
For branch quantity,

//caps,3 for branch quantity (ideveno = 3)


//caps,3,ibusno(frombusno),istateno (tobusno),ickt (circuit no), ibrchqty
//ibrchqty is branch quantity
// - ibrchqty = 1, MW
// - ibrchqty = 2, MVAR
// - ibrchqty = 3, Current
// - ibrchqty = 4, Apparent R, resistance
// - ibrchqty = 5, Apparent X, reactance
// - ibrchqty = 6, Apparent G, conductance
// - ibrchqty = 7, Apparent B, susceptance

For system quantity,

//caps, 4, for system/subsystem totals


//caps, 4, area/total system, system quantity (sysqty)
//sysqty
// - sysqty = 1, Pgen
// - sysqty = 2, Qgen
// - sysqty = 3, Pload
// - sysqty = 4, Qload
//caps,4,0,1

27
Another command to record states and controls is CAPSALL that allows one to select for all buses, machines buses, and
branches the quantity to record and CAPSALL has the following format:

Capsall,idevno,item_quantity,record

ƒ Idevno = 1, for bus quantities


ƒ Idevno = 2, for machine quantities
ƒ Idevno = 3, for branch quantities
ƒ Idevno = 4, for system totals

For bus quantities, the item_quantity that can be selected are;

ƒ item_quantity = 1, for voltage; and


ƒ item_quantity = 2, for frequency

For machine quantities, the item_quantity that can be selected are;

ƒ item_quantity = 1, for eqp


ƒ item_quantity = 2, for edp
ƒ item_quantity = 3, for efd
ƒ item_quantity = 4, for del, rotor angle
ƒ item_quantity = 5, for speed deviation
ƒ item_quantity = 6, for pm
ƒ item_quantity = 7, for edpp
ƒ item_quantity = 8, for eqpp
ƒ item_quantity = 9, for pe

28
For branch quantities, the item_quantity that can be selected are;

ƒ item_quantity = 1, for MW
ƒ item_quantity = 2, for MVAR
ƒ item_quantity = 3, for Current
ƒ item_quantity = 4, for Apparent R, resistance
ƒ item_quantity = 5, for Apparent X, reactance
ƒ item_quantity = 6, for Apparent G, conductance
ƒ item_quantity = 7, for Apparent B, susceptance

For system totals quantities, the item_quantity that can be selected are;

ƒ item_quantity = 1, Pgen
ƒ item_quantity = 2, Qgen
ƒ item_quantity = 3, Pload
ƒ item_quantity = 4, Qload

29
1.17 Perform Simulation Run Without Disturbance

In transient stability simulation, it is usual to perform simulation for a short period of time to ensure that, the states and
controls are not changing and their associated derivatives are zero. To perform time solution, tsol is used with the following
format:

>tsol,solution_method,from_time,to_time,timestep,print_instruction,number_of_processors

Solution_method = 1 for Modified Euler integration method


From_time = specify the start simulation time in second, e.g., 0.0, 5.0
To_time = specify end of the simulation time in second, e.g., 5.0, 25.0
Time_step = the integration time step is seconds, e.g., 0.01, 0.002
Print_instruction = 0 not to print output at each time step on the screen, 1 to print outputs of each time step on the screen.
number_of_processors = not used.

To simulate without disturbance for 1 second, we use:

> tsol,1,0.0,1.00,0.005,0,5

30
1.18 Apply Disturbance/Remove Disturbance

The disturbances that can be applied using DCPS-TS are;

1) 3-phase fault at a bus;


2) Trip a branch;

A 3-phase fault is simulated using,

asht,syb,bus_no,at_time,shunt_value

the above command will add a shunt of shunt_value p.u. to bus bus_no at the given instance, e.g.,

>asht,syb,3000,0.0,1000.0

Following any change in network element like adding large shunt, remove line etc. it is necessary to do the following
calculations:

Factorise the admittance matrix using, fac2,syb;


Solve the network equation using, nsol; and
Perform dq-transformation using, dqtr;

Example,
fac2,syb
nsol;
dqtr;

31
To remove the shunt (clearing the fault) use:

rsht,syb,bus_no,at_time

Example,
rsht,syb,3000,0.0
rvln,3000,2000,2,0.0
fac2,syb
nsol;
dqtr;

To trip a line use:

rvln,From_Bus,To_Bus,At_Time

Example,
rvln,3000,2000,2,0.0
fac2,syb
nsol;
dqtr;

To trip a generator, remove the generator transformer using rvln.

1.19 Run Simulation to the End

The simulation can be completed after removal of the disturbance and removal of line, if any, using TSOL.

Example,
tsol,1,1.475,6.0,0.005,0
svou,fourL1.gpf

Command SVOU is used to save the output of the transient simulation to a file.

32
1.20 Plotting Results

The output file saved at the end of the simulation (extension *.gpf) contains the records of the selected states and controls for
the whole simulation period. To plot states and controls, use a companion plotting program gp that can be invoke from DCPS:

ts>gp

An interface as shown below will appear on the screen (Figure 4).

Figure 4: gp plotting program interface


33
The following is typical procedure for using gp:

(1) Under ‘Plot’ drop down menu, select ‘dynamic output’ and another form will appear as shown below (Figure 5). Under
‘File’ drop down menu, select ‘Open’ file type ‘DCPS Gpf File’. You will need to select the *.gpf file from the file dialogue
menu.

Figure 5: Open *.gpf file

(2) Under ‘Plot’ drop down menu select the number of graph windows for plotting (Figure 6):

Figure 6: Selecting number of plot windows

34
(3) For each plot window, a ‘MulSel’ (multiple selection) button is provided. Click the ‘MulSel’ button and select the items to
be plotted (Figure 7).

Figure 7: Use ‘multiple select’ to plot

35
(4) After selecting the items to plot, clicking the ‘MulSel’ button will plot the items on the particular plot window (Figure 8)

Figure 8: Plotting response on each window

36
Another plotting program that can be used is called gpnew that can be accessed as shown below. With command gpnew, the
user will have to enter the *’gpf filename to plot and then simply click plot (Figure 9).

Figure 9: Gpnew selecting plot file and plotting all channels

37
As shown in Figure 10 below, gpnew will plot all channels in the *’gpf file and the user can the channel tree view on the left
hand side of the screen to select the channels to plot.

Figure 10: Gpnew plotting all channels

38
Figure 11 shows plotting of rotor angles only – note the selection in tree view.

Figure 11: Gpnew – plotting rotor angles only

39
1.21 Analysing Response of States and Controls

Typical disturbances applied to analyse the response of the power systems are:

a) Fault, fault clearance and trip of a line or a transformer;


b) Trip of a line or a transformer without fault;
c) Disconnection of a generating unit without fault;\
d) Disconnection of a load without fault;

In DCPS a three-phase fault is simulated by suddenly placing a shunt reactor at a selected bus. For example a 1000 p.u. shunt
reactor is equivalent to placing 100,000 MVAR of shunt reactor which result in flow of a large short-circuit current and collapse
of voltage (to zero) at the bus. In practice, fault clearance occurs following removal of the affected line or branch from the
network by protective relay action and opening of breakers. Following removal of fault and loss of one element, if the system is
stable, the system voltage is expected to recover and generator rotors would settle back to its synchronous speed. Figure 12
below shows voltage and field voltage plots at during fault, fault clearance and recovery.

Figure 12 is obtained using the following simulation commands:

tsol,1,0.0,1.00,0.005,0
asht,syb,1520,0.0,1000.0
fac2,syb
nsol;
dqtr;
tsol,1,1.005,1.105,0.005,0
rsht,syb,1520,0.0
rvln,2530,1520,1,0.0
fac2,syb
nsol;
dqtr;
tsol,1,1.11,5.0,0.005,0
svou,20bus0y.gpf

40
(a) Bus voltage

(b) Field voltage

Fault
Applied Fault
Removed
Figure 12: Voltage response during short-circuit and following fault clearance

Referring to Figure 12(a), at time of 1.0s a 3-phase fault is applied at bus 1520. At the instant of fault voltage at bus 1520
sagged to almost zero. Voltage at other buses also dropped accordingly depending on distance to the fault. On removal of fault,
the voltages recovered but with slight overshot which is termed as dynamic overvoltage. In studies it is important to note the
dynamic overvoltage to check that it is within the specified limits. In case of Figure 12(a), the system voltage recovered and
the system is expected to be voltage stable.

Figure 12(b) shows the response of the generator field voltage and Figure 13 shows a closeup view of the field voltage. At the
instant of fault, the terminal voltage of the generator will drop and detected by the AVR and immediately ramped up the DC

41
field voltage. However, the field voltage cannot change instantaneously due to the inductance of the field winding (see Tdo’).
When the fault is cleared and overvoltage occurred, the field voltage is ramped down with slight undershoot.

Limit +10p.u.

Field voltages

Figure 13: Closeup view of the field voltage response

Figure 14 shows the rotor angle and speed responses for the same disturbance (fault and fault clearance). There are two
groups of generators with opposite response. The first group accelerated (increase in speed) at the instant fault and the other
decelerated (reduced speed). Turbine-governors for each generator responded to the speed by closing or opening
fuel/water/steam valve to bring back speed and thus frequency to the nominal level.

42
Rotor Angle

Speed
Figure 14: Rotor angle and speed response

43
An important type of disturbance normally studied is loss of generating unit. An example command sequence involving a loss
of a generating unit is:

tsol,1,0.0,1.00,0.005,0
dropunit,1910,1
fac2,syb
nsol;
dqtr;
tsol,1,1.005,15.0,0.005,0
svou,20bus4.gpf

At time of 1.0s, a generating unit 1910 is removed from the system and the response up to 15s is recorded.

44
2. Detailed Calculations for Transient Stability
2.1 Solved Load Flow Case

All dynamic calculations such as transient stability, short-term voltage stability or small signal stability involving a power system
will need to start with a solved load flow case. A solved load flow case is such that when information on calculated voltages
and angles are used to calculate the bus powers, the calculated values are the same as the scheduled values within the given
tolerance. For example, consider a network as shown in Figure 2.1 with load flow data in DCPS format as shown in Table 2.1.

Table 2.1: Unsolved load flow data for system in Figure 2.1 (Data File Name, Timka0.sol)

7 9
100.0
1210 0 1.00 0.0 0.0 0.0 1.0 0.5 0.0 0.0 1 0.0 0.0 0.0 275.0 0.0 0.00 'FUSEBAY'
1910 2 1.02 0.0 6.0 0.0 0.0 0.0 0.0 0.0 1 -350.0 450.0 980.0 30.0 0.0 0.25 'FUSEBAY_G'
2210 0 1.00 0.0 0.0 0.0 5.0 3.0 0.0 0.0 2 0.0 0.0 0.0 275.0 0.0 0.00 'UJUNG'
2220 0 1.00 0.0 0.0 0.0 4.0 2.0 0.0 0.0 2 0.0 0.0 0.0 275.0 0.0 0.00 'GREENBERG'
2910 2 1.02 0.0 4.0 0.0 0.0 0.0 0.0 0.0 2 -150.0 250.0 690.0 30.0 0.0 0.22 'UJUNG_G'
3200 0 1.00 0.0 0.0 0.0 4.0 2.0 0.0 0.0 3 0.0 0.0 0.0 275.0 0.0 0.00 'TIMIKA'
3900 3 1.00 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3 -150.0 250.0 690.0 30.0 0.0 0.22 'TIMIKA_G'
0 1 1210 2220 0.00460 0.038 0.920 680.0 0.0 0.000 0 0 0.0 0.0 0.0 0.0 1
0 2 1210 2220 0.00460 0.038 0.920 680.0 0.0 0.000 0 0 0.0 0.0 0.0 0.0 1
0 1 1210 3200 0.00690 0.057 1.380 680.0 0.0 0.000 0 0 0.0 0.0 0.0 0.0 1
1 1 1910 1210 0.00000 0.200 0.000 900.0 1.0 0.000 0 0 0.0 0.0 0.0 0.0 1
0 1 2210 2220 0.00920 0.076 1.835 680.0 0.0 0.000 0 0 0.0 0.0 0.0 0.0 1
0 2 2210 2220 0.00920 0.076 1.835 680.0 0.0 0.000 0 0 0.0 0.0 0.0 0.0 1
0 1 2210 3200 0.01150 0.095 2.290 680.0 0.0 0.000 0 0 0.0 0.0 0.0 0.0 1
1 1 2910 2210 0.00000 0.180 0.000 600.0 1.0 0.000 0 0 0.0 0.0 0.0 0.0 1
1 1 3900 3200 0.00000 0.180 0.000 600.0 1.0 0.000 0 0 0.0 0.0 0.0 0.0 1

45
PEAK LOAD
1210 2220 2210
Fusebay Greenberg Ujung
275kV 275kV 275kV
100MW 400MW 500MW
50MVAR 200MVAR 300MVAR

1910 2910
Fusebay_G Ujung_G
30kV 30kV
100km 200km
G1 G2
1.02 p.u. 1.02 p.u.

400MW
600MW
AREA 2
AREA 1 150km 250km

3200
Timika

G1: 700 MW, PF 0.85 Transmission Line, 275kV


G2: 500 MW, PF 0.85 AREA 3 400MW Parameters per km,
G3: 500 MW, PF 0.85 200MVAR
1.02 p.u. 3900 R=0.0348 ohm, X = 0.2866 ohm
Timika_G Charging Current =1.926 A,
Transformers 30kV Rating = 680 MVA
G1: 900MVA, X = 20% 400MW
G2: 600MVA, X = 18% G3
Slack Bus
G3: 600MVA, X = 18%

Figure 2.1: Single line diagram of network with data in Table 2.1
46
In DCPS-TS if one reads and calculate bus powers using command sequence below:

Table 2.2: BPOW to check powerflow solution

ts>redn,timka0.sol,dcps
ts>orde;
ts>ybus;
ts>bpow

===========================================================
BUS TY Pc Qc Pa Qa Pa-Pc Qa-Qc
-----------------------------------------------------------
2910 2 0.0000 0.6800 4.0000 0.0000 -4.0000 0.0000
3900 3 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
1910 2 0.0000 0.9180 6.0000 0.0000 -6.0000 0.0000
2220 0 -0.0000 -2.7550 -4.0000 -2.0000 4.0000 -0.7550
3200 0 0.0000 -1.8350 -4.0000 -2.0000 4.0000 0.1650
2210 0 0.0000 -3.6467 -5.0000 -3.0000 5.0000 -0.6467
1210 0 0.0000 -2.5100 -1.0000 -0.5000 1.0000 -2.0100
ts>

The output of BPOW shows that the load flow is not solved since the active and reactive mismatches (column Pa-Pc and Qa-
Qc) at buses are large. Looking at BPOW output table, Pc and Qc are calculated active and reactive power from the voltage
and angle while Pa and Qa are scheduled active and reactive power at the bus. The differences between scheduled and
calculated values are termed as mismatches.

47
If one reads the solved load flow file and calculate bus power, the mismatches will be small and within the desired tolerance as
shown below.

Table 2.3: BPOW showing solved loadflow

ts>redn,timka0.sol,dcps
ts>orde;
ts>ybus;
ts>bpow

ts>bpow
===========================================================
BUS TY Pc Qc Pa Qa Pa-Pc Qa-Qc
-----------------------------------------------------------
2910 2 3.9999 0.2787 4.0000 0.0000 -0.0001 0.0000
3900 3 4.0514 0.0346 0.0000 0.0000 0.0000 0.0000
1910 2 5.9999 -0.2693 6.0000 0.0000 -0.0001 0.0000
2220 0 -4.0000 -2.0000 -4.0000 -2.0000 0.0000 0.0000
3200 0 -3.9999 -2.0000 -4.0000 -2.0000 0.0001 0.0000
2210 0 -4.9999 -3.0000 -5.0000 -3.0000 0.0001 0.0000
1210 0 -1.0000 -0.5000 -1.0000 -0.5000 0.0000 0.0000
ts>

48
Sometime it is necessary to initiate dynamic simulation using different network configuration. For example, one is interested to
examine the response or stability of the system when a disturbance occurs while two lines are under maintenance outage as
shown in Figure 2.2. This situation, is regularly encountered in system operation and before the scheduled outage of the lines
are approved, a study is carried out and if necessary certain remedial actions are made or certain control precautionary
measures are applied.

LIGHT LOAD With Line on Maintenance Outage


1210 2220 2210
Fusebay Greenberg Ujung
275kV 275kV 275kV
60MW 240MW 500MW
30MVAR 120MVAR 300MVAR

1910 2910
Fusebay_G Ujung_G
30kV 30kV
100km 200km
G1 G2
1.02 p.u. 1.02 p.u.

240MW
360MW
AREA 2
AREA 1 150km 250km

3200
Timika

G1: 700 MW, PF 0.85 Transmission Line, 275kV


G2: 500 MW, PF 0.85 AREA 3 240MW Parameters per km,
G3: 500 MW, PF 0.85 120MVAR
1.02 p.u. 3900 R=0.0348 ohm, X = 0.2866 ohm
Timika_G Charging Current =1.926 A,
Transformers 30kV Rating = 680 MVA
G1: 900MVA, X = 20% 240MW
G2: 600MVA, X = 18% G3
Slack Bus
G3: 600MVA, X = 18%

Figure 2.2: Network with two circuits on maintenance outage


49
Table 2.4: Load flow data with line outages in Figure 2.2 (File name TkaLO.sol)

7 9
100.0
1210 0 1.00 0.0 0.0 0.0 1.0 0.5 0.0 0.0 1 0.0 0.0 0.0 275.0 0.0 0.00 'FUSEBAY'
1910 2 1.02 0.0 6.0 0.0 0.0 0.0 0.0 0.0 1 -350.0 450.0 980.0 30.0 0.0 0.25 'FUSEBAY_G'
2210 0 1.00 0.0 0.0 0.0 5.0 3.0 0.0 0.0 2 0.0 0.0 0.0 275.0 0.0 0.00 'UJUNG'
2220 0 1.00 0.0 0.0 0.0 4.0 2.0 0.0 0.0 2 0.0 0.0 0.0 275.0 0.0 0.00 'GREENBERG'
2910 2 1.02 0.0 4.0 0.0 0.0 0.0 0.0 0.0 2 -150.0 250.0 690.0 30.0 0.0 0.22 'UJUNG_G'
3200 0 1.00 0.0 0.0 0.0 4.0 2.0 0.0 0.0 3 0.0 0.0 0.0 275.0 0.0 0.00 'TIMIKA'
3900 3 1.00 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3 -150.0 250.0 690.0 30.0 0.0 0.22 'TIMIKA_G'
0 1 1210 2220 0.00460 0.038 0.920 680.0 0.0 0.000 0 0 0.0 0.0 0.0 0.0 1
0 2 1210 2220 0.00460 0.038 0.920 680.0 0.0 0.000 0 0 0.0 0.0 0.0 0.0 0
0 1 1210 3200 0.00690 0.057 1.380 680.0 0.0 0.000 0 0 0.0 0.0 0.0 0.0 1
1 1 1910 1210 0.00000 0.200 0.000 900.0 1.0 0.000 0 0 0.0 0.0 0.0 0.0 1
0 1 2210 2220 0.00920 0.076 1.835 680.0 0.0 0.000 0 0 0.0 0.0 0.0 0.0 1
0 2 2210 2220 0.00920 0.076 1.835 680.0 0.0 0.000 0 0 0.0 0.0 0.0 0.0 0
0 1 2210 3200 0.01150 0.095 2.290 680.0 0.0 0.000 0 0 0.0 0.0 0.0 0.0 1
1 1 2910 2210 0.00000 0.180 0.000 600.0 1.0 0.000 0 0 0.0 0.0 0.0 0.0 1
1 1 3900 3200 0.00000 0.180 0.000 600.0 1.0 0.000 0 0 0.0 0.0 0.0 0.0 1

Table 2.4 shows how the two lines are placed on outage before the load flow is solved. Once the load flow is solved, the case
must be written to a file so that it can be read for transient stability simulation.

50
2.1.1 Exercise 2.1 (Assignment #1)

Model the 17-bus network as shown in Figure EX2.1.1 in DCPS-LF and solve the load flow.

3x200MW 130 Turbine Rate


Tx1 Area 1
305MW each
G2 200MW Sukum Coal Area 3
190 90MVAR 3x150MW
Tx2 G9 G8 G7
G1
392 391 390 Kopom
191 Turbine Rate
Tx3 250MW 260MW each
Tx9 Tx8 Tx7 400MW
G3 194MVAR 121MVAR Jamna Coal
192
325 200MW
Grewal
Turbine Rate
Hydro 328 Tx4
250MW each
321 G4
Generating units and 150km 100km
Transformers
395
G1, G2, G3 at 22kV, at 1.0 p.u. Volt 550km 200MW
278MVA each, 18.24% xd” Tx5
Tx1, Tx2, Tx3 400km
300 MVA, 15% each 200km G5
397
G4, G5, G6 at 22kV, at 1.0 p.u. Volt 200MW
291.7MVA each, 32.65% xd” Tx6
Tx4, Tx5, Tx6
300MVA, 15% each G6
Tumbu 250km 398
G7, G8, G9 at 22kV, at 1.0 p.u. Volt 230
340MVA each, 19% xd” TxS1 Area 2 150MW
Tx7, Tx8, Tx9
360MVA each, 18%
72.6MVAR

Txs1, Txs2
750MVA, 28% each
TxS2
For calculating Qmax and Qmin 100km 50km
assume each gen unit to have Line parameters/km,
Pf lag 0.9, Pf lead 0.95 500kV:
225 228 R1 = 0.0028 ohm, X1 = 0.03 ohm
B1 = 0.31 MVAR, rate = 2800MVA
100MW Tampas 275kV:
500kV Dukis R1 = 0.0036 ohm, X1 = 0.046 ohm
48MVAR 350MW 200MW B1 = 0.18 MVAR, rate = 700MVA
275kV 220
170MVAR 97MVAR
22kV

Figure EX2.1.1: 17-bus network


51
Select most appropriate generating units from the list in Tables EX2.1.1 and EX2.1.2.

Table EX2.1.1: Typical data for round rotor alternators

52
Table EX2.1.2: Typical data for salient pole alternators

The load profile and load duration curves for the system are as shown in Figure EX2.1.2

Load Profile and Duration Curves – 17-bus


1.0

0.8

0.6

0.4

Load Profile
0.2
Load Duration Curve

7 10 14 18 22 0 3 7 Hours
Figure EX2.1.2: System daily load profile and load duration curve

53
(1) Prepare load flow files for 100%, 90%, 80%, 70% and 60% loads. Schedule generation in accordance with the following
merit order:
ƒ Sukum;
ƒ Jamna; and
ƒ Grewal Hydro
Figure Ex2.1.1 describes the network at 100% load. Each unit should be scheduled with headroom of not less than 10%.
For coal plants minimum generation is not less than 40% of the turbine power. For the hydro units, to avoid turbine
cavitation, each unit should not be loaded to less than 30% of the turbine rating. Ensure with system intact, the followings
are satisfied:
ƒ Voltage at each bus remains within 0.95 p.u. and 1.05 p.u. under system intact condition and to within 0.9 p.u. and 1.1
p.u. under contingency;
ƒ No overload under both normal and contingency conditions;
ƒ Generating units reactive power limits are to be observed under both normal and contingency conditions;

(2) Apply QV Curve calculations to determine the necessary reactive compensation at bus 130 to meet voltage limits under
normal and (N-1) contingencies for all lines and transformers.

(3) Determine the voltage transfer limit, using PV analysis for flow from Grewal Hydro to Area 2 via the 500kV lines under
normal and (N-1) contingencies for lines and transformers.

(4) Prepare dynamic data for all the generating units including, generating unit electrics, excitation controller (use Exc10), and
turbine-governor (use Gov6). Perform the following simulations, plot the the outputs, and comment:

a) 3-phase fault at bus 230 for 100ms and followed by loss of one line between bus 130 and 230
b) Simulate the loss of generating Jamna at bus 395 by disconnecting the generator transformer. Compare frequency
response without and with load-shedding.
c) Simulate a sudden islanding of Area 1 and comment on frequency response with load-shedding

54
2.2 Understanding Dynamic Data and Reading into DCPS
2.2.0 General

Dynamic data for a network is to be provided in a separate file with extension *.mac and read in DCPS-TS using command
REDM. For example, generator electrics, excitation controls, and turbine-governor data for network in Figure 2.1 is shown in
Table 2.5.

Table 2.5: Dynamic data for network in Figure 2.1

//Generator electric & mechanical


//gen5, imn,iunit, h, xd, xdp, xdpp, tdop, tdopp, xq, xqp, xqpp, tqop,tqopp, ra,damp, xlk, sat1,sat2
gen5, 1910, 1,2.71, 1.90, 0.300,0.293, 4.57, 0.042, 1.60, 0.70, 0.293, 0.50, 0.30, 0.0, 0.0,0.25,0.118,0.46
gen5, 2910, 1,2.80, 2.00, 0.329,0.252, 6.50, 0.025, 1.60, 0.50, 0.252, 0.34, 0.25, 0.0, 0.0,0.20,0.158,0.46
gen5, 3900, 1,2.80, 2.00, 0.329,0.252, 6.50, 0.025, 1.60, 0.50, 0.252, 0.34, 0.25, 0.0, 0.0,0.20,0.158,0.46
//Excitation controller data
//exc#,bsno,ieunit, Tr, Ka , ta ,ke/tb,te/tc, aex , bex , kf , tf , vrmax , vrmin, efdmin,efdmax
exc10, 1910,1 , 0.01, 30.0, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -10 , 10
exc10, 2910,1 , 0.01, 30.0, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -10 , 10
exc10, 3900,1 , 0.01, 30.0, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -10 , 10
//Turbine-governor controller
//ty,busno,igunit,turb MW, Pmax, Pmin, droop, T1 , T2 , T3 , KT , Vmax , Vmin ,Dturb
gov10,1910, 1, 900.0, 1.0, 0.00, 0.050, 30.500, 0.000, 0.000, 0.000, 1.000, -1.000, 0.0
gov10,2910, 1, 500.0, 1.0, 0.00, 0.050, 1.500, 0.000, 0.000, 0.000, 1.000, -1.000, 0.0
//ty,busno,igunit,turb MW, Pmax, Pmin, ddbnd, droop, T1 , T2 , T3 , KT , Vmax , Vmin ,Dturb
gov2, 3900, 1, 500.0, 1.0, 0.00, 400.0, 0.050, 30.00 , 0.500, 10.000, 1.0 , 0.8, -0.8, 0.0
//load-shedding
//ldshdfrq1, bus , freq, fraction, relay time, breaker time
ldshdfrq1 , 1210, 49.0, 0.2, 0.04, 0.15
ldshdfrq1 , 2220, 49.0, 0.2, 0.04, 0.15
ldshdfrq1 , 3200, 49.0, 0.2, 0.04, 0.15
ldshdfrq1 , 2210, 49.0, 0.2, 0.04, 0.15

55
The categories of dynamic data expected by DCPS-TS in sequence as they are written in the file are:

a) Machine electrics – detailed machine model, classical machine and induction motors;
b) Machine Controllers - excitation controller, power system stabilizer and turbine-governor controller;
c) Relays – frequency-based load-shedding etc..;
d) Dynamic Load Models

For the network in Figure 2.1, the dynamic data comprises of 3 x detailed machine electrics, 3 x excitation controllers type
gov10, 2 x turbine-governor controllers type 10, 1 x turbine-controller type gov2 and 4 x frequency-based load-shedding relays.

2.2.1 Machine Electrics

In DCPS-TS, there are 4 machine models that can be specified, namely:

a) gen0 – classical machine model, having the following first-order differential equations:

d*i/dt = Ti - 2Bf ................................................................. (1)


dTi/dt = ((Pm – Pe – (Ti - 2Bf)Di)/Mi ............................................... (2)

The required data for gen0 are:

gen0,imn,iunit, h, xd, xdp, ra, damp

where:
gen0 – denotes classical model;
imn – machine bus number;
iunit – machine unit id or number;
h – inertia constant in MW-s on machine base MVA;
xd – direct-axis synchronous reactance in per unit on machine base MVA;
xdp – direct-axis transient reactance in per unit on machine base MVA;
ra – armature resistance in per unit on machine base MVA;

56
damp – damping factor per unit

Since in DCPS-TS, calculations are carried out on per unit on a given system Base MVA in the load flow data, the resistance
and reactance of all generating unit parameters are converted to per unit on system base. The machine base MVA must be
specified in the load flow data. For example, as soon as xdp is read, it is converted to system base using:

Base_pu = System_Base_MVA/ Machine_MVA_Base


xdp = xdp x Base_pu

gen0 is usually used to model an infinite bus with constant voltage. For example, a large h as shown in data below will
cause equations (1) and (2) to have zero derivatives.

gen0, 100, 1, 999999.9, 1.95, 0.30, 0.0, 0.0

b) gen2 – transient level model synchronous machine has the following equations,

d*i/dt = Ti - 2Bf ................................................................. (3)


dTi/dt = ((Pm – Pe – (Ti - 2Bf)Di)/Mi ............................................... (4)
dE’qi/dt = (Efdi – E’qi + (xdi – x’di)Idi)/T’doi .................................... (5)
dE’di/dt = (-E’di - (xqi – x’qi) Iqi)/T’qoi ......................................... (6)

The required data are

gen2,imn,iunit, h, xd, xdp, tdop, xq, xqp, tqop, ra,damp, xleak, sat1, sat2

where:
gen2 – denotes transient level model;
imn – machine bus number;
iunit – machine unit id or number;
h – inertia constant in MW-s on machine base MVA;
xd – direct-axis synchronous reactance in per unit on machine base MVA;
xdp – direct-axis transient reactance in per unit on machine base MVA;
tdop – open circuit direct-axis transient time constant in seconds;

57
xq – quadrature-axis synchronous reactance in per unit on machine base MVA;
xqp – quadrature-axis transient reactance in per unit on machine base MVA;
tqop – open circuit quadrature-axis transient time constant in seconds;
ra – armature resistance in per unit on machine base MVA;
damp – damping factor per unit;
xleak – leakage reactance in per unit on machine base MVA;
sat1 – saturation factor at 1.0;
sat2 – saturation factor at 1.2;

Example data for gen2 model is:

gen2, 100, 1, 3.5, 1.4, 0.3, 6.0, 1.35, 0.6 1, 0.0, 0.0, 0.1, 0.0, 0.0

c) gen5 – a generator detailed model comprising of one main field winding on the d-axis circuit [eqn.(9)], one damper
winding on the d-axis [eqn. (12)], and two damper windings on the q-axis circuit [eqns. (10) & (11)]. Equations (7) and (8)
describe the mechanical motion of the rotor.

d*i/dt = Ti - 2Bf ................................................................. (7)


dTi/dt = ((Pm – Pe – (Ti - 2Bf)Di)/Mi ............................................... (8)
dE’qi/dt = (Efdi – E’qi + (xdi – x’di)Idi)/T’doi .................................... (9)
dE’di/dt = (-E’di - (xqi – x’qi) Iqi)/T’qoi ......................................... (10)
dE”qi/dt = (E’qi – E”qi + (x’di – x”di)Idi)/T”doi ................................... (11)
dE”di/dt = (-E”di + E’di - (x’qi – x”qi) Iqi)/T”qoi ................................. (12)

The required data are:

gen5,imn,iunit,h,xd,xdp,xdpp,tdop,tdopp,xq,xqp,xqpp,tqop,tqopp,ra,damp,xleak,sat1,sat2

where:
gen5 – denotes detailed machine model;
imn – machine bus number;

58
iunit – machine unit id or number;
h – inertia constant in MW-s on machine base MVA;
xd – direct-axis synchronous reactance in per unit on machine base MVA;
xdp – direct-axis transient reactance in per unit on machine base MVA;
xdpp – direct-axis sub-transient reactance in per unit on machine base MVA;
tdop – open circuit direct-axis transient time constant in seconds;
tdopp – open circuit direct-axis sub-transient time constant in seconds;
xq – quadrature-axis synchronous reactance in per unit on machine base MVA;
xqp – quadrature-axis transient reactance in per unit on machine base MVA;
xqpp – quadrature-axis sub-transient reactance in per unit on machine base MVA;
tqop – open circuit quadrature-axis transient time constant in seconds;
tqopp – open circuit quadrature-axis sub-transient time constant in seconds;
ra – armature resistance in per unit on machine base MVA;
damp – damping factor per unit;
xleak – leakage reactance in per unit on machine base MVA;
sat1 – saturation factor at 1.0;
sat2 – saturation factor at 1.2;

Example data for gen5 model is:

gen5, 100, 1,3.5,1.4,0.3,0.2,6.00,0.050,1.35,0.6,0.2,1.0,0.05,0.0,0.0,0.1,0.03,0.4

All reactances must be of unsaturated vales,

59
2.2.2 Excitation Controls

Relationship between machine states and excitation controls is illustrated in Figure 2.3. The output of the excitation controller
is the field voltage (Efd), i.e., the voltage across the field winding of the synchronous generator located in the rotor. Field
voltage and current will determine the reactive power output of the machine and thus the level of the terminal voltage.

Turbine Power, PMECH Angle, *

Speed, ω
Machine
Field Voltage, EFD
Model Terminal Voltage, Vrk

Current Injection, Cirx


Bus Terminal
Voltage, VT

Excitation
EFD Controller VS = Other Signals =
VUEL +VOEL + VSO

Turbine-
Governor

Figure 2.3: Relationship between machine states and controller quantities

60
Equations (5) and (9) for gen2 and gen5 models respectively are describing how the field voltage input will influence the q-axis
transient voltage. As indicated in Table 2.3, the next category of data read by DCPS-TS is excitation controller having the
following format:

exc# , bsno,ieunit, Tr, Ka , ta ,ke/tb,te/tc, aex , bex , kf , tf , vrmax , vrmin, efdmin,efdmax


exc10, 100,1 ,0.015,200.0, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -6.4 , 7.0

The above data contains parameters for a simple excitation controller type exc10 whose block diagram is illustrated in Figure
2.4.

VREF
Es
Efdmax
+
VT 1 EV - EIV VOUT EFD
3 KA
(1+sTR)
+
Efdmin

VSO

Figure 2.4: DCPS Excitation control type exc10

Another excitation control model implemented in DCPS-TS is ‘exc1’ representing an IEEE Type 1 Excitation Control as shown in
Figure 2.5. The data required for exc1 model is shown below.

Exc# , bsno,ieunit, Tr, Ka , ta ,ke/tb,te/tc, a , b , kf , tf , vrmax , vrmin, efdmin,efdmax


exc1 , 100,1 ,0.050,100.0,0.055, 0.00, 0.36,0.006,1.075, 0.125,1.8 , 5.2 , -5.2 , -7.3 , 7.3

61
Efd

E2

Efdx

E1

SE = B(Efdx – A)2/Efdx

When Efdx > E1 and


Efdx < E2

A B Ix

Exciter Field Current

VREF SE
VRMAX
EFDMAX
+ -
VT 1 - KA + 1
3 3
1 + sTR 1 + sTA 1 + sTE
-
EFDMIN
VRMIN
VSO sKF
1 + sTF

Figure 2.5: Excitation model type exc1 representing IEEE Type 1

62
2.2.3 Turbine-Governor Control

Referring to Figure 2.3, a turbine-governor monitors the speed to the rotor being driven by the turbine. Depending on the
deviation of the rotor speed with respect to the synchronous speed, the governor will provide the appropriate signal to fuel
valve controllers either to open on close the valve. Figure 2.6 shows a simple turbine-governor control DCPS-TS type ‘gov10’.
The data required for model in Figure 2.6 is:

Type ,busno,igunit,turb MW, Pmax, Pmin, droop, T1 , T2 , T3 , KT , Vmax , Vmin ,Dturb


gov10, 1910, 1, 900.0, 1.0, 0.00, 0.050, 30.500, 0.000, 0.000, 0.000, 1.000, -1.000, 0.0

PREF
Vmax
+
)T 1 - 1
G Pmech
R 1 + sT1
-
Vmin

Figure 2.6: Simple turbine-governor model, gov10

63
2.2.4 Power System Stabiliser Data

2.2.5 Frequency-Based Load-Shedding Relays

2.2.6 Load Dynamic Model Data

64
2.3 Network Ordering, Sparsity and Admittance Matrix
2.3.1 General

All power system dynamic simulations require the solutions of linear algebraic systems in the form of YV = I where the
admittance matrix Y is highly sparse. The unknown voltage vector, V is fully filled but the current injection vector, I is usually
sparse. Here we only discuss sparse matrix method used in the DCPS-TS and DCPS-LF. Sparsity technique involves two major
aspects, (1) choice of storage, and (2) sparsity arithmetic. For example, below is an admittance matrix for a three area system
and note the population of zeros.

ts>ybus
3930 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0
...... -15.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 15.00i 0i
3300 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
...... 0i -9.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 9.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i
3970 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00
...... 0i 0i -15.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 15.00i
3310 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0
...... 0i 0i 0i -9.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 9.00i 0i 0i 0i 0i 0i 0i
3980 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00
...... 0i 0i 0i 0i -15.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 15.00i
1910 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i -15.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 15.00i 0i 0i 0i 0i 0i 0i 0i 0i
3910 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0
...... 0i 0i 0i 0i 0i 0i -15.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 15.00i 0i
1901 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i -200.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 200.00i 0i 0i 0i 0i 0i
3920 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0
...... 0i 0i 0i 0i 0i 0i 0i 0i -15.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 15.00i 0i
3311 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i -9.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 9.00i 0i 0i 0i 0i 0i 0i
3960 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -15.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 15.00i
1900 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -200.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 200.00i 0i 0i 0i 0i 0i
1921 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -2.08i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 2.08i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i
2300 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -9.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 9.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i
1911 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -15.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 15.00i 0i 0i 0i 0i 0i 0i 0i 0i
2900 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -200.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 200.00i 0i 0i 0i
2901 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -200.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 200.00i 0i 0i 0i
2910 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -200.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 200.00i 0i 0i 0i 0i
2911 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -200.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 200.00i 0i 0i 0i 0i
1920 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -2.08i 0i 0i 0i 0i 0i 2.08i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i
3950 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -15.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 15.00i
1313 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12.50 -3.68 -8.82 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -20.82i 6.13i 14.71i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i
1314 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3.68 11.03 0 0 0 0 0 0 0 -7.35 0 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 6.13i -18.34i 0i 0i 0i 0i 0i 0i 0i 12.25i 0i 0i 0i 0i 0i 0i 0i 0i 0i
1312 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -8.82 0 11.03 0 0 -2.21 0 0 0 0 0 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 14.71i 0i -18.37i 0i 0i 3.68i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i
3540 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 26.97 0 0 0 0 0 0 0 0 0 0 0 0 0 -17.98 -8.99
...... 0i 9.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -291.70i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 188.76i 94.38i
1311 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0.00 0 0 0 0 0 2.94 -2.94 0 0 0 0 0 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 2.08i 0i 0i 0i 0i 0i 0i 2.08i 0i 0i 0i 0i 0i -9.06i 4.90i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i
1310 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.21 0 -2.94 9.56 0 0 0 -4.41 0 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 3.68i 0i 4.90i -15.90i 0i 0i 0i 7.35i 0i 0i 0i 0i 0i 0i 0i 0i 0i
2530 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 33.95 0 -9.43 0 0 -5.66 0 0 -18.86 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -337.51i 0i 94.30i 0i 0i 56.58i 0i 0i 188.59i 0i 0i 0i 0i
2520 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 30.65 0 0 0 0 0 0 -14.14 -7.07 0 -9.43 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -304.56i 0i 0i 0i 0i 0i 0i 141.44i 70.72i 0i 94.30i 0i
2510 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 -9.43 0 18.86 0 0 0 0 0 0 -9.43 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 9.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 94.30i 0i -196.79i 0i 0i 0i 0i 0i 0i 94.30i 0i 0i 0i
1300 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -7.35 0 0 0 -4.41 0 0 0 11.76 0 0 0 0 0 0 0.00 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 12.25i 0i 0i 0i 7.35i 0i 0i 0i -28.57i 0i 0i 0i 0i 0i 0i 9.00i 0i 0i
1530 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 28.29 0 0 0 0 0 -28.29 0 0
...... 0i 0i 0i 0i 0i 15.00i 0i 0i 0i 0i 0i 0i 0i 0i 15.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -312.69i 0i 0i 0i 0i 0i 282.89i 0i 0i
1520 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -5.66 0 0 0 0 33.95 0 -14.14 0 0 -14.14 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 56.58i 0i 0i 0i 0i -336.96i 0i 141.44i 0i 0i 141.44i 0i 0i
3520 0 0 0 0.00 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 73.23 0 0 0 0 -28.29 -44.94
...... 0i 0i 0i 9.00i 0i 0i 0i 0i 0i 9.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -772.48i 0i 0i 0i 0i 282.89i 471.91i
1500 0 0 0 0 0 0 0 0.00 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -14.14 0 28.29 0 0 -14.14 0 0
...... 0i 0i 0i 0i 0i 0i 0i 200.00i 0i 0i 0i 200.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 141.44i 0i -682.39i 0i 0i 141.44i 0i 0i
2540 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0.00 0 0 0 0 0 0 0 0 -18.86 -14.14 0 0 0 0 0 0 33.00 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 200.00i 200.00i 0i 0i 0i 0i 0i 0i 0i 0i 188.59i 141.44i 0i 0i 0i 0i 0i 0i -729.63i 0i 0i 0i 0i
2500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0.00 0 0 0 0 0 0 0 0 0 0 0 -7.07 -9.43 0 0 0 0 0 0 16.50 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 200.00i 200.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 70.72i 94.30i 0i 0i 0i 0i 0i 0i -564.67i 0i 0i 0i
1510 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 -28.29 -14.14 0 -14.14 0 0 56.58 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 9.00i 282.89i 141.44i 0i 141.44i 0i 0i -573.87i 0i 0i
3530 0.00 0 0 0 0 0 0.00 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -17.98 0 0 0 -9.43 0 0 0 0 -28.29 0 0 0 0 55.70 0
...... 15.00i 0i 0i 0i 0i 0i 15.00i 0i 15.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 188.76i 0i 0i 0i 94.30i 0i 0i 0i 0i 282.89i 0i 0i 0i 0i -609.84i 0i
3510 0 0 0.00 0 0.00 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0.00 0 0 0 -8.99 0 0 0 0 0 0 0 0 -44.94 0 0 0 0 0 53.93
...... 0i 0i 15.00i 0i 15.00i 0i 0i 0i 0i 0i 15.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 15.00i 0i 0i 0i 94.38i 0i 0i 0i 0i 0i 0i 0i 0i 471.91i 0i 0i 0i 0i 0i -626.02i

65
2.3.2 Sparse Storage

Whatever the choice of storage, in sparsity technique only the non-zero elements are to be stored. This results in a small
memory requirement which makes possible the solution of large systems. Two most important storage schemes are: (1) the
collections of vectors, and (2) the linklist. The two storage methods are illustrated using a sparse matrix shown below.

┌ ┐
│ 3 -1 0 0 -2 │
│-1 13 -5 -4 -3 │
│ 0 -5 5 0 0 │
│ 0 -4 0 10 -6 │
│-2 -3 0 -6 11 │
└ ┘
In the ‘collections of vectors’ method, the matrix is stored using the following arrays:
x.first x.val x.col

1 3 1
4 -1 2
9 -2 5
11 -1 1
14 13 2
18 -5 3
-4 4
-3 5
-5 2
5 3
-4 2
10 4
-6 5
-2 1
-3 2
-6 4
11 5

Array x.first points to the location in array x.val of the first element of each row of the matrix and array x.col contains the
column number of the corresponding element in x.val. The matrix can also be stored column-wise by making x.first to point to
the first element in each column of the matrix and x.col/x.row to store the row numbers. For the small example above, the

66
collection of vectors require more memory space than the corresponding full matrix but the relative memory size decreases as
number of zeros increases with the size of the matrix. A slight variation to the storage scheme shown is to store the diagonal
elements in a separate vector, and vector x.first stores the number of elements of each row. This scheme is used in storing
the LU factor in DCPS. Using the ‘linklist’ method the same matrix is stored using the following arrays:

x.first x.val x.col x.next

1 3 1 1
4 -1 2 1
9 -2 5 0
11 -1 1 1
14 13 2 1
18 -5 3 1
-4 4 1
-3 5 0
-5 2 1
5 3 0
-4 2 1
10 4 1
-6 5 0
-2 1 1
-3 2 1
-6 4 1
13 5 0

Note that in the linklist method an additional vector x.next is required.

To obtain the third row of the matrix, the procedure is as follows:

1) Find the third element of vector x.first, 9, which points to the information on the first element in that row in vectors x.val,
x.col and x.next. Vector x.val stores the actual value, -5. Vector x.col gives the column number, 2. Vector x.next
points to the next element in the same row relative to the current position;

67
2) In this case the x.next value is 1 which means that the next element is 1 row below the current row. When the value of
x.next is zero, it indicates the last element and when the sign is negative, the position is above the current row;

The main of advantage of the linklist method is that, elements can be added and inserted without the need for rearrangement
of the vectors or arrays. However, in the collection of vectors method where elements are accessed in sequence, an addition
of an element requires that all elements below it to be shifted by a row. If a new element, -99 is inserted at position 5, 3 of
the example matrix the resulting linklist is as shown below:

x.first x.val x.col x.next

1 3 1 1
4 -1 2 1
9 -2 5 0
11 -1 1 1
14 13 2 1
-5 3 1
-4 4 1
-3 5 0
-5 2 1
5 3 0
-4 2 1
10 4 1
-6 5 0
-2 1 1
-3 2 3
-6 4 1
13 5 0
-99 3 -2

The new element is added below the last row. Only a single modification is necessary on the existing vectors, i.e., the x.next
value for element before this new element is changed to 3.

The linklist storage is used when the matrix is expected to change in size due to fill-ins such as during factorization. New fill-ins
are conveniently added with little data movement. The collection vectors method which requires less memory space than the
linklist method is useful when the matrix structure is expected to remain the same. As an example, the LU factor which is used
repeatedly is more efficiently accessed by rows or by columns if stored in the collections of vectors method.

68
2.3.3 Sparsity Arithmetics

Many arithmetic operations involving sparse-stored matrices can be done more efficiently. If linklist-stored matrix Y has ne
number elements and to be multiplied by scalar c then it is simply done as follows:

for (i = 1; i <= ne; i++){


Y.value[i] = c * Y.value[i];
}

i.e., having ne operations

Instead of the usual (nrow x ncol) operations, as below:

for (i = 1; i <= nrow; i++){


for (j = 1; j <= ncol; j++) {
Y[i][j] = c * Y[i][j];
}
}

Matrix-vector multiplication is also performed more efficiently. Let matrix Y be an n × n matrix - be stored using the collection
of vectors method and to be multiplied by vector x. It can be implemented as follows:

for (i = 1; i <= n; i++) {


s = 0.0;
irowf = Y.first[i];
icolf = Y.col[irowf];
s += Y.val[irowf] * x[icolf];
irown = Y.first[i+1] - 1;
for (j = irowf + 1; j <= irown; j++)
icol = Y.col[j];
s += Y.val[j] * x[icol];
}
}

69
The above operation is more efficient than the corresponding full matrix method as shown below:

for (i = 1; i <= nrow; i++) {


s = 0.0;
for (j = 1; j <= ncol; j++) {
s += Y[j][j]*x[j];
}
}

One of the most important procedure in solving equation YV = I is the one that factorizes Y. Matrix Y is factorized into lower
and upper triangular matrices such that, Y = LU. The direct solution starts by solving, Lz = I using using forward substitution
and then V is solved by backward substitution using, UV = z.

70
2.3.4 Network Ordering

Network ordering (ORD1 and ORDE) is a process of arranging network, so that the buses are arranged in the admitaance
matrix in ascending order of the number of branches connected to the bus. This process is carried out as follows:

1) Count the number of branches to each bus;


2) Sort the buses in ascending order of the number of branches connected to it;
3) Rearrange the bus data to the sequence in 2) above

200 200 400 G4 G4 400


G1 G1 Area 2
1901 1900 2901 2900
300+j200
200+j100
2500
1500
100+j60 50
1910
100km 150km
G2
100km
G2 2510
200km 1911 j50
1510 1530 Tx 200km
50
j50 2300
Tx
100km 1300
50+j30
2520
50+j30
j100
1520
150km 400+j250
j100
400+j250 Area 1 2530
100km

2540
200+j100
100+j50
j50
500km 225
2910
1. All lines 275kV, Impedance/circuit/km, 0.000007 + j0.00007, 0.002 p.u.
2. G1, 500MVA, Gen Tx, 500MVA, 15%, voltage, 1.03 p.u.
G5
150km
3. G2, 100MVA, Gen Tx, 100MVA, 10%, voltage, 1.03 p.u.
4. G4, 500MVA, Gen Tx, 500MVA, 15%, voltage, 1.03 p.u. G5
5. G5, 500MVA, Gen Tx, 500MVA, 15%, voltage, 1.03 p.u. 2911
225
6. Tx, 275/33kV, 60MVA, 12%, tap 1.0 p.u.
7. Each unit has power factor lag = 0.85 and led = 0.9

Figure 2.6: 19-bus network

71
For a 19-bus network shown in Figure 2.6, ordering results in buses to be arranged as,

ts>orde
index Bus Number Bus Type Bus Name Mac Base
----------------------------------------------------
1 1901 2 GENA1A_2 500.00
2 1900 2 GENA1A_1 500.00
3 2911 2 GENA2B_2 500.00
4 2900 3 GENA2A_1 500.00
5 2901 2 GENA2A_2 500.00
6 2910 2 GENA2B_1 500.00
7 1910 2 GENA1B_1 100.00
8 1911 2 GENA1B_2 100.00
9 2300 0 LOADA21275 0.00
10 1300 0 LOADA1133 0.00
11 2520 0 LOADA22275 0.00
12 2530 0 INT_A2 0.00 3 branches connected
13 2510 0 LOADA21275 0.00
14 1530 0 GENAIB275 0.00
15 1520 0 INT_A1 0.00
16 2540 0 GENA2B275 0.00 4 branches connected
17 1510 0 LOADA11275 0.00
18 2500 0 GENA2A275 0.00
19 1500 0 GENA1A275 0.00
----------------------------------------------------

Buses 1500, 2500, 1510, and 2540 each has 4 branches connected to it. Subsequently, the admittance matrix (see next page)
is formed with buses arranged in accordance to the above index.

72
When the admittance matrix is factorised, the high % of the sparsity will be preserved as shown below.

ts>ybus
1901 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00
...... -200.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 200.00i
1900 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00
...... 0i -200.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 200.00i
2911 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0 0 0
...... 0i 0i -200.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 200.00i 0i 0i 0i
2900 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0
...... 0i 0i 0i -200.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 200.00i 0i
2901 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0 0 0 0.00 0
...... 0i 0i 0i 0i -200.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 200.00i 0i
2910 0 0 0 0 0 0.00 0 0 0 0 0 0 0 0 0 0.00 0 0 0
...... 0i 0i 0i 0i 0i -200.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 200.00i 0i 0i 0i
1910 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0.00 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i -15.00i 0i 0i 0i 0i 0i 0i 15.00i 0i 0i 0i 0i 0i
1911 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0.00 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i -15.00i 0i 0i 0i 0i 0i 15.00i 0i 0i 0i 0i 0i
2300 0 0 0 0 0 0 0 0 0.00 0 0 0 0.00 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i -9.00i 0i 0i 0i 9.00i 0i 0i 0i 0i 0i 0i
1300 0 0 0 0 0 0 0 0 0 0.00 0 0 0 0 0 0 0.00 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i -9.00i 0i 0i 0i 0i 0i 0i 9.00i 0i 0i
2520 0 0 0 0 0 0 0 0 0 0 25.08 0 0 0 0 -20.00 0 -5.08 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -209.77i 0i 0i 0i 0i 140.00i 0i 71.07i 0i
2530 0 0 0 0 0 0 0 0 0 0 0 36.15 -9.90 0 -6.45 -19.80 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -351.49i 99.01i 0i 56.41i 198.02i 0i 0i 0i
2510 0 0 0 0 0 0 0 0 0.00 0 0 -9.90 19.80 0 0 0 0 -9.90 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 9.00i 0i 0i 99.01i -206.22i 0i 0i 0i 0i 99.01i 0i
1530 0 0 0 0 0 0 0.00 0.00 0 0 0 0 0 40.00 0 0 -40.00 0 0
...... 0i 0i 0i 0i 0i 0i 15.00i 15.00i 0i 0i 0i 0i 0i -309.80i 0i 0i 280.00i 0i 0i
1520 0 0 0 0 0 0 0 0 0 0 0 -6.45 0 0 36.60 0 -20.00 0 -10.15
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 56.41i 0i 0i -336.04i 0i 140.00i 0i 142.13i
2540 0 0 0.00 0 0 0.00 0 0 0 0 -20.00 -19.80 0 0 0 39.80 0 0 0
...... 0i 0i 200.00i 0i 0i 200.00i 0i 0i 0i 0i 140.00i 198.02i 0i 0i 0i -737.62i 0i 0i 0i
1510 0 0 0 0 0 0 0 0 0 0.00 0 0 0 -40.00 -20.00 0 80.00 0 -20.00
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 9.00i 0i 0i 0i 280.00i 140.00i 0i -568.10i 0i 140.00i
2500 0 0 0 0.00 0.00 0 0 0 0 0 -5.08 0 -9.90 0 0 0 0 14.98 0
...... 0i 0i 0i 200.00i 200.00i 0i 0i 0i 0i 0i 71.07i 0i 99.01i 0i 0i 0i 0i -569.73i 0i
1500 0.00 0.00 0 0 0 0 0 0 0 0 0 0 0 0 -10.15 0 -20.00 0 30.15
...... 200.00i 200.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 142.13i 0i 140.00i 0i -681.63i
ts>fac2,syb,1
->New fill-ins = 18

73
U-Factor
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
...... -200i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
...... 0i -200i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
...... 0i 0i -200i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
...... 0i 0i 0i -200i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i -200i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i -200i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i -15i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i -15i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i -9i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i -9i 0i 0i 0i 0i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 25.08 0 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -209.77i 0i 0i 0i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 36.15 0 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i -351.49i 0i 0i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 -9.90 17.09 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 9i 0i 0i 99.01i -169.33i 0i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 40.00 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 15i 15i 0i 0i 0i 0i 0i -279.80i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 -6.45 -1.77 0 35.28 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 56.41i 15.89i 0i -325.50i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 -20.00 -19.80 -5.42 0 -4.10 11.24 0 0 0
...... 0i 0i 200i 0i 0i 200i 0i 0i 0i 0i 140.00i 198.02i 55.78i 0i 37.01i -110.09i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 -40.00 -20.00 -2.31 28.88 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 9i 0i 0i 0i 280.00i 140.00i 15.92i -216.46i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 -5.08 0 -9.90 0 -1.03 -7.74 -2.21 3.16 0
...... 0i 0i 0i 200i 200i 0i 0i 0i 0i 0i 71.07i 0i 99.01i 0i 9.29i 81.15i 15.73i -26.58i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -10.15 -1.19 -26.74 -3.15 0.10
...... 200i 200i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 142.13i 16.16i 203.55i 30.77i 9.73i
ts>

74
L-Factor
...... 1.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.00
...... 0.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0.00i
...... 0 1.00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.00
...... 0i 0.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0.00i
...... 0 0 1.00 0 0 0 0 0 0 0 0 0 0 0 0 -1.00 0 0 0
...... 0i 0i 0.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0.00i 0i 0i 0i
...... 0 0 0 1.00 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.00 0
...... 0i 0i 0i 0.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0.00i 0i
...... 0 0 0 0 1.00 0 0 0 0 0 0 0 0 0 0 0 0 -1.00 0
...... 0i 0i 0i 0i 0.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0.00i 0i
...... 0 0 0 0 0 1.00 0 0 0 0 0 0 0 0 0 -1.00 0 0 0
...... 0i 0i 0i 0i 0i 0.00i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0.00i 0i 0i 0i
...... 0 0 0 0 0 0 1.00 0 0 0 0 0 0 -1.00 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0.00i 0i 0i 0i 0i 0i 0i 0.00i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 1.00 0 0 0 0 0 -1.00 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0.00i 0i 0i 0i 0i 0i 0.00i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 1.00 0 0 0 -1.00 0 0 0 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0.00i 0i 0i 0i 0.00i 0i 0i 0i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 1.00 0 0 0 0 0 0 -1.00 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0.00i 0i 0i 0i 0i 0i 0i 0.00i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 1.00 0 0 0 0 -0.67 0 -0.34 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0.00i 0i 0i 0i 0i -0.02i 0i 0.02i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 1.00 -0.28 0 -0.16 -0.56 0 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0.00i 0.00i 0i -0.00i 0.00i 0i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 0 1.00 0 -0.09 -0.33 0 -0.58 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0.00i 0i -0.00i 0.00i 0i 0.00i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 1.00 0 0 -1.00 0 0
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0.00i 0i 0i 0.00i 0i 0i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.00 -0.11 -0.43 -0.03 -0.43
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0.00i -0.00i -0.01i -0.00i 0.02i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.00 -0.15 -0.74 -0.15
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0.00i -0.01i 0.00i 0.00i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.00 -0.07 -0.94
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0.00i -0.00i 0.00i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.00 -1.16
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0.00i 0.02i
...... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.00
...... 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0i 0.00i

75
2.4 Calculation of Bus Power

Calculation of bus powers is carried out to ensure that the network load flow has been properly solved. The power flowing out
of bus i to bus a through branch ia is given by,

Sia = V*i(Vi-Va)Yia ............................................................(2.4.1)

For bus i in Figure 2.7, the bus power is given by, Sia + Sib + (PL + jQL) + (PG + jQG). For a bus with a scheduled load of PL +
jQL, the sume of the powers from all branches connected to the bus calculated using equation 2.4.1 is equal to the scheduled
load within the given load flow tolerance.

Vi = Vir + jVix

Vb = Vbr + jVbx

Va = Var + jVax

PG + jQG

PL + jQL

Figure 2.7: Bus powers at bus i

76
Bpow in DCPS-LF will give an output;

dsa>bpow
Calculated, actual bus powers and mismatches
============================================================
Bus Ty Pcal Qcal Pactual Qactual Pmis Qmis
------------------------------------------------------------
3900 3 405.14 3.46 0.00 0.00
1910 2 599.99 -26.93 600.00 0.00 -0.01
2910 2 399.99 27.87 400.00 0.00 -0.01
3200 0 -399.99 -200.00 -400.00 -200.00 0.01 0.00
2220 0 -400.00 -200.00 -400.00 -200.00 0.00 0.00
2210 0 -499.99 -300.00 -500.00 -300.00 0.01 0.00
1210 0 -100.00 -50.00 -100.00 -50.00 0.00 0.00
Absolute Total power mismatch MW & MVAr = 0.021607 0.009245
Total load power MW & MVAr = -1400.00 -750.00
Slack bus power MW & MVAr = 405.14 3.46
dsa>

77
2.5 Initial Conditions Calculations for Machine States

2.5.1 General

Initial conditions for each machine are calculated from its terminal condition as found from the solved load flow. In load flow at
terminal of a machine the calculated quantities are voltage and power as shown in Figure 2.8.

Sg = Pg + jQg

VT = Vr + jVx

Figure 2.8: Terminal quantities for machine available from load flow

In dynamic calculations, initial valaues of the states in the machine differential equations discussed in 2.2.1 are to be
determined. In the following sections, initial conditions for the various machine models will be discussed.

78
2.5.2 Gen0 – Classical Model

For a classical generator model, the rotor angle of the machine is determined from the internal voltage angle behind the direct-
axis transient reactance (x’d) as illustrated in Figure 2.9.

ra + jx’d IT

Vk VT

Figure 2.9: gen0 – internal voltage

From Pg + jQg, we calculate the terminal current, using Sg = VI*,

IT* = (Pg + jQg)/(Vr +jVx) = (Pg + jQg) (Vr - jVx) / (Vr2 + Vx2)

IT = Ir + jIx = ((PgVr + QgVx) - j (QgVr – PgVx))/ (Vr2 + Vx2) = ((PgVr + QgVx) + j (PgVx - QgVr))/ (Vr2 + Vx2)

The voltage is given by,

Vk = Vkr + jVkx = VT + IT (ra + jx’d) = Vr + jVx + (Ir + jIx)(ra + jx’d) = Vr + Irra - Ixx’d + j(Vx + Ixra + Ir x’d )

The rotor angle, i.e., the internal voltage angle is,

* = arctan (Vkx/ Vkr) ……………………………………………………………………………………… (2.5.1)

79
Consider an example with a network with a generator supplying load connected near to an infinite bus as in Figure 2.10.

1009 2009

1000 2000
Infinite
source

Generator

Figure 2.10: A generator supplying load near an infinite source

The load flow data for the network in Figure 2.10 is (see Table 2.4):

4 4
100.0
1000 2 1.02 0.0 2.0 0.0 0.0 0.0 0.0 0.0 1 -300.0 400.0 900.0 22.0 0.0 0.2 'GEN1 '
1009 0 1.00 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1 0.0 0.0 0.0 275.0 0.0 0.0 'GEN1_275KV '
2000 3 1.02 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2 -300.0 400.0 900.0 22.0 0.0 0.2 'INFINITE_BUS '
2009 0 1.00 0.0 0.0 0.0 2.0 1.0 0.0 0.0 2 0.0 0.0 0.0 275.0 0.0 0.0 'LOAD_BUS '
0 1 1009 2009 0.01 0.15 0.20 800.00 0.0 0.0 0 0 0.0 0.0 0.0 0.0 1
0 2 1009 2009 0.01 0.15 0.20 800.00 0.0 0.0 0 0 0.0 0.0 0.0 0.0 1
1 1 1000 1009 0.00 0.20 0.00 960.0 1.00 0.0 0 0 0.0 0.0 0.0 0.0 1
1 1 2000 2009 0.00 0.20 0.00 960.0 1.00 0.0 0 0 0.0 0.0 0.0 0.0 1

Bus 2000 is the slack bus. Therefore, in the load flow solution, all bus voltage angles will be referred to the slack bus voltage
angle. If generator at bus 2000 is modeled as gen0, its internal voltage (Vk) will be calculated from the terminal voltage (VT)
as determined in the load flow and this terminal voltage angle is referred to the the slack bus voltage as illustrated in Figure
2.11.

80
Vk x’dIT

raIT
VT

*
$ IT
"
Reference
Slack bus voltage

Figure 2.11: Rotor angle referred to slack bus for classical generator model.

From the load flow result as shown below, $ for generator at bus 1000 is 10.7 degrees. Using eqn 2.5.1 it is expected that with
respect to the slack bus, the rotor angle would larger than $.

bus quantities
No Bus Ty Vol_Mag Vol_Ang P_Gen Q_Gen P_Load Q_Load Q_Shunt Q_Min Q_Max Area Bus_Name
====================================================================================================
1 1000 2 1.0200 10.658 200.0 10.8 0.0 0.0 0.0 -300.0 400.0 1 GEN1
2 1009 0 1.0186 8.360 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1 GEN1_275KV
3 2000 3 1.0200 0.000 2.0 87.2 0.0 0.0 0.0 -300.0 400.0 2 INFINITE_BUS
4 2009 0 1.0022 -0.023 0.0 0.0 200.0 100.0 0.0 0.0 0.0 2 LOAD_BUS

Initial condition calculations with the dynamic data shown below give * of about 14.3 degrees (see initial condition calculations
table).

Machine data
//GENERATOR ELECTRIC AND INERTIA
//gen0,imn,iunit, h, xd, xdp, ra, damp
gen0, 1000, 1, 4.0, 1.4, 0.3, 0.0, 0.0
//MAIN SYSTEM AS INFINITE BUS
gen0, 2000, 1,999999.0, 0.00, 0.01, 0.0, 0.0
//end

81
Initial condition calculations
ts>iniv
TY MACNO Iq Id Vq Vd Eqp Edp Eqpp Edpp Efd Del Speed Pm/Pag
dEqpdt dEdpdt dEqppdt dEdppdt dDeldt dWdt
--------------------------------------------------------------------------------------------------------
0 1000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 14.312 314.159 2.0000
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
0 2000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.001 314.159 0.0195
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
--------------------------------------------------------------------------------------------------------

82
2.5.3 gen 2 – Transient Level Model

This model (gen2) comprises of one field circuit and one damper circuit (see equations 5 and 6). Since this model is based on
two-axis models it is necessary for us to locate the q- and d- axes. To locate the q-axis, we use equation:

Eq = VT + IT (ra + jxq)............................................................. (2.5.2)

Refering to Figure 2.12, the angle of VT , i.e., $ in |VT|cos$ + j |VT|sin$ is referred to the reference axis which is related to the
slack bus angle and that all voltages are referred to the slack bus. The position of the q-axis must be located further from the
reference axis (assume the machine is sending output power) at an angle *. Knowing the q-axis the d-axis can be located, at
90 degrees to the q-axis.
d-axis

Eq xqIT

is
* ax
q-
raIT
VT
$’

"’ *
$ IT
" Iq Vq q-axis Eq

Reference $’
Slack bus voltage Vd "’
*

Id

Figure 2.12: Locating the q-axis and changing reference

The angles with respect to the reference slack bus voltage are calculated as follows:
Since, VT = Vr + jVx , then $ = arctan (Vx/ Vr)
Since, IT = Ir + jIx, then " = arctan (Ix/ Ir)

83
With Eq = Eqr + jEqx , then * = arctan (Exq/ Eqr), i.e., the rotor angle position.
Referring to Figure 2.12, it is possible to transform the machine terminal voltage and current to the machine d-axis and q-axis
reference.
VT w.r.t.to q-axis is at angle, $’ = $ - *
IT w.r.t.to q-axis is at angle, "’ = " - *

Terminal voltage (VT) and current (IT) can now be transformed to the machine q- and d-axes as follows:
Vd = |VT|cos$’; and
Vq = |VT|sin$’
Vq = |VT|cos$’ = |VT|cos($-*) = |VT|cos$cos* + |VT|sin$sin*
Vd = |VT|sin$’ = |VT|sin($-*) = |VT|sin$cos* - |VT|cos$sin*
But , |VT|cos$ = Vr, and |VT|sin$ = Vx

Therefore,
Vq = Vrcos* + Vxsin*
Vd = Vxcos* - Vrsin*

or,

Vq cos* sin* Vr
=
Vd -sin* cos* Vx

The reverse transformation is,

Vr cos* -sin* Vq
=
Vx sin* cos* Vd

The transformation matrices are also applicable to current, Iq, Id to Ir, Ix and vice-versa.

84
To allow for initial flux linkages during transients, fictitious voltages behind transient and subtransient reactances on the d- and
q-axes are created using the following equations:

E’q = Vq + raIq – x’dId .........................................................(2.5.3)


E’d = Vd + raId + x’qIq ........................................................(2.5.4)

The field voltage is given by;

Efd = Vq - Idxd .....................................................................(2.5.5)

For the same system in Figure 2.10, dynamic model for machine at bus 1000 is changed to gen2, transient level as shown in
Table below.

//GENERATOR ELECTRIC AND INERTIA


//gen2,imn,iunit, h, xd, xdp, tdop, xq, xqp, tqop, ra, damp, xleak, sat1, sat2
gen2, 1000, 1, 5, 1.4, 0.25, 8.5, 1.3, 0.20, 0.60, 0.0, 0.0, 0.022, 0.0, 0.0
//gen0, 1000, 1, 4.0, 1.4, 4.6, 0.0, 0.0
//MAIN SYSTEM AS INFINITE BUS
gen0, 2000, 1,999999.0, 0.00, 0.01, 0.0, 0.0
//end

The result of the initial condition calculations is shown below. In this case the initial transient voltages (E‘q and E’d) behind
transient reactances (x’q and x’d) are calculated together with the d- and q-axes quantites Vq, Vd, Iq, Id).

ts>iniv
TY MACNO Iq Id Vq Eqp Vd
Edp Eqpp Edpp Efd Del Speed Pm/Pag
dEqpdt dEdpdt dEqppdt dEdppdt dDeldt dWdt
--------------------------------------------------------------------------------------------------------
2 1000 0.493 -0.170 0.794 -0.641 0.836 -0.542 0.000 0.000 1.032 41.533 314.159 0.5000
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
0 2000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 314.159 0.0012
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
--------------------------------------------------------------------------------------------------------

85
2.5.4 gen5 – Sub-Transient Level Model

Gen5 model has one main field winding one damper winding on the d-axis and two damper windings on the q-axis circuit. The
q-axis is located using the same equation (2.5.2),

Eq = VT + IT (ra + jxq).............................................................. (2.5.6)

However, to model initial flux linkages during transients two fictitious voltages are required representing sub-transient period
and transient periods, namely:

E’q = Vq + raIq – x’dId ..........................................................(2.5.7)


E’d = Vd + raId + x’qIq ..........................................................(2.5.8)

for transient; and

E”q = Vq + raIq – x”dId ..........................................................(2.5.9)


E”d = Vd + raId + x”qIq .........................................................(2.5.10)

for sub-transient. The field voltage is given by;

Efd = Vq - Idxd .................................................................(2.5.11)

For network in Figure 2.10, with machine model at bus 1000 changed to gen5 (see below),
//GENERATOR ELECTRIC AND INERTIA
//gen5, imn,iunit, h, xd, xdp, xdpp, tdop, tdopp, xq, xqp, xqpp, tqop,tqopp, ra,damp, xlk, sat1,sat2
gen5, 1000, 1,2.71, 1.90, 0.300,0.293, 4.57, 0.042, 1.60, 0.70, 0.293, 0.50, 0.30, 0.0, 0.0,0.25,0.118,0.46
//MAIN SYSTEM AS INFINITE BUS
gen0, 2000, 1,999999.0, 0.00, 0.01, 0.0, 0.0
//end

86
The initial conditions are:

ts>iniv
TY MACNO Iq Id Vq Vd Eqp Edp Eqpp Edpp Efd Del Speed Pm/Pag
dEqpdt dEdpdt dEqppdt dEdppdt dDeldt dWdt
--------------------------------------------------------------------------------------------------------
5 1000 1.426 -0.361 0.988 -0.253 1.000 -0.143 1.000 -0.207 1.064 22.332 314.159 1.5000
-0.0000 -0.0000 0.0000 0.0000 0.0000 0.0000
0 2000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.001 314.159 0.0109
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
--------------------------------------------------------------------------------------------------------

87
2.6 Initial Condition Calculations for Excitation System

2.6.1 General

Referring to Figure 2.3, an excitation controller has the terminal voltage as the main input and the output being field voltage
Efd. But from equations 2.5.5 and 2.5.11, the initial field voltage is calculated from the direct-axis steady-state voltage, current
and xd. Therefore, at the initial condition the output of the excitation control must be equal to the initial condition Efd as
calculated from the machine terminal conditions.

Using the principle described above, we will examine how initial conditions are calculated for two excitation control models in
DCPS-TS.

2.6.2 Exc10, Excitation system with a simple gain

An excitation system with a simple gain KA is shown in Figure 2.13.

VREF

EFDMAX
+
VT 1 VC - Verr
3 KA EFD
1 + sTR
+
EFDMIN

VSO

Figure 2.13: Excitation system with a simple gain

88
The following are equations describing describing exc10:

dVC/dt = (VT – VC)/TR


Verr = VREF – VC, assume VSO = 0
EFD = KAVerr

At initial condition, EFD and VT are known and therefore we need to determine VREF,

KA VREF - KAVC = EFD


VREF = (EFD + KAVC)/KA .......................................................... (2.5.12)
VC = VT

Example 2.1:
Given that the dynamic data for machine at bus 1000 with excitation control added is shown below:
//GENERATOR ELECTRIC AND INERTIA
//gen5, imn,iunit, h, xd, xdp, xdpp, tdop, tdopp, xq, xqp, xqpp, tqop,tqopp, ra,damp, xlk, sat1,sat2
gen5, 1000, 1,2.71, 1.90, 0.300,0.293, 4.57, 0.042, 1.60, 0.70, 0.293, 0.50, 0.30, 0.0, 0.0,0.25,0.118,0.46
//MAIN SYSTEM AS INFINITE BUS
gen0, 2000, 1,999999.0, 0.00, 0.01, 0.0, 0.0
//Excitation controller data
//exc#,bsno,ieunit, Tr, Ka , ta ,ke/tb,te/tc, aex , bex , kf , tf , vrmax , vrmin, efdmin,efdmax
exc10, 1000,1 , 0.01, 20.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -10 , 10
//end

89
And at initial conditions the machine states are as shown in Tables below:

ts>shvo
Bus Bus Name Ty Vmag Vang Pgen Qgen MacPF Pload Qload LdPF Qshnt AR
No p.u. deg. MW MVAR MW MVAR MVAR
-------------------------------------------------------------------------------------------------
1000 GEN1 2 1.0200 7.94 150.00 -0.49 1.000 0.00 0.00 0.000 0.00 1
1009 GEN1_275KV 0 1.0206 6.22 0.00 0.00 0.000 0.00 0.00 0.000 0.00 1
2000 INFINITE_BUS 3 1.0200 0.00 1.09 60.99 0.018 0.00 0.00 0.000 0.00 2
2009 LOAD_BUS 0 1.0075 -0.01 0.00 0.00 0.000 150.00 80.00 0.882 0.00 2
-------------------------------------------------------------------------------------------------
ts>iniv
TY MACNO Iq Id Vq Vd Eqp Edp Eqpp Edpp Efd Del Speed Pm/Pag
dEqpdt dEdpdt dEqppdt dEdppdt dDeldt dWdt
--------------------------------------------------------------------------------------------------------
5 1000 1.426 -0.361 0.988 -0.253 1.000 -0.143 1.000 -0.207 1.064 22.332 314.159 1.5000
-0.0000 -0.0000 0.0000 0.0000 0.0000 0.0000
0 2000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.001 314.159 0.0109
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
--------------------------------------------------------------------------------------------------------

Calculate VREF for excitation control model in Fiogure 3.10?

Referring to the given Tables,

VC = 1.02 p.u.
EFD = 1.064 p.u.
KA = 20

Using equation 2.5.12;

VREF = (1.064 + 20 x 1.02)/20 = 1.0732 p.u.

90
2.6.3 Exc1, IEEE Type 1 Excitation Control

Exc1 model is shown in Figure 2.14 with the following data:

//exc#,bsno ,ieunit, Tr, Ka , ta ,ke/tb,te/tc, A , B , kf , tf , vrmax , vrmin, efdmin,efdmax


exc1 , 1000,1 ,0.050, 100.0,0.055, 0.00, 0.36,0.006,1.075, 0.125,1.8 , 5.2 , -5.2 , -7.3 , 7.3

VSE
VREF SE
VRMAX
EFDMAX
+ -
VT 1 VC - Verr KA VA + 1 VE
3 3
1 + sTR 1 + sTA 1 + sTE
-
VF EFDMIN
VRMIN
VSO sKF
1 + sTF
Figure 2.14: Excitation control type exc1

The equations describing exc1 are:

dVC/dt = (VT – VC)/TR


Verr = VREF – VC - VF, assume VSO = 0
dVF/dt = -VF/TF + KF/TF (dEFD/dt)
dVA/dt = (KAVerr – VA)/TA subject to the rate limit
dEFD/dt = (VA – VSE - EFD)/TE

91
VSE = SEEFD
SE = Ae(B/EFD)/EFD

Since at initial condition, VF = 0, then

Verr = VREF – VC
VC = VT
VA = KA(VREF – VT)

VA = VSE + EFD

Since VSE = SEEFD, then

VA = = EFD(1 + SE)
KA(VREF – VT)= EFD(1 + SE)
VREF = EFD(1 + SE)/KA + VT

Using example 2.1,

SE = 0.006e(1.075/1.064)/1.064 = 0.0169
VREF = 1.064 (1 + 0.0169)/100 + 1.02 = 1.0308

92
2.7 Initial Condition Calculations for Turbine-Governor

2.7.1 General

A turbine-governor controls the mechanical power input to the alternator so that it is balanced by the electrical power output.
To do this turbine-governor monitors the speed of the generator and any deviation (up or down) of the the speed from the
synchronous value will provide a signal to the appropriate controls to increase or retract power input.

In this section we will discuss two turbine-governor models in DCPS-TS.

2.7.2 gov10, Simple Turbine-Governor

Gate Control &


Delivery
PREF
VMAX

+ gs1
)T 1 - Terr 1 Pm
E
R 1 + sT1
-

VMIN Gate opening


Droop

Figure 2.15: gov 10 governor model in DCPS-TS

93
Turbine-governor model gov10 is shown in Figure 2.15. Change in speed is the input to the governor which is then multiplied
by governor gain – inverse of the droop setting, R. The modified speed change is compared with reference PREF and feedback
signal for input into control block for fluid power valve opening. This control block is combined with turbine time constant to
produce mechanical power output, PMECH.

Example data for gov10 is:

//Turbine-governor controller
//ty,busno,igunit,turb Rate, Pmax, Pmin, droop, T1 , T2 , T3 , KT , Vmax , Vmin ,Dturb
gov10,1000, 1, 750.0, 0.95, 0.00, 0.050, 5.00, 0.000, 0.000, 0.000, 1.000, -1.000, 0.0

The turbine power (TRATE) is specified at 750MW. Pmax and Pmin are per unit maximum and minimum turbine power output of
the generating unit specified at 95% and 0% respectively. The droop setting is set to 5% and this is typical. T1 is specified at
5s and it is a combination of governing and fluid flow – steam through piping etc. – time constants. Valve opening and closing
rate limits are specified to be not more 1.0 and -1.0 per unit respectively

At the initial condition the mechanical power Pmech is known and remains constant until a disturbance is applied. When gate
or valve is fully opened (1.0 p.u) it will produce TRATE MW of output. Therefore, the p.u. gate/valve opening (gs1) is:
Gs1 = PMECH x BaseMVA/TRATE

The gate opening must be within Pmax and Pmin.

Per unit speed change as input,


)T = (T0 - T)/T0

The output of the droop block,


Tr = )T(1.0/R);

Since at initial condition, input to gate control block, Terr = gs1, and s=0, then
PREF = Tr + Gs1+ Gs1 = 2Gs1

Input into valve control block is,


Terr = PREF - Tr – Gs1

94
The derivatives are,
dgs1/dt = (Terr – gs1)/T1
dpm/dt = dgs1/dt

The initial mechanical power ouput is,


PMECH = GPGOV x TRATE/100.0;

Example: Using system in Figure 2.10 and turbine-governor data above, we have,
ts>iniv
TY MACNO Iq Id Vq Vd Eqp Edp Eqpp Edpp Efd Del Speed Pm/Pag
dEqpdt dEdpdt dEqppdt dEdppdt dDeldt dWdt
--------------------------------------------------------------------------------------------------------
5 1000 1.426 -0.361 0.988 -0.253 1.000 -0.143 1.000 -0.207 1.064 22.332 314.159 1.5000
-0.0000 -0.0000 0.0000 0.0000 0.0000 0.0000
0 2000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.001 314.159 0.0109
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
--------------------------------------------------------------------------------------------------------

ts>inig
Bus Govtype Gpref Gs1 dGs1dt Gs2 dGs2dt Gs3 dGs3dt dPmdt
---------------------------------------------------------------------------------
1000 10 0.4000 0.2000 0.00000 0.0000 0.00000 0.0000 0.00000 0.00000
---------------------------------------------------------------------------------

PREF is 0.4 p.u. since,

Gs1 = 1.5 x 100/750 = 0.2


PREF = 2 x 0.2 = 0.4 p.u.

95
2.7.3 gov2, PSS/E TGOV1 Model with Deadband Added

Model gov2 is adapted from TGOV1 model in PSS/E but with speed deadband added to the speed deviation input as shown in
Figure 2.16.

Droop Gain VMAX Piping, engine etc.

PREF 1 Tr KT gs1 1 + sT2 gs2 Pm


E E
+ R 1 + sT1 1 + sT3 +
- -
Gate position
Deadband Gate opening/
closing control
block VMIN
)T
Dt

Load Damping

Figure 2.16: gov2, PSS/E TGOV1 with deadband

Example data for gov2 is:


//ty,busno,igunit,turb MW, Pmax, Pmin, ddbnd, droop, T1 , T2 , T3 , KT , Vmax , Vmin ,Dturb
gov2, 1000, 1, 750.0, 0.95, 0.00, 400.0, 0.050, 30.00 , 0.500, 10.000, 1.0 , 0.8, -0.8, 0.0

Model gov1 measures speed deviation )T p.u. which is filtered by a deadband of ±400mHz (±0.008 p.u.). If the speed
deviation is outside the deadbaand, the speed signal is substracted from set point PREF to become the input to the governor
gain (1/droop or 1/R). Signal Tr enters the gate control block whose function is to admit the right amount of driving power to
the turbine. Time constant T1 is associated with device (e.g. motor) that performs the closing and opening function. However,

96
before reaching the turbine blade or the combustion chamber the power fluid or gas will need to go through delivery channel
such as pipes or engine and this block is modeled by a lead-lag function. The output of the lead-lag block is the PMECH once the
affect of load damping is included, if any.

At initial condition, gs1 which is the gate opening is determined by the initial PMECH
gs1 = PMECH x System_Base_MVA/TRATE

From the block diagram, at initial condition,


gs1/Tr = gs1/((PREF - )T)/R) = KT

Therefore,
PREF = R x gs1 / KT

For example, using gov2 data above and system in Figure 2.10, the initial conditions are:
ts>iniv
TY MACNO Iq Id Vq VdEqp Edp Eqpp Edpp Efd Del Speed Pm/Pag
dEqpdt dEdpdt dEqppdt dEdppdt dDeldt dWdt
--------------------------------------------------------------------------------------------------------
5 1000 1.426 -0.361 0.988 -0.253 1.000 -0.143 1.000 -0.207 1.064 22.332 314.159 1.5000
-0.0000 -0.0000 0.0000 0.0000 0.0000 0.0000
0 2000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.001 314.159 0.0109
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
--------------------------------------------------------------------------------------------------------
ts>inig
Bus Govtype Gpref Gs1 dGs1dt Gs2 dGs2dt Gs3 dGs3dt dPmdt
---------------------------------------------------------------------------------
1000 2 0.0100 0.2000 0.00000 0.2000 -0.00000 0.0000 0.00000 -0.00000
---------------------------------------------------------------------------------

Where,
PREF = 0.05 x 0.2/1.0 = 0.01 p.u.

97
2.8 Modify Admittance Matrix to Include Machine Impedance

As discussed in section 2.5, a generating unit is modeled as a voltage source behind an impedance. However, a network
modeled is more conveniently expressed using its admittance matrix (Y) rather than the impedance matrix (Z). Therefore, in
order to incorporate the machine into the network it has to be converted to an equivalent current source in parallel with an
admittance. In other words, the Thevenin source has to be converted to a current in parallel with an admittance based on
Norton’s theorem and the admittance formed can then be added as the machine bus admittance and treated as network
parameter.

Consider a machine connected to the to the network model as voltage source behind an impedance as shown in Figure 2.17
(a) where E’ or E” is the machine internal voltage and Zt is the time-varying impedance.

V V
Zt

E’ I E’Yt Yt

(a) (b)

Figure 2.17: Voltage behind impedance and equivalent Norton equivalent

From Figure 2.17(a),


I = (E’ – V)/Zt ................... (2.8.1)
or
I = E’Yt - VYt .................... (2.8.2)
Equation 2.8.2 has a circuit as shown in Figure 2.17(b). The approach to deal with the time varying admittance is to split into
two components; constant admittance and time varying current injections. Equation (2.8.2) is,
98
I = E’Yt - VYt ............................... (2.8.4)
Include constant impedance Y0 and adjustable time-varying current Iadj,
I = E’Y0 – VY0 + Iadj ............................... (2.8.5)

Using equation (2.8.4) to replace the l.h.s.of (2.8.5), we have,


(E’ – V)Yt = (E’ – V)Y0 + Iadj
Iadj = (E’ –V)(Yt – Y0) ............................... (2.8.6)

The adjustable and unadjustable components of the current can be expressed as,
I = Iunadj + Iadj

From (2.8.5), if Y0 is included in the network admittance matrix and since V is network voltage, then
Iunadj = E’Y0 ............................... (2.8.7)

Figure 2.18 shows the equivalent circuit for equations (2.8.6) and 2.8.7)

Iadj E’Y0 Y0

Figure 2.18: Adjustable and unadjustable current injections

The two impedances x’d/x”d and x’q/x”q must be made into a single impedance for inclusion into the admittance matrix. The
approach is to take the mean of the two impedances,

z0 = ra + 2(jx’d + jx’q)
y0 = 1/(ra + 2(jx’d + jx’q))

99
Let,
xdq = 2(jx’d + jx’q)
Therefore,
y0 = (ra - jxdq /(ra2 + x’dx’q)

Since,
Iunadj = Y0E’

Iunadjr 1 ra xdq E’r


=
Iunadjx Ra2 + x’dx’q -xdq ra E’x
............ (2.8.8)

It can also be shown that the adjustable current is given by,

Iadjr E’r - Vr
(x’d – x’q) -sin2* cos2*
=
ra2 + x’dx’q E’x - Vx
Iadjx cos2* sin2*
.......... (2.8.9)

100
Example:

Show that (2(jx”d + jx”q))2 . x”dx”q

The reactance is the mean of xd" and xq", i.e.,


z = ra + ½[jxd" + jxq"]

1 ra – j½[xd” + xq”]
y = •••••••••••••••••• = ••••••••••••••••••••
ra + j½[xd” + xq”] ra² + ¼(xd” + xq”)²

ra – j½[xd” + xq”]
= ••••••••••••••••••••••••••••••
ra² + ¼(xd”² + xq”² + 2xd”xq”)

Assuming that the magnitude xd” and xq” are of the same order, then

ra – j½[xd” + xq”]
y = ••••••••••••••••••
ra² + ¼(4xd”xq”)

(ra – j½[xd” + xq”])


y = ••••••••••••••••••••
(ra² + xd”xq”)

Exercise: Show that the adjustable current Iadj is given by equation (2.8.9)

In DCPS-TS Y0 is added at the start of the calculation in function MOYM. Both adjustable and unadjustable currents are
calculated at each step of time simulation in functions GINJ and GINJN.

101
2.9 Modify Admittance Matrix to Include Load Admittance

In DCPS a static load is modeled to vary with voltage and frequency using equations:
P = Kp|V|pv (1 + )f x pf)
Q = Kq|V|qv (1 + )f x qf) .............. (2.8.10)

Kp and Kq are constants determined during the initial condition. Parameters pv and qv are voltage exponents for active and
reactive powers respectively. Parameters pf and qf represent per unit change in load for 1Hz change in frequency.

At initial condition load Pi0 and Qi0 at bus i are known and )f is zero. Therefore,

Kp = Pi0 /|Vi0|pv
Kq = Qi0 /|Vi0|qv

Kp and Kq are also calculated for both pv and qv equal to 2.0, i.e., the load is modeled as constant impedance. In DCPS-TS
loads will revert to constant impedance when voltage at the bus falls below 0.6 p.u. The equivalent admittance of the load at
initial condition is added to the network admittance matrix using,

Yp = Pi0/VV*
Yq = Qi0/VV*

Since S = VI* then I = S/V*


Y = I/V = S/(VV*)
S = I2Z = II*Z, but V = IZ. Therefore S = VI*

At each time step, using equations (2.8.10), the load is calculated and the difference between the newly calculated load and
the original load in the initial condition is converted to equivalent current injection for inclusion in YV = I.
For the network in Figure 2.10, the original admittance matrix is,

ts>ybus
1000 0.00 0 0 0.00

102
...... -48.00i 0i 0i 48.00i
2000 0 0.00 0.00 0
...... 0i -48.00i 48.00i 0i
2009 0 0.00 0.88 -0.88
...... 0i 48.00i -61.07i 13.27i
1009 0.00 0 -0.88 0.88
...... 48.00i 0i 13.27i -61.07i

Function MOYM discussed in 2.8 modifies the admittance matrix to include machine admittance, first calculated and then inserted into the
matrix as shown below.

ts>moym
Bus_no Mac_no Area Yrold Yxold Yrnew Yxnew
---------------------------------------------------------
1000 1 1 0.00 -48.00 0.00 -78.72
2000 1 2 0.00 -48.00 0.00 -948.00
---------------------------------------------------------
1000 0.00 0 0 0.00
...... -78.72i 0i 0i 48.00i
2000 0 0.00 0.00 0
...... 0i -948.00i 48.00i 0i
2009 0 0.00 0.88 -0.88
...... 0i 48.00i -61.07i 13.27i
1009 0.00 0 -0.88 0.88
...... 48.00i 0i 13.27i -61.07i

Function CINJ calculates Kp and Kq based on voltage exponents of pv and qv as well as when load is modeled as constant impedance (Kp2
and Kq2). Table below shows the calculations of Kp, Kq, Kp2 and Kq2. The load admittances are then added to the admittance matrix.

103
ts>cinj
Bus_no Pload Qload Vmag Kp Kq Kp2 Kq2
----------------------------------------------------------------
1000 0.00 0.00 1.0200 0.000 0.000 0.000 0.000
2000 0.00 0.00 1.0200 0.000 0.000 0.000 0.000
2009 1.50 0.80 1.0075 1.478 0.788 1.478 0.788
1009 0.00 0.00 1.0206 0.000 0.000 0.000 0.000
----------------------------------------------------------------

1000 0.00 0 0 0.00


...... -78.72i 0i 0i 48.00i
2000 0 0.00 0.00 0
...... 0i -948.00i 48.00i 0i
2009 0 0.00 2.36 -0.88
...... 0i 48.00i -61.86i 13.27i
1009 0.00 0 -0.88 0.88
...... 48.00i 0i 13.27i -61.07i

104
2.10 Calculate Current Injections

At each time step of transient stability calculation, a linear network equation, YV = I is solved. Voltage vector V is solved for
changes in Y and/or changes in I. Vector I represents current injection that has the dimension N number of buses in the
nertwork. Current injection is calculated for each load (static and dynamic) and each generating unit.

2.10.1 Static Load Current Injection

At the initial condition, the equivalent admittance (converted from P0 + jQ0 to YL0r + jYL0x) of a static load is included in the
admittance matrix. At each time step, the load is recalculated using equations (2.8.10),

P = Kp|V|pv (1 + )f x pf)
Q = Kq|V|qv (1 + )f x qf)

P + jQ above could be different from the initial condition P0 + jQ0 (already included in the admittance matrix) due to changes
in voltage and/or frequency. The difference between calculated load (P + jQ) and the initial load (P0 + jQ0), )P + j)Q is
converted to equivalent current injection. Since the equivalent admittance for )P + j)Q is:
)Yp = )P/VV*
)Yq = )Q/VV*

then current injection is given by,


Iinj = ()Yp + )Yq)V

2.10.2 Generating Unit Current Injection

Current injection form each generating unit is calculated using equations 2.8.8 and 2.8.9.

105
2.11 Factorise Admittance Matrix

Everytime changes is made to the admittance matrix such as applying short-circuit, tripping of branch, tripping of load etc., the
admittance matrix needs to be refactorised using command, fac2,syb.

Given a square matrix Y, factorization decomposes into L and U factors, i.e.,


Y = LU

Where L is lower triangular matrix with the diagonal elements set to 1.0 and U is the upper triangular matrix. After the bus
current injection has been calculated, the network bus voltage can be determined as follows:

LUV = I

0 U
V = I
L 0

Let z = UV,

U
z = V
0

Therefore, Lz = I

0
z = I
L

106
z can be solved by forward substitution,
z1 =I1/L11
z2 = (I2 – L21z1)/ L22
etc..

After z is known, V can be found using backward substitution in, UV = z,

U
V = z
0

Vn = zn/Unn
Vn-1 = (zn-1 –Un-1nVn)/Un-1
etc..

107
2.12 States and Controls to be Captured for Output

Several states and controls can be recorded at each time step. Most states and controls are directly obtained from the solutions
of the differential equations for machines and controls as well as from the algebraic network solutions. For a generating unit
rate of change of rotor angle is the speed, T which can be approximated as the frequency at the generator bus. However, at a
load bus (where no generating unit is connected), the frequency has to be calculated using the rate of change of voltage angle
as illustrated in Figure 2.19. Voltage at each bus is obtained after solution of YV = I.

Voltage
Angle
2 23
22

21

t1 t2 t3

Current
time step
Figure 2.19: Calculating frequency from the rate of change of voltage angle

108
If the current time is tm, the frequency at tm is calculated using the average of the the previous two slopes,

d21/dt = (23 - 22 )/(t3 – t2)


d22/dt = (22 - 21 )/(t2 – t1)
d23/dt = (d21/dt + d22/dt)/2
Branch quantities that are required to be calculated include:

Power flow,
Spq = E*p(Ep - Eq)Ypq + E*pEpYppq

Current flow,
Ibase = SBASE x 1000/(/3 BasekV);
Ipq = Ibase x Spq/E*p

Apparent impedance,
Ep/Ipq

109
2.13 Numerical Solutions of First-Order Differential Equations

Previously, we have discussed several first-order differential equations describing machine dynamics and controls. In this
section we will focus discussion on solutions of these equations. First-order differential equations are in the form of,

dx/dt = f(x, t) with x(t0) = x0 ...... (2.13.1)

where x(t) 0 Rn, are time varying functions depend on initial condition x0. These are “initial value” problems and cannot be
solved analytically since there is no closed solution and therefore x(t) must be solved numerically.

The objective of solving (2.13.1) is to determine x0, x1, x2, …, xn at time t0, t1, t2, …tn. The time-step h is given by ti+1 - ti. Time-
step h can be constant or variable. For the solutions the followings aspects important requirements:
a) Accuracy – numerical error bounded
b) Stability – propagation of error
c) Efficiency – computation

2.13.1 One-Step Method

In a one-step method, to obtain xn+1 we use xn. All one-tep methods are derived from Taylor series expansion of x(t). The
most commonly used one-step methods are:
a) Forward Euler
b) Runge-Kutta

These methods are also categorised as ‘Explicit Methods’

110
Forward Euler method is in the form of (see also Figure 2.20):
xn+1 = xn + hf(xn, tn) ......... (2.13.2)

dx/dt = f(x,t)
x(t)

slope
f(x0,t0)

x(t1)

t0 t1 t
Figure 2.20: Forward Euler Method

The Runge-Kutta method has the following form:


xn+1 = xn + hK4(xn, tn) ......... (2.13.3)

where,
K4 = (k1 + 2k2 + 2k3 + k4)/6
k1 = f(xn, tn)
k2 = f(xn + 0.5hk1, tn+0.5h)
k3 = f(xn+0.5hk2, tn+0.5h)
k4 = f(xn+hk3, tn+h)

Both Forward Euler and Runge-Kutta have main advantage being straight-forward to compute. However, both methods require
small time step to ensure stability.

111
Example:
Given that, dx/dt = t – x, x = 1 when t = 0. The analytical solution is x(t) = 2e-t + t – 1. Use Forward Euler Method to
determine x for t = 0.1:0.5:0.1 (for t from 0.1 to 0.5 at step of 0.1)

Solution:
Using spreadsheet, the calculated values using both Forward Euler and Runge-Kutta Methods are compared with the analytical
solution.

Remarks:
a) Euler Method is most simplest to implement;
b) Runge-Kutta Method is more complicated to implement but gives accurate results;

112
FORWARD EULER
Time-Step 0.1
x f(x,t) = x = x +
Time, t Initial t - x hf(x,t) 2e-t + t - 1 Analytical

0 1 -1.0000 1.0000 1.0000 Runge-Kutta


0.1 -0.8000 0.9000 0.9097 Forw ard-Euler
0.2 -0.6200 0.8200 0.8375 1.4000

0.3 -0.4580 0.7580 0.7816


0.4 -0.3122 0.7122 0.7406 1.2000
0.5 -0.1810 0.6810 0.7131
0.6 -0.0629 0.6629 0.6976
0.7 0.0434 0.6566 0.6932 1.0000

0.8 0.1391 0.6609 0.6987


0.9 0.2252 0.6748 0.7131 0.8000
1 0.3026 0.6974 0.7358

x
1.1 0.3724 0.7276 0.7657
1.2 0.4351 0.7649 0.8024 0.6000

1.3 0.4916 0.8084 0.8451


1.4 0.5425 0.8575 0.8932 0.4000
1.5 0.5882 0.9118 0.9463
1.6 0.6294 0.9706 1.0038
1.7 0.6665 1.0335 1.0654 0.2000

1.8 0.6998 1.1002 1.1306


1.9 0.7298 1.1702 1.1991 0.0000
2 0.7568 1.2432 1.2707 0 0.5 1 1.5 2 2.5
Tim e

RUNGE-KUTTA
k2 = k3 = k4 = K4 = (k1 +
x, k1 = f(x+0.5k1,t f(x+0.5k2, f(x+hk3, 2k2 + 2k3 + x1 = x +
Time, t initial f(x,t) +0.5h) t+0.5h) t+h) k4)/6 hK4(x, t) x
0 1.0000 -1.0000 -0.9000 -0.9050 -0.8095 -0.9033 0.9097 1.0000
0.1 0.9097 -0.8097 -0.7192 -0.7237 -0.6373 -0.7221 0.8375 0.9097
0.2 0.8375 -0.6375 -0.5556 -0.5597 -0.4815 -0.5582 0.7816 0.8375
0.3 0.7816 -0.4816 -0.4076 -0.4113 -0.3405 -0.4100 0.7406 0.7816
0.4 0.7406 -0.3406 -0.2736 -0.2770 -0.2129 -0.2758 0.7131 0.7406
0.5 0.7131 -0.2131 -0.1524 -0.1554 -0.0975 -0.1544 0.6976 0.7131
0.6 0.6976 -0.0976 -0.0427 -0.0455 0.0069 -0.0445 0.6932 0.6976
0.7 0.6932 0.0068 0.0565 0.0540 0.1014 0.0549 0.6987 0.6932
0.8 0.6987 0.1013 0.1463 0.1440 0.1869 0.1448 0.7131 0.6987
0.9 0.7131 0.1869 0.2275 0.2255 0.2643 0.2262 0.7358 0.7131
1 0.7358 0.2642 0.3010 0.2992 0.3343 0.2998 0.7657 0.7358
1.1 0.7657 0.3343 0.3675 0.3659 0.3977 0.3665 0.8024 0.7657
1.2 0.8024 0.3976 0.4277 0.4262 0.4550 0.4268 0.8451 0.8024
1.3 0.8451 0.4549 0.4822 0.4808 0.5069 0.4813 0.8932 0.8451
1.4 0.8932 0.5068 0.5315 0.5302 0.5538 0.5307 0.9463 0.8932
1.5 0.9463 0.5537 0.5761 0.5749 0.5962 0.5753 1.0038 0.9463
1.6 1.0038 0.5962 0.6164 0.6154 0.6347 0.6157 1.0654 1.0038
1.7 1.0654 0.6346 0.6529 0.6520 0.6694 0.6523 1.1306 1.0654
1.8 1.1306 0.6694 0.6859 0.6851 0.7009 0.6854 1.1991 1.1306
1.9 1.1991 0.7009 0.7158 0.7151 0.7294 0.7153 1.2707 1.1991
2 1.2707 0.7293 0.7429 0.7422 0.7551 0.7424 1.3449 1.2707

Table 2.13.1: Spreadsheet for numerical solutions of first-order ODE using Forward Euler and Runge-Kutta
Methods
113
In DCPS-TS, explicit integration method used is the Improved Euler Method. In this method a Predictor Formula is first applied
using:
xpn+1 = xn + hf(xn, tn) .......(2.13.4)

Using the result in 2.13.4, the Corrector Formula is applied to get the final value,
xcn+1 = xn + 0.5h(f(xn, tn) + f(xpn+1, tn+1))

The Improved Euler Method is illustrated in Figure 2.21

x(t) slope
f(x1,t1)

slope
f(x0,t0)

x(t1)

t0 t1 t
Figure 2.21: Illustration of Modified Euler Method

114
Example:
Solve the previous example using Improved Euler Method

Solution:
The spreadsheet for Improved Euler Method is shown in Table below.

IMPROVED EULER

Corrector, xc =
f(x,t) = Predictor, xp f(xp, t) = t- x + 0.5h(f(x,t)
Time, t x t - x = x + hf(x,t) xp + f(xp,t))
0.00 1.0000 -1.0000 0.9000 -0.9000 0.9050
0.10 0.9050 -0.8050 0.8245 -0.7245 0.8285
0.20 0.8285 -0.6285 0.7657 -0.5657 0.7688
0.30 0.7688 -0.4688 0.7219 -0.4219 0.7243
0.40 0.7243 -0.3243 0.6918 -0.2918 0.6935
0.50 0.6935 -0.1935 0.6741 -0.1741 0.6751
0.60 0.6751 -0.0751 0.6676 -0.0676 0.6680
0.70 0.6680 0.0320 0.6712 0.0288 0.6710
0.80 0.6710 0.1290 0.6839 0.1161 0.6833
0.90 0.6833 0.2167 0.7049 0.1951 0.7038
1.00 0.7038 0.2962 0.7335 0.2665 0.7320
1.10 0.7320 0.3680 0.7688 0.3312 0.7669
1.20 0.7669 0.4331 0.8102 0.3898 0.8081
1.30 0.8081 0.4919 0.8573 0.4427 0.8548
1.40 0.8548 0.5452 0.9093 0.4907 0.9066
1.50 0.9066 0.5934 0.9659 0.5341 0.9630
1.60 0.9630 0.6370 1.0267 0.5733 1.0235
1.70 1.0235 0.6765 1.0911 0.6089 1.0878
1.80 1.0878 0.7122 1.1590 0.6410 1.1554
1.90 1.1554 0.7446 1.2299 0.6701 1.2262
2.00 1.2262 0.7738 1.3035 0.6965 1.2997

115
Another variation to the Euler Method is the Modified Euler.

First use Predictor formula:


xpn+1 = xcn + hf(xcn, tn)

Then use Corrector formula:


xcn+1 = xcn + 0.5h[f(xcn, tn) + f(xpn+1, tn+1)]

Iterate to convergence using:


(xcn+1)new= xcn + 0.5h[f(xcn, tn) + f((xpn+1)old, tn+1)]

Exercise: Write algorithm to implement the Modified Euler Method

2.13.2 Multi-Step Methods

In a multi-step method, xn+1 is approximated using various number of previous values xn, xn-1, xn-2, … and future values xn+1,
xn+2,.. Examples of multi-step methods are:
a) Backward Euler Method
b) Trapezoidal Method

Backward Euler:
xn+1 = xn + hf(xn+1, tn+1)

Multistep method is also categorized as ‘implicit’.

116
Trapezoidal:
xn+1 = xn + 0.5h[f(xn+1, tn+1) + f(xn, tn)]

Example:
Matlab code for solving previous example using Backward Euler and Trapezoidal Methods,

%Backward Euler Method


%Initial condition
x(1) = 1.0;
t(1) = 0.0;
h = 0.1;% Time step
k = 2;
%Go through the time step
for tm = h:0.1:2.0;
t(k) = tm;
x0(k) = x(k-1); %Estimate of x(k)
%Initial calculation of x(k) using backward Euler
x(k) = x(k-1) + h*(t(k) - x0(k));
%Iterate
while (true)
x0(k) = x(k); % Previous x(k) is the new estimate for x(k)
x(k) = x(k-1) + h*(t(k) - x0(k));
x(k)
if (abs(x(k) - x0(k))) < 0.001
break;
end
end
k = k+1;
end

117
%Trapezoidal Method
%Initial condition
x(1) = 1.0;
t(1) = 0.0;
h = 0.1;%Timestep
k = 2;
for tm = h:h:2.0; %time from h to 2.0 step h
t(k) = tm;
x0(k) = x(k-1);
%calculate the constant part
cx = 0.5*h*(t(k-1) - x(k-1));

%First estimate
x(k) = x(k-1)+0.5*h*(t(k) - x0(k)) + cx;

%Iterate to convergent
while (true)
x0(k) = x(k);
x(k) = x(k-1)+0.5*h*(t(k) - x0(k)) + cx;
x(k)
if (abs(x(k) - x0(k))) < 0.0001
break;
end
end
k = k+1;
end

118
2.14 Dynamic Solution Approaches and Methods

In this section we will discuss power system dynamic solution approach and then focus on the solution methods employed by
DCPS-TS. As discussed in the previous section, it can be summarized that the problem is to solved two equations at the same
time, namely:

A set of first order differential equations,

dx/dt = f(x, V) ............(2.14.1)

and algebraic equation,

YV = I(x, V) .......... (2.14.2)

The solution scheme may vary according to the way the followings are handled:
a) Interfacing of (2.14.1) and 2.14.2) – how results of calculations in one equation is transferred to the other vice-versa;
b) Integration method used – discussed in 2.13; and
c) Solution of algebraic equation (2.14.2)

For interfacing between (2.14.1) and (2.14.2), two ways can be applied, 1) partitioned, 2) simultaneous. In the partitioned
approach, the differential equations in (2.14.1) are solved independently for x and the algebraic equations in (2.14.2) are
solved for V.

In the partitioned approach it is possible to choose the solutions of differential equations and algebraic equations
independently. For example in DCPS-TS, differential equations are solved using improved Euler Method and the algebraic
solution of linear equation with iteration. It is also possible to use six-order Runge-Kutta Method for solutions of the differential
equations. In some cases it is also possible to solve the network after a number of time steps such that extrapolation and/or
interpolation used to estimate network variables.

119
2.15 Newton-Based Method for Solution of Power System Dynamic Equations

In this section we will discuss in greater details the applications of Newton’s Method for solution of power system dynamic
equations.

2.15.1 Newton-Raphson Method for Solutions of Non-Linear Equations

120
2.15.2 Newton Method for Power System Dynamics

As stated previously, two equations to be solved are:

dx/dt = f(x, V) ............(2.15.1)


YV = I(x, V) ................(2.15.2)

where x is a vector of state variables and V is a vector of bus voltages.

Applying Trapezoidal numerical integration method on (2.15.1), we obtain:

xn+1 = xn + 0.5h(f(xn, Vn) + f(xn+1, Vn+1)) .......... (2.15.3)

where h denotes the time interval. The network equation (2.15.2) becomes:

YVn+1 = I(xn+1, Vn+1) .......... (2.15.4)

Let,
F(xn+1, Vn+1)= xn+1 - xn + 0.5h(f(xn, Vn) + f(xn+1, Vn+1)) ........... (2.15.5)

and,
G(xn+1, Vn+1)= I(xn+1, Vn+1)- YVn+1 ........... (2.15.6)

Newton-Raphson Method can be applied to equations (2.15.5) and (2.15.6) to get:

……………………..

121
3. Small Signal Stability Analysis Using DCPS-AACG

122
4. APPENDICES

123
4.1 Appendix A – DCPS-LF Load Flow Tutorial
A.1 Introduction

This tutorial document contains step-by-step process of modeling a network in Figure A4.1.1 using DCPS Load Flow and performing
some basic load flow calculations. A solved load flow case is a pre-requisite to transient stability calculations and therefore
understanding load flow solutions and ensuring its accuracy is fundamental to dynamic simulations of power systems.

200 200 400 G4 G4 400


G1 G1 Area 2
1901 1900 2901 2900
300+j200
200+j100
2500
1500
100+j60 50
1910
150km
100km G2
100km
G2 2510
200km 1911 j50
1510 1530 Tx 200km
50
j50 2300
Tx
100km 1300
50+j30
2520
50+j30
j100
1520
150km 400+j250
j100
400+j250 Area 1 2530
100km

2540
200+j100
100+j50
j50
500km 225
2910
1. All lines 275kV, Impedance/circuit/km, 0.000007 + j0.00007, 0.002 p.u.
2. G1, 500MVA, Gen Tx, 500MVA, 15%, voltage, 1.03 p.u.
G5
150km
3. G2, 100MVA, Gen Tx, 100MVA, 10%, voltage, 1.03 p.u.
4. G4, 500MVA, Gen Tx, 500MVA, 15%, voltage, 1.03 p.u. G5
5. G5, 500MVA, Gen Tx, 500MVA, 15%, voltage, 1.03 p.u. 2911
225
6. Tx, 275/33kV, 60MVA, 12%, tap 1.0 p.u.
7. Each unit has power factor lag = 0.85 and led = 0.9

Figure A4.1.1: Network model

124
The network in Figure A4.1.1 comprises of two areas, namely Area 1 and Area 2. Each area has two power plants and each has two
generating units. All generating units have terminal voltage at 11kV and transmission voltage is at 275kV. The distribution voltage is
at 33kV. Area 1 and Area 2 are connected by a long transmission line having a distance of 500km.

A.2 Starting DCPS

You can place DCPS short cut on your desktop. The short cut icon should have the following parameters (see Figure A4.1.2):

The target must be AATS.EXE and the start-in is the folder containing the working files. You set
other parameters to control how DCPS will be displayed on the desktop including size of window,
fonts and colors. Once DCPS shortcut is clicked, DCPS screen will appear for dynamic simulation.
To have load flow session simply enter:

ts>lf

and enter (see Figure A4.1.3).

Figure A4.1.2: Parameters for DCPS Shortcut

125
Figure A4.1.3: DCPS Load Flow

126
To perform load flow calculations in DCPS, the following procedure is to be followed:

1) Prepare load flow file (in ascii format) – the file will be written in DCPS format with extension *.sol, e.g. 20bus0.sol;
2) Read the file in DCPS, dsa>redn,20bus0.sol,dcps where dcps is the file format to be used;
3) Perform network ordering, dsa>ord1
4) Form bus admittance matrix, dsa>ybus
5) Convert the admittance matrix from rectangular form to polar form, dsa>ybpo
6) Convert bus voltage from rectangular form to polar form, dsa>vbpo
7) Calculate powers at all buses in the network, dsa>bpow
8) Perform load flow calculations, dsa>dnlf,100,10 – using decoupled Newton load flow (DNLF) specifying 100 as the
maximum number of iterations and 10 as the number of iteration to skip factorization of the Jacobian matrices

All above commands in DCPS could be written in a file such as:

'DNLF.APS: Sequence to run decoupled Newton Load flow


chco,0.0005,,,,,,0.7,0.7,1.0
redn,20bus0.sol,dcps
ord1;
ybus;
ybpo;
vbpo;
bpow;
dnlf,100,10.0

The above commands can be executed as macro in DCPS simply by typing:

dsa>runf,dnlf.aps

127
A.3 Preparing Load Flow File

The load flow file has the following lines:

Line 1:
number_of_buses number_of_branches

Line 2:
system_MVA_base

Line 3, the total number of buses each having the following data:
bus_no, bus_type, volt_mag, volt_ang, pgen, qgen, pload, qload, pshunt, qshunt, area, qmin, qmax,
macbase, kV, rsorce, xsorce, busname

Line 4, the total number of branches each having the following data:
br_type, ckt_no, from_bus, to_bus, r, x, b, ratemva, tapr, tapa, cntrl_bus, tapsidebus, tapsize,
tapmin, tapmax, desired_volt, status

128
As an example for the network model in Figure A4.1.4, the load flow data would be as shown in table 1.

100 1000 Example Network


G

110 Line 1 2000

50km 50km
G
10 11

120
93km 20 21 93km
G
Line 2
130 Series Homer
Compensation 500kV
G

Burns 1 - 4 Smithers
24kV 500kV

Generators, each Generator 500kV transmission lines, Main System,


unit transformers each Line 1 and Line 2: reactance/km = 0.5631 ohm
unit, Series compensation (capacitors), H = 99999
555MVA Line 1: 20 ohms MWs/MVA
500MW maximum 555MVA Line 2: 40 ohms Xd’ = 1%
Xd’ = 30% X1 = 15% Series capacitor bypass switch, resistance = 0.0001
H = 3.5MWs/MVA p.u.

Figure A4.1.4: Example Network

129
Table A4.1.1: Load flow data for the Example Network
10 12
100.0
2000 3 0.95 0.0 0.0 0.0 4.0 2.0 0.0 0.0 1 0.0 0.0 100.0 500.0 0.0 0.0 'HOMER '
1000 0 1.00 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2 0.0 0.0 0.0 500.0 0.0 0.0 'SMITHERS '
100 2 1.00 0.0 1.0 0.0 0.0 0.0 0.0 0.0 2 0.0 0.0 555.0 24.0 0.0 0.0 'BURNS_1 '
110 2 1.00 0.0 1.0 0.0 0.0 0.0 0.0 0.0 2 0.0 0.0 555.0 24.0 0.0 0.0 'BURNS_2 '
120 2 1.00 0.0 1.0 0.0 0.0 0.0 0.0 0.0 2 0.0 0.0 555.0 24.0 0.0 0.0 'BURNS_3 '
130 2 1.00 0.0 1.0 0.0 0.0 0.0 0.0 0.0 2 0.0 0.0 555.0 24.0 0.0 0.0 'BURNS_4 '
10 0 1.00 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2 0.0 0.0 0.0 500.0 0.0 0.0 'BUS_10 '
11 0 1.00 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2 0.0 0.0 0.0 500.0 0.0 0.0 'BUS_11 '
20 0 1.00 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2 0.0 0.0 0.0 500.0 0.0 0.0 'BUS_20 '
21 0 1.00 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2 0.0 0.0 0.0 500.0 0.0 0.0 'BUS_21 '
1 1 100 1000 0.000 0.1500 0.000 555.0 1.0 0.0 0 0 0.0 0.0 0.0 0.0 1
1 1 110 1000 0.000 0.1500 0.000 555.0 1.0 0.0 0 0 0.0 0.0 0.0 0.0 1
1 1 120 1000 0.000 0.1500 0.000 555.0 1.0 0.0 0 0 0.0 0.0 0.0 0.0 1
1 1 130 1000 0.000 0.1500 0.000 555.0 1.0 0.0 0 0 0.0 0.0 0.0 0.0 1
0 1 1000 10 0.000 0.0113 0.000 1200.0 1.0 0.0 0 0 0.0 0.0 0.0 0.0 1
0 1 11 2000 0.000 0.0113 0.000 1200.0 1.0 0.0 0 0 0.0 0.0 0.0 0.0 1
0 1 1000 20 0.000 0.0210 0.000 1200.0 1.0 0.0 0 0 0.0 0.0 0.0 0.0 1
0 1 21 2000 0.000 0.0210 0.000 1200.0 1.0 0.0 0 0 0.0 0.0 0.0 0.0 1
0 1 10 11 0.000 -0.0080 0.000 1200.0 1.0 0.0 0 0 0.0 0.0 0.0 0.0 1
0 1 20 21 0.000 -0.0160 0.000 1200.0 1.0 0.0 0 0 0.0 0.0 0.0 0.0 1
0 2 10 11 0.0001 0.0000 0.000 1200.0 1.0 0.0 0 0 0.0 0.0 0.0 0.0 0
0 2 20 21 0.0001 0.0000 0.000 1200.0 1.0 0.0 0 0 0.0 0.0 0.0 0.0 0

The following are details of data items for each line:

Line 1:
a) number_of_buses - number of buses in the network model
b) number_of_branches – number of branches in the network model

Line 2:
a) system_MVA_base – system base MVA used

Line 3 to the total number of buses:


1) bus_no – bus number, a unique number up to 5 digits to identify the bus;

130
2) bus_type – bus type, 3 for slack, 2 for generation and 0 for load bus (default = 0);
3) volt_mag – voltage magnitude in p.u. For generator or slack bus, this magnitude should be the scheduled voltage. For other
buses it will be calculated (default = 1.0);
4) volt_ang – voltage angle in radians. This will be calculated (default = 0.0);
5) pgen – for a generator bus this represents the scheduled active power in p.u.;
6) qgen – for a generator this is the calculated reactive power output of the unit in p.u.;
7) pload – for any bus this represents the active load in p.u. at the bus;
8) qload – for any bus this represents the reactive load in p.u. at the bus;
9) pshunt – for any bus this represents the active power shunt in p.u.;
10) qshunt - for any bus this represents the reactive power shunt in p.u., e.g., negative value for reactor and positive value for
capacitor;
11) area – this identifies the area number that the bus is assigned to;
12) qmin – this parameter specifies the minimum reactive capability of the generating unit in p.u.;
13) qmax - this parameter specifies the maximum reactive capability of the generating unit in p.u.;
14) macbase – this specifies the base rating of generating unit;
15) rsorce – this represents the armature resistance of the generating unit in p.u.;
16) xsorce – this represents the reactance (sub-transient) of the generating unit in p.u.;
17) kv – base voltage for the bus in kV;
18) busname – bus name to entered in quote exactly with 12 characters inside the quotes including space, e.g. ‘BUSX ’,
‘SMITHSONIAN ’

Line 4 to the total number of branches:


a) br_type - branch type, 1 for transformer and 0 for line;
b) ckt_no – circuit number in integer, 1, 2, 3;
c) from_bus – from bus number;
d) to_bus – to bus number;
e) r – resistance in p.u. for transformer on its rating base;
f) x – reactance in p.u.. for transformer on its rating base;
g) b – line charging in p.u.;
h) ratemva – branch rating in MVA;
i) tapr – transformer tap ratio in p.u.;

131
j) tapa – transformer angle in degree;
k) cntrl_bus – control bus number;
l) tapsidebus – bus no where tap is located;
m) tapsize – size of tap step in p.u.;
n) tapmin – minimum tap position in p.u.;
o) tapmax – maximum tap position in p.u.;
p) desired_volt – desired voltage at the control bus for transformer;
q) status – branch status, 1 for ON and 0 for OFF;

132
A.4 Solving Load Flow

Three load flow solution methods are available in DCPS, namely

a) Gauss-Seidel Method, GSLF,max_iteration


b) Full Newton Method, NRLF,max_iteration,_iteration_skip
c) Decoupled Newton Method, DNLF, max_iteration,_iteration_skip

Where,

Max_iteration – maximum number of iterations allowable


Iteration_skip – number of iteration before re-factorisation of Jacobian matrix is performed

Sequence of commands to perform the above load flow calculation methods are given in Tables A4.1.2 through A4.1.4 for Gauss-
Seidel, Full Newton and Decoupled Newton Methods.

Table A4.1.2: Gauss-Seidel Method commands sequence

'==============================================================================
'GSLF.aps: Gauss-Seidel Ybus load flow sequence
'==============================================================================
chco,0.0000000001,,,,,,,0.8 'change constants
redn,pw0.sol,dcps 'read network data in dso format
ord1; 'ordering buses for minimum fill-ins
ybus; 'form admittance matrix, rectangular form
gslf,1000 'perform GS-Ybus iteration

133
Table A4.1.3: Full Newton Method commands sequence

'==========================================================================
'NRLF.aps: Newton-Raphson load flow
'==========================================================================
chco,0.00005,,,,,,0.9 'change constants
redn,pw0.sol,dcps 'read network data
ord1; 'ordering buses for minimum fill-ins
ybus; 'form admittance matrix, rectangular form
ybpo; 'convert admittance matrix to polar form
vbpo; 'convert bus voltages to polar form
nrlf,100,10.0

Table A4.1.4: Decoupled Newton Method commands sequence

'==========================================================================
'DNLF.APS: Sequence to run decoupled Newton Load flow
'==========================================================================
chco,0.0005,,,,,,0.7,0.7,1.0
redn,pw0.sol,dcps
ord1;
ybus;
ybpo;
vbpo;
bpow;
dnlf,100,10.0

Where,

a) Quote (‘) indicates comments


b) chco is a command to alter solution constants,
tol ,tolv ,tolx ,acf ,pv ,qv ,tolw ,dnacn
0.000500 0.000100 0.010000 1.820 1.500 1.500 0.020000 0.700000

134
c) ord1 – ordering buses
d) ybus – establish admittance matrix
e) ybpo – converts admittance matrix from rectangular form to polar form
f) vbpo – converts bus voltages from rectangular form to polar form
g) bpow – calculate bus powers
h) gslf – performs Gauss-Seidel load flow
i) nrlf – performs Full Newton-Raphson load flow
j) dnlf - performs Decoupled Newton-Raphson load flow

Table A4.1.5 shows the results of solving the load flow for the Example Network in Figure A4.1.1 using the Decoupled Newton
Method (dnlf).

135
Table A4.1.5: Load flow solution for the example network

AATS
TRANSIENT STABILITY
FOR EDUCATION & RESEARCH
-------------------------------------------
(c) Sallehhudin Yusof,1998,2001, 04, 06 APS
-------------------------------------------

ts>lf

DSA
LOAD FLOW
FOR EDUCATION & RESEARCH
-----------------------------------------------
(c) Sallehhudin Yusof,1998,2001/03,04,05,06 APS
-----------------------------------------------
dsa>runf,dnlf.aps
dsa>'==========================================================================
dsa>'DNLF.APS: Sequence to run decoupled Newton Load flow
dsa>'==========================================================================
dsa>chco,0.0005,,,,,,0.7,0.7,1.0
dsa>redn,pw0.sol,dcps
Summary of Network Elements
---------------------------
No. of machines = 5
No. of load buses = 0
No. of lines = 6
No. of transformers = 4
No. of areas = 0
No. of two-terminal DC = 0
No. of switched shunts = 0
dsa>ord1;
dsa>ybus;

136
ybus formed: nb = 10 ne = 30
dsa>ybpo;
dsa>vbpo;
dsa>bpow;
dsa>dnlf,100,10.0
Iteration/largest bus mismatch: 1 [ 100] / 443.1046 MW/MVAR
Iteration/largest bus mismatch: 2 [ 100] / 141.7333 MW/MVAR
Iteration/largest bus mismatch: 3 [ 100] / 45.3677 MW/MVAR
Iteration/largest bus mismatch: 4 [ 1000] / 14.5230 MW/MVAR
Iteration/largest bus mismatch: 5 [ 1000] / 4.6487 MW/MVAR
Iteration/largest bus mismatch: 6 [ 1000] / 1.4886 MW/MVAR
Iteration/largest bus mismatch: 7 [ 1000] / 0.4769 MW/MVAR
Iteration/largest bus mismatch: 8 [ 1000] / 0.1523 MW/MVAR
Iteration/largest bus mismatch: 9 [ 1000] / 0.0487 MW/MVAR
Loadflow converged
dsa>
dsa>

137
A.5 Load Flow Outputs

The followings describe various means to review the results of the load flow calculations:

1) Bus quantities, SHVO – show voltage

dsa>shvo
bus quantities
Bus Ty Volmag Volang Pgen Qgen Pload Qload Qshnt Ar Bsname
==============================================================================
10 0 0.95630 0.533 0.0 0.0 0.0 0.0 0.0 2 BUS_10
11 0 0.97191 1.797 0.0 0.0 0.0 0.0 0.0 2 BUS_11
20 0 0.95535 0.454 0.0 0.0 0.0 0.0 0.0 2 BUS_20
21 0 0.97288 1.873 0.0 0.0 0.0 0.0 0.0 2 BUS_21
100 2 1.00000 3.889 100.0 81.0 0.0 0.0 0.0 2 BURNS_1
110 2 1.00000 3.889 100.0 81.0 0.0 0.0 0.0 2 BURNS_2
120 2 1.00000 3.889 100.0 81.0 0.0 0.0 0.0 2 BURNS_3
130 2 1.00000 3.889 100.0 81.0 0.0 0.0 0.0 2 BURNS_4
1000 0 0.97848 2.306 0.0 0.0 0.0 0.0 0.0 2 SMITHERS
2000 3 0.95000 0.000 0.0 -81.3 400.0 200.0 0.0 1 HOMER
dsa>

This command list all buses in the network providing results on voltage, generation and load. Other shvo command options are:

dsa>shvo,>,0.99
bus quantities
Bus Ty Volmag Volang Pgen Qgen Pload Qload Qshnt Ar Bsname
==============================================================================
100 2 1.00000 3.889 100.0 81.0 0.0 0.0 0.0 2 BURNS_1
110 2 1.00000 3.889 100.0 81.0 0.0 0.0 0.0 2 BURNS_2
120 2 1.00000 3.889 100.0 81.0 0.0 0.0 0.0 2 BURNS_3
130 2 1.00000 3.889 100.0 81.0 0.0 0.0 0.0 2 BURNS_4

List buses with voltage greater than (>) 0.99 p.u.

138
dsa>shvo,<,0.96
bus quantities
Bus Ty Volmag Volang Pgen Qgen Pload Qload Qshnt Ar Bsname
==============================================================================
10 0 0.95630 0.533 0.0 0.0 0.0 0.0 0.0 2 BUS_10
20 0 0.95535 0.454 0.0 0.0 0.0 0.0 0.0 2 BUS_20
2000 3 0.95000 0.000 0.0 -81.3 400.0 200.0 0.0 1 HOMER

List buses with voltage smaller than (<) 0.96 p.u.


dsa>shvo,ar,1
bus quantities
Bus Ty Volmag Volang Pgen Qgen Pload Qload Qshnt Ar Bsname
==============================================================================
2000 3 0.95000 0.000 0.0 -81.3 400.0 200.0 0.0 1 HOMER

List buses in area 1


dsa>shvo,bt,2
bus quantities
Bus Ty Volmag Volang Pgen Qgen Pload Qload Qshnt Ar Bsname
==============================================================================
100 2 1.00000 3.889 100.0 81.0 0.0 0.0 0.0 2 BURNS_1
110 2 1.00000 3.889 100.0 81.0 0.0 0.0 0.0 2 BURNS_2
120 2 1.00000 3.889 100.0 81.0 0.0 0.0 0.0 2 BURNS_3
130 2 1.00000 3.889 100.0 81.0 0.0 0.0 0.0 2 BURNS_4

List buses with bus type (bt) 2.

139
dsa>shvo,br
Frbus Tobus Ct Ty Rpu Xpu Bpu Tap PhShf Ctbs Br-Code Lg/Tdv
Fbswh Tbswh St Failrt RprTm FbswTm TbswTm
==============================================================================
100 1000 1 1 0.0000 0.0270 0.0000 1.0000 0.0 0 0.000
1 0.0000 0.00 0.000 0.000
110 1000 1 1 0.0000 0.0270 0.0000 1.0000 0.0 0 0.000
1 0.0000 0.00 0.000 0.000
120 1000 1 1 0.0000 0.0270 0.0000 1.0000 0.0 0 0.000
1 0.0000 0.00 0.000 0.000
130 1000 1 1 0.0000 0.0270 0.0000 1.0000 0.0 0 0.000
1 0.0000 0.00 0.000 0.000
1000 10 1 0 0.0000 0.0113 0.0000 1.0000 0.0 0 0.000
1 0.0000 0.00 0.000 0.000
11 2000 1 0 0.0000 0.0113 0.0000 1.0000 0.0 0 0.000
1 0.0000 0.00 0.000 0.000
1000 20 1 0 0.0000 0.0210 0.0000 1.0000 0.0 0 0.000
1 0.0000 0.00 0.000 0.000
21 2000 1 0 0.0000 0.0210 0.0000 1.0000 0.0 0 0.000
1 0.0000 0.00 0.000 0.000
10 11 1 0 0.0000 -.0080 0.0000 1.0000 0.0 0 0.000
1 0.0000 0.00 0.000 0.000
20 21 1 0 0.0000 -.0160 0.0000 1.0000 0.0 0 0.000
1 0.0000 0.00 0.000 0.000
dsa>

List branches in the network

140
2) SULF provides summary of the flow solution..

dsa>sulf
SUMMARY OF LOAD FLOW CASE
--------------------------------------------------------------------------
Area Generation Load Loss
MW MVAr MW MVAr MW MVAr
1 0.0 -81.3 400.0 200.0
2 400.0 324.0 0.0 0.0
--------------------------------------------------------------------------
Total 400.0 242.7 400.0 200.0 0.0 42.7
--------------------------------------------------------------------------

Lowest Voltage(kV) Highest Voltage(kV)


2000 [HOMER ] 475.0 100 [BURNS_1 ] 24.0
-- Slack Bus -- Voltage kV Load Shunt
2000 [ HOMER ] 0.9500 0.00 475.0 400.00 200.00 0.00 0.00
Flow to => MW MVAr MVA Losses(MW&MVAr)
11 [ BUS_11 ] -256.16 -180.16 313.17 0.00 -12.28
21 [ BUS_21 ] -143.84 -101.17 175.86 0.00 -7.20
dsa>

3) Power Flow from a given bus, BFLO

dsa>bflo
Give option - bus no. or all or ol
bflo#1000
Voltage kV Load Shunt
1000 [ SMITHERS ] 0.9785 2.31 489.2 0.00 0.00 0.00 0.00
MW MVAr MVA Losses(MW&MVAr)
100 [ BURNS_1 ] -100.00 -76.53 125.92 0.00 -4.48
110 [ BURNS_2 ] -100.00 -76.53 125.92 0.00 -4.48
120 [ BURNS_3 ] -100.00 -76.53 125.92 0.00 -4.48
130 [ BURNS_4 ] -100.00 -76.53 125.92 0.00 -4.48
10 [ BUS_10 ] 256.16 196.03 322.56 0.00 -12.28
20 [ BUS_20 ] 143.84 110.08 181.13 0.00 -7.20
bflo#

For this command two output options available, first flows from a given bus number, second if option all is given flows from all buses
will be displayed.

141
Assignment #A4.1

Model the network in Figure A4.1.1 and solve the load flow for the following system conditions
1. With system intact (all elements in service) – base case
2. Loss of one line (N-1) between the two areas
3. Simultaneous loss of two lines (N-2) between bus 2540 and 2530

Report and comment on the following for each case:


a) Bus voltages
b) Branch flows
c) System losses

142
4.2 Apendix B - Excel VBA as a Calculation Tool

B.1 Introduction

In this course document, for most examples, Excel Spreadsheet is used as the calculator. In majority of the examples only
spreadsheet are used. However, there are calculations that require iterative process and complex mathematics. For this
purpose, VBA (Visual Basic for Applications) may be required. This Appendix provides an introduction to VBA with sufficient
depth to enable one to use VBA as a programming tool.

The approach that we will use in using the VBA is illustrated in Figure B.1 as viewed from the spreadsheet

INPUTS
Re Im
Source Voltage, p.u. 1 0
Line impedance, p.u. 0.1 1
Load, p.u. 0.02 0.005

Number of Iteration 5

CALCULATE

OUTPUTS
Load voltage, p.u. 0.9930 -0.0195 0.9932
0.9927 -0.0192 0.9929
0.9927 -0.0192 0.9929
0.9927 -0.0192 0.9929
0.9927 -0.0192 0.9929

Figure A.1: Approach to using VBA in Excel Spreadsheet

143
Referring to Figure B.1, the inputs for the calculations are placed in input cells and this can be changed and recalculated. The
VBA is located behind the “CALCULATE” button and finally the output will be displayed in the output cells. In most cases it is
not necessary to have the “CALCULATE” button because calculations can be done on the output cells.

Example B.1:
To start we use a simple example as shown below (In fact this example can be done without using the VBA).

INPUTS
Description Real Value Imag Value Remarks
Peak load, kW 2000
Period, days 30
Load factor 0.65

CALCULATE

OUTPUTS
Description Real Value Imag Value Remarks
Units

Given the three inputs, peak load, period in days and load factor one is required to write VBA code under command button
“CALCULATE” and display the result in the output area.

144
B.2 Visual Basic and Control Toolbox Toolbars

Firstly, you need to ensure that you have both Visual Basic and Control Tollbox Toolbars on top of your spreadsheet to easily
move between calculation and VBA editing mode. Selection of the toolbars is indicated in Figure B.2.

Visual Basic Control toolbox


Toolbars toolbar

Figure B.2: Selecting VBA and Control Toolbox

145
In Visual Basic Toolbox, a toolbar that is frequently used is to toggle between ‘design mode’ and ‘execution (or running) mode’
(See Figure B.3).

Toggle Toggle
Control Toolbox Design Mode
Figure B.3: Toggling “Design Mode”

If it is in the ‘design mode’, then a double click on the CALCULATE button will reveal the VBA code, as shown in Figure B.4.
Clicking the Excel button will move back to the spreadsheet. To execute, make sure that the design mode is off.

Figure B.4: VBA Design Area

146
B.3 Referencing to Cells and Range of Cells

In the VBA code, there a number of ways to get information from the spreadsheet – termed as cell referencing. This is
required since you’ll need to take values from the INPUTS part and place the results in the OUTPUT part. The two commonly
used macros are:

Cells(RowIndex, ColumnIndex)
Range(“B1:B10”)

Cells() refers to a value in a given cell. Range has many ways to refer to cells including value of a single cell, Range(“B3”),
many cells, Range(“G1:G6”) or Range (“G1:J6”).

Example B.1 is completed using the following VBA code in the click button ’CALCULATE’ procedure.

Private Sub CommandButton1_Click()

'Get Inputs
PkLoad = Cells(3, 2)
Days = Cells(4, 2)
LF = Cells(5, 2)

'Process Inputs
Units = PkLoad * Days * 24 * LF

'Place Outputs
Cells(14, 2) = Format(Units, "###,###,##0")

End Sub

147
B.4 Program Controls

Instead of entering inputs directly to the cells, it is possible to select from list of standard items or inputs, for example, to
calculate the per unit impedance of a selected cable and other parameters, we would create a spreadsheet input and output as
shown below (See Figure B.5).

Combo boxes

Figure B.5: Example of input selections and program controls

148
In Figure B.5, we have added two new items in the spreadsheet, i.e., ‘START’ button and ‘DATA” part. It is always necessary in
engineering calculations to provide data and the data can be added at will in accordance to the given column format. The
‘START’ button is used to initialize the Combo boxes and read the DATA so that selection can be made. The big advantage of
EXCEL is the ability of the user to quickly enter data in column format rather than prepare separate database. In fact, the
database could be placed in another worksheet.

The ‘START’ button contains codes to populate the combo boxes and read the data. Example code to populate voltage options
is:

'Voltage
ComboBox1.Clear
ComboBox1.AddItem ("11")
ComboBox1.AddItem ("22")
ComboBox1.AddItem ("33")
ComboBox1.AddItem ("6.6")
ComboBox1.Text = ComboBox1.List(0)

An example code to read data in another sheet is:

'READ DATA
For i = 1 To 200
cableData(i).volt = Sheet4.Cells(2 + i, 1)
cableData(i).insu = Sheet4.Cells(2 + i, 2)
cableData(i).core = Sheet4.Cells(2 + i, 3)
cableData(i).cond = Sheet4.Cells(2 + i, 4)
cableData(i).size = Sheet4.Cells(2 + i, 5)
cableData(i).r1 = Sheet4.Cells(2 + i, 6)
cableData(i).x1 = Sheet4.Cells(2 + i, 7)
cableData(i).b1 = Sheet4.Cells(2 + i, 8)
cableData(i).r0 = Sheet4.Cells(2 + i, 9)
cableData(i).x0 = Sheet4.Cells(2 + i, 10)
cableData(i).b0 = Sheet4.Cells(2 + i, 11)
cableData(i).rate = Sheet4.Cells(2 + i, 12)
Next

Take note how a control loop, For ….. next is used above.

149
Under the ‘CALCULATION’ button control, you will take note of other control statements, example:

If (cableData(i).volt = ivolt And _


cableData(i).insu = iinsu And _
cableData(i).cond = icond And _
cableData(i).core = icore And _
cableData(i).size = isize) Then
Exit For
End If

Another useful control statement is Do While …. Loop. Reading the column formatted data using the For … Next without
considering the number of actual data is not efficient. This is done using Do While ….. Loop as shown below:

i = 1
'For i = 1 To 200
Do While (Sheet4.Cells(2 + i, 1) <> "")
cableData(i).volt = Sheet4.Cells(2 + i, 1)
cableData(i).insu = Sheet4.Cells(2 + i, 2)
cableData(i).core = Sheet4.Cells(2 + i, 3)
.
.
cableData(i).rate = Sheet4.Cells(2 + i, 12)
i = i + 1
Loop
'Next

To exit prior to normal termination of For … Next and Do While …. Loop use Exit For and Exit Do respectively.

150
B.5 Searching a Particular Data Item from a List

On many occasions, one is required to search for a particular item in a data list and Excel VLOOKUP function can be used
efficiently to find the data. In this case it is not necessary to read the data and store into arrays but read it when required. The
data must be sorted in ascending order based on column 1.

An example application is to determine operating time of a fuse given its time characteristocs as shown in Figure B.6.

SIBA - MV Fuses for Oil Insulated Switchgears


Pre-Arcing Time (s)

Prospective RMS Current (A)


Figure B.6: Cartridge fuse characteristics

151
From the characteristic in Figure A.6, for each fuse we obtain the prospective RMS current at the following pre-arcing time;
10,000s, 1000s, 100s, 10s, 1s, 0.1s and 0.01s. Example data in Excel is:

Fuse Name Size 10000 1000 100 10 1 0.1 0.01


SIBAHV10 10 17.0 20.0 22.0 29.0 37.0 50.0 73.0
SIBAHV100 100 100.0 200.0 300.0 400.0 500.0 600.0 700.0
SIBAHV112 112 100.0 200.0 300.0 400.0 500.0 600.0 700.0
SIBAHV125 125 100.0 200.0 300.0 400.0 500.0 600.0 700.0
SIBAHV145 145 210.0 260.0 350.0 440.0 820.0 1400.0 2400.0

152
4.3 Appendix C – Per Unit System

Voltage, current, kVA and impedance in a circuit are often expressed as % or p.u. of a selected base or reference value of
each of these quantities. They are simpler to use. The p.u. system has an advantage over the % system in that the product is
also in p.u.. Four basic quantities are usually considered; V, I, kVA, Z - they are related to each other. The base value of only
two quantities are specified; the other can be calculated. The base impedance for example, is that Z which has a voltage drop
across it equal to the base voltage, when the base current flows through it.

Some basic p.u. Formulae are:

Base Current, A = Base kVA1φ/Base Voltage kVLN


Base Impedance, Ω = Base Voltage VLN/Base Current, A
Base Impedance, Ω = (Base Voltage VLN)2 x 100/Base kVA1φ
Base Impedance, Ω = (Base Voltage kVLN)2/Base MVA1φ
Base Power, kW1φ = Base kVA1φ
Base Power, MW1φ = Base MVA1φ

p.u. impedance of a circuit element = actual impedance, Ω/ Base impedance, Ω

Data are usually given as total 3-phase MVA and line-to-line voltage.

The base current = Base MVA/√3 kVL-L


(kA)b = (MVA)b/√3 (kV)b

The base impedance = (Base Voltge kVL-L/√3)2/(Base MVA/3)


Zb = (kVb)2/(MVb)

When it is required to change the base of a p.u. quantity, the principle is based on:

P.u. impedance of circuit element = (Actual impedance, Ω x Base MVA)/(Base Voltage, kV)2
Zp.u = ZΩ (MVAb)/(kVb)2

153
For changing the base quantities (augmenting to one base);

p.u Znew = p.u Zgiven (Base kVgiven/Base kVnew)2 x (Base MVAnew/Base MVAgiven)
or Z'p.u = Zp.u[(kVb)2/(kVb')2] x [(MVAb')/(MVAb)]

The p.u. system facilitates the description and analysis of different parts of the network (separately) according to the local
(manufacturer) p.u. base. The parts of the network are usually separated by transformers. The resistance and reactance of a
device are given by the manufacturer in p.u. using the rated MVA and kV of the device as base quantities. The ohmic values of
transformer resistance and leakage reactance depend on whether they are measured on LV or HV side of the transformer.
When the transformer impedance is given in p.u., the base MVA is understood to be the rated MVA. The base kV is the rated
HV or LV side depending on how the ohmic values are measured. The p.u. impedance of transformer is the same on any side.

154
4.4 Appendix D – Differential Equations for Control Blocks and Their Numerical Solutions

D.1 Integrator

u 1 y
s

The differential equation is,


y/u = 1/s
dy/dt = u
An integrator has input (u) as the derivative of the output (y).
At initial condition,
dy/dt = 0, and
y = y0
For time simulations,
dy/dt = u, and
y=y
Example implementation of integrator using the Euler method is:
'Initialisation
If (mode = 0) Then
dstate = 0
state = y
End If
'Predictor formula, yn+1 = yn + h*f(yn,t)
If ((mode = 1)) Then
If (tm >= tnew) Then u = unew
dstate = u
stateP = state + delt * dstate
y = stateP
End If

155
'Corrector formula, yn+1 = yn + 0.5 x h x (f(yn,t)+f(y+1,t))
If ((mode = 2)) Then
If (tm >= tnew) Then u = unew
dstateP = u
state = state + 0.5 * delt * (dstate + dstateP)
y = state
End If

D.2 First-Order Lag

u 1 y
1 + sT

The differential equation is,


y/u = 1/(1 + sT)
dy/dt = (u – y)/T
At initial condition,
dy/dt = 0, and
y = y0
For time simulations,
dy/dt = (u –y)/T, and
y=y

156
Example implementation of the first-order lag using Euler integration method is:
'Initialisation
If (mode = 0) Then
dstate = 0
state = y
u = y
End If

'Predictor formula, yn+1 = yn + h*f(yn,t)


If ((mode = 1)) Then
If (tm >= tnew) Then u = unew
dstate = (u - state) / T1
stateP = state + delt * dstate
y = stateP
End If

'Corrector formula, yn+1 = yn + 0.5 x h x (f(yn,t)+f(y+1,t))


If ((mode = 2)) Then
If (tm >= tnew) Then u = unew
dstateP = (u - stateP) / T1
state = state + 0.5 * delt * (dstate + dstateP)
y = state
End If

157
D.3 Washout

u sK y
1 + sT

The differential equation is,


y/u = sK/(1 + sT)
dy/dt = (Kdu/dt – y)/T
At initial condition,
dy/dt = 0, and
y = y0

For time simulations,


dy/dt = (u –y)/T, and
y=y

158
4.5 Appendix E – Power-Angle Curve and Steady-State Stability

Before we develop equations describing relationship between power and angle (known as power-angle curve), it is pertinent to review
some of the fundamental equations used in power systemn analysis.
V

P + jQ
Figure E.1: Power at a bus

Complex power, S at a bus is given by:

S = P + jQ = VI* ………. (E.1)

where I is the sum of all currents at the bus.

Using the above relationship, as an exercise, describe how bus power at bus i in Figure E.2 can be calculated (use Excel VBA).
Vi Vj2
Vj1
yij1 yij2

Pi + jQi Vj3
yij13

Bus i
Figure E.2: Calculation of bus power for bus with multiple connections.

159
Voltage drop across a line as shown in Figure E.3 can be calculated using:

)V12 = V1 – V2 = IZ ………. (E.2)


V1 V2
Z

I
Figure E.3: Voltage drop across a line

To understand the fundamental of active and reactive power flow, one can use power-angle relationship using a simple circuit as
shown in Figure E.3. Figure E.3(a) shows a source with a transformer connected to a line. At the end of the line a transformer is
connected with a load. Figure E.3(b) indicates the impedances of the source, transformers and the line with sending end voltage of ES
and receiving end voltage of ER. Figure E.3(c) shows a simplified circuit with all impedances combined together as reactance jX.

VS VR

S Load

(a)

ES *S ER * R
S Load

(b)

I
ES *S ER * R
S Load
jX

(c)

Figure E.3: Simple network with a source and a load

160
Let all the voltages be referred to ERp*R and that *S - *R = *, then the current on the line in Figure E.3 is given by:

I = (EScos* + jESsin* - ERcos(0) – jERsin(0))/jX


= (EScos* + jESsin* - ER)/jX

Since power flow on the line is determined by the load at the receiving end, i.e., S*R = ERI*, then,

I* = XESsin* - j(XER - XEScos*)/X2

S*R = ERI* = ERESsin*/X + j(EREScos* - E2R)/X

Active power transfer is,

P = ERESsin*/X ………. (E.3)

Reactive power transfer,

Q = (EREScos* - E2R)/X .......... (E.4)

Assume a small * thus cos* .1, then

Q = ER(ES – ER)/X ………. (E.5)

From the above relationship, it is clear that reactive power transfer through a line depends on the difference between sending end
and receiving voltages. For more reactive power transfer the difference must be greater. However, in practice one would like to
maintain voltages close to the statutory limits near 1.0 p.u. and because of this, it is not possible to transfer large reactive power with
similar voltage levels. Therefore, reactive power is more effectively provided locally.

161
Before using equations E.3 … E.5, let us review the power transfer using DCPS-LF on a two-area network as shown in Figure E.4.

4 4
100.0
1000 3 1.0 0.0 0.00 0.0 0.0 0.0 0.0 0.0 1 0.0 0.0 500.0 10.0 0.0 0.22 'SLACK'
1009 0 1.0 0.0 0.00 0.0 0.0 0.0 0.0 0.0 1 0.0 0.0 0.0 100.0 0.0 0.22 'SLACK_TX'
2009 0 1.0 0.0 0.00 0.0 0.0 0.0 0.0 0.0 2 0.0 0.0 0.0 100.0 0.0 0.18 'LOAD_TX'
2000 0 1.0 0.0 0.00 0.0 0.6 0.0 0.0 0.0 2 0.0 0.0 0.0 10.0 0.0 0.18 'LOAD'
1 1 1000 1009 0.0000 0.1000 0.000 500.0 1.0 0.0 0 0 0.0 0.0 0.0 0.0 1
1 1 2000 2009 0.0000 0.1000 0.000 500.0 1.0 0.0 0 0 0.0 0.0 0.0 0.0 1
0 1 1009 2009 0.0000 0.5000 0.000 650.0 0.0 0.0 0 0 0.0 0.0 0.0 0.0 1
0 2 1009 2009 0.0000 0.5000 0.000 650.0 0.0 0.0 0 0 0.0 0.0 0.0 0.0 1

1009 2009
1000 2000
1.0
j0.5 1.0

j0.5
j0.1 j0.1
Slack 60MW

Area 1 Area 2

162
Figure D.4: Two-Area network DCPS model

163
4.6 Appendix F – A Guideline for Adding Models in DCPS-TS

F.1 Excitation Controller Model

VREF
Es
Efdmax
+
VT 1 EV - EIV VOUT EFD
3 KA
(1+sTR)
+
Efdmin

VSO

We will use a simple excitation controller as shown above as the example and we call this as type ‘exc10’.

Step 1 – Model constants and data file


The first step is to identify model constants in ‘exc10’ and these are TR, KA, Efdmax and Efdmin. TR is the transducer time constant and
typical value is half a cycle or 0.01s. KA is the amplifier gain and can have any value between 100 and 2000. The voltage output Vout
is limited typically to between -10.0 p.u. and +10 p.u as the field voltage input to the machine excitation winding, Efd

Excitation controller data input format in DCPS has the form of;
exc#,bsno,ieunit,tr, Ka, ta, ke/tb, te/tc, aex, bex, kf, tf, vrmax, vrmin, efdmin, efdmax

164
(In the future it will be in the form of:
‘excname’, bsno, ieunit, NoConstants, const1, const2, …, consti, …, constN/

Where ‘excname’ is the given excitation controller name, bsno is the generating unit busno, ieunit is the generating unit number,
NoConstants are the number of model constants for the model, const1 to constN are the values of the constsnts. )

Next, we specify the input data for ‘exc0’ that must be placed in the dynamic data file, *.mac;
exc10,bsno,i, 0.01,1000, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -10, 10

Step 2 – Reading model data


Second step is to add code in Redm_2.c to read in data for ‘exc10’.

Add the count number for ‘exc10’;

//exc10
if (strcmp(_strlwr(LineWords[0]),"exc10") == 0) ne = ne+1;

Read the data for ‘exc10’ like other existing excitation controller model;
//exc10 - exciter with amplifier gain only
if (strcmp(_strlwr(LineWords[0]),"exc10") == 0) {
ne = ne + 1;
ety[ne] = 10;
ibe[ne] = atoi(LineWords[1]);
.
.
if (ety[ne] > 0) iexcno += 1;
}

Note: When the new data format is implemented this step is not required. It will be automatically read.

165
Step 3 – Calculate initial conditions
Calculate initial conditions for the excitation controller states and controls.

Add a template for calculating initial values for the model ‘exc10’ using template of previous model;

//Add Exciter with Amplifier Gain Only - Type 10


if (ety[i] == 10) {
//Exciter type 10
.
.
}

We first need to identify the first order differential equations and other equations describing ‘exc10’;

VT is the terminal voltage of the unit obtained from;

vt = sqrt(vr[imn[j]] * vr[imn[j]] + vx[imn[j]] * vx[imn[j]]);

where i is the excitation controller index, j is the machine index and network index with reference to machine index is imn[j].

From the transducer block;

dEV/dt = (VT – EV)/TR


EIV = ES – EV + VSO
VOUT = KAEIV
EFD = VOUT, subject to limits EFDMIN and EFDMAX

dEFD/dt = dVOUT/dt = KAdEIV/dt = KA(-dEV/dt + dVSO/dt)


Initial values of the states in the control block are;

ev[i] = vt;
eiv[i] = efd[j] / ka[i];

166
Reference input or Vref;

es[i] = eiv[i] + ev[i] - vso[i];

devdt[i] = 0.0;
defddt[i] = 0.0;

Step 4 – Euler Method Initial Estimates


Initial estimates are obtained from current derivatives or from initial condition derivatives using:

xn = x + )t dx/dt

The objective here is to determine initial estimate of Efd from the control block.

vt = sqrt(vr[imn[j]] * vr[imn[j]] + vx[imn[j]] * vx[imn[j]]);


devdt[i] = (vt - ev[i]) / tr[i]; //current derivative
evn[i] = ev[i] + devdt[i] * dt; //initial estimate
eivn[i] = es[i] + vson[i] - evn[i];//initial estimate of input to amplifier
efdn[j] = ka[i] * eivn[i]; //initia estimate of Efd – note index j
//Check and apply limits on efdn
if (efdn[j] >= efdmax[i]) {
efdn[j] = efdmax[i];
}
if (efdn[j] <= efdmin[i]) {
efdn[j] = efdmin[i];
}

Terminal voltage for the machine must be obtained using network index (imn[j] or ibe[j]). All states must use controller index, i.
Output for machine must use machine index, j.

167
Step 5 – Euler Method Final Estimates
Final estimates are obtained from derivatives and values of initial estimates using:

xf = x + 0.5)t (dx/dt + dxn/dt)

The objective of this part is to determine Efd from the control block;

vt = sqrt(vr[imn[j]] * vr[imn[j]] + vx[imn[j]] * vx[imn[j]]);


devdtn = (vt - evn[i]) / tr[i]; //derivatives of initial estimate
ev[i] = ev[i] + 0.5*(devdt[i]+devdtn) * dt; //final estimate of state ev
eiv[i] = es[i] + vso[i] - ev[i]; //estimate of input to amplifier gain
efd[j] = ka[i] * eiv[i]; //final estimate of Efd
//Check and apply limits on efdn
if (efd[j] >= efdmax[i]) {
efd[j] = efdmax[i];
}
if (efd[j] <= efdmin[i]) {
efd[j] = efdmin[i];
}

Terminal voltage for the machine must be obtained using network index (imn[j] or ibe[j]). All states must use controller index, i.
Output for machine must use machine index, j.

168
F.2 Power System Stabiliser

VREF
Es
Efdmax
+
VT 1 EV - EIV VOUT EFD
3 KA
(1+sTR)
+
Efdmin

LSMAX

VSO
PE KS (1 + sT1)
(1 + sT2)

LSMIN

We will use a simple PSS controller as shown above as the example and we call this type ‘pss10’.

169
Step 1 – Model constants and data file
First step is to identify model constants in the model ‘pss10’ and these are KS, T1, T2, LSMAX and LSMIN . KS is the gain and T1 and T2 are
lead and lag time constants. The output VSO is limited by LSMAX and LSMIN. These constants are set through parametric analysis (carried
out after modeling) in order to achieve the desired response to reduce oscillation, that is, to add damping.

PSS data input format in DCPS has the form of;


pss# , bsno,ieunit, insig, ks, ts5, t1, t2, t3, t4, vsmax, vsmin

Where insig is the input signal, for this case we use electrical power, Pe. Next, we specify the input data for ‘pss10’ that must be
placed in the dynamic data file, *.mac as;
pss10, 2000, 1, 1, 10.00, 0.0, 0.3, 0.036, 0.0, 0.000, 0.20, -0.20

Step 2 – Reading model data – REDM_2


Second step is to add code in Redm_2.c to read in data for ‘pss.

Add the count number for ‘pss10’;

//pss10
if (strcmp(_strlwr(LineWords[0]),"pss10") == 0) np = np+1;

Read the data for ‘pss10’ like other existing pss model;
//pss10
if (strcmp(_strlwr(LineWords[0]),"pss10") == 0) {
np = np + 1;
ipsty[np] = 10;
.
.
if (ipsty[np] > 0) ipssno += 1;
}

170
Step 3 – Calculate initial conditions - INIE
Calculate initial conditions for the pss states. The lead-lag control block can be simplified as shown below for ready manipulations;

LSMAX

PE KS (1 + sT1) VSO
(1 + sT2)

LSMIN

PE KST2 VO1
LSMAX
T1
+
PE
3 VSO

+
PE KS (1 – T2/T1) VO2 LSMIN
(1 + sT1)

171
Add a template for calculating initial values for the model ‘pss10’ using template of previous model;

//simple pss - Type 10


if (ety[i] == 10) {
//Exciter type 10

At the initial condition, the objective is to calculate Vso as input to the excitation controller;

if (ipsty[i] == 10) {
// Simple PSS
//pe is p.u. on 100MVA basej must be referred to machine index
for (ki = 1; ki <= nm; ki++) {
if (ibp[i] == imn[ki]) {
pv01[i] = pe[imn[ki]]*ks[i]*ts2[i]/ts1[i];
pv02[i] = pe[imn[ki]]*ks[i]*(1.0 - ts2[i]/ts1[i]);
break;
}
}
//non-zero vso will change excitation controller reference voltage
vso[j] = pv01[i] + pv02[i];
dv01dt[i] = 0.0;
dv02dt[i] = 0.0;
dvsodt[i] = 0.0;
}

From the pss block diagram;

V01 = PEKST2/T1
If K1 = KS(1 – T2/T1)
dV02/dt = (PEK1 – V02)/T1
Since, VSO = V01 + V02
dVSO/dt = dVO2/dt

172
Step 4 – Euler Method Initial Estimates – EUE1
Initial estimates are obtained from current derivatives or from initial condition derivatives using:

xn = x + )t dx/dt

The objective here is to determine initial estimate of Vson from the pss control block.

if (ipsty[i] == 10) {
// Simple PSS
k1 = ks[i]*(1.0 - ts2[i]/ts1[i]);
dv01dt[i] = 0.0;
for (ki = 1; ki <= nm; ki++) {
if (ibp[i] == imn[ki]) {
dv02dt[i] = (pe[imn[ki]]*k1 - pv02[i])/ts1[i];
break;
}
}
dvsodt[i] = dv02dt[i] + dv01dt[i];
pv01n[i] = pv01[i] + dt*dv01dt[i];
pv02n[i] = pv02[i] + dt*dv02dt[i];
vson[j] = pv01n[i] + pv02n[i];
//apply limits
if (vson[j] >= vsmax[i]) vson[j] = vsmax[i];
if (vson[j] <= vsmin[i]) vson[j] = vsmin[i];
}

173
Step 5 – Euler Method Final Estimates – EUE2
Final estimates are obtained from derivatives and values of initial estimates using:

xf = x + 0.5)t (dx/dt + dxn/dt)

The objective of this part is to determine Vso from the control block ;

if (ipsty[i] == 10) {
// Simple PSS
k1 = ks[i]*(1.0 - ts2[i]/ts1[i]);
dv01dtn = 0.0;
for (ki = 1; ki <= nm; ki++) {
if (ibp[i] == imn[ki]) {
dv02dtn = (pen[imn[ki]]*k1 - pv02n[i])/ts1[i];
break;
}
}
dvsodtn = dv02dtn + dv01dtn;
pv01[i] = pv01[i] + 0.5*dt*(dv01dt[i]+dv01dtn);
pv02[i] = pv02[i] + 0.5*dt*(dv02dt[i]+dv02dtn);
vso[j] = vso[j] + 0.5*dt*(dvsodt[i]+dvsodtn);
//apply limits
if (vso[j] >= vsmax[i]) vso[j] = vsmax[i];
if (vso[j] <= vsmin[i]) vso[j] = vsmin[i];
}

174
Washout filter as shown in figure below can be added to the model.

Vref
Transducer Exciter Emax
+
Et 1 -
3 KA Efd
1 + sTR
+ Emin
Parameters for
Excitation System: Field Limits
KA = 200
TR = 0.015s
EFmax = 7.0
EFmin = -6.4 Parameters for PSS
Phase KSTAB = 9.5
Gain Washout Compensation Vsmax TW = 1.41s
T1 = 0.154s
∆Tr sTW 1 + sT1 T2 = 0.033s
KSTAB
1 + sTW 1 + sT2 Vsmax = 0.2
Vsmin = -0.2

Vsmin

175
Washout
Pe sTW Pe1
1 + sTW

Pe - Pe1
3
+

Pe2
1
1 + sTW

From the above block diagram,’

dPe2/dt = (Pe – Pe2)/Tw


Pe1 = Pe2 - Pe

176
F.3 Turbine-Governor

We will use a simple governor-turbine control as shown below as the example. We will call this as ‘gov10’.

PREF
Vmax
+
)T 1 - 1
G Pmech
R 1 + sT1
-
Vmin

Change in speed is the input to the governor which is then multiplied by governor gain – inverse of the droop setting, R. The modified
speed change is compared with reference PREF and feedback signal for input into control block for fluid power valve opening. This
control block is combined with turbine time constant to produce mechanical power output, PMECH.

Step 1 – Model constants and data file


First step is to identify model constants in the model ‘gov10’ and these are R, T1, and VMAX and VMIN. VMAX and VMIN are limits on valve
opening and closing rates.

In DCPS template for turbine-governor data is:

Type ,busno,igunit,turb MW, Pmax, Pmin, droop, T1 , T2 , T3 , KT , Vmax , Vmin ,Dturb

177
For model ‘gov10’ the following data are required:
gov10, 2000, 1, 400.0, 0.95, -0.10, 0.050, 1.500, 0.000, 0.000, 0.000, 1.000, -1.000, 0.0

The turbine power (TRATE) is specified at 200MW. Pmax and Pmin are per unit maximum and minimum turbine power output of the
generating unit specified at 95% and -10% respectively. Negative Pmin implies that the generator is allowed to become motoring. The
droop setting is set to 5% and this is typical. T1 specified at 1.5s is combination of governing and fluid flow – steam through piping
etc. – time constants. Valve opening and closing rate limits are specified to be not more 1.0 and -1.0 per unit respectively.

Step 2 – Reading model data – REDM_2


Second step is to add code in Redm_2.c to read in data for ‘gov10’.

Add the count number for ‘gov10’;

//gov10
if (strcmp(_strlwr(LineWords[0]),"gov10") == 0) ng = ng+1;

Read the data for ‘gov10’ like other existing governor model;
//gov10
if (strcmp(_strlwr(LineWords[0]),"gov10") == 0) {
ng = ng + 1;
gty[ng] = 1;
ibg[ng] = atoi(LineWords[1]);
.
.
if (gty[ng] > 0) igovno += 1;
}

178
Step 3 – Calculate initial conditions - INIG
Calculate initial conditions for the turbine-governor states. At the initial condition the mechanical power output PMECH is constant. P.u.
gate opening is:
GPGOV = PMECH x 100/TRATE
The initial conditions are calculated as follows:
//gov10 - simple turbine governor
if (gty[i] == 10) {
//per unit valve opening
//When fully opened (1.0 p.u) produced gmw MW of output
//Therefore gate opening at initial condition is:
//(pm*100*gvmax)/gmw
gpgov[i] = pm[j]*100.0/gmw[i];
//assign gs1 as gate opening
gs1[i] = gpgov[i];
//This gate opening must not be greater Gpmax and less than
//Gpmin
if ((gs1[i] > gpmax[i]) || (gs1[i] < gpmin[i])) {
printf ("Turbine Governor for Machine %d initialised out of limits\n",
nblg[ibg[i]]);
}
//per unit speed change as input
dw = (w0 - w[j])/w0;
//wr after droop block
wr = dw*(1.0/droop[i]);
//since at initial condition Werr = gsq1, s=0, then
gpref[i] = wr + gs1[i] + gs1[i];
//input into valve control
werr = gpref[i] - wr - gs1[i];
//Derivatives
dgs1dt[i] = (werr - gs1[i])/gt1[i];
dpmdt[i] = dgs1dt[i];
//initial mecahnical power
pm[j] = gpgov[i]*gmw[i]/100.0;
}

179
Step 4 – Euler Method Initial Estimates – EUG1
Initial estimates are obtained from current derivatives or from initial condition derivatives using:

xn = x + )t dx/dt

The objective here is to determine initial estimate of PMECH from the turbine-governor control block. This is calculated using the code
below:

//gov10 - simple turbine governor


if (gty[i] == 10) {
kpm = gmw[i]/100.0; //turbine rating over MVA base
dw = (w[j] - w0)/w0; //p.u. speed change as input
wr = dw/droop[i]; //after the droop
werr = gpref[i] - wr - gs1[i]; //speed error into control block
dgs1dt[i] = (werr - gs1[i])/gt1[i]; //derivative of gs1
gs1n[i] = gs1[i] + dgs1dt[i]*dt; //initial estimate of gs1

//check for valve rate limits on dgs1dt


if ((dgs1dt[i] >= gvmax[i]) && (dgs1dt[i] > 0.0)) {
dgs1dt[i] = 0.0;
gs1n[i] = gvmax[i];
} else if ((dgs1dt[i] <= gvmin[i]) && (dgs1dt[i] < 0.0)) {
dgs1dt[i] = 0.0;
gs1n[i] = gvmin[i];
}

//turbine power derivative


dpmdt[i] = dgs1dt[i]*kpm; //turbine power rate of change
pmn[j] = pm[j] + dpmdt[i]*dt; //initial estimate of turbine power

//Apply pmax and pmin limits on pm


if (pmn[j] > gpmax[i]*kpm) pmn[j] = gpmax[i]*kpm;
if (pmn[j] < gpmin[i]*kpm) pmn[j] = gpmin[i]*kpm;
}

Take note that kpm is used to ensure that the PMECH output is always based on 100MVA base

180
Step 5 – Euler Method Final Estimates – EUE2
Final estimates are obtained from derivatives and values of initial estimates using:

xf = x + 0.5)t (dx/dt + dxn/dt)

The objective of this part is to determine PMECH from the control block. This is accomplished by the following code:

//gov10 - simple turbine governor


if (gty[i] == 10) {
//Final Estimates
kpm = gmw[i]/100.0; //turbine rating over MVA base
dw = (wn[j] - w0)/w0; //p.u. speed change
wr = dw/droop[i];
werr = gpref[i] - wr - gs1n[i]; //speed error
dgs1dtn = (werr - gs1n[i])/gt1[i]; //derivative of gs1
gs1[i] = gs1[i] + 0.5*(dgs1dtn + dgs1dt[i])*dt;//final est gs1

//check for valve rate limits on dgs1dt


if ((dgs1dtn >= gvmax[i]) && (dgs1dtn > 0.0)) {
dgs1dt[i] = 0.0;
gs1[i] = gvmax[i];
} else if ((dgs1dtn <= gvmin[i]) && (dgs1dtn < 0.0)) {
dgs1dt[i] = 0.0;
gs1[i] = gvmin[i];
}

//turbine power derivative


dpmdtn = dgs1dtn*kpm; //turbine power rate of change
pm[j] = pm[j] + 0.5*(dpmdtn + dpmdt[i])*dt; //final est PMECH

//Apply hardlimit on pm
if (pm[j] > gpmax[i]*kpm) pm[j] = gpmax[i]*kpm;
if (pm[j] < gpmin[i]*kpm) pm[j] = gpmin[i]*kpm;
}

181
GOV2 – PSS/E TGOV1 with deadband

Droop Gain VMAX Piping, engine etc.

PREF 1 Tr KT gs1 1 + sT2 gs2 Pm


E E
+ R 1 + sT1 1 + sT3 +
- -
Gate position
Deadband Gate opening/
closing control
block VMIN
)T
Dt

Load Damping

T3 Vo1
T2 +
gs1 gs2
E
+

1 – T3/T2
1 + sT2 Vo2

182
GOV2 has the following data inputs

//ty,busno,igunit,turb MW, Pmax, Pmin, ddbnd, droop, T1 , T2 , T3 , KT , Vmax , Vmin ,Dturb


gov2, 1900, 1, 500.0, 1.0, 0.00, 300.0, 0.050,30.500, 0.100, 0.800, 2.500, 0.8, -0.8, 0.0

For the above input data, the turbine rating (turb_MW) is specified as 500MW. The governor that controls gate opening has gain of
2.5 and a 30.5s motor time constant. After the gate, elements involving piping or engines may introduce some delay to the
mechanical power output.

Data input for the model:

The data is read in REDM_2.C using:

//gov2 - TGOV1 Modified with deadband and governor gain


if (strcmp(_strlwr(LineWords[0]),"gov2") == 0) {
ng = ng + 1;
gty[ng] = 2;
ibg[ng] = atoi(LineWords[1]); // bus no
igunit[ng] = atoi(LineWords[2]); // unit no
gmw[ng] = atof(LineWords[3]); // turbine rating MW
gpmax[ng] = atof(LineWords[4]); // max turbine limit p.u.
gpmin[ng] = atof(LineWords[5]); // min turbine limit p.u.
deadband[ng] = atof(LineWords[6]); // speed/frequency measurement deadband mHz
droop[ng] = atof(LineWords[7]); // droop p.u.
gt1[ng] = atof(LineWords[8]); // governor valve time constant
gt2[ng] = atof(LineWords[9]); // piping/engine lead time constant
gt3[ng] = atof(LineWords[10]); // piping/engine lag time constant
gkt[ng] = atof(LineWords[11]); // governor gain
gvmax[ng] = atof(LineWords[12]); // gate max opening rate limit p.u.
gvmin[ng] = atof(LineWords[13]); // gate min opening rate limit p.u.
gdturb[ng] = atof(LineWords[14]); // load damping
if (gty[ng] > 0) igovno += 1;
}

183
Initial condition calculations

The output of the turbine-governor that is the input to the generator rotor is the turbine mechanical power, Pm. Pm is known from
the generator initial condition and is assumed to be same as the electrical power Pe. For the delivered Pm, the necessary per unit
gate opening must be determined. Assuming that the gate is fully opened at 1.0 p.u. and fully closed at 0.0 p.u. and the when at fully
opened position the turbine power output is the rated turbine power, then the p.u. gate opening is calculated using, gs1 = Pm x
SBase/Turbine Rating. The per unit speed input to the turbine governor must be speed deviation in p.u. calculated as, )T = (T0 -
T)/T0 and at the initial condition this should be zero. The initial conditions calculation is implemented as shown below:

//Modified TGOV1 with deadband and KT


if (gty[i] == 2) {
//TGOV1 Modified
gpgov[i] = pm[j]*100.0/gmw[i]; //per unit gate opening
gs1[i] = gpgov[i];
if ((gs1[i] > gpmax[i]) || (gs1[i] < gpmin[i])) {
printf ("Turbine Governor for Machine %d initialised out of limits\n",
nblg[ibg[i]]);
}
dw = (w0 - w[j])/w0; //per unit speed change
gpref[i] = droop[i]*gs1[i]/gkt[i] + dw; //PREF
wr = (gpref[i]-dw)*(1.0/droop[i]); // wr
dgs1dt[i] = (gkt[i]*wr - gs1[i])/gt1[i];
gs2[i] = gs1[i];
t32 = gt3[i]/gt2[i];
vo1 = gs1[i]*t32;
tk = 1.0 - t32;
dgs2dt[i] = (tk*gs1[i] - (gs2[i] - vo1))/gt2[i];
dtw = gdturb[i]*dw;
dpmdt[i] = dgs2dt[i];
pm[j] = gpgov[i]*gmw[i]/100.0;
//printf ("pm = %8.6f dpmdt = %8.6f\n", pm[j], dpmdt[i] );
}

184
Solution of differential equations – Euler Predictor

Next the derivatives of the states are calculated and states estimated using Euler Predictor formula. From Figure 2, there are three
states, gs1, gs2 and Pm. Predictor formula is, xPn+1 = xn + hdx/dt. The derivative of Pm is based on the derivative of gs2. Since gs2 is
valve opening, it must be accordingly scaled to get Pm.

//Modified TGOV1 with deadband and KT - for SESB postmortem analysis


if (gty[i] == 2) {
kpm = gmw[i]/SBASE; //turbine rating over system MVA base
dw = (w[j] - w0)/w0; //p.u. speed change
//introduce deadband - simple
//as soon as outside deadband use actual speed change
//and will not check deadband again
if (ideadband[i] == 0) {
dw50 = dw*50.0*1000.0; //convert to mHz
if (abs(dw50) <= deadband[i]) {
dw = 0.0;
ideadband[i] = 0;
} else {
ideadband[i] = 1;
}
}
wr = (gpref[i]-dw)*(1.0/droop[i]); // wr
//STATE 1
dgs1dt[i] = (gkt[i]*wr - gs1[i])/gt1[i]; //Governor valve control
gs1n[i] = gs1[i] + dgs1dt[i]*dt; //initial estimate of gs1
//check for valve rate limits on dgs1dt
if ((dgs1dt[i] >= gvmax[i]) && (dgs1dt[i] > 0.0)) {
dgs1dt[i] = 0.0;
gs1n[i] = gvmax[i];
}

185
if ((dgs1dt[i] <= gvmin[i]) && (dgs1dt[i] < 0.0)) {
dgs1dt[i] = 0.0;
gs1n[i] = gvmin[i];
}
t32 = gt3[i]/gt2[i];
vo1 = gs1[i]*t32;
tk = 1.0 - t32; //for lag this must be positive t32 < 1.0
//STATE 2
dgs2dt[i] = (tk*gs1[i] - (gs2[i] - vo1))/gt2[i];
gs2n[i] = gs2[i] + dgs2dt[i]*dt;//initial estimate of gs2
//STATE 3
dpmdt[i] = dgs2dt[i]*kpm;
dtw = gdturb[i]*dw;
pmn[j] = pm[j] + dpmdt[i]*dt; //initial estimate of turbine power
pmn[j] = pmn[j] - dtw; //load damping
//Apply hardlimit on pm
if (pmn[j] > gpmax[i]*kpm) pmn[j] = gpmax[i]*kpm;
if (pmn[j] < gpmin[i]*kpm) pmn[j] = gpmin[i]*kpm;
}

186
Solution of differential equations – Euler Corrector

For final estimate of the state, the Euler Corrector formula is used, i.e., xn+1 = xn + 0.5h(dxPn+1/dt + dxn/dt).

//Modified TGOV1 with deadband and KT


if (gty[i] == 2) {
kpm = gmw[i]/SBASE; //turbine rating over system MVA base
dw = (wn[j] - w0)/w0; //dwn = dw, p.u. speed change
//introduce deadband
if (ideadband[i] == 0) {
dw50 = dw*50.0*1000.0;
if (abs(dw50) <= deadband[i]) {
dw = 0.0;
ideadband[i] = 0;
} else {
ideadband[i] = 1;
}
}
wr = (gpref[i]-dw)*(1.0/droop[i]); // wrn
//STATE 1
dgs1dtn = (gkt[i]*wr - gs1n[i])/gt1[i];
gs1[i] = gs1[i] + 0.5*(dgs1dtn + dgs1dt[i])*dt; //final estimate of gs1
//check for valve rate limits on dgs1dt
if ((dgs1dtn >= gvmax[i]) && (dgs1dtn > 0.0)) {
dgs1dt[i] = 0.0;
gs1[i] = gvmax[i];
}
if ((dgs1dtn <= gvmin[i]) && (dgs1dtn < 0.0)) {
dgs1dt[i] = 0.0;
gs1[i] = gvmin[i];
}

187
//LEAD-LAG BLOCK
t32 = gt3[i]/gt2[i];
vo1 = gs1n[i]*t32;
tk = 1.0 - t32;
//STATE 2
dgs2dtn = (tk*gs1n[i] - (gs2n[i] - vo1))/gt2[i];
gs2[i] = gs2[i] + 0.5*(dgs2dtn + dgs2dt[i])*dt; //final estimate of gs2
//STATE 3
dpmdtn = dgs2dtn*kpm;
pm[j] = pm[j] + 0.5*(dpmdtn + dpmdt[i])*dt; //final estimate of turbine power
dtw = gdturb[i]*dw;
pm[j] = pm[j] - dtw; //load damping
//Apply hardlimit on pm
if (pm[j] > gpmax[i]*kpm) pm[j] = gpmax[i]*kpm;
if (pm[j] < gpmin[i]*kpm) pm[j] = gpmin[i]*kpm;
}

188
Appendix G – Course Project
G.1 Project Requirements

Each student shall submit to the course lecturer the following:

(1) One CD containing the followings:


a) DCPS Program C/C++ codes with the models required by the project;
b) Input data files for testing the project – solved load flow (*.sol) and dynamic data (*.mac);
c) Run File (*.aps) for testing the model; and
d) Project report in MS Word format.

(2) Bounded Project Report that must include the following chapters/contents:
a) Preface;
b) Table of contents;
c) Chapter 1: Introduction to equipment or controller to be modeled;
d) Chapter 2: Functions and Modeling of equipment or controller;
e) Chapter 3: Implementation of model in DCPS
f) Chapter 4: Results and Findings on the response of equipment in DCPS
g) Chapter 5: Conclusions and Recommendations
h) References
i) Appendices – Listing of the new C/C++ codes implemented in DCPS

The deadline for submission will be announced in class.

189
G.2 Excitation Systems

G2.1.1 Model excitation system type IEEE AC4 (PSS/E EXAC4) as shown below in DCPS

VREF VS

VIMAX VRMAX – KC IIFD


+ +
+
EC 1 - VERR 1 + sTC KA
1 + sTR E E 1 + sTB 1 + sTA
EFD

VIMIN VRMIN – KC IIFD


VS = VOTHSG + VUEL + VOEL

Use the following ranges for parameter data:


0 <= TR < 0.1
0 < VIMAX <= 0.2
-0.2 < VIMIN <= 0
0 <= TC < 10.0
4xDELT < TB < 20
50 <= KA <= 1000
0 <= TA <= 0.5
3 <= VRMAX <= 8
-8 < VRMIN <= -3
0 <= KC < 0.3

190
G2.1.2 Model excitation system type IEEE ST1 (PSS/E EXST1) as shown below in DCPS

VREF VS

VIMAX VRMAX – KC IIFD


+ +
+
EC 1 - VERR 1 + sTC KA
1 + sTR E E 1 + sTB 1 + sTA
EFD

-
VIMIN VRMIN – KC IIFD
VS = VOTHSG + VUEL + VOEL sKF
1 + sTF

Use the following ranges for parameter data:


0 <= TR < 0.1
0 < VIMAX <= 0.2
-0.2 < VIMIN <= 0
0 <= TC < 10.0
4xDELT < TB < 20
50 <= KA <= 1000
0 <= TA <= 0.5
3 <= VRMAX <= 8
-8 < VRMIN <= -3
0 <= KC < 0.3
0 < KF <= 0.3
4 x DELT < TF < 1.5

191
G2.1.3 Model excitation system IEEE Type 1 (PSS/E Type IEEEX1) in DCPS

VREF VS
VRMAX
Regulator
+ +
+ 1
EC 1 - VERR 1 + sTC KA +
1 + sTR E E 1 + sTB 1 + sTA VR
E sTE
EFD

- -

VFB VRMIN S E + KE
VS = VOTHSG + VUEL + VOEL sKF
1 + sTF1

Damping
Use the following ranges for parameter data:
0 <= TR < 0.1 4 x DELT < TE < 1
0 < VIMAX <= 0.2
-0.2 < VIMIN <= 0
0 <= TC < 10.0
4xDELT < TB < 20
50 <= KA <= 1000
0 <= TA <= 0.5
3 <= VRMAX <= 8
-8 < VRMIN <= -3
0 <= KC < 0.3
0 < KF <= 0.3
4 x DELT < TF1 < 1.5
5 <= TF1/KF <=15
-1<= KE <= 1

192
G2.1.4 Model excitation system IEEE Type 2 (PSS/E Type IEEEX2) in DCPS

VREF VS
VRMAX
Regulator
+ +
+ 1
EC 1 - VERR 1 + sTC KA +
1 + sTR E E 1 + sTB 1 + sTA VR
E sTE
EFD

- -

VFB VRMIN SE + KE
VS = VOTHSG + VUEL + VOEL
sKF
(1 + sTF1) (1 + sTF2)

Damping
Use the following ranges for parameter data:
0 <= TR < 0.1 4 x DELT < TE < 1
0 < VIMAX <= 0.2 4 × DELT < TF2 < 1.5
-0.2 < VIMIN <= 0
0 <= TC < 10.0
4xDELT < TB < 20
50 <= KA <= 1000
0 <= TA <= 0.5
3 <= VRMAX <= 8
-8 < VRMIN <= -3
0 <= KC < 0.3
0 < KF <= 0.3
4 x DELT < TF1 < 1.5
5 <= TF1/KF <=15
-1<= KE <= 1
193
G2.1.5 Model excitation system IEEE Type 1A (PSS/E Type IEEET1A) in DCPS

Use the following ranges for parameter data:


0 <= TR < 0.1 4 x DELT < TE < 1
10 <= KA <= 500
0 <= TA <= 1
0.5 <= VRMAX <= 10
-10 < VRMIN < 0
-1<= KE <= 1
4 x DELT < TF1 < 1.0
0 < KF <= 0.3
4xDELT < TF or TF1 < 1.5
5 <= TF/KF <=15

194
Excitation Controller
VRMAX
Vref

+
VT 1 - 1 + sTC KA
G 1 + sTA 1 + sTA EFD
1 + sTR
Vs -

VRMIN

LSMAX

Vs sT5 1 + sT3 1 + sT1


KS
1 + sT6 1 + sT4 1 + sT2

LSMIN

Pe
Power System Stabilizer

195
G.3 Turbine-Governor System

GAST
Speed
Dturb

1
R
VMAX

Load - -
+ Low +
Reference 1 1
E Value
Select 1 + sT1 1 + sT2 E PMECH

VMIN

+ - 1
E KT E 1 + sT3
+ +

Load
Limit

196
HYGOV

197
EEEG1

198
G.4 Dynamic Load Models and Load-Shedding Relays

Load is modeled to vary with both voltage and frequency,

P = fP(V, f)
Q = fQ(V,f)

During the initialization of the dynamic calculations, the equivalent admittance of the load at the bus is added to the respective
diagonal element of the admittance matrix using;

YP0 = P0/|V0|2
YQ0 = -Q0/|V0|2

During dynamic event, it is expected that both voltage and frequency would vary and the value of the load is recalculated:

Pt = fP(Vt, ft)
Qt = fQ(Vt,ft)
YPt = Pt/|Vt|2
YQt = -Qt/|Vt|2

However, YP0 and YQ0 are already included in the admittance matrix. To account for the new load Pt and Qt the difference
between the initial load (already in the admittance matrix) and dynamic load is modeled as current injection using:

IP + j IQ = (Y0 – Yt)Vt
The above described models are static load models because loads depend only on the current value of the voltage and
frequency.

The load model that we want establish in this course project is dynamic load model. In this case instead of depending only on
the current value of the voltage magnitude and frequency, the load is modeled to be dependent on the rate of change of both
voltage magnitude and frequency. In DCPS the rate of change of angle d2/dt is the bus frequency while the rate of change of
voltage dV/dt is array vmag3[i][0] where is the bus number index, i.e., nblg[i] is the physical bus number.

199
For this option, student is required to implement load models as described in the following references:

a) IEEE Task Force on Load Representation for Dynamic Performance “LOAD REPRESENTATION FOR DYNAMIC
PERFORMANCE ANALYSIS”, IEEE Transactions on Power Systems, Vol. 8, No. 2, May 1993, pp 472 - 482; and
b) “DEVELOPMENT AND COMPARATIVE STUDY OF INDUCTION MACHINE BASED DYNAMIC P,Q LOAD MODELS”, IEEE
Transactions on Power Systems, Vol. 10, No.1, February 1995, pp 182 - 190

and implement the load models as state in the paper particularly model provided on page 480 of paper a) and model E in
paper b). The student is required to analyse the response of different types of loads as provided in the papers.

G.5 Protective Relay Model

A protective relay must measure branch current and in case of distance relays, the voltage at point of current measurement is
also required. In DCPS the convention for placing relay should be:

From_Bus, To_Bus, Circuit, relay parameters ….

For the purpose of the project, the student is required to model mho distance relay with zone 1, 2 and 3. Student must
perform necessary literature search to establish the most appropriate settings of the relays.

In the DCPS, branch impedance can be calculated from the branch current and the adjacent bus voltage. The relay must also
be model with the necessary transfer trip.

200
G.6 SVC Model

For the purpose of this project, the SVC will be modeled as a generator with zero active power in laod flow. In dynamic
simulation, the reactive power output will be controlled by a typical controller as shown below.

201
The CSVGN1 model represents an SCR-controlled shunt reactor and a parallel connected capacitor, if present. The SCR gate is
controlled by voltage error with an auxiliary signal. The voltage reference VREF must be calculated during initialization, and the
auxiliary signal can be neglected for this project.

The physical size of the reactor is specified by the base MVA, MBASE, assigned to the generator in the load flow data. The size
of the capacitor is given by the parameter CBASE in the model data. This constant is zero if no capacitor is represented by the
model.

The limits VMAX and VMIN specify the active range of the voltage control loop. Normal values of VMAX and VMIN are unity and
zero, respectively, though they could have more restrictive values if the controls are adjusted for an active range
corresponding to only a part of the reactor’s rating. The minimum admittance limit, RMIN, specifies the effective admittance of
the reactor when the SCR control element is turned completely off. The value of RMIN would be zero, or very nearly zero, in
units where the SCR element controls main current directly and can turn the reactor completely off and nonzero in elements
where the SCR controls work through a secondary winding and allow the reactor to draw magnetizing current even in the off
condition.

The time constant, T5, allows a rough approximation of delays in the reactor’s response to control signals. Its value should, in
the light of the fast response observed in most tests of SVC units, be 0.05 sec. or less. The time constants T1 through T4
provide for transient gain reduction in the control loop and hence allow for a high value, K, of steady-state voltage control gain.

202

Das könnte Ihnen auch gefallen