Вы находитесь на странице: 1из 165

A Report on:

A Feasibility Study of Applying


Coordinated Voltage Controls in
TNB’s Transmission Network

Report Prepared for:


TNB Research

FINAL REPORT

Report Prepared by:


Members of TNB Research Working Group on Coordinated Voltage Control

Date: Tuesday, August 31, 2010


Preface

This report presents the findings of a study carried out between October 2009 and August
2010 to determine the feasibility of applying coordinated voltage control (CVC) in TNB’s
Transmission Network. The study was conducted by a TNB Research Working Group (WG)
on CVC whose members include TNB engineers from system operation, system planning,
transmission engineering, TNB Research and several staff of APS.
Currently, primary voltage controls in the Grid are carried out automatically by using
generating units, SVCs, and on-line automatic transformer tap changers. Only limited number
of these equipments can be controlled directly from the National Load Dispatch Centre
(NLDC) and therefore, in the usual practice, system control operators would instruct station
operators to perform the control locally. For secondary voltage controls, several means are
available including manual switching in and out of shunt capacitors/reactors, reconfiguration
of network, and manual controls of transformer tap-changers. Secondary voltage controls
are carried out by control operators based on a set of guidelines and taking the necessary
actions accordingly. Since the guidelines are broad in nature, control actions could vary from
one operator to another depending on experience, system information and knowledge. TNB
believes that improvement in the approach and methods to performing secondary voltage
controls are desirable since it could enhance system performance in terms of reliability and
security as well as system losses.
A CVC refers to an approach in which secondary voltage control or regulations (SVR)
is carried out automatically using a control system that would coordinate the various voltage
control equipment to achieve a desired voltage at a pilot node in the system. This research
project is aimed at determining the feasibility of applying SVR in TNB’s Transmission network
from the perspective of system reliability and security as well as economic operation.
The research work began with a review of the current practices of voltage controls in
the network and the WG concluded that a more systematic secondary voltage regulation
could result in a more consistent voltage profile across and network and constancy in bus
voltages that can lead to improvement in system performance. Therefore, the work should
proceed as intended.
Based literature survey carried out by members of the WG, it was agreed that the
approach as described in CIGRE Report 310 “Coordinated Voltage Controls in Transmission
Network”, February 2007, could be emulated but required to be enhanced with a new
simulation approach. Since voltage control is a real time activity that repeats itself on a daily
basis, it was agreed that a more effective approach to study the process of CVC would be to
perform simulations on a 24-hour basis where at defined times during the day the SVR would
be applied.
The Working Group firmly believes that there is potential for applications of SVR in
TNB’s network whose main benefits would be improvement in voltage security as well as
reduction in losses. The main achievement of this research work has been the development
of 24-hour based simulations covering both steady-states and dynamics that could be
applied not only to further investigate the detailed design of the SVR but also to facilitate
developments of other applications including enhancements of the daily security assessments.

(Sallehhudin Yusof)
WG CVC, Project Mentor/Report Editor

2
Executive Summary
In this project, the Working Group on Coordinated Voltage Control (WG-CVC) has completed
the following tasks:

(1) Reviewed existing secondary voltage controls practices in TNB’s Transmission


Network and recognized that improvement in voltage controls through CVC could
enhance network performance;

(2) Carried out literature review of several documents on CVC and found that
approaches as described in CIGRE Report 310 “Coordinated Voltage Controls in
Transmission Network”, February 2007, could be emulated but required to be
complemented with a new simulation approach and methodology;

(3) Developed both load flow and dynamic based 24-hour simulation tools to facilitate
investigations into the techniques to perform CVC in evaluating its performance
and effectiveness;

(4) Developed supporting functions for use with CVC including, identification of
voltage control areas, identification of pilot node in each voltage control area,
methods for sharing and controls of generating units reactive power and control
algorithms in dynamic simulations, and visualization tools to facilitate analysis of
results;

(5) Using the developed tools and methods, carried out simulations of typical SVR in
the network and found that the results are favourable; and

(6) Documented all the work carried out by the WG-CVC into this report;

Based on the study/research performed, the followings are main findings/conclusions of WG-
CVC:

(1) Currently, secondary voltage controls in the transmission network are being carried
out manually by the control operators based on the given guidelines and control
actions and results could vary from one operator to another depending on their
experience and system information and knowledge and therefore, the applications
of SVR could offer a more consistent voltage control actions;

(2) Currently, voltage and reactive power sources scheduling are not included as part
of operation planning inputs in the day ahead submission to the control operators
and WG-CVC believes that there is a need to provide day ahead reactive power
and voltage schedules as guidelines to the control operators to further enhance
system operations;

(3) In normal operation, generating unit AVR set point is normally used to affect
desired terminal voltage but being achieved through manual generator-transformer
tap control;

3
(4) Analysis of voltage profile across the network revealed a large variation in voltage
magnitude geographically which would result in significant reactive power transfer
incurring additional losses and therefore a flatter voltage profile across the
network through the use of SVR could reduce losses;

(5) Based on the investigations carried out on the applications of SVR in the network,
the WG concluded that its implementation is feasible and it could generate
potential benefits in the areas voltage security and savings in losses;

The followings are main recommendations of the WG-CVC:

(1) To use the tools developed by the WG-CVC to perform detailed investigations of
the applications of SVR and to design the SVR scheme including its implementation
plan;

(2) To initiate a process to include reactive power sources and voltage scheduling in
the day ahead report to the control operators including the necessary control
actions;

(3) To initiate a process in operational planning to improve further the day ahead daily
security assessment based on 24-hour security analysis which would require
research to be conducted in the following areas:
a) Massive computation of contingency analysis, i.e., 48 snapshots of base cases;
and
b) Development of visualization algorithms and tools to interpret and summarise
large number of outputs and results;

(4) It is also recommended that the following technical papers be written by the
members of TNB Research WG on CVC for submissions to suitable international
conferences or journals:

(a) “Overview of Voltage Control Issues and Potential Applications of Secondary


Voltage Regulations”;

(b) “Development of 24-Hour Load Flow Simulations, output Visualisations and


its Applications in Operational Planning”

(c) “Development of 24-Hour Dynamic Simulations, Output Visualisation and its


Potential Applications”;

(d) “Methods for Identifying Voltage Control Areas, Pilot Nodes and
Participating Generators in Secondary Voltage Control Scheme”; and

(e) “Modeling of Secondary Voltage Control Component for 24-Hour Dynamic


Simulations”

4
Table of Contents
PREFACE ..................................................................................................................2
EXECUTIVE SUMMARY.............................................................................................3
TABLE OF CONTENTS...............................................................................................5
LIST OF FIGURES ....................................................................................................9
CHAPTER 1: INTRODUCTION AND POWER SYSTEM VOLTAGE CONTROLS ...........12
BY DANIAL MOHD NOOR, SALLEHHUDIN YUSOF, AND SHEIKH KAMAR SHEIKH
ABDULLAH .............................................................................................................12
1.1 BACKGROUND .....................................................................................................12
1.2 CURRENT VOLTAGE CONTROL PRACTICE AND ISSUES IN TNB...........................................14
1.3 REVIEW OF VOLTAGE CONTROL PERFORMANCE ............................................................16
1.4 COORDINATED VOLTAGE CONTROL – SUMMARY OF LITERATURE SURVEY .............................22
1.5 CONTENTS OF THE REPORT ....................................................................................25
1.6 WORKING GROUP MEMBERS ...................................................................................26
1.7 WORKING GROUP MEETINGS AND WORKSHOP .............................................................27
1.8 REFERENCE ........................................................................................................28
CHAPTER 2: 24-HOUR LOAD FLOW SIMULATION METHODOLOGY .......................29
BY LEONG CHOONG YEOW AND DR. AZNAN EZRAIE ARIFFIN ..............................29
2.1 INTRODUCTION AND OBJECTIVE ...............................................................................29
2.2 LOAD FLOW FOR EXISTING DAILY SYSTEM SECURITY ASSESSMENTS (DSSA)........................30
2.3 PROPOSED 24-HOUR LOAD FLOW SIMULATIONS ...........................................................31
2.4 RESULTS ...........................................................................................................34
CHAPTER 3: 24-HOUR DYNAMIC SIMULATION –..................................................36
BY MOHD NASIR AHMAD AND MOHAMAD ZAID MOHAMAD ALI...........................36
3.1 INTRODUCTION AND OBJECTIVE ...............................................................................36
3.2 HOURLY DYNAMIC EVENTS .....................................................................................37
3.3 SIMULATIONS OF DYNAMIC EVENTS ..........................................................................39
3.3.1 General .......................................................................................................39
3.3.2 Generating Units ..........................................................................................39
3.3.3 Loads ..........................................................................................................42
3.3.4 Capacitors/Reactors......................................................................................43
3.4 DYNAMIC SIMULATION METHODOLOGY ......................................................................43
3.5 RESULTS ...........................................................................................................45
3.5.1 Verification of GREF calculations ....................................................................45
3.5.2 24-Hour Dynamic Simulation .........................................................................45
3.6 REFERENCES ......................................................................................................48
CHAPTER 4: SELECTION OF PILOT NODE ..............................................................49
BY ROFIDAH MOHAMAD AND DR. AZNAN EZRAIE ARIFFIN..................................49
4.1 INTRODUCTION/OBJECTIVE ....................................................................................49
4.2 METHODOLOGY ...................................................................................................50
4.2.1 General .......................................................................................................50

5
4.2.2 Short Circuit Level Method ............................................................................50
4.2.3 Proposed Jacobian Matrix Participation Factor.................................................52
CHAPTER 5: ALLOCATING REACTIVE POWER TO PARTICIPATING GENERATORS
LOAD FLOW METHOD ............................................................................................54
BY DANIAL MOHD NOOR AND NIK SOFIZAN NIK YUSUF......................................54
5.1 INTRODUCTION ...................................................................................................54
5.2 DETERMINING VOLTAGE CONTROL ZONES ..................................................................54
5.3 PILOT NODE SELECTION CONSIDERATION ...................................................................55
5.4 IDENTIFYING INFLUENTIAL GENERATING UNITS ............................................................56
5.5 ALLOCATING REACTIVE POWER AMONG PARTICIPATING GENERATORS GIVEN THE PILOT NODE ...60
5.6 SVR SIMULATIONS USING LOAD FLOW ......................................................................63
5.6.1 Investigating the Impact of SVR Controls on Bus Voltages ...............................63
5.6.2 Comparison of Different Pilot Nodes Selections ..............................................65
CHAPTER 6: SVR SIMULATIONS TOOLS AND RESULTS .........................................67
BY DANIAL MOHD NOOR, MOHD SALLEH SERWAN, MOHD NIZAM AND
SALLEHHUDIN YUSOF ...........................................................................................67
6.0 INTRODUCTION ...................................................................................................67
6.1 DATABASE APPLICATIONS FOR DATA HANDLING AND VISUALIZATION ..................................68
6.2 SVR MODEL IN LOAD FLOW SIMULATIONS ..................................................................76
6.2.1 Coordinated Voltage Control Overview ...........................................................76
6.2.2 CVC Simulation – Load Flow Approach ...........................................................76
6.2.3 Results of CVC Load Flow Simulations ............................................................79
6.3 DYNAMIC MODELING OF SVR .................................................................................81
6.3.1 General .......................................................................................................81
6.3.2 SVR Dynamic Model Implementation in PSS/E.................................................83
6.3.3 SVR Dynamic model response test results ......................................................84
6.4 SVR MODEL SIMULATIONS – LOAD FLOW AND DYNAMICS ...............................................86
6.4.1 Case Study ..................................................................................................86
6.4.2 Load Flow Simulations ..................................................................................87
6.4.3 Dynamic Simulations ....................................................................................92
6.5 SVR MULTI ZONE MODEL SIMULATION RESULTS –LOAD FLOW AND DYNAMICS ....................97
6.5.1 Case Study ..................................................................................................97
6.5.2 Load Flow Simulations ..................................................................................98
6.5.3 Dynamic Simulation .................................................................................... 107
6.5.4 Conclusion of Multi Zone SVR Load Flow and Dynamic Simulation Model and
Method................................................................................................................ 114
CHAPTER 7: CONCLUSIONS AND RECOMMENDATIONS......................................115
BY SALLEHHUDIN YUSOF ....................................................................................115
7.1 SUMMARY OF COMPLETED TASKS ........................................................................... 115
7.2 MAIN FINDINGS AND CONCLUSIONS ........................................................................ 115
7.3 RECOMMENDATIONS ........................................................................................... 116
APPENDIX 1A – LITERATURE SURVEY PRESENTATIONSAPPENDIX 2B –
EXTRACTING AND ASSEMBLING .........................................................................118
APPENDIX 2B – EXTRACTING AND ASSEMBLING ...............................................119
VOLTAGE CHANGE DATA FROM OUTPUT OF QV RUNS ........................................119

6
INPUT DATA FILES: ..................................................................................................... 119
PYTHON PROGRAM: (“SAVEOUT.PY” AND “SAVEOUT2.PY”) ...................................................... 119
APPENDIX 3A – GREF VERIFICATIONS ...............................................................121
RESULTS OF GREF VERIFICATION BY INJECTING 5 MW TO SELECTED MACHINES ............................ 121
IEEEG1................................................................................................................ 121
GAST .................................................................................................................. 122
HYGOV................................................................................................................ 122
IEEESGO ............................................................................................................. 123
GAST2A............................................................................................................... 123
RESULTS OF GREF VERIFICATION BY REDUCING 5 MW TO SELECTED MACHINES ............................ 124
GAST2A............................................................................................................... 124
HYGOV................................................................................................................ 124
IEEESGO ............................................................................................................. 125
APPENDIX 3B - PYTHON CODE FOR GREF VERIFICATION BY INJECTING 5 MW TO
SELECTED MACHINES..........................................................................................126
INPUT FILES: ............................................................................................................. 126
OUTPUT FILES: ........................................................................................................... 126
PYTHON CODE (SINGLE MAC TEST_FINAL.PY): .................................................................... 127
APPENDIX 3C - PYTHON CODE FOR FULL DYNAMIC SIMULATION .....................129
INPUT FILES: ............................................................................................................. 129
OUTPUT FILES: ........................................................................................................... 129
PYTHON CODE (LEARNCVC TNB DATA.PY):........................................................................ 130
APPENDIX 4A – SHORT CIRCUIT LEVELS AND VARIOUS NODES IN THE CENTRAL
AREA....................................................................................................................134
APPENDIX 5A – SINGLE ZONE SVR SIMULATION ...............................................137
INPUT DATA FILE: (“ONEZON.DAT”) ................................................................................. 137
PYTHON PROGRAM: (“ONEZONE.PY”) ............................................................................... 137
APPENDIX 5B – MULTI ZONE SVR SIMULATION.................................................139
INPUT DATA FILE: (“MULTIZON.DAT”)............................................................................... 139
PYTHON PROGRAM: (“MULTIZONE.PY”)............................................................................. 139
APPENDIX 5C – QV SENSITIVITY CALCULATIONS ..............................................142
INPUT DATA FILE: (“GENBUS.DAT”).................................................................................. 142
PYTHON PROGRAM: (“VOLT_SENS.PY”)............................................................................. 142
APPENDIX 6A – GENERATION OF 24 HOUR LOAD FLOW SAVECASES.................144
INPUT DATA FILES: ..................................................................................................... 144
PYTHON PROGRAM: (“24HRLOAD.PY” ) ............................................................................ 144
PYTHON PROGRAM: (“24HRGEN.PY”)............................................................................... 145
APPENDIX 6B – 24 HOUR OPTIMAL POWER FLOW RUNS...................................146
INPUT DATA FILES: ..................................................................................................... 146
PYTHON PROGRAM: (“24HROPT.PY” ) .............................................................................. 146
PYTHON PROGRAM: (“GETPV.PY” ) ................................................................................... 146
PYTHON PROGRAM: (“GETTXRATIO.PY” )........................................................................... 147
PYTHON PROGRAM: (“GETSHUNT.PY” ).............................................................................. 148

7
APPENDIX 6C – 24 HOUR MULTIZONE SVR LOAD FLOW SIMULATION ..............149
INPUT DATA FILES: ..................................................................................................... 149
PYTHON PROGRAM: (“MZ.PY” ) ....................................................................................... 149
APPENDIX 6D – DATA EXTRACTION FROM 24 HOUR LOAD FLOW ROUTINES....152
INPUT DATA FILES: ..................................................................................................... 152
PYTHON PROGRAM: (“PRTKV.PY” )................................................................................... 152
PYTHON PROGRAM: (“GETKV.PY” ) .................................................................................. 152
PYTHON PROGRAM: (“GETPFLOW.PY” ) ............................................................................. 153
PYTHON PROGRAM: (“GETQFLOW.PY” ) ............................................................................ 153
PYTHON PROGRAM: (“GETMVA.PY” ) ............................................................................... 154
PYTHON PROGRAM: (“GETLOSS.PY” ) ................................................................................ 155
APPENDIX 6E - FORTRAN CODE FOR CVC MODEL...............................................156
APPENDIX 6F - PYTHON CODE FOR SIMULATION RUN.......................................159

8
List of Figures

FIGURE 1.1: ILLUSTRATION OF PVR, SVR AND TVR IN POWER NETWORK ........................................13
FIGURE 1.2: 24-HOUR VOLTAGE PROFILE ON SELECTED 275KV BUSES IN THE CENTRAL AREA ON AUGUST, 12,
2009 .....................................................................................................................16
FIGURE 1.3: 24-HOUR VOLTAGE PROFILE ON SELECTED 275KV BUSES IN THE CENTRAL AREA ON AUGUST, 12,
2009 .....................................................................................................................17
FIGURE 1.4: HOURLY TOTAL VAR GENERATION AND VOLTAGE AT KL WEST ......................................17
FIGURE 1.5: HOURLY SHUNT COMPENSATION VERSUS DEMAND (MW) ............................................18
FIGURE 1.6: BFLD AND PTAI TRANSFORMER REACTIVE FLOWS VERSUS VOLTAGES ............................19
FIGURE 1.7: BDNG AND KSTR TRANSFORMER REACTIVE FLOWS VERSUS VOLTAGES...........................20
FIGURE 1.8: REACTIVE POWER GENERATION FROM TJGS POWER STATION AND VOLTAGE AT OLPT........21
FIGURE 1.9: HIERARCHY OF COORDINATED VOLTAGE CONTROLS ....................................................24
FIGURE 1.10: PRINCIPLE OF SECONDARY VOLTAGE CONTROLS .......................................................24
FIGURE 2.1: SAMPLE UHR FILE ............................................................................................31
FIGURE 2.2: FLOWCHART FOR PREPARATION OF 24-HOUR LOAD FLOW FILES AND PLOTTING OF NODE
VOLTAGE .................................................................................................................33
FIGURE 2.3: 24 HOUR ACTIVE (P) AND REACTIVE Q LOAD FROM LOAD FLOW...................................34
FIGURE 2.4: 24 HOUR PILOT NODE VOLTAGE VARIATION .............................................................35
FIGURE 3.1: DYNAMIC COMPONENTS OF THE SVR .....................................................................36
FIGURE 3.2: LOAD PROFILE ESTIMATION FOR DYNAMIC CALCULATIONS .............................................37
FIGURE 3.3: TYPICAL HOURLY GENERATION DISPATCH PROFILE ......................................................38
FIGURE 3.4: TYPICAL HOURLY SWITCHING OF A CAPACITOR BANK ...................................................38
FIGURE 3.5: SIMPLE TURBINE-GOVERNOR MODEL ......................................................................39
FIGURE 3.6: TURBINE-GOVERNOR RESPONSE TO CHANGE IN PREF ...................................................40
FIGURE 3.7: SETTING TERMINAL VOLTAGE BY CHANGING VREF .......................................................41
FIGURE 3.8: EXCITATION RESPONSE FOLLOWING A CHANGE IN REFERENCE VOLTAGE, VREF .....................41
FIGURE 3.9: IMPACTS OF LOAD CHANGE AT A BUS. .....................................................................42
FIGURE 3.10: FLOWCHART OF DYNAMIC SIMULATION FOR SECONDARY VOLTAGE CONTROL .....................44
FIGURE 3.11: MW GENERATION IN HALF-HOURLY INTERVAL IN TNB SYSTEM FROM THE 24-HOUR DYNAMIC
SIMULATION .............................................................................................................46
FIGURE 3.12: LOAD DEMAND IN HALF-HOURLY INTERVAL IN TNB SYSTEM FROM THE 24-HOUR DYNAMIC
SIMULATION .............................................................................................................46
FIGURE 3.13: DIFFERENCES BETWEEN GENERATING MW AND LOAD DEMAND IN TNB SYSTEM FOR THE 24-
HOUR PERIOD............................................................................................................47
FIGURE 3.14: VOLTAGE PROFILE AT A BUS BASED ON THE 24-HOUR DYNAMIC SIMULATION....................47
FIGURE 4.1: VOLTAGE VARIATION OF THE 275KV PILOT NODE CANDIDATES ......................................51
FIGURE 4.1: VOLTAGE VARIATION OF THE 132KV PILOT NODE CANDIDATES ......................................52
FIGURE 5.1: HOURLY VOLTAGE PROFILE OF SOME REGIONAL BUSBARS (ACTUAL MEASUREMENTS).............55
FIGURE 5.2 ΔV/ΔQ SENSITIVITY MATRIX ................................................................................56
FIGURE 5.3: SORTED ΔV/ΔQ SENSITIVITIES FOR THE CANDIDATE PILOT NODES .................................57
FIGURE 5.4: SORTED ΔV/ΔQ SENSITIVITIES FOR PRGS 132KV BUS ..............................................58
FIGURE 5.5: PARTICIPATING CONTROLLING GENERATORS WITH ΔV/ΔQ SENSITIVITY SET AT 0.05% ......58
FIGURE 5.7: GRAPHIC ILLUSTRATION OF THE SVR LOAD FLOW SIMULATION METHOD ...........................60
FIGURE 5.8: FLOWCHART FOR PERFORMING SVR USING LOAD FLOW SIMULATION ...............................62
FIGURE 5.9 VOLTAGE PROFILE OF CENTRAL AREA SVR ZONE 275 KV BUSES ....................................64
FIGURE 5.10 VAR GENERATION FROM PARTICIPATING GENERATORS ...............................................64
FIGURE 5.11 VOLTAGE PROFILE OF CENTRAL AREA WITH DIFFERENT PILOT NODES ............................65
FIGURE 5.12: VAR GENERATION WITH DIFFERENT PILOT NODES..................................................66
FIGURE 6.1: SIMULATION PROCESS OVERVIEW WITH DATABASE .....................................................68
9
FIGURE 6.2: EXAMPLE OF GENERATION DISPATCH INPUTS WITH PAKA GT2A HIGHLIGHTED ..................69
FIGURE 6.3: EXAMPLE OF SUBSTATION LOAD INPUTS WITH T1 KULN HIGHLIGHTED ............................69
FIGURE 6.4: TOTAL SYSTEM GENERATION AND LOAD .................................................................70
FIGURE 6.5: GENERATION MAPPING TABLE..............................................................................70
FIGURE 6.6(A): LOAD MAPPING TABLE ...................................................................................71
FIGURE 6.6(B): SVR SETTING TABLES ...................................................................................71
FIGURE 6.7: EXAMPLE OF VOLTAGE (OLPT275) AND TOTAL MW GENERATION .................................72
FIGURE 6.8: EXAMPLE OF VOLTAGE (OLPT275) AND TOTAL MVAR GENERATION ...............................72
FIGURE 6.9: EXAMPLE OF VOLTAGE AND MW LOAD (KULN132)...................................................73
FIGURE 6-10: EXAMPLE OF VOLTAGE AND MVAR LOAD (KULN132)...............................................73
FIGURE 6-11: EXAMPLE OF BUS MW GENERATION AND SCHEDULED VOLTAGE (KNYR_U2)..................74
FIGURE 6.12: EXAMPLE OF BUS MVAR GENERATION AND SCHEDULED VOLTAGE (KNYR_U2)................74
FIGURE 6-13: TOTAL MW GENERATION VS TOTAL LOSS (%).......................................................75
FIGURE 6-14: TOTAL MVAR GENERATION VS TOTAL LOSS (%) ....................................................75
FIGURE 6.15: FUNCTIONAL OVERVIEW OF THE CVC...................................................................76
FIGURE 6.16: OVERVIEW OF THE CVC SIMULATION USING LOAD FLOW METHOD ...............................77
FIGURE 6.17: COMPARISON OF BUS VOLTAGE 24 HOURS MAX-MIN VARIATION .................................79
FIGURE 6.18: COMPARISON IN USE OF REACTIVE COMPENSATION..................................................79
FIGURE 6.19: COMPARISON OF REACTIVE POWER GENERATION BETWEEN CVC AND ACTUAL .................80
FIGURE 6.20: DIFFERENCE IN SYSTEM LOSSES BETWEEN REFERENCE CASE AND SVR ..........................80
FIGURE 6.21: COMPONENTS OF SVR FOR DYNAMIC MODELING ......................................................81
FIGURE 6.22: PILOT BUS SVR VOLTAGE CONTROLLER .................................................................82
FIGURE 6.23: GENERATING UNIT AVR INPUT CONTROLLER WITH SVR ............................................82
FIGURE 6.24: IMPROVED EULER METHOD IS EMPLOYED FOR NUMERICAL INTEGRATION .........................83
FIGURE 6.25: CVC PILOT BUS RESPONSE ...............................................................................84
FIGURE 6.26: CVC GENERATOR RESPONSE .............................................................................84
FIGURE 6.27: CVC PILOT BUS VOLTAGE RESPONSE WITH MULTIPLE VOLTAGE TARGETS .......................85
FIGURE 6.28: CVC GENERATOR MVAR RESPONSE WITH MULTIPLE VOLTAGE TARGETS..........................85
FIGURE 6.29: ASSIGNMENT OF PILOT BUS TO GENERATORS IN LOAD FLOW ......................................87
FIGURE 6.30: COMPARISON OF BUS VOLTAGE AT OLPT275 WITH DIFFERENT REGULATIONS .................87
FIGURE 6.31: COMPARISON OF TOTAL JMAH MVAR GENERATION AT DIFFERENT REGULATIONS ............88
FIGURE 6.32: VOLTAGE AT PILOT BUS WITH CONSTANT SCHEDULED VOLTAGE ..................................88
FIGURE 6.33: VOLTAGE AT PILOT BUS WITH OPTIMAL SCHEDULED VOLTAGE ....................................89
FIGURE 6.34: TOTAL AMOUNT OF SWITCHED SHUNT (MVAR) IN THE SYSTEM ..................................89
FIGURE 6.35: COMPARISON OF SYSTEM LOSS FOR WITH AND WITHOUT SVR ...................................90
FIGURE 6.36: REDUCTION OF SYSTEM LOSS WITH SVR ..............................................................91
FIGURE 6.37: OVERALL PROCEDURE FOR SIMULATING SVR LOAD FLOW AND DYNAMICS IN PSS/E ...........92
FIGURE 6.38: PART OF PYTHON CODE FOR CVC MODEL .............................................................93
FIGURE 6.39: COMPARISON OF BUS VOLTAGE AT OLPT275 WITH DIFFERENT VOLTAGE REGULATIONS .....94
FIGURE 6.40: COMPARISON OF MVAR GENERATION BY JMAH AT DIFFERENT REGULATIONS .................94
FIGURE 6.41: VOLTAGE AT PILOT BUS WITH CONSTANT SCHEDULED VOLTAGE ..................................95
FIGURE 6.42: VOLTAGE AT PILOT BUS WITH OPTIMAL SCHEDULED VOLTAGE ....................................95
FIGURE 6.43: COMPARISON OF SYSTEM LOSS FOR WITH AND WITHOUT SVR ...................................96
FIGURE 6.44: RESULTS OF CONSTANT SCHEDULED VOLTAGE ........................................................98
FIGURE 6.45: RESULTS OF TWO STEP CONSTANT SCHEDULED VOLTAGE ..........................................99
FIGURE 6.46: RESULTS OF GRADUALLY REDUCED SCHEDULED VOLTAGE ..........................................99
FIGURE 6.47: RESULTS OF OPTIMAL SCHEDULED VOLTAGE ........................................................ 100
FIGURE 6.48: RESULTS COMPARISON FOR PILOT NODE PAKA275............................................... 100
FIGURE 6.49: RESULTS COMPARISON FOR PILOT NODE PRGS275............................................... 101
FIGURE 6.50: RESULTS COMPARISON FOR PILOT NODE OLPT275............................................... 101
FIGURE 6.51: RESULTS COMPARISON FOR PILOT NODE BBTU275 .............................................. 102
10
FIGURE 6.52: COMPARISON FOR TOTAL MVAR GENERATION BY PARTICIPATING GENERATORS FOR PILOT
NODE PAKA275 ..................................................................................................... 102
FIGURE 6.53: COMPARISON FOR TOTAL MVAR GENERATION BY PARTICIPATING GENERATORS FOR PILOT
NODE PRGS275 ..................................................................................................... 103
FIGURE 6.54: COMPARISON FOR TOTAL MVAR GENERATION BY PARTICIPATING GENERATORS FOR PILOT
NODE LPT275........................................................................................................ 103
FIGURE 6.55: COMPARISON FOR TOTAL MVAR GENERATION BY PARTICIPATING GENERATORS FOR PILOT
NODE BBTU275 ..................................................................................................... 104
FIGURE 6.56: COMPARISON FOR TOTAL SWITCHED SHUNT WITH AND WITHOUT SVR ........................ 104
FIGURE 6.57: TOTAL SWITCHED SHUNT REDUCTION WITH OPTIMAL REGULATION ............................ 105
FIGURE 6.58: COMPARISON FOR TOTAL SYSTEM LOSS WITH AND WITHOUT SVR.............................. 105
FIGURE 6.59: TOTAL SYSTEM LOSS REDUCTION WITH SVR ....................................................... 106
FIGURE 6.60: DYNAMIC SIMULATION RESULTS SHOWING PILOT NODES VOLTAGES FOR CONSTANT SCHEDULED
VOLTAGE ............................................................................................................... 107
FIGURE 6.61: DYNAMIC SIMULATION RESULTS SHOWING PILOT NODES VOLTAGES FOR TWO STEP CONSTANT
SCHEDULED VOLTAGE ................................................................................................ 108
FIGURE 6.62: DYNAMIC SIMULATION RESULTS SHOWING PILOT NODES VOLTAGES FOR GRADUALLY REDUCED
SCHEDULED VOLTAGE................................................................................................ 108
FIGURE 6.63: DYNAMIC SIMULATION RESULTS SHOWING PILOT NODES VOLTAGES FOR OPTIMAL SCHEDULED
VOLTAGE ............................................................................................................... 109
FIGURE 6.64: DYNAMIC SIMULATION RESULTS FOR VARIOUS SCHEDULED VOLTAGES FOR PILOT NODE
PAKA275 ............................................................................................................. 109
FIGURE 6.65: DYNAMIC SIMULATION RESULTS FOR VARIOUS SCHEDULED VOLTAGES FOR PILOT NODE
PRGS275 ............................................................................................................. 110
FIGURE 6.66: DYNAMIC SIMULATION RESULTS FOR VARIOUS SCHEDULED VOLTAGES FOR PILOT NODE
OLPT275 ............................................................................................................. 110
FIGURE 6.67: DYNAMIC SIMULATION RESULTS FOR VARIOUS SCHEDULED VOLTAGES FOR PILOT NODE
BBTU275 ............................................................................................................. 111
FIGURE 6.68: COMPARISON FOR TOTAL MVAR GENERATION BY PGAU U1 FOR PILOT NODE PAKA275 . 112
FIGURE 6.69: COMPARISON FOR TOTAL MVAR GENERATION BY JMJG U2 FOR PILOT NODE PRGS275 . 112
FIGURE 6.70: COMPARISON FOR TOTAL MVAR GENERATION BY JMAH U2 FOR PILOT NODE OLPT275 . 113
FIGURE 6.71: COMPARISON FOR TOTAL MVAR GENERATION BY TBIN U1 FOR PILOT NODE BBTU275.. 113
FIGURE 6.72: COMPARISON OF SYSTEM LOSS FOR WITH AND WITHOUT SVR .................................. 114

11
Chapter 1: Introduction and Power System
Voltage Controls
By Danial Mohd Noor, Sallehhudin Yusof, and Sheikh Kamar Sheikh Abdullah

1.1 Background
1.1.1 In power system operation, the main objective with respect to steady-state voltage
is to ensure its constancy at all buses and to maintain voltage magnitude to the
same level across the network. In relation to voltage security, the objective is to
ensure that there are sufficient dynamic reactive reserves available to enable
voltages at load buses to recover quickly following disturbances. These objectives
can only be achieved if operation engineers have information on voltage profiles
and its expected behaviour over the operation period and the voltages can be
controlled effectively to within the pre-defined limits.

1.1.2 Voltage controls hierarchy can be divided into three levels [1], namely:
1. Primary – Primary Voltage Regulation or PVR;
2. Secondary – Secondary Voltage Regulation of SVR; and
3. Tertiary – Tertiary Voltage Regulation or TVR

1.1.3 A primary voltage control is carried out automatically by equipment based on local
or remote measurement that can be affected within a short period of time (100ms
to several seconds). Referring to generating units G1 and G2 in Figure 1.1, each
has its terminal voltage being measured (i.e., local) and compared with a locally
set reference voltage. Any deviation between reference (VREF) and terminal (VT)
voltages would cause the AVR, i.e., the PVR to change the field voltage accordingly.
On Load Transformer Tap Changer when placed on AVR control is also classified as
PVR but may take between 20 to 40 seconds to operate as compared to
generating unit AVR in less than 1 second. Similarly, switch capacitors on AVR
control are also PVR sources.

1.1.4 Secondary voltage regulation (SVR) is intended to effectively control voltage in an


area or zone by adjusting reactive power outputs of several reactive power
resources in the area. SVR monitors a voltage at a pilot bus (see Figure 1.1) and
depending on the control algorithms, it will adjust reactive power outputs of
selected generating units in the zone. In the case illustrated in Figure 1.1, signals
from the SVR will also supplement the reference signal VREF thus providing another
control to the same AVR and reactive power resources. Normally, SVR is applied
after some time delay, i.e., in tens of seconds. SVR can also be designed to control
other than generators including transformer tap-changers as well as switched
capacitors.

12
SCADA
Other area
TVR

VOPF

SVR
VREF
PVR
VREF VPILOT VT
EFD
Pilot
PVR G2
Bus
VT
EFD
Tx1
G1
PVR From SVR

PVR From SVR


From SVR PVR
Tx2
Figure 1.1: Illustration of PVR, SVR and TVR in power network

1.1.5 Tertiary voltage regulation (TVR) is intended for economic operations in which
voltage set points are calculated to minimize objective function like losses or
reactive power generation. The new set point voltages are then conveyed to the
various PVR or SVR in the system. Normally TVR is affected in terms of tens of
minutes. As illustrated in Figure 1.1, TVR provides set point voltages to SVR which
will be used as the reference voltage for individual generating unit AVR.

1.1.6 In this research work, our focus is SVR and the main objectives are:
(1) To understand the fundamental of coordinated voltage control;
(2) To develop simulation methodologies and algorithms suitable for modeling
of SVR; and
(3) To use the developed methodology and tools in 2) to investigate the
possible applications of SVR in TNB’s Transmission Network

1.1.7 As the network expands, more equipment are required to be coordinated and
controlled and with respect to reactive power and voltage control resources, the
operator at TNB’s NLDC currently has access to the following equipment:
a) 129 generating units;
b) 61 shunt capacitor banks;
c) 67 shunt reactors;
d) 2 static VAR compensators (SVCs) and
e) More than 250 transformers with on-line tap-changers
While all generating units and SVC are set on automatic primary voltage control,
shunt capacitors and transformer tap-changers remain on manual controls. The
current challenge is for the operator to coordinate the controls of the devices
manually using some guidelines that will be discussed in section 1.2.

13
1.1.8 Based on experience of many utilities around the world [1], voltage control when
coordinated brings about the following benefits:
a) Flatter and better regulated voltage profile within the region and across the
Grid System;
b) More effective use of reactive resources from generation and shunt
compensation;
c) Reduced system losses; and
d) Better voltage security margin

1.2 Current Voltage Control Practice and Issues in


TNB
1.2.1 Performing voltage regulation is one of the main tasks of power system operation.
Voltage control or regulation is mandatory for the following reasons:
(1) To meet the voltage limit requirements as specified in the Malaysian Grid
Code and transmission license conditions, and to comply with performance
standards as guaranteed in the TNB Transmission Security and Reliability
Standards (TSRS);
(2) To maintain the security of the Grid System under normal and contingency
conditions. With respect to voltage, adequate reactive power reserves must
be provided, voltages are to be kept within the operational ranges,
continuous voltage regulation to be effected throughout the grid system and
maintenance of sufficient voltage stability margin; and
(3) To pursue economic operation of the Grid System through minimisation of
productions costs and system losses.

1.2.2 Voltage regulation or control can be a very challenging problem due to its dynamic
nature. There is constant changes in demand, generation dispatch and network
configuration. The different timescales of control time constants are wide ranging,
from milliseconds to hours. The presence of various voltage control devices,
characteristics and locations adds to the complexities. Unlike frequency regulation
where the impact is global or system wide, voltage regulation has a very local
impact. Therefore, control actions and balancing of reactive power resources are
generally regionalised or zoned. In essence, voltage regulation requires temporal
and geographical coordination, for it to be effective.

1.2.3 In the TNB system, system voltage control is largely carried out manually by the
System Operators. Currently there is no daily 24-hour reactive control or dispatch
plan or schedule for the operators like the generating units MW schedule.

1.2.4 The transmission grid system is divided principally into four voltage control regions,
namely North, Central, South, and East. Additional separate attention is also given
to the 500 kV bus voltages. System Operator switches in or out reactive
compensation based observed regional voltages. The transmission voltages are
maintained to within the operational range of 1.0 to 1.05 per unit during steady
state and 0.95 to 1.10 per unit during emergencies.

14
1.2.5 500/275kV and 275/132 kV auto-transformers tap changers are sparingly adjusted
to ensure reactive power flows from high voltage side to the low voltage side and
that reactive flows are kept minimum. Also taps controls are applied when voltages
are observed at the extreme of the declared ranges.

1.2.6 Generators are operated to continuously maintain their terminal voltages via
automatic voltage regulators (AVR). When necessary, generator transformer online
taps are adjusted to achieve the desired high-side bus voltages.

1.2.7 Similarly, set-points of Static VAr Compensators are manually adjusted to ensure
275kV voltages are kept at 285kV or 1.03 per unit. Bias or voltage droops (percent
voltage change for 100 percent change in reactive capacity) are kept between 1%
and 2%. Generally, SVC droops at KL North is set at 1% (high fault level or ‘strong’
bus) and 2% at Yong Peng.

1.2.8 Based on the operating practices and experiences, the followings are the main
voltage control issues identified:
(1) Wide voltage variation within each region and the system (not
geographically “flat” profile);
(2) Circulating reactive power flows;
(3) Uncoordinated use of reactive resources (Var generation, transformer taps,
capacitors and reactors);
(4) Not optimal voltage targets at generation buses and SVCs;
(5) Larger system losses; and
(6) Unjustified/unnecessary dispatch of generators to provide voltage support.

15
1.3 Review of Voltage Control Performance
1.3.1 A 24-hour actual system data including busbar voltages, reactive generation, shunt
capacitors and reactors on August 12, 2009 (Maximum Demand day for FY08/09)
were compiled and some issues identified in 1.2.8 can be further elaborated.

1.3.2 An assessment of the existing voltage control performance of the Central Region
was performed based on the hourly system data recorded on 12th August 2009
(Maximum Demand day for FY08/09). Busbar voltages, reactive power generation
and transformer power flow measurements were collected and analysed.

1.3.3 Figure 1.2 shows the recorded 275kV bus voltages and the total demand in the
Central region. It can be seen that the difference between voltages at one location
and another during peak hours can be as large as 18kV or 6.5%. The voltages
generally share the same hourly pattern with buses closer to generating plant or
the 500kV sources like CBPS, PKLG, KLPP and BTRK showing less hourly variation
as compared to ‘pure’ load buses like KULW, VCTY and BFLD.

1.3.4 Figure 1.3 shows the 132kV hourly voltages profile within the Central region. It can
be observed that voltage profile within the region is not very flat with the largest
variation occurring during peak demand hours and can be as large as 8 kV or 6%..

Figure 1.2: 24-hour voltage profile on selected 275kV buses in the


Central Area on August, 12, 2009

16
Figure 1.3: 24-hour voltage profile on selected 275kV buses in the
Central Area on August, 12, 2009

1.3.5 Figure 1.4 shows the of total reactive power or VAr generation from generators
within the Central Area against the 275kV busbar voltage recorded at KL West.
Close observation reveals that there is an opposing interaction between the VAr
generation amount and the voltage magnitudes i.e. when voltages are lower VAr
generation is higher and vice versa. This is a clear indication that the generators
are performing voltage regulation accordingly.

Figure 1.4: Hourly total VAR generation and voltage at KL West

17
1.3.6 Figure 1.5 compares the total reactive power from shunt capacitors within Central
region and the load demand in MW. The shunt capacitors are switched in and out
manually by the System Operators according to the monitored voltages. Ideally,
shunt capacitors are switched in and out in anticipation of the respective voltage
decrease or increase (due to increasing or reducing load demand).

Figure 1.5: Hourly Shunt Compensation versus Demand (MW)

1.3.7 In TNB, for large transformers, taps are generally put on manual control of the
System Operators. Assessment of how well the taps are controlled and coordinated
is done by comparing the reactive power flows through the transformers that are
supplying a common 132 kV load area. From figure 1.6, it can be seen that the
reactive power flows of transformers at BFLD and PTAI are very similar in hourly
pattern and magnitude which suggest the taps are well coordinated. However, the
recorded high and low side voltages indicate that the transformer taps were not
effectively used to regulate or maintain the low side voltage. In fact the taps
appeared to be fixed.

18
Figure 1.6: BFLD and PTAI Transformer Reactive Flows versus Voltages

1.3.8 Figure 1.7 clearly indicates that the reactive power flow recorded on BDNG
transformers were actually opposing that recorded at KSTR. This suggests that
there was a circulating reactive power flow i.e. reactive power flowing down KSTR
transformers and then up through BDNG transformers. This implies that the
transformer taps were not coordinated and the circulating reactive flow was
creating a voltage difference between KSTR and BDNG. This is reflected in the
voltage plots. The voltage difference was larger when the reactive flow was higher
during off-peak hours and smaller during peak hours when the flow was smaller.

19
Figure 1.7: BDNG and KSTR Transformer Reactive Flows versus Voltages

1.3.9 Figure 1.8 shows the variation of reactive power outputs of generating units at
Tuanku Jaafar Power Station as compared with the high side 275kV voltage. From
the figure it can be seen that in general the reactive power generation responded
well (opposing) to the voltage variations on the high side bus. However, the
amount of reactive generation differs among the generating units. This is probably
due to the uncoordinated taps of the generator step-up transformers.

20
Figure 1.8: Reactive Power Generation from TJGS Power Station and
Voltage at OLPT

1.3.10 Based on foregoing, it is clear that some type of a more systematic and possibly
automatic secondary voltage controls are required to mitigate some of the
identified issues.

21
1.4 Coordinated Voltage Control – Summary of
Literature Survey
1.4.1 Primary reference for this research work is CIGRE publication No. 310 –
“Coordinated Voltage Control In Transmission Networks”, February 2007 [1]. This
document among others describes worldwide practices in coordinated voltage
controls. Other technical resources referred to are:
(1) EPRI Web Seminar on Automatic Voltage Control System with its
implementation in China; and
(2) Reactive Power Control Workshop by CESI / ZET
The following technical papers were also reviewed:
a) S. Corsi, M. Pozzi, et. all “The Coordinated Automatic Voltage Control of the
Italian Transmission Grid, Part 1 & 2: Reasons Of The Choice And Overview
Of the Consolidated Hierarchical System”, IEEE Transactions on Power
Systems, November 2004, Vol.19 No.4.
b) J.P Piret, et all “The Study Of A Centralised Voltage Control Method
Applicable To The Belgian System”, CIGRE 1992 Session Report 39-201.
c) Gomez C.B., Martins N, et. All “Fast Simulations of Long Term Coordinated
Voltage Control”, IEEE Transactions on Power Systems, 2001.
d) Sandro Corsi, “The Secondary Voltage Regulation in Italy” IEEE/PES
Summer Meeting, July 2000.

1.4.2 Review of the literature revealed that, there are a number of transmission voltage
control practices worldwide ranging from the popular European styled coordinated
voltage control (CVC) to the Japanese high side voltage control (HSVC) and power
system voltage regulation (PSVR) systems. Generally, the voltage control system is
hierarchical in structure, each addressing a different aspect of the control problem.
Often the control is regionalized or divided into a number of zones.

1.4.3 The voltage control hierarchy can be summarized to comprise of the following
levels with major attributes:
a) Primary Control:
• Automatic actions based on local measurements
• Generator & Transformer LTC AVR, SVC
• 100 ms to seconds
b) Secondary Control
• Manual or automatic centralized coordination of voltage control devices
within a control area/zone
• Minimize interaction among primary controllers by adjustments of control
set-points
• to a few minutes
c) Tertiary Control
• Performs overall economic and security optimization at highest/national
level
• Based on real-time measurements adjusts the set-points (pilot nodes) of
Secondary Control
• Slow manual/automatic control, > 10 minutes

22
1.4.4 Based on the literature review and understanding of the local voltage control
practices, the European voltage control model as practiced in Belgium, Italy,
France, Brazil and China (slightly modified form) seems to be the model that worth
exploring further for possible applications in TNB’s network. This form of control
introduced in early 1990s, began as a secondary voltage control or regulation
system and later adding a tertiary control loop to feature security and optimization
in the system.

1.4.5 The concept of secondary voltage control was introduced based on the fact that
voltage control of all buses is too complex, unreliable, impractical and uneconomic.
Therefore, generator reactive power is the main and economic resource for
dynamic voltage support. Practical voltage control should be simple and considers
only a few dominant buses (pilot nodes) thus allowing for a sub-optimal but
feasible and reliable control solution. In this case, control is divided into a few
regulated areas which independently regulates a pilot node voltage. Typically, the
largest generator within the area applies the most influence on the pilot node
voltage.

1.4.6 Tertiary Voltage Regulation (TVR) has main objective of improving operational
security and economics by timely update of SVR pilot node voltages with due
consideration to Grid operating conditions and avoiding conflicting control actions.
TVR provides the real-time computation and update of pilot node voltage set-
points. With TVR inputs, pilot node voltages can be optimized to reduce
transmission losses while preserving security margins.

1.4.7 Figure 1.9 illustrates the hierarchical coordinated voltage control. Referring to
control of the generating unit, the lowest level is the ‘unit control’ where unit
measurements (e.g. terminal voltage, current, speed, frequency etc.) are carried
out and used as inputs to the ‘unit controller’. The ‘unit controller’ has its
references (e.g. VREF, GREF, GLOAD etc..) being determined by the ‘plant controller’
that sits on the next level of the control hierarchy. The ‘plant controller’ may
decide the reference levels based on tele-measurements of plant-wide parameters.
It is also possible for the ‘plant controller’ to receive references from the ‘system
control’ based on the optimization calculations. Optimization calculations are
carried out in real time based on the state of the system as provided by the State
Estimator. Note that in Figure 1.10, the CVC control is located at the system
control where it receives tele-measurement information from the pilot bus and
then provides the necessary generating unit controls through system and plant
controls.

1.4.8 Figure 1.10 shows the principle behind the CVC. The pilot bus voltage (VPP)
magnitude is measured and through a PI-controller it is compared with the set
voltage (VSET) and used to calculate the new reference reactive power output
control (QREF). Current reactive power output of individual generating unit (QG) is
compared with QREF in order to determine alteration on the reference voltage
(VREF) of the AVR that finally affects the field voltage.

23
System
Optimisation

System Control
State Estimator
References

System
Pilot Bus
Control Grid System
Tele-measurements
SCADA
Power Plant Tele-measurements
Power System Control References
Power Plant
Control Hierarchy Tele-measurements
Power Plant
Control

Unit Control Pilot Bus


G
Reference, e.g.
VREF EFD
G

Unit Control
G
Unit
Measurements Power System

Figure 1.9: Hierarchy of coordinated voltage controls

VSET
Voltage
Set Point

PI- Controller
VPP
Pilot bus Voltage
QREF Measurement
Reactive Power
Reference

Reactive Power
Control Loop

ªVREF QG Pilot Bus


Unit Measured
Variation in
Reactive Power
Ref. Voltage
VT
VREF
AVR G

IFD
Exciter

Figure 1.10: Principle of secondary voltage controls

24
1.5 Contents of the Report
1.5.1 This document is divided into 7 Chapters. Contents of each chapter are
summarized in the following paragraphs.

1.5.2 Chapter 1 establishes the background of the research project, and reviews the
following aspects:
(1) Current voltage control practices – examines voltage control practices and
some associated issues;
(2) Review of the system voltage performance – analyses 24-hour variations of
transmission voltage and identifies issues w.r.t. voltage controls.
(3) Summary of literature survey carried out and a review of SVR

1.5.3 Chapter 2 discusses current procedure with respect to Daily System Security
Assessments (DSSA) and its load flow model preparation, development of 24-hour
load flow procedure and some results of the load flow simulations.

1.5.4 Chapter 3 describes the method of performing 24-hour dynamic simulations. The
important dynamic events such as generator dispatch, voltage scheduling, load
changes, and capacitor switchings are identified and their dynamic simulation
models are developed. Results of the 24-hour dynamic simulations are also
presented.

1.5.5 Chapter 4 focuses on the approach for selecting the pilot node in the SVR scheme
and in this project, the short-circuit level approach is used. A method based on
load flow Jacobian has also been proposed but not yet implemented.

1.5.6 Chapter 5 describes several elements of SVR implementation prior to allocating


reactive power among the participating generating units. These elements include
determination of voltage control zones, additional considerations with respect to
pilot node selection, and identifications of influential generating units. The chapter
includes analysis of several load flow simulation results.

1.5.7 Chapter 6 consolidates the development of tools simulating the SVR – both load
flow and dynamics. The developed tools comprise of database and visualization
components.

1.5.8 Chapter 7 concludes the work of the WG on CVC and put forward several
recommendations for next course of actions.

1.5.9 The document comprises also of several appendices arranged according to the
chapters.

25
1.6 Working Group Members
1.6.1 TNB Research Working Group on Coordinated Voltage Controls comprises of the
following members (see Table 1.1):

Table 1.1: Members of the CVC Working Group


1 Sheikh Kamar Bin Sheikh TNB Research, Head of the Working
Abdullah Group
2 Danial Bin Md Noor TNB Transmission Engineering
3 Nik Sofizan Bin Nik Yusuf TNB Transmission Engineering
4 Dr. Aznan Ezraie Bin Ariffin TNB Transmission Operational Planning
5 Rofidah Binti Mohamad TNB Transmission Operational Planning
6 Leong Choong Yeow TNB Transmission Operational Planning
7 Mohammad Faizal Bin Yahaya TNB Transmission Operational Planning
8 Mohd Nasir Bin Ahmad TNB System Planning
9 Mia America Binti Mustadza TNB System Planning
10 Suhanee Sutree Chit A/L Sop Chit TNB System Planning
11 Mohamad Zaid Bin Mohamad Ali TNB System Planning
12 Maszatul Akmar Bin Mustafa TNB System Planning
13 Wong Yow Kee TNB System Planning
12 Mohd Salleh Serwan APS
13 Mohd Nizam APS

The working group mentor is Dr. Sallehhudin Yusof of APS, Malaysia.

26
1.7 Working Group Meetings and Workshop
1.7.1 Table 1.2 summarises the activities of the CVC Working Group during the research
period.

Table 1.2: Summary of CVC Working Group activities and topics of


discussions
No Date Location Activities/Item Discussed
th
1 15 Oct 2009 NLDC Project kick-off meeting
2 9th Nov 2009 NLDC Discussion on project plan and milestone
3 9th Dec 2009 NLDC Presentation and discussion on the existing voltage
control performance in TNB grid system
Presentation and discussion on chapter 1 – 4 of
CIGRE Task Force report
4 16th Dec 2009 NLDC Presentation and discussion on chapter 4 – 6 of
CIGRE Task Force report
5 23rd Dec 2009 NLDC Presentation and discussion on chapter 7 – 8 of
CIGRE Task Force report
Discussion on voltage control preliminary study to be
carried out: voltage control zone and pilot node,
generator voltage control.
6 22nd Jan 2010 NLDC Sharing and discussion on the progress/results of
preliminary study: voltage control zone and pilot
node, generator voltage control based voltage
sensitivity analysis
7 11th Feb 2010 NLDC Sharing and discussion on preliminary studies
conducted and seek feedback from project technical
advisor [Dr. Sallehuddin]
5th Mac 2010 APS Discussion and hand-on session on modeling and
simulation approach for the SVR, CIGRE load flow
procedures [as per chapter 7], understanding short-
circuit analysis with respect to voltage change and
calculating Jacobian to get sensitivity of dV w.r.t. dQ,
etc.
8 25th Mac 2010 APS Update of previous assignments: user models, files of
24-loads, generator dispatch and voltage setting, pilot
nodes study based on short-circuit and Jacobian
Discussion on 24-hour load flow and dynamic
simulation of load variation, generation dispatch and
voltage setting, fundamental of python programming
for PSS/E dynamic and extended term, etc.
8 1st April 2010 NLDC Discussion on project status: pilot node simulation
and selection, SVR control model development and
24-hour load flow simulation, python coding-
decoding, etc.
8th April 2010 APS Discussion and hand-on session: pilot node selection
[based on load flow simulation], 24-hour load flow
and dynamic simulation
21st May 2010 APS Discussion on 24-hour load and dynamic simulation,
allocating reactive power to participating generators,
etc.

27
No Date Location Activities/Item Discussed
th
9 17 Jun 2010 NLDC Discussion on project status: SVR control model and
load flow simulation
29th Jun 2010 APS Discussion on 24-hour load flow dynamic modeling
and simulation, CVC control model and integration of
24-hour dynamic model and CVC control model for full
CVC simulation
2nd Aug 2010 APS Discussion on CVC technical report and results of 24-
hour dynamic simulation with CVC control model

1.8 Reference
[1] CIGRE Report 310 “Coordinated Voltage Controls in Transmission Network”,
February 2007.

28
Chapter 2: 24-Hour Load Flow Simulation
Methodology
By Leong Choong Yeow and Dr. Aznan Ezraie Ariffin

2.1 Introduction and Objective


2.1.1 Since voltage controls – both primary and secondary – are real time control
operation activities, it is pertinent that any proposed voltage control method
should be examined on a 24-hour basis so that its effectiveness could be
determined over the whole day as and when such controls are applied.

2.1.2 In typical planning and operation applications, load flow simulations are carried out
for some selected snapshots of a system load profile, e.g., day and night peak
conditions. These times are chosen as they represent the possible highest loading
conditions that may lead to violations of the criteria during contingency conditions.
However, using only the two snapshots, the simulations could not exhibit voltage
variations over the day. One of the main objectives of voltage control is to achieve
a flatter voltage profile across the network (lower losses) and a more constancy
(better usage of reactive power resources) during the day. This can only be
examined if a 24-hour load flow simulations are developed.

2.1.3 In this chapter, the development of 24-hour load flow simulation is described and
results of simulations applied to typical day operation are presented and discussed.
The purpose of this task is to produce the hourly simulation load flow files for input
into the steady-state and quasi-dynamic voltage control studies.

2.1.4 The general approach is for each hour, a load flow file is prepared using a typical
generation and load profiles from the unit commitment schedule and metering
database respectively, with optimal power flow performed to obtain feasible
solutions and voltages are within criteria. This OPF action is assumed to be
representative of the manual control action of the operators.

2.1.5 The output visualization of the load flow results must allow one to:
a) Assess the profile across the network in geographical sense;
b) Assess the constancy of the voltage at each bus over time;
c) The ability of the system to maintain voltage to within comfortable voltage
security margin, usually within the range of 1.03 p.u. to 1.05 p.u.

29
2.2 Load Flow for Existing Daily System Security
Assessments (DSSA)
2.2.1 Daily, the System Operation Department prepares suitable load flow files, based on
the load forecast, that best reflect the planned network configuration for the next
day operation along with the (unconstrained) generation schedule from the
System Planning Division, and load profile that are mostly retrieved from the
metering database.

2.2.2 The load flow simulations are carried out for some peak snapshots of a system
load profile, e.g., day and night peak conditions. These times are chosen as they
represent the possible highest loading conditions that may lead to violations of the
security criteria during contingency conditions. The peak night condition is usually
selected to be at 22:00 hours as to accommodate the planned outage program.

2.2.3 The network configuration includes the planned outages and commissioning work
that have been prepared by the Outage Management Group. The Operation
Studies group performs exhaustive contingency analysis (N-1 and N-2) to check for
violations against the security criteria. The load flow files are also employed for
transfer analysis and voltage stability margins between generation export and
import areas.

2.2.4 Load flow and busbar voltage before contingencies (N-0) are examined to ensure
that the following criteria are met:
a. Load flow on transmission (132kV, 275kV and 500kV) lines, cables and
transformers must be within its thermal rating (i.e. not exceeding its 100% MVA
rating);
b. Voltage on 275kV and 500kV must be within the upper and lower limits of 1.05
p.u. and 1.0 p.u. respectively; and
c. Maximum allowable load (MW) transfers from North, East and South towards
Central are analyzed using transfer analysis.

2.2.5 As for during contingencies, load flow and voltages should meet the following
requirements:
a. Load flow on transmission (132kV, 275kV and 500kV) lines, cables and
transformers must not exceed its 130% and 150% MVA rating respectively
b. Voltage on 275kV and 500kV must be within the upper and lower limits of 1.1
p.u. and 0.9 p.u. respectively.

2.2.6 Load data is prepared for weekly and weekend conditions from the data retrieved
from metering and NORMS database (realtime data base – SCADA measurements).
For those that are not available from the two databases, an estimate of the
quantum is made based on past load data. This activity is performed every
quarterly as there are only minor and/or incremental changes in load.

2.2.7 Following security analysis, if there are violations, preventive actions such as re-
shifting of the generation affecting the violation are performed or suitable network
configuration is made to circumvent the violation. For cases where the violations
are unavoidable, corrective actions are proposed post-contingency.

30
2.2.8 Transient stability assessments are also performed monthly to ascertain that the
system resiliency and stability limits are complied with for secured contingency
conditions.

2.3 Proposed 24-hour Load Flow Simulations


2.3.1 For the purpose of examining voltage variations over the day, a 24-hour load flow
simulation method is proposed using the following steps:
(1) Obtain the latest Control Power Flow (CPF) file in PSS/E saved format. This
file should already incorporate the best representation of the current
network configuration;

(2) Read in the generation schedule from the Unit Hourly Rate (UHR) file
prepared by the System Planning Division for the next 24 hours. Note that
as the UHR file schedules generation according to blocks for the Combined
Cycle plants, a macro is employed to allocate the generation to the
individual units. The total system load is already accounted for in this file.
An example of an UHR file is depicted in Figure 2.1 below.

Figure 2.1: Sample UHR file

31
(3) Read the pre-prepared load profile file into the sav file incorporating the
latest load data from individual substation load if necessary. This activity is
conducted every quarterly as the changes are not that frequent and only
incremental. The total load is then scaled to match the generation at one of
the units at TMGR, which is the designated swing bus;

(4) Incorporate the possible changes in the network to accommodate the


transmission outages for the next day or network to be studied for every
hour in PSS/E;

(5) Generate the solved powerflow cases for the 24 hour in sav format. Open
the load flow files individually, solve and check for any anomalies;

(6) Run Optimal Power Flow for each hour to minimize reactive power loss,
enabling the switched shunt (round values) and using the OPF voltage
attributes data. OPF then triggers the necessary switched shunts to meet
the objective while satisfying the constraints;

(7) Open again the load flow files to solve with enabling the switched shunt
data and check for anomalies. Record the voltage at the designated pilot
node;

Figure 2.2 shows the flowchart for the above implementation steps.

32
Chosen load Latest save case
pattern representation of
(for scaling) the network

Scale Load to
match the
slack bus output
(Constant P/Q)
Extract
Generation
L
from UHR
F
Case
@ XXXX

OPF Data:
• Minimize
Q losses
• Enable
Fixed OPF
Shunt
Case OPF
@ XXXX

LF:
• Change Ctrl Mode
Next Available
to Discrete except
Time
SVC
• Solve NR with
S it h Sh t L
F
Extract Data & Input into Array:
• Voltage at
OLPT
• P,Q Losses
• Binit at each

Comparison
&
Plotting in Excel

End

Figure 2.2: Flowchart for Preparation of 24-hour load flow files and plotting of
node voltage

33
2.4 Results
2.4.1 Figure 2.3 shows the 24-hour active (P) and reactive (Q) loads profile for the
entire system that have been executed using the load flow procedure described in
2.3. As indicated in Figure 2.3, P and Q load have similar profile as the latter is
derived as a percentage of the former and scaled down across time. Ideally, if the
actual Q load is obtained for each bus, then it is expected that the two profiles
would be different.
15000 1000

PGen
QGen
14500 800

14000 600

13500 400

13000 200

12500 0

12000 -200

11500 -400

11000 -600

10500 -800

10000 -1000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Figure 2.3: 24 Hour Active (P) and Reactive Q Load From Load Flow

2.4.2 Figure 2.4 shows the pilot node voltage across 24 hour period. The voltage profile
after the OPF is performed and it has a more constant profile.

34
1.060

1.058

1.056

1.054

1.052

1.050

1.048

1.046

1.044

1.042

1.040

1.038

1.036

1.034

1.032

1.030
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Figure 2.4: 24 Hour pilot node voltage variation

35
Chapter 3: 24-Hour Dynamic Simulation –
By Mohd Nasir Ahmad and Mohamad Zaid Mohamad Ali

3.1 Introduction and Objective


3.1.1 As explained in Chapter 1, the principle of SVR is to be able to control generating
unit reactive power output by manipulating its reference voltage (VREF) at the AVR.
Such change or alteration is a dynamic event that will affect the generating unit as
well as the system. Therefore, it is important that any change in system dynamic
be examined thoroughly to avoid adverse consequences. Since the SVR would be
carried out on a 24-hour cycle, the 24-hour load flow discussed in Chapter 2 will
have to be complemented with a 24-hour dynamic simulation and this capability
would allow us to examine the impacts of SVR in greater detail.

3.1.2 24-hour load flow simulations would provide snapshots of voltage profile at each
hour while the 24-hour dynamic simulations would provide transient responses
when voltages are being controlled to the desired values. As indicated in Figure
3.1, SVR would require one to model the changes in VREF, the reactive power
control loop as well as the PI-controller with the necessary differential and
algebraic equations to obtain the time responses.

VSET
Voltage
Set Point

PI- Controller
VPP
Pilot bus Voltage
QREF Measurement
Reactive Power
Reference

Reactive Power
Control Loop

ªVREF QG Pilot Bus


Unit Measured
Variation in
Reactive Power
Ref. Voltage
VT
VREF
AVR G

IFD
Exciter

Figure 3.1: Dynamic components of the SVR

36
3.1.3 For practical implementation, the developed model could be used to tune the
parameters of the controllers and to develop calculations and control algorithms
for the centrally located computer.

3.1.4 In this chapter, the procedure for carrying out 24-hour dynamic simulation is
described while modeling of the SVR controllers is discussed in Chapter 6.

3.2 Hourly Dynamic Events


3.2.1 In developing the procedure for 24-hour dynamic simulations it is important to
understand the normal dynamic events that will occur during each hour or half-an-
hour period of the day. Normal event does not include large disturbances due to
faults or loss of generation.

3.2.2 Typically, over the 24-hour period the total system load would vary as illustrated in
Figure 3.2. The actual load would vary every minute as indicated in blue.
Performing load flow or dynamic simulations for every minute would very time
consuming. It is possible to estimate the load variation assuming that it will remain
constant over a given period. A rough estimate as shown in green (dash line)
would divide the profile into 6 periods of 4-hour each. A better estimate is to use
every hour or every half-hour load profile as indicated by the hourly bars in Figure
3.2.

LOAD

0 12 24
Actual profile
Rough estimation HOURS
Hourly estimation
Figure 3.2: Load profile estimation for dynamic calculations

3.2.3 Generation dispatch is more predictable within each hour since units are
dispatched according to a given schedule. Figure 3.3 shows a typical dispatch
showing the minimum and maximum outputs and when the unit is also not
generating. Figure 3.4 indicates typical capacitor bank switching during the day

37
Generation
100%

90%

80%

70%

60%

50%

40%

30%

20%

10%

0%
0 12 24

HOURS
Figure 3.3: Typical hourly generation dispatch profile

Capacitor Banks
100%

90%

80%

70%

60%

50%

40%

30%

20%

10%

0%
0 12 24

HOURS
Figure 3.4: Typical hourly switching of a capacitor bank

3.2.4 The hourly or half-hourly changes in load, generation dispatch, generation


scheduled voltage, capacitor switching, and transformer tap-changing will have
influence on voltages and could initiate operation of the SVR. Therefore, all these
changes must be modeled dynamically.

38
3.3 Simulations of Dynamic Events
3.3.1 General

3.3.1.1 In this section, the procedure/method for implementing the event changes in
dynamic simulations is discussed. The procedure described in this section focuses
on how the changes are carried out in dynamic simulations but may not be exactly
the way it is performed in practice.

3.3.2 Generating Units

3.3.2.1 There two (2) important controls that are to be varied at each hour during the 24-
hour simulation, namely; active power dispatch and terminal voltage.

3.3.2.2 Typically, the plant operator would be given a schedule of MW dispatch at every
half hour. When the time comes to increase or decrease output, the operator will
give command directly on the control panel. Depending on the type of generator,
the control valve(s) will start to open or close until the target MW is reached. In
practice, the MW will not change abruptly instead increase or decrease with a
certain time constant.

3.3.2.3 In simulation, the MW schedule can be changed by adjusting the load reference
(PREF) as indicated in simple turbine-governor model in Figure 3.5. 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 speed from the
synchronous value will provide a signal to the appropriate controls to increase or
retract power input.

Figure 3.5: Simple turbine-governor model

39
3.3.2.4 Referring to Figure 3.5, for a given mechanical power input (PM) to the alternator,
PREF is determined knowing that speed change ªT is zero. Therefore, for any given
scheduled MW, the corresponding PM can be determined and PREF modified
accordingly. By changing PREF, the entire control system will operate to the change
PM to the desired value and thus introducing the inherent time lag. Figure 3.6
shows a typical turbine-governor response to change in PREF.

Figure 3.6: Turbine-governor response to change in PREF

3.3.2.5 PREF or GREF of a generator can be changed through its turbine-governor dynamic
model. In TNB system, there are 5 turbine-governor models. The data sheet of the
models and its respective Python code for GREF change are as per Appendix 3B.
The 5 turbine-governor models are; GAST, GAST2A, HYGOV, IEEEG1 and IEESGO.

3.3.2.6 Changing of generator terminal voltage can be affected by modifying VREF which is
an input in the excitation control system as indicated in Figure 3.7 for a simple
controller. Field voltage (EFD) would change if there is error between VREF and the
terminal voltage VT. Under steady-state condition when the terminal voltage is
constant, it can only be changed by setting VREF to a new value. This way the
entire control system of AVR is required to operate to respond to the order. Figure
3.8 shows an example of EFD and terminal voltage, VT response following a
command that increases VREF. While EFD changes very quickly, terminal voltage
change will lag due to the inductance of the field circuit.

40
Figure 3.7: Setting terminal voltage by changing VREF

Figure 3.8: Excitation response following a change in reference voltage,


VREF

41
3.3.3 Loads

3.3.1 In practice, loads at substations are always changing. However, for the purpose of
24-hour dynamic CVC simulations, it is sufficient to estimate that loads will change
at each hourly or half-hourly period. In dynamic simulation, the generators are
converted to current sources as per the Norton equivalent, while the loads are
converted to a voltage dependant model. To represent the worst case scenario,
active loads, P are normally converted to 100% constant current (I) and the
reactive loads, Q are converted to 100% constant admittance (Z). In the case of
100% constant I, the value of P and Q is linearly proportional to the magnitude of
bus voltage. For 100% constant Z, the value of P and Q is proportional to the
square of bus voltage magnitude.

3.3.2 Therefore, during each interval prior to load change, for each load, the conversion
is made and re-substituted back into the appropriate arrays. Load conversion
factors are calculated based on how the loads are converted at the initialization or
the beginning of the first simulation period. Figure 3.9 shows the impact of load
increase at a bus – drop in voltage and changes in MW and MVAR flows.

Figure 3.9: Impacts of load change at a bus.

42
3.3.4 Capacitors/Reactors

3.3.4.1 Since capacitors and reactors are modeled as constant impedance load, every time
it is changed its equivalent impedance is calculated and re-inserted into the
admittance matrix.

3.4 Dynamic Simulation Methodology


3.4.1 A 24-hour dynamic simulation procedure is summarized in Figure 3.10 and
comprise of the following steps:
1) Prepare normal power flow case at 00:00 hrs. This power flow case will be
converted to dynamic form. The converted case will be the reference case in
dynamic simulation;
2) Prepare snapshot file with the relevant dynamic data files and channel
selections;
3) Run dynamic simulation for 400 seconds – representing 1-hour period;
4) For the next 23 hours, prepare the remaining 23 power flow cases. From these
cases, the generation dispatch (MW and terminal voltage) and bus load are
extracted. These values will be inserted into the reference converted case and
simulated for another 400 seconds. In the output file, total simulation time will
be 9600 seconds.

43
Start

Prepare power flow


for 00:00 hrs

Convert generators and loads in power flow to


Norton equivalent and voltage-dependent. Save
the newly converted power flow

Prepare snapshot file with relevant dynamic • Apply GREF and VREF
data files and channel selections. change to generators
• Change Load value
• Capacitor switching

Run dynamics for 400 seconds


Extract generation dispatch
and load value
Repeat until 23:00 hrs

Prepare power flow for 01:00


to 23:00 hrs (23 Cases)

Obtain output file

End

Figure 3.10: Flowchart of dynamic simulation for secondary voltage


control

44
3.5 Results
3.5.1 Verification of GREF calculations

3.5.1.1 A Python file is prepared to verify the GREF calculations before proceeding with
the 24 load flow cases. One machine is selected for each of the 5 turbine-governor
model. 5 MW was injected to the selected machines. The results are shown in
Appendix 3A. The Python code is as per Appendix 3B.

3.5.1.2 From the results, the GREF manipulations can be used to effectively re-dispatch
generating unit MW and therefore can be applied for the 24-hour dynamic
simulations.

3.5.2 24-Hour Dynamic Simulation

3.5.2.1 Some results of the 24-hour dynamic simulation are presented in this section.
Figure 3.11 shows the total MW generation in the TNB system, while Figure 3.12
shows the load demand for the 24 hour period. Power flow cases on 25th March
2010 case was chosen to run the simulation. The differences between MW
generation and load demand MW – losses - is shown in Figure 3.13. From Figure
3.13, minimum loss is 138 MW, while maximum loss is 143 MW.

3.5.2.2 Figure 3.14 shows the voltage profile at one of the network buses from the 24-
hour dynamic simulation. It is clear that, the proposed methodology for the 24-
hour dynamic simulation has been able to model the system responses and it is
therefore can be used for SVR analysis when its components (controllers) are
included as discussed in Chapter 6.

45
Figure 3.11: MW generation in half-hourly interval in TNB system from
the 24-hour dynamic simulation

Figure 3.12: Load Demand in half-hourly interval in TNB system from the
24-hour dynamic simulation

46
Figure 3.13: Differences between Generating MW and Load Demand in
TNB system for the 24-hour period

Figure 3.14: Voltage profile at a bus based on the 24-Hour dynamic


simulation

47
3.6 References
[1] Online Documentation, PSSE 32.0, Siemens Power Technologies International,
Schenectady, NY, June 2009

48
Chapter 4: Selection of Pilot Node
By Rofidah Mohamad and Dr. Aznan Ezraie Ariffin

4.1 Introduction/Objective
4.1.1 In an SVR scheme, a pilot node (pilot bus) is a nodal point in a network that is the
most electrically influential in a given control zone whereby it represents the
behavior of the whole set of buses (observability) and is sensitive to control
actions (controllability).

4.1.2 The pilot node selection is based on the intuitive assumption that such nodes must
be chosen amongst the strongest, that is, the nodes which impose their voltages
to the load nodes electrically close to them.

4.1.3 Subsequent to the determination of suitable voltage control zones, the designated
pilot buses for each voltage control zones are identified. Several criteria can be
applied to do this, however the most common is to simply select the bus with the
highest fault level within the control zone as the pilot bus. This also guarantees the
pilot bus to be the one with highest voltage ‘stiffness’ whose voltage changes are
commonly replicated among buses within the same control zone.

4.1.4 Ideally there would be a constraint on the electrical coupling between pilot nodes;
such coupling must be below a pre-established limit. In this way, potential
problems of dynamic interaction between neighbor secondary voltage control loops
are minimized as well as excessive reactive power exchanges among adjacent pilot
nodes.

49
4.2 Methodology
4.2.1 General

4.2.1.1 Two methods for selecting most suitable pilot nodes are discussed in this section.
The first method is based on short circuit level and the second is load flow
Jacobian sensitivity matrix. However, only the first method is implemented.
Implementation of the second would require some research work and time.

4.2.2 Short Circuit Level Method

4.2.2.1 The pilot nodes selection is based on the short circuit level and on its suitable
reordering: the short circuit level of the selected pilot node has to be sufficiently
high, so that its voltage magnitude is representative of the voltages in all the other
busses in the area. To this aim all the grid nodes with a short circuit power higher
than a certain user-defined level are first selected, as the possible candidates for
pilot node.

4.2.2.2 Central area is the assumed control area for this exercise. To get the candidates
for pilot node; which is buses with high fault levels, the short circuit study has to
be performed on the power flow base case.

4.2.2.3 The type of short circuit performed is three phase balanced short circuit – applied
to all 132kV and above buses in the Central area. The study is carried out in PSS/E
using ‘Automatic Sequence Fault Calculation (ASCC)’ command. The output of this
study, which is the three phase short circuit current at each bus, is then sorted out
from highest value to lowest, as in Appendix 4A.

4.2.2.4 The candidates for pilot node are selected from the above list, among the 132kV
and 275kV buses. The selected buses are:
(1) OLPT, PKLG, HCOM, CBDK, SRDG, PDPS and BBTG among the 275kV
buses; and
(2) PULU, KULW, NUNI, CBPS, KULE, KULN and KULS among the 132kV buses

4.2.2.5 The following steps are performed to select the best candidate for pilot node:
(1) Step 1: Set all generators to PQ bus by changing the Bus Code from ‘2’ to
‘1’;
(2) Step 2: Convert the MW generated at these buses to negative (Pload = -
Pgen) and MVAR to zero (Qload = 0);
(3) Step 3: Select one pilot node candidate from the fault level ranking and
convert this bus to a PV bus (Type 2), with Pgen = 0;
(4) Step 4: Schedule terminal voltage for the selected pilot node to the desired
voltage, for example set to 1.05p.u.;
(5) Step 5: Run load flow to solve for Q at the pilot node;
(6) Step 6: Record bus voltages in the area and reactive power requirement at
the pilot node to achieve the set voltage;
(7) Step 7: Repeat for other pilot node candidates;
(8) Step 8: Plot voltage profile for all the pilot node candidates; and
(9) Step 9: Identify the pilot node with minimum reactive power requirement.
50
4.2.2.6 A number of can be noted from the results of implementing steps in 4.2.2.5, these
are:
ƒ The voltage profile throughout the Central network is better; i.e. less variation
between the buses within Central area if the pilot node is selected among the
275kV buses;
ƒ By comparing the VAR requirements of all the pilot node candidates, as well as
the ability to control the surrounding voltages, it is observed that the bus with
highest fault level; in this case – PKLG 275kV, does not necessarily make the
best candidate for pilot node. Furthermore, the VAR requirement at the pilot
node candidates also does not follow the fault level ranking as predicted earlier,
as clearly shown by Figure 4.1 and 4.2;
ƒ Pilot node cannot be selected among buses at radial feeds; i.e. BBTG – due to
high VAR requirements and its inability to control the bus voltages in the same
control zone.

Voltage Profile (275kV pilot nodes)

1.09

1.07

1.05

1.03

1.01

0.99

0.97

0.95
FS T13 T
PR S1 )

W 32
NG 2
W 32

AS 2

LW 32

S 2

PK G S2 5
KU G27 5
CM AN 1 2

L 5
S S N I1 2

BC G1 2
H G 32

L 2

H 32

A 32

PR SC 2

MG M2 5
L 2

E 2

B 32

0
O 32

R 32
D 2

D 2

G W LU 1 2

K K LL1 2

L 5
K U LD 1 2

N N 32

S 75
M G 32R
G 2
BA G 1 2

LE 5T
BT 2R

AH R
T K A I1 2 R
S G L13 R

H C LG 2 R
G T

O I_
K J H 13

PB S13

TJ D27
L 7
KS S 13
NU G13

BL 13

S B L13

O 7

B F E 27
K S G 13

N 13
P K T13

PI G13

S H R 13

50
LK 13

P U T13

K U T27
B J 13
BF Y13

TJ G 13
D 3
BR DR(

JM 275
C 2

P K 132
DM 1

HL G1
BB W 1

PT 13
K
SR

OLPT275 PKLG275 HCOM275 CBDK275 SRDG275 BBTG275 PDPS275

Figure 4.1: Voltage variation of the 275kV pilot node candidates

51
Voltage Profile (132kV pilot nodes)
1.1

1.05

0.95

0.9

0.85
S R D R (T )
B R G S 132

P K LG 132
N U N I132
S S W W 132
B B D G 132
B A R G 132
P ID H 132
K JN G 132
B LK G 132

P K LG 275
H C O M 275
B C H G 132
LK D G 132
K S LS 132
K S A S 132

K U LE 275
B F LD 275

JM A H 500
P U LU 132
G W A Y 132
B F LD 132
K U LW 132
B JLL132
K K W G 132

P B S R 132
S H E L132
S B A N 132
C M B G 132
H LN N 132
P R O T 132

M G S T 275
D M H T 132

T JG S 132

T JG S 275
N S C I_T

P K LG 275T
F S C L132R

K U LE 275R
P R O T 132R

S G B T 132R
P T A I132R
T K M G 132R
PULU132 KULW132 NUNI132 CBPS132 KULE132 KULN132 KULS132

Figure 4.1: Voltage variation of the 132kV pilot node candidates

4.2.2.7 Olak Lampit 275kV bus is chosen as the pilot node because of its high fault level
(2nd highest from the list in Appendix 4A). It also provides better voltage control
for the buses in the controlled area as compared to the rest of the candidates.

4.2.3 Proposed Jacobian Matrix Participation Factor

4.2.3.1 The proposed analytical procedure is based on the sensitivity matrix of node
voltages to reactive power injected into the nodes, when operating with primary
voltage regulation only. The method identifies as the primary pilot node as the
strongest node (having the largest fault MVA level) in the whole network, without
distinguishing between load or generation buses and excludes, from subsequent
choices, all nodes with a coupling coefficient with the primary pilot node greater
than a pre-established limit (these nodes determine the network Area-1 under the
primary pilot node voltage control). The subsequent pilot node is the strongest of
the remaining nodes excluding from this choice those nodes with coupling
coefficients to primary pilot node exceeding the pre-established limit.

4.2.3.2 By proceeding in this way, pilot nodes that are gradually less and less strong are
identified. The procedure is stopped when the choice of the next pilot node falls
onto a node that is not sufficiently strong. Usually, a sufficient number of pilot
nodes is defined in this way.

4.2.3.3 This method is simple, does not require a heavy computational load and gives
satisfactory results after refining the coupling threshold values, which are
dependent on the network characteristics. Highly decoupled secondary voltage
52
control loops are achieved by using excessively low threshold values, but the
number of the pilot nodes could be very small and the quality of the network
voltages low. Selecting the right threshold values for the coupling coefficients is
important, to ensure a well dimensioned number of pilot nodes for the system.

4.2.3.4 For the power flow (or QV) sensitivity analysis, three matrices can be used:
(1) standard power flow Jacobian matrix which is obtained from the static
equations of power flows in transmission lines and transformers;
(2) complete Jacobian matrix of the power flow equations of the system; or
(3) dynamic power flow Jacobian matrix which is computed from differential
algebraic equations describing the dynamical system.

4.2.3.5 Once the power flow Jacobian matrix has been selected and computed, the
eigenvalue analysis is performed on a reduced matrix, as follows. Let’s assume
that the power flow Jacobian matrix is divided into four sub-matrices:

⎡ J Pθ J PV ⎤
J LF = ⎢
⎣ J Qθ J QV ⎦⎥ (1)

4.2.3.6 In case of the standard Jacobian matrix , this has also a physical meaning, since it
can be obtained by the linearization of the power flow equations with constant
power injections:

⎡ ΔP ⎤ ⎡ J Pθ J PV ⎤ ⎡ Δθ ⎤
⎢ ΔQ ⎥ = ⎢ J J QV ⎥⎦ ⎢⎣ ΔV ⎥⎦ (2)
⎣ ⎦ ⎣ Qθ
4.2.3.7 Then, the reduced matrix is defined as follows:

J LFr = J QV − J Qθ J P−θ1 J PV (3)

That can thus be used for a QV sensitivity analysis, if one assumes that ΔP = 0
and that the sub-matrix is non-singular:

ΔQ = J LFr ΔV (4)

The reduced matrix J LFr is defined in (3) and can be used the computation of the
pilot node.

4.2.3.8 Due to the complexity of this method, it is not considered as an option to


determine a suitable candidate for pilot node selection. However, a research work
on this approach is encouraged.

53
Chapter 5: Allocating Reactive Power to
Participating Generators Load Flow Method
By Danial Mohd Noor and Nik Sofizan Nik Yusuf

5.1 Introduction
5.1.1 Chapter 2 describes the steps for performing 24-hour load flow so that voltage
profile over the day could be examined. Assuming that the pilot node is already
identified (see Chapter 4), it is the duty of SVR controller to instruct selected
generating units to dispatch the required reactive power to meet the target pilot
node voltage.

5.1.2 This chapter describes the complete process of simulating secondary voltage
regulation (SVR) using load flow method. The discussion begins with the method
of identifying voltage control zones, respective pilot nodes and the participating
controlling generators. Subsequently, given the pilot nodes, and their scheduled
hourly voltages over the 24-hour period, participating generating units reactive
power output are adjusted to achieve the pilot node desired voltages. Finally
results of the SVR simulation are briefly presented.

5.2 Determining Voltage Control Zones


5.2.1 Determining the number of voltage control zones, the pilot nodes and participating
controlling generators defining the control zones are some of fundamental
questions that need to be addressed first in a secondary voltage regulation scheme.

5.2.2 Earlier implementations of SVR like those in Italy and France have the zones
definition and pilot nodes to be physically ‘hard coded’ within the SVR
infrastructure. More recent SVR implementation in China has the zones to be
defined within centrally located software which can dynamically change with
changes in the transmission structure. Regardless of the implementation option,
there is a need to determine the number of control zones to adequately control the
voltages within the transmission network.

5.2.3 Figure 5.1 illustrates the hourly voltage profile of a number of regionally located
buses within TNB Transmission Grid System. From the Figure, it can be observed
that there are four distinct voltage patterns which can be traced to common
regional buses. The red group pattern is commonly shared among Northern
located buses, the green group among Southern located buses, the yellow group
among Centrally located buses and the blue group among Eastern located buses.
It is possible that the number distinct voltage profile patterns can be used a guide
in determining the number of voltage control zones.

54
Figure 5.1: Hourly voltage profile of some regional busbars (actual
measurements)

5.3 Pilot Node Selection Consideration


5.3.1 With number of voltage control zones determined, next we need to determine the
designated pilot buses for each voltage control zone. Several criteria can be
applied for this selection, however the most common is to simply select the bus
among the highest fault level within the control zone as the pilot bus as described
in Chapter 4. This approach also guarantees the pilot bus is the one with
sufficiently high voltage ‘stiffness’ (sensitivity of voltage change to VAr injection)
and whose voltage changes are commonly replicated among buses within the
same control zone.

5.3.2 There may be more than one pilot node candidate for each voltage control zone,
the final selection of the pilot nodes can be decided when the participating
controlling generators are determined and may also be influenced by other
practical considerations such as buses with higher reliability or accuracy of voltage
measurements and availability of communications facilities.

55
5.4 Identifying Influential Generating Units
5.4.1 To identify the generators which participate in regulating the voltage within the
zones, it proposed to use of information on the sensitivity of voltage to reactive
power change. There are various sources of this information, including from the
the load flow Jacobian matrix (JΔV = ΔQ) and by the method described next.

5.4.2 Iteratively perform load flow solutions, each time by introducing a small change in
reactive power generation (ΔQ) at different generating stations and monitoring the
voltage changes (ΔV) that result at buses of interest. From the results, compile a
matrix of ΔV/ΔQ sensitivities as shown in the table below (Figure 5.2).

Figure 5.2 ΔV/ΔQ sensitivity matrix

5.4.3 Table of sensitivities in Figure 5.2 was formed by introducing a fixed quantum
increase in reactive power generation (in this case, 50 MVar) at each generating
station (table column headers) and monitoring the per unit change in voltage at all
132kV and higher voltage buses (table rows). A collection of python programs to
automatically perform the above task is given in appendix 5A and 5B.

5.4.4 Each row within the ΔV/ΔQ sensitivity matrix represents the respective voltage
change percentage produced at the bus with a 50 MVar increase in reactive power
at each generating station. If the selected bus row is a candidate pilot node bus,
then the ΔV/ΔQ sensitivities would indicate the relative influence of each
generating station in controlling its bus voltage. Obviously it follows that the
generating stations which is most influential should belong and participate in the
pilot node’s control zone. Figure 5.3 shows a Table of the candidate pilot nodes
and their sorted ΔV/ΔQ sensitivities.

56
Figure 5.3: Sorted ΔV/ΔQ sensitivities for the candidate pilot nodes
5.2.1 Figure 5.4 graphically illustrates the sorted sensitivities for the candidate pilot node
at PRGS 132 kV bus.

Figure 5.4: Sorted ΔV/ΔQ sensitivities for PRGS 132kV bus

5.2.2 The sorted ΔV/ΔQ sensitivities also allow us to identify participating controlling
generators for each pilot node by simply selecting the generators whose ‘influence’
or voltage/var sensitivity is above a certain level. Figure 5.5 shows the selected
participating controlling generators for each of the candidate pilot nodes when
ΔV/ΔQ sensitivity level is set at equal or above 0.05%.

Figure 5.5: Participating Controlling Generators with ΔV/ΔQ Sensitivity


set at 0.05%
5.2.3 Since each generator should only be participating in one voltage control zone,
therefore it follows that each generator should only be associated with only one
pilot node. At the same time, the more generators participating in voltage control
the better the voltage regulation performance would be. These requirements can
be quite conflicting if there are generators which are equally influential to more
than one pilot node. By careful selection of pilot nodes and participating
generators, this can possibly be avoided.

5.2.4 Examining the chart in Figure 5.5, it is observed that a number of the candidate
pilot nodes share many of the same controlling generators. Sharing most of the
same controlling generators means that the candidate pilot nodes share the same
voltage control zone. These ‘shadow’ candidate nodes can be eliminated leaving
only one pilot node per voltage control zone. Similarly ‘overlapping’ generators
assigned to more than one pilot node can be removed by selecting generators with
higher ΔV/ΔQ sensitivity levels. Figure 5.6 illustrates the results after eliminating
the ‘shadow’ candidate nodes and selecting only generators with ΔV/ΔQ sensitivity
level equal or higher than 0.1%.

Figure 5.6: Participating Controlling Generators with ΔV/ΔQ Sensitivity


set at 0.1%

59
5.5 Allocating Reactive Power among Participating
Generators given the Pilot Node
5.5.1 The method described here is based on in CIGRE document, Report 310
“Coordinated Voltage Controls in Transmission Network”, February 2007.

5.5.2 The goal of secondary voltage control is to regulate each pilot node voltage at the
scheduled or desired voltages. It does so by allocating the necessary reactive
power generation among the participating generators within the designated control
region or zone. Generally, the quantum of reactive power allocated to each
generator is proportional to its reactive power capability.

5.5.3 To simulate the process of determining the required reactive power and allocation
among the participating generators within the control zone, iterative load flow
solutions are carried out.

Figure 5.7: Graphic illustration of the SVR load flow simulation method

5.5.4 Details of this methodology are as follows (see figures 5.7 and 5.8):
(1) Model a fictitious synchronous condenser (a generator with zero MW
generation and unlimited MVAr capability) at the designated pilot node;
(2) Set the schedule voltage of the pilot node to the desired voltage level;
(3) Model all participating generators within the zone as generators with fixed
MW and VAr generation or alternatively as PQ type buses;
(4) Determine the reactive power participation factors for each generator based
on its reactive capability;

60
(5) For the initial load flow run, set the VAr generation of each participating
generator within the zone to zero;
(6) Perform a load flow solution;
(7) Obtain the VAr generation from the synchronous condenser at the pilot
node;
(8) If the VAr generation amount is not zero (or smaller than a predetermined
tolerance), allocate it among the participating generators according to its
participation factor;
(9) For each participating generator add the allocated quantum to its current
VAr generation;
(10) While the VAr generation from the pilot node is not zero or small enough
then repeat steps 6 to 10;
(11) End of load flow solution iterations and report VAr generation of each
participating generators.

61
Start

Initialize variables

Read In
• pilot node bus no
• pilot node scheduled voltage
• participating generators bus nos

Insert synchronous condenser at pilot nod and


schedule its voltage at the desired level

Determine Var capability for each participating


generator and calculate the participation factors

Set Var generation for all participating generators to


zero

Perform load flow solution

Obtain Var generation from synchronous condenser

Var < Tol ?


Yes

No

Distribute the Var quantum to all participating Print Var generation for each
generators based on participation factors and add participating generators
the allocated amount to current Var generation of
each unit

End
Figure 5.8: Flowchart for performing SVR using load flow simulation

NOTES:
1. The above methodology describes simulation of Secondary Voltage Regulation within one control
zone. An example of its implementation with Python is given in appendix 5C.
2. Similar methodology can be applied to simulate Secondary Voltage Regulation simultaneously in
many control zones each with its own designated pilot node and voltage schedule and its set of
controlling generators. A Python demonstration program simulating multi-zone SVR is given in
appendix 5D.

62
5.6 SVR Simulations Using Load Flow
5.6.1 Investigating the Impact of SVR Controls on Bus Voltages

5.6.1.1 The SVR methodology as proposed in CIGRE Report 310 was put to test by
performing load flow simulations on the base cases listed in Table 5.1.

Table 5.1: SVR tests base cases


Test Cases Description
Case0.sav Base Case:
• Voltage Schedule of Generator Bus set to 1.0 pu (Participating
Generators in Central Area Only)
• Taps of Generator and 275/132 kV Transformers set to 1.0 pu
(Transformers in Central Area)
Case1.sav SVR Case:
• Taps of Generator and 275/132 kV Transformers set to 1.0 pu
(Transformers in Central Area)
• Pilot Bus – OLAK275, Voltage Schedule as per Base Case
• Participating Generators in Central Area
Case1-1.sav SVR Case:
• Taps of Generator Transformers and 275/132 kV Optimised to
Minimise Loss
• Pilot Bus – OLAK275, Voltage Schedule as per Base Case
• Participating Generators in Central Area
Case1-2.sav SVR Case:
• Taps of 275/132 kV Transformers and Shunt Capacitors Optimised
to Minimise Loss
• Pilot Bus – OLAK275, Voltage Schedule as per Base Case
• Participating Generators in Central Area
Test Cases Modeling Notes:
1. The above cases were modelled based on the actual TNB demand and generation dispatch as
experienced on 1400 hrs August 12, 2009;
2. For test cases, Case0.sav and Case1.sav, the shunt compensation was modelled as in the
actual system;
3. Since complete information on transformer taps were not available from the SCADA, the taps
positions of generator transformers and 275/132 kV transformers in the Central Area zone
were modelled at the nominal taps i.e. 1.0 pu;
4. For test cases Case1-1.sav and Case1-2.sav, optimal load flow runs were performed prior to
the SVC simulation with the objective function to minimise system losses.

5.6.1.2 In all of the above simulation runs, OLAK275 is selected as the pilot node and the
scheduled pilot node voltage was set to 0.969 pu, the same voltage level as in the
base case i.e. Case0.sav. Results are shown in Figures 5.9 and 5.10.

5.6.1.3 The following observations are made:


(1) Simulation with secondary voltage regulation on generators alone does not
result in any change to the voltage profile of buses in the control zone (red
curve) as compared to the base case without SVR (blue curve);
(2) Only when controls on taps and shunt compensation devices are carried out
via OPF did we observe changes to the voltage profile (flatter profile);
(3) With SVR, VAr generations of participating generators are distributed equally
among them according to their respective VAr capacities. This is evident in all
63
the test cases except in the base case (without SVR). This was the primary
impact of SVR on controlling generators.

Figure 5.9 Voltage Profile of Central Area SVR Zone 275 kV Buses

Figure 5.10 VAr Generation from Participating Generators

5.6.1.4 Based on the results, it can be concluded that:


(1) Without controls on transformer taps and reactive shunt compensation
devices, generator controls alone does not significantly affect the voltage
profile of buses within the control zone; and
(2) More significantly the generator controls result in more equitable
distribution of VAr generation among the participating generators.

64
5.6.2 Comparison of Different Pilot Nodes Selections

5.6.2.1 Using the SVR algorithm described previously, a simple study on the selection of
pilot nodes based on fault levels was carried out. In this study, four different CVC
load flow runs were made (see Table 5.2), each with different pilot node of
different fault levels.

Table 5.2: Pilot Node Study Test Cases


Test Cases Description
Case0.sav Base Case: No SVR
Case2.sav SVR Case: OLAK275 at 1.03 pu, FL = 36.5 kA
Case2-1.sav SVR Case: PTAI275 at 1.03 pu, FL = 19.4 kA
Case2-2.sav SVR Case: BTAI132 at 1.03 pu, FL = 9.2 kA
Case2-3.sav SVR Case: KSGR132 at 1.03 pu, FL = 5.1 kA

5.6.2.2 The objective is to observe whether fault level can serve as criteria in the selection
of pilot node. The study was performed on a single voltage control zone defined
around the Central Area and the candidate pilot nodes have target voltages of 0.3
pu above its base case voltages. The results as summarized in Figures 5.11 and
5.12.

Figure 5.11 Voltage Profile of Central Area With Different Pilot Nodes

65
Figure 5.12: VAR Generation With Different Pilot Nodes

5.3.2.1 The following observations are noted:


(1) Despite having pilot nodes of different fault levels, the general voltage profile
is similar;
(2) With pilot nodes on the western side of the voltage control zone like PTAI275
and BTAI275, voltages are generally higher compared to when pilot nodes
are on the eastern side like OLAK275 and KSGR132. This is expected given
the generation in the Central zone is concentrated around the western part of
the zone. Therefore to raise voltages of nodes on the eastern side would
require higher voltages on the western side. Here, the difference in faults
levels did not seemed to influence the voltages observed.
(3) VAR generation is generally higher when pilot nodes are on the eastern side
of the zone. Again this is a result of the generation distribution with the zone
and not a function of fault levels.

5.3.2.2 Clearly there is no visible trends in the results with pilot nodes of different fault
levels, rather it is the physical structure of the network and distribution of
generators that played greater role in influencing the voltage profiles and VAR
generation, hence the choice of pilot nodes.

66
Chapter 6: SVR Simulations Tools and Results
By Danial Mohd Noor, Mohd Salleh Serwan, Mohd Nizam and Sallehhudin Yusof

6.0 Introduction
6.0.1 This chapter describes the tools that have been developed in this project and
discusses some results of the SVR simulations. There are two simulation tools that
have been developed:
(1) Load flow based SVR simulations; and
(2) Dynamic based SVR simulations
For each of the tools, the following items are described further:
(a) Input files and parameters;
(b) Additional control models established; and
(c) Output visualization facilities;

6.0.2 Several SVR simulations and their results are also described in this chapter. These
simulations are used to demonstrate the use of the tools. It is our view that for
more detailed analysis that leads to the design of SVR, it is necessary for TNB
Research to develop cases and scenarios to enable the functional designs of the
SVR be established.

6.0.3 One important aspect of the tool is to develop additional output visualizations so
that the results of the simulations could be more easily interpreted to enable fast
decisions to be made. In fact one main aspect of research in power system
analysis is on result visualization of large simulation outputs and it pertinent upon
TNB Research to consider getting involve in such research and development.

67
6.1 Database Applications for Data Handling and
Visualization
6.1.1 Database plays an important role for organization of simulation input parameters
and output results (including its visualization), especially when we are dealing with
a very large system. Using Python scripts (suitable for interfacing with PSS/E),
input data can be transferred into base network to produce half hourly snapshot
data. Figure 6.1 illustrates the simulation process with a database repository for
data handling.

Half Hourly
Snapshot Data

Output Python Base Network


Data

Generator
Schedule

Database Individual Load


Point

Database
Interface

Figure 6.1: Simulation process overview with database

6.1.2 From the database, input parameters are called through Python program and
transferred as base network. Each of these inputs can be manageable and
manipulated to perform the 24 hour load flow. Examples input data established
and available from the database are shown in Figures 6.2 through 6.6. Each input
data can be viewed graphically to aid in visualization.

6.1.3 Figure 6.2 and 6.3 show generation schedule and load data over the 24-hour
period for each half-hour interval.

68
Figure 6.2: Example of generation dispatch inputs with PAKA GT2A
highlighted

Figure 6.3: Example of substation load inputs with T1 KULN highlighted

69
6.1.4 Figure 6.4 shows the total system generation and dispatch. The database has also
name mapping facilities so that substation names from other databases, e.g.,
metering, can be mapped to PSS/E mneumonic names and the mapping tables are
shown in Figure 6.5 and 6.6(a).

Figure 6.4: Total System Generation and Load

Figure 6.5: Generation Mapping Table

70
Figure 6.6(a): Load Mapping Table

6.1.5 Tables for SVR settings are also provided as shown in Figure 6.6(b). SVR setting
includes list of pilot node in each zone and constant used for PI controllers. In
addition to this, list of participating generators and their controller constants can
also be specified.

Figure 6.6(b): SVR Setting Tables


71
6.1.6 Based from the input parameters, new saved cases and snapshots are established
for calculations. The output data recorded from the calculations are stored into a
database for output visualisation. These data are easily manageable and
manipulated to visualize the 24-hour results. Figure 6.7 shows the results of a 24-
hour load flow of voltage variation at the pilot node together with the total system
MW generation. While Figure 6.8 shows the same voltage with total system MVAR
generation.

Figure 6.7: Example of Voltage (OLPT275) and Total MW Generation

Figure 6.8: Example of Voltage (OLPT275) and Total MVar Generation


72
6.1.7 Figure 6.9 shows voltage and load variations at KL North after a 24-hour load flow
simulations and Figure 6.10 shows the load MVAR variations.

Figure 6.9: Example of Voltage and MW Load (KULN132)

Figure 6-10: Example of Voltage and MVar Load (KULN132)

73
6.1.8 Figure 6.11 and 6.12 show MW and MVAR dispatch with scheduled terminal
voltage respectively for Kenyir unit 2. This serves to show that he 24-hour load
flow enables one to examine the variation of generation dispatch over the day and
assess its impacts to the system.

Figure 6-11: Example of Bus MW Generation and Scheduled Voltage


(KNYR_U2)

Figure 6.12: Example of Bus MVar Generation and Scheduled Voltage


(KNYR_U2)

74
6.1.9 Figure 6.13 and 6.14 show variations of total system loss in % together with
system total MW and MVAR generation respectively.

Figure 6-13: Total MW Generation vs Total Loss (%)

Figure 6-14: Total MVAr Generation vs Total Loss (%)

75
6.2 SVR Model in Load Flow simulations
6.2.1 Coordinated Voltage Control Overview

6.2.0.1 A quick review of the functional components of the Coordinated Voltage Control
may be helpful in understanding the approaches and models used in the
simulations. Figure 6.15 provides a graphical summary of the CVC functions.

Figure 6.15: Functional Overview of the CVC

6.2.2 CVC Simulation – Load Flow Approach

6.2.2.1 Load flow simulation of the CVC is primarily done in three separate steps. They
are:
a) Generation of 24-hour load flow saved cases;
b) Optimal power flow runs; and
c) Hourly SVR load flow simulations.

6.2.2.2 The methodology in generation of 24-hour load flow saved cases is basically the
same as described in Chapter 2. Starting from a base load flow saved case, 24
hour load flow saved cases are generated using information of 24 hour load
demand profile or fractions and 24 hour generator dispatch schedules. Python
scripts to automatically generate the 24-load flow saved cases and the necessary
load demand scaling and generator dispatch updates are given in appendix 6A.
Also included are the sample load demand fractions and dispatch schedule data.
76
6.2.2.3 In the load flow approach, coordination of shunt compensation and transformer
taps is not carried out during the SVR simulation. Instead it is done separately in
24 Optimal Power Flow (OPF) runs. The OPF runs will result in optimal hourly
schedules of shunt compensation use and transformers taps positions that will be
used in the SVR hourly load flow simulations.

6.2.2.4 The OPF runs are also used to obtain the optimal hourly target voltages for the
pilot nodes that will be used in the SVR simulation. The objective function used for
the OPF runs is to minimise active power losses subject to constraints whereby
generator terminal and transmission bus voltages are kept within limits of 0.95 to
1.05 per unit.

6.2.2.5 Python scripts to perform the 24 OPF runs and extract hourly shunt compensation
statuses, transformers tap positions and optimal pilot node voltages are given in
appendix 6B.

6.2.2.6 The steps performed in the above 2 steps will form as inputs to the 24 hourly SVR
load flow simulations. Basically the SVR simulation is the same multi-zone
methodology described in section 5.2.2 but expanded for 24 hourly runs. Python
scripts to perform this simulation and extract results from the 24 hourly load flow
savecases are given in appendix 6C.

Figure 6.16: Overview of the CVC Simulation Using Load Flow Method

6.2.2.7 Summary of all python scripts used in this load flow methodology and their brief
descriptions is given in the table 6.1.
77
Table 6.1: Summary of Python Scripts for SVR Load Flow Simulations
Python Script Description
24HrLoad.py
Input: NewCase.sav Generated 24 hourly load flow files using a
LoadPattern.dat ‘master’ load flow and 24 hour load fractions
Output: 24 Hour Load Flow files data.
24HrGen.py
Input: 24 Hour Load Flow files Updates the 24 hourly load flow files with hourly
GenPattern.dat generator dispatch data.
Output: 24 Hour Load Flow files
24HrOpt.py
Input: 24 Hour Load Flow files Perform optimization on the 24 hourly load flow
Output: 24 Hour Optimised Load files. Objective is to minimise active losses
Flow files subject to voltage constraints.
getpv.py
Input: 24 Hour Optimised Load Extract the optimal hourly voltages for the
Flow files defined pilot nodes.
Output: pnodekV.dat
getShunt.py
Input: 24 Hour Load Flow files Extract the 24 hour shunt compensation values.
Output: shshunt.dat
getTxRatio.py
Input: 24 Hour Load Flow files Extract the 24 hour transformers HV and LV tap
Output: pritap.dat, sectap.dat positions.
Mz.py
Input: 24 Hour Load Flow files Perform hourly multi-zone SVR simulation.
mz.dat Input to the simulation include the zone
pnodekV.dat definition and the optimal hourly pilot node
Output: 24 Hour SVR Run Output voltages.
Load Flow files
prtkV2.py
Input: 24 Hour Load Flow files Prints out bus data load flow output for each 24
Output: 24 Hour bus data output hour load flow file.
Files
getkV.py
Input: 24 Hour bus data output Extracts the voltages in the bus data output files
files and assembles them in 2 output files
Output: kVout1.dat, kVout2.dat
getPFlow.py
Input: 24 Hour Load Flow files Extracts the 24 hour active power flow of all
Output: pflow.dat branches.
getQFlow.py
Input: 24 Hour Load Flow files Extracts the 24 hour reactive power flow of all
Output: qflow.dat branches.
getMVA.py
Input: 24 Hour Load Flow files Extracts the 24 hour mva power flow of all
Output: mva.dat branches.
getloss.py
Input: 24 Hour Load Flow files Extracts the 24 hour total active loss of all
Output: loss.dat branches.

78
6.2.3 Results of CVC Load Flow Simulations

6.2.3.1 Following are the CVC simulation results obtained from a saved case based on
actual generation and demand scenario taken on 12th August 2009. The charts
compare the simulation results with data recorded from NLDC SCADA system.

6.2.3.2 Figure 6.17 compares actual voltage range with and without the SVR. It can be
observed that voltage regulation is tighter and flatter using SVR as compared to
actual recorded voltage in the system.

Figure 6.17: Comparison of Bus Voltage 24 hours Max-Min Variation

6.2.3.3 The use of reactive compensation in the CVC case is observed to be higher than
the actual case as shown in figure 6.18.

Figure 6.18: Comparison in Use of Reactive Compensation

79
6.2.3.4 Figure 6.19 shows that reactive power generation from units participating in the
voltage control is higher in the CVC case as compared to the actual recorded
outputs.

Figure 6.19: Comparison of Reactive Power Generation between CVC and


Actual

6.2.3.5 Total system losses is found to be generally less in the CVC case as compared to a
Reference case where generator terminal voltages and transformer tap positions
are kept at nominal values i.e. 1.0 per unit (see Figure 6.20).

Figure 6.20: Difference in System Losses between Reference Case and


SVR

6.2.3.6 To summarise, it can be concluded that the simulations indicate potential benefits
that could be accrued with the use of CVC in terms of better voltage regulation
and reduction in system losses.

80
6.3 Dynamic Modeling of SVR
6.3.1 General

6.3.1.1 In Chapter 3, 24-hour dynamic simulation procedure is described. It is easily


extended to include SVR components in dynamic model forms. As described in
Chapter 1, SVR comprises of several components and illustrated in more details in
Figure 6.21.

6.3.1.2 During each time step, the pilot bus voltage VPB is compared with the reference
voltage VREFPB and the error is process in a PI-controller to set the reference
voltage VREF of participating generating units. To ensure that reactive power
contribution by the participating units are shared accordingly another controller is
attached to each unit having its reactive power output (QGi) being compared with
the amount that it is supposed to contribute through participating factor, ", i.e.,
"QGi.

VT2
-
EFD2
3 AVR2 G2
+ +
VOS2
VREF2 QG2 -
KPG2 + KIG2/s 3 "2
+

QG2 Pilot
Bus
+
QT -
3 KPPB + KIPB/s 3
VPB
+ +
QG1 VREFPB

+
KPG1 + KIG1/s 3 "1
VREF1 QG1 -
+ + EFD1
3 AVR1 G1
- VT1

Figure 6.21: Components of SVR for dynamic modeling

6.3.1.3 The pilot bus controller may also be modeled as a PID controller with input
transducer as shown in Figure 6.22. Also indicated are states associated with the
control. For generating unit control, the input to the AVR may be modeled as
shown in Figure 6.23.

81
VREFPB
Pilot
Node
+
VPB 1 es1 es2 es3 ªVP REF
3 KP 3
(1 + sTR) - +
+ +
Transducer
TR = 0.0 ∼ 0.04s KI es4
s

es5
sKD

Figure 6.22: Pilot bus SVR voltage controller

G1
Pilot
Node
Control (VREF)
QG1 VT
- - +
eg1 eg2 eg3 ªVG REF
"1 3 KPG 3 3 AVR
+ + +
+ +
QG1 +
KIG eg4
3 QGT
s

QG2 +
eg5
sKDG

Figure 6.23: Generating unit AVR input controller with SVR

82
6.3.2 SVR Dynamic Model Implementation in PSS/E

6.3.2.1 In PSS/E, for convenient, all the controller models are written directly using
FORTRAN code into the subroutine CONEC which is entered at every time step. In
order to be able to control and manipulate the process, numerical integration of all
state derivative are also implemented directly in CONEC rather than using PSS/E
internal facilities. Improved Euler Integration Method is employed whose principle
is shown in Figure 6.24.

Given that at t = 0, x = x0
dx/dt = f’(x,t) = f’
xp = x + h x f’ (Predictor)
fp= f’(xp, t) (Derivative using predicted states)
xc= x + 0.5 x h x (f’ + fp) (Corrector)

Figure 6.24: Improved Euler Method is employed for numerical


integration

6.3.2.2 In PSS/E, the following dynamic Modes are noted for implementation in CONEC:
a) MODE=1: The model must initialize all of its state variables and algebraic
variables;
b) MODE=2: The model must make all computations of state derivatives;
c) MODE=3: Each model must compute the present value of its output signal and
place it in the appropriate array;

6.3.2.3 Referring to Figure 6.24 and the three Modes in PSS/E, the structure of the
controller modeling process in CONEC is:
a) Mode 1:
• Input constants; and
• Calculate initial states – initialisation
b) Mode 2:
• Calculate current state derivative and its predicted state value;
c) Mode 3:
• Calculate predicted state derivative and corrected state value; and
• Update appropriate PSS/E arrays
However, in PSS/E following MODE 1, it goes into MODE 3. Since it is necessary to
calculate predicted values in the numerical integration, the process is forced to go
into Mode = 2 immediately after Mode = 1.

83
6.3.3 SVR Dynamic model response test results

6.3.3.1 Figure 6.25 and 6.26 shows the pilot bus voltage and generator reactive power
responses when simulating CVC model with single voltage target. It is clear that
the controller model has been implemented successfully with the expected
response.

Figure 6.25: CVC Pilot Bus Response

Figure 6.26: CVC Generator Response


84
6.3.3.2 Figure 6.27 and 6.28 illustrates the pilot bus voltage response and generating unit
reactive power outputs with the CVC model with multiple voltage targets.

Figure 6.27: CVC Pilot Bus Voltage Response with multiple voltage
targets

Figure 6.28: CVC Generator MVar Response with multiple voltage targets

85
6.4 SVR Model Simulations – Load Flow and
Dynamics
6.4.1 Case Study

6.4.1.1 For purpose of SVR simulations and analysis, specific study cases are established.
These cases are based on actual load and generation data with both generator
voltages and generator transformers taps set to 1.0. The amount of switched
shunt required is determined through power flow solutions with adjustment for
switched shunt being enabled. OLPT275 is used as pilot bus, i.e., the focal point
of SVR controller, and JMAH U1 and U2 generators are also included as reactive
power sources.

6.4.1.2 In order to assess effect of SVR, first simulation run is carried out without
regulation. Additional simulations are then performed with regulations having two
different approaches of scheduling voltage at the pilot bus. First, it is scheduled to
a constant level of 1.016 per unit for the whole 24-hour period, and secondly,
scheduled based on optimum value determined at each half-hour interval using
OPF as shown in Table 6.2.

Table 6.2: Optimal Scheduled Voltage


Hour 0:00 0:30 1:00 1:30 2:00 2:30 3:00 3:30 4:00 4:30 5:00 5:30
P.U. 1.028 1.031 1.032 1.032 1.036 1.039 1.042 1.039 1.040 1.034 1.041 1.036
Hour 6:00 6:30 7:00 7:30 8:00 8:30 9:00 9:30 10:00 10:30 11:00 11:30
P.U. 1.037 1.037 1.034 1.032 1.031 1.024 1.019 1.015 1.012 1.011 1.010 1.009
Hour 12:00 12:30 13:00 13:30 14:00 14:30 15:00 15:30 16:00 16:30 17:00 17:30
P.U. 1.009 1.010 1.012 1.009 1.007 1.006 1.006 1.006 1.006 1.006 1.007 1.009
Hour 18:00 18:30 19:00 19:30 20:00 20:30 21:00 21:30 22:00 22:30 23:00 23:30
P.U. 1.013 1.015 1.014 1.012 1.010 1.009 1.011 1.013 1.017 1.018 1.021 1.025

86
6.4.2 Load Flow Simulations

6.4.2.1 In load flow simulations, a generating unit can be set to regulate either the local or
remote bus. In SVR simulation, it is possible for the remote pilot bus to to be
regulated by generators. Figure 6.29 shows the necessary setting in PSS/E load
flow with the desired scheduled voltage and percentage of MVAR contribution by
each unit.

Percentage of MVAR Contribution

Assign Pilot Bus to Remote Bus in Load Flow to represent SVR


Set Scheduled Voltage

Figure 6.29: Assignment of Pilot Bus to Generators in Load Flow

6.4.2.2 Based on the load flow simulations, voltages at the pilot bus OLPT275 are
compared for three different types of voltage regulations, namely, without
regulation, constant voltage regulation, and optimal voltage regulation. The results
are shown in Figure 6.30.

Bus Voltage (P.U.)


1.05

1.04

1.03

1.02

1.01

1.00

0.99

0.98

0.97

0.96
No Regulation
Constant Regulation
Optimal Regulation
0.95
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.30: Comparison of Bus Voltage at OLPT275 with different


Regulations

87
6.4.2.3 Figure 6.31 shows reactive power generation for JMAH units for the three different
types of voltage regulation settings.

Total Q Gen by JMAH (MVAR)


1100

1000

900

800

700

600

500

400

300

200

100

-100

-200

-300
No Regulation
-400 Constant Regulation
Optimal Regulation
-500
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.31: Comparison of Total JMAH MVAR Generation at different


Regulations

6.4.2.4 Figure 6.32 shows the pilot bus voltage over the 24-hour period with constant
scheduled voltage indicating that there is possibility that the target could not be
met.

Bus Voltage (P.U.)


1.05

1.04

1.03

1.02

1.01

1.00

0.99

0.98

0.97

0.96

Schedule Voltage
Bus Voltage
0.95
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.32: Voltage at Pilot Bus with Constant Scheduled Voltage

88
6.4.2.5 Figure 6.33 shows pilot bus voltage variations based on optimal voltage schedule
indicating that, there is adequate reactive power dispatches from generating units
to achieve the desired voltage.

Bus Voltage (P.U.)


1.05

1.04

1.03

1.02

1.01

1.00

0.99

0.98

0.97

0.96

Schedule Voltage
Bus Voltage
0.95
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.33: Voltage at Pilot Bus with Optimal Scheduled Voltage

6.4.2.6 In the simulations, the total amount of required switched shunt in the system
varies over the hour (see Figure 6.34) but assumed to remain the same for the 3
types of voltage regulations.

Total Shunt (MVAR)


3300

3200

3100

3000

2900

2800

2700

2600

2500

2400
No Regulation
Constant Regulation
Optimal Regulation
2300
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.34: Total Amount of Switched Shunt (MVAR) in the System

89
6.4.2.7 Individual switched shunt loading is shown in Table 6.3. It can be observed that
the load flow simulations could result in some switched shunt to switched in and
out frequently with a short period. This is however not the actual practice, hence
to improve simulation results, it is pertinent that a specific study should be carried
out to arrive at proper scheduling of switched shunts.

Table 6.3: Individual Switched Shunt Loading


BusNam kV BusNo 0:00 0:30 1:00 1:30 2:00 2:30 3:00 3:30 4:00 4:30 5:00 5:30 6:00 6:30 7:00 7:30 8:00 8:30 9:00 9:30 10:00 10:30 11:00 11:30 12:00 12:30 13:00 13:30 14:00 14:30 15:00 15:30 16:00 16:30 17:00 17:30 18:00 18:30 19:00 19:30 20:00 20:30 21:00 21:30 22:00 22:30 23:00 23:30 24:00
AHTM132 132 51028 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
AMPG132 132 88120 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
BDNG132 132 61115 60 60 60 60 60 60 60 0 60 0 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
BJLL132 132 88177 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
BJTG132 132 51083 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
BKPR132 132 51045 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
BLKG132 132 51062 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
BMYK132 132 62108 60 60 60 0 0 0 0 0 0 60 0 0 0 0 0 0 0 0 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
BPHE132 132 97106 60 60 60 60 60 60 60 60 60 60 60 0 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
BTBN132 132 62101 60 60 60 60 60 60 60 60 60 0 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
BTGA132 132 51048 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
BTIN132 132 51008 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
CBRU132 132 97178 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
CJYA132 132 51038 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
DMHT132 132 88112 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
GBNG132 132 74138 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 0 0 0 0 0 0 0 0 0 0 0
GRNE275 275 61214 60 60 60 60 60 60 60 60 60 0 60 60 60 60 60 60 60 60 60 60 60 120 120 180 120 120 120 60 180 180 180 180 180 180 180 180 120 60 120 120 240 300 240 180 180 180 120 60 60
HCOM132 132 51072 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
HKCK132 132 88156 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
KJNG132 132 51055 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
KKMG132 132 51036 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
KKSR132 132 63138 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
KLMK132 132 96126 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
KTBR132 132 97189 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
KULN275 275 88201 180 120 0 0 0 0 0 0 0 0 0 0 0 0 0 0 60 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180 180
KULNSVC1 6.7 88501 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 20 40 40 40 40 40 40 40 40 40 40 60 60 60 60 60 40 40 40 40 40 40 40 40 40 40 20 20 20 20 0
KULNSVC2 6.7 88551 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 20 40 40 40 40 40 40 40 40 40 40 60 60 60 60 60 40 40 40 40 40 40 40 40 40 40 20 20 20 20 0
KULS132N 132 88117 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120
LMUT132 132 63129 60 60 60 60 60 60 0 0 0 0 0 0 0 0 0 0 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
MERU132 132 51057 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
MHTA132 132 51022 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
PCHJ132 132 88174 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
PGDT132 132 97153 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120
PIDH132 132 51049 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
PKLN132 132 63133 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 0 0 0 0 0 0 0 0 0 0 0
PPJG132 132 96147 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30
PRID132 132 62155 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
RASA132 132 96117 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30
SDAM132 132 88173 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
SIKD132 132 63111 60 60 60 60 60 60 60 60 60 0 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
SJAY132 132 62112 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
SLTI132 132 51079 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
SMRK132 132 96133 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
SMTI132R 132 597154 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
SNAI132 132 97162 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
SSWW132 132 51029 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
TMAS132 132 96110 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
TMSY132 132 51084 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
TPOI132 132 97127 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
TPOI132R 132 597127 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 0 0 0 0 0 0 0 0 0 0 0
YGPG132 132 97107 60 60 60 60 60 60 60 60 0 0 0 0 0 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60
YGPNSVC 6.7 97503 -10 -10 -15 -15 -20 -20 -20 -20 -20 -20 -20 -20 -20 -20 -20 -20 -20 -10 -5 0 0 10 10 10 10 10 0 10 10 10 10 10 10 10 10 10 0 0 0 10 10 20 10 10 10 0 0 -5 -10

6.4.2.8 Based on optimized voltage schedule, comparison on total system MW loss with
and without SVR regulation is shown on Figure 6.35 and it is clear that SVR could
realize further reduction in system losses.

Total System Loss (MW)


200

195

190

185

180

175

170

165

160

155

150

145

140

135

130

125

120
No Regulation
115
Optimal Regulation
110
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.35: Comparison of System Loss for With and Without SVR

90
6.4.2.9 Total amount of reduction in losses for total system with SVR regulation in a 24-
hour period is 19.561MWh, and variation over the day is shown in Figure 6.36.

Difference in Losses (MW)


1.8

1.7

1.6

1.5

1.4

1.3

1.2

1.1

1.0

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0.0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.36: Reduction of System Loss with SVR

91
6.4.3 Dynamic Simulations

6.4.3.1 For dynamic simulations, SVR controllers are equipped at the pilot bus and at each
of the participating generating units. Control parameters for the controllers are
given in Table 6.4.

Table 6.4: Control Parameter for the SVR Controllers


Pilot Bus
Bus No. Name KP KI
52027 OLPT275 0.500 0.500
Generator
Bus No. Name KPQ KIQ
59036 JMAH U1 0.001 0.001
59037 JMAH U2 0.001 0.001

6.4.3.2 The user defined model (UDM) for the SVR was created using available tool in
PSS/E software. The source code for the model is written using FORTRAN shown
in Appendix 6E. Overall flow of SVR simulations in PSS/E Load Flow and in
Dynamic is shown in Figure 6.37.

Source of Load and Generation


TNBTMeter and Realtime

Microsoft® Office
Access Database

PSS®E Base Case Python

Convert Load and Generation Create 49 PSS®E Load Flow


Other purposes
with 1st Instant Load Flow for every half-hour for one day

Change Load Create Input Files for CVC


svr.dat and vpn.dat
svr.dat – Pilot Bus, Generators, and Control Parameter
vpn.dat – Scheduled Voltage
Change Switched-Shunt

Load CVC Model – cvc.dll


Change GREF for Governor
(Status = 1) Loop Every Half-Hourly Instant

Change VREF for Exciter Run Dynamic 200 seconds


Write Plot File
(Status = 1 and Generation > 0.0) (to represent half hour)

Figure 6.37: Overall Procedure for simulating SVR load flow and dynamics in
PSS/E

92
6.4.3.3 Part of Python code where CVC Model input files are created and added for
simulation is shown in Figure 6.38. Full Python code used to run simulation is
given in Appendix 6F.

Figure 6.38: Part of Python Code for CVC Model

93
6.4.3.4 Figure 6.39 compares voltage variations using dynamic simulations at the pilot bus
OLPT275 for three different types of regulations, namely, without regulation,
constant voltage regulation, and optimal voltage regulation

l
Figure 6.39: Comparison of Bus Voltage at OLPT275 with different
voltage Regulations

6.4.3.5 Comparison of MVAR generation form JMAH units under different types of voltage
regulation is shown in Figure 6.40.

Figure 6.40: Comparison of MVAR Generation by JMAH at different


Regulations

94
6.4.3.6 Figure 6.41 shows the voltage at the pilot bus using constant SVR voltage schedule.
It is clear that the SVR controllers have performed as intended.

Figure 6.41: Voltage at Pilot Bus with Constant Scheduled Voltage

6.4.3.7 Result of simulation for voltage at the pilot bus with optimal scheduled voltage is
shown Figure 6.42 together with scheduled voltages.

Schedule Voltage

Figure 6.42: Voltage at Pilot Bus with Optimal Scheduled Voltage

95
6.4.3.8 Based on optimized voltage regulation, comparison of total system MW losses for
with and without SVR regulation is shown on Figure 6.43. Results indicate slight
difference between load flow and dynamic simulations due to the modeling of load.
In load flow simulation, load is modeled as constant power where in dynamic
simulation load is modeled as mix constant current, and constant impedance.

Figure 6.43: Comparison of System Loss for With and Without SVR

96
6.5 SVR Multi Zone Model Simulation Results –
Load Flow and Dynamics
6.5.1 Case Study

6.5.1.1 In this section, SVR multi zone simulation results are presented using the same as
for single zone in section 6.4. However, in this case additional pilot buses are
included for each of the voltage control zone. They are total of four pilot buses,
which are, PAKA275, PRGS275, OLPT275, and BBTU275. Each bus was assigned
to its voltage regulating zone with identified participating generating units to
provide reactive power as shown in Table 6.5. Only on-line generating units are
included to participate as their effects can be observed.

Table 6.5: Pilot Buses and Participating Generating Units


Zone 0 1 2 3
Pilot Bus PAKA275 PRGS275 OLPT275 BBTU275
Generator KNYR U2 JMJG U1 JMAH U1 MPSS GT1
Unit KNYR U3 JMJG U2 JMAH U2 MPSS GT2
KNYR U4 JMJG U3 KLPP GT13 MPSS ST
PAKA GT1A SGRI GT13 KLPP GT14 PGPS GT3A
PAKA GT1B SGRI GT31 KLPP GT15 PGPS ST3C
PAKA GT2A SGRI GT32 KLPP ST17 TBIN U1
PAKA GT2B SGRI GT33 PGLA GT11 TBIN U2
PAKA GT3A SGRI GT34 PGLA GT12 YPGS GT11
PAKA GT3B SGRI ST14 PGLA ST10 YPGS GT12
PAKA ST1C SIHY U1 PKLG U3 YPGS ST10
PAKA ST2C SIHY U2 PKLG U4
PAKA ST3C SIHY U3 PKLG U5
PGAU U1 SKSP GT1 PKLG U6
YPKA GT11 PKLG GT8
YPKA GT12 PKLG GT9
YPKA GT21 TJGS GT1A
YPKA GT22 TJGS GT1B
YPKA ST10 TJGS GT2A
YPKA ST20 TJGS GT2B
TJGS ST1C
TJGS ST2C

6.5.1.2 Various modes of scheduled voltage are applied to the pilot busses as to
demonstrate the flexibility of the SVR model. Modes of scheduled voltage
simulated are constant voltage, two steps constant voltage, gradually reduced
voltage, and optimal voltage obtained based on OPF.

97
6.5.2 Load Flow Simulations

6.5.2.1 Results of SVR load flow simulations using the various modes of pilot bus are
shown in Figures 6.44, 6.45, 6.46, and 6.47, for the following voltage schedule
modes:
a) constant voltage,
b) two steps constant voltage,
c) linearly reduced voltage, and
d) optimal voltage obtained based on OPF.
respectively. It is clear that, the load flow method developed for SVR simulations in
multi zone case is functioning as expected.

Bus Voltage (pu)


1.060
PAKA275
PRGS275
1.055 OLPT275
BBTU275

1.050

1.045

1.040

1.035

1.030

1.025

1.020

1.015

1.010

1.005

1.000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.44: Results of Constant Scheduled Voltage

98
Bus Voltage (pu)
1.060
PAKA275
PRGS275
1.055 OLPT275
BBTU275

1.050

1.045

1.040

1.035

1.030

1.025

1.020

1.015

1.010

1.005

1.000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.45: Results of Two Step Constant Scheduled Voltage

Bus Voltage (pu)


1.060
PAKA275
PRGS275
1.055 OLPT275
BBTU275

1.050

1.045

1.040

1.035

1.030

1.025

1.020

1.015

1.010

1.005

1.000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.46: Results of Gradually Reduced Scheduled Voltage

99
Bus Voltage (pu)
1.060
PAKA275
PRGS275
1.055 OLPT275
BBTU275

1.050

1.045

1.040

1.035

1.030

1.025

1.020

1.015

1.010

1.005

1.000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.47: Results of Optimal Scheduled Voltage

6.5.2.2 Figure 6.48, 6.49, 6.50 and 6.51 show voltage variations at each of the pilot due
to the different voltage scheduling modes in comparison with that without any
voltage regulation.

Bus Voltage (pu)


1.070
No Regulation
1.065
Constant Regulation
1.060 Two Step Constant Regulation
Gradually Reduced Regulation
1.055
Optimal Regulation
1.050

1.045

1.040

1.035

1.030

1.025

1.020

1.015

1.010

1.005

1.000

0.995

0.990

0.985

0.980

0.975

0.970
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.48: Results Comparison for Pilot Node PAKA275

100
Bus Voltage (pu)
1.070
No Regulation
1.065
Constant Regulation
1.060 Two Step Constant Regulation
Gradually Reduced Regulation
1.055
Optimal Regulation
1.050

1.045

1.040

1.035

1.030

1.025

1.020

1.015

1.010

1.005

1.000

0.995

0.990

0.985

0.980

0.975

0.970
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.49: Results Comparison for Pilot Node PRGS275

Bus Voltage (pu)


1.070
No Regulation
1.065
Constant Regulation
1.060 Two Step Constant Regulation
Gradually Reduced Regulation
1.055
Optimal Regulation
1.050

1.045

1.040

1.035

1.030

1.025

1.020

1.015

1.010

1.005

1.000

0.995

0.990

0.985

0.980

0.975

0.970
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.50: Results Comparison for Pilot Node OLPT275

101
Bus Voltage (pu)
1.070
No Regulation
1.065
Constant Regulation
1.060 Two Step Constant Regulation
Gradually Reduced Regulation
1.055
Optimal Regulation
1.050

1.045

1.040

1.035

1.030

1.025

1.020

1.015

1.010

1.005

1.000

0.995

0.990

0.985

0.980

0.975

0.970
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.51: Results Comparison for Pilot Node BBTU275

6.5.2.3 Figures 6.52, 6.53, 6.54 and 6.55 show for each pilot node (voltage control zone)
the total MVAR generation of the participating generating units in the voltage
control area with and without SVR. As with SVR, only MVAR outputs using optimal
voltage schedule are shown.

MVAR Generation
700
No Regulation
600 Optimal Regulation

500

400

300

200

100

-100

-200

-300

-400

-500

-600

-700

-800

-900

-1000

-1100

-1200
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.52: Comparison for Total MVAR Generation by Participating


Generators for Pilot Node PAKA275

102
MVAR Generation
700
No Regulation
600 Optimal Regulation

500

400

300

200

100

-100

-200

-300

-400

-500

-600

-700

-800

-900

-1000

-1100

-1200
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.53: Comparison for Total MVAR Generation by Participating


Generators for Pilot Node PRGS275

MVAR Generation
700
No Regulation
600 Optimal Regulation

500

400

300

200

100

-100

-200

-300

-400

-500

-600

-700

-800

-900

-1000

-1100

-1200
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.54: Comparison for Total MVAR Generation by Participating


Generators for Pilot Node LPT275

103
MVAR Generation
700
No Regulation
600 Optimal Regulation

500

400

300

200

100

-100

-200

-300

-400

-500

-600

-700

-800

-900

-1000

-1100

-1200
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.55: Comparison for Total MVAR Generation by Participating


Generators for Pilot Node BBTU275

6.5.2.4 Figure 6.56 compares the total amount of capacitor banks in service between with
and without SVR and Figure 6.57 shows the amount of shunt capacitor reduction
with the applications of SVR.
Total Shunt (MVAR)
3300
No Regulation
Optimal Regulation
3200

3100

3000

2900

2800

2700

2600

2500

2400

2300

2200

2100

2000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.56: Comparison for Total Switched Shunt with and without SVR

104
Total Shunt Reduction (MVAR)
600

550

500

450

400

350

300

250

200

150

100

50

0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.57: Total Switched Shunt Reduction with Optimal Regulation

6.5.2.5 Figure 6.58 compares total system losses with and without SVR. In this case, the
pilot node scheduled voltage is based on OPF. Figure 6.59 shows the amount of
loss reduction over the day.

Total System Loss (MW)


200
No Regulation
Optimal Regulation
190

180

170

160

150

140

130

120

110

100
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.58: Comparison for Total System Loss with and without SVR

105
Total Loss Reduction (MW)
17

16

15

14

13

12

11

10

0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Figure 6.59: Total System Loss Reduction with SVR

106
6.5.3 Dynamic Simulation

6.5.3.1 Control parameters (KP and KI) for each pilot node voltage controller and the
corresponding participating generating units voltage controller used in SVR
dynamic simulations are given in Table 6.6.

Table 6.6: Pilot Bus and Generator Unit Control Parameters


Zone 0 1 2 3
Pilot Bus PAKA275 0.5 0.5 PRGS275 0.5 0.5 OLPT275 0.5 0.5 BBTU275 0.5 0.5
Generator KNYR U2 0.001 0.001 JMJG U1 0.001 0.001 JMAH U1 0.001 0.001 MPSS GT1 0.010 0.010
Unit KNYR U3 0.001 0.001 JMJG U2 0.001 0.001 JMAH U2 0.001 0.001 MPSS GT2 0.010 0.010
KNYR U4 0.001 0.001 JMJG U3 0.001 0.001 KLPP GT13 0.010 0.010 MPSS ST 0.001 0.001
PAKA GT1A 0.010 0.010 SGRI GT13 0.001 0.001 KLPP GT14 0.010 0.010 PGPS GT3A 0.010 0.010
PAKA GT1B 0.010 0.010 SGRI GT31 0.001 0.001 KLPP GT15 0.010 0.010 PGPS ST3C 0.001 0.001
PAKA GT2A 0.010 0.010 SGRI GT32 0.001 0.001 KLPP ST17 0.001 0.001 TBIN U1 0.001 0.001
PAKA GT2B 0.010 0.010 SGRI GT33 0.001 0.001 PGLA GT11 0.010 0.010 TBIN U2 0.001 0.001
PAKA GT3A 0.010 0.010 SGRI GT34 0.001 0.001 PGLA GT12 0.010 0.010 YPGS GT11 0.001 0.001
PAKA GT3B 0.010 0.010 SGRI ST14 0.001 0.001 PGLA ST10 0.001 0.001 YPGS GT12 0.001 0.001
PAKA ST1C 0.001 0.001 SIHY U1 0.001 0.001 PKLG U3 0.001 0.001 YPGS ST10 0.001 0.001
PAKA ST2C 0.001 0.001 SIHY U2 0.001 0.001 PKLG U4 0.001 0.001
PAKA ST3C 0.001 0.001 SIHY U3 0.001 0.001 PKLG U5 0.001 0.001
PGAU U1 0.001 0.001 SKSP GT1 0.001 0.001 PKLG U6 0.001 0.001
YPKA GT11 0.001 0.001 PKLG GT8 0.010 0.010
YPKA GT12 0.001 0.001 PKLG GT9 0.010 0.010
YPKA GT21 0.001 0.001 TJGS GT1A 0.010 0.010
YPKA GT22 0.001 0.001 TJGS GT1B 0.010 0.010
YPKA ST10 0.001 0.001 TJGS GT2A 0.010 0.010
YPKA ST20 0.001 0.001 TJGS GT2B 0.010 0.010
TJGS ST1C 0.001 0.001
TJGS ST2C 0.001 0.001

6.5.3.2 Figures 6.60, 6.61, 6.62 and 6.63 show voltage variations at each of the four pilot
nodes for different schedule voltage control for the SVR. It is also clear that the
results of the dynamic simulations are similar to that of load flows.

Figure 6.60: Dynamic simulation results showing pilot nodes voltages for
constant scheduled voltage
107
Figure 6.61: Dynamic simulation results showing pilot nodes voltages for
two step constant scheduled voltage

Figure 6.62: Dynamic simulation results showing pilot nodes voltages for
Gradually Reduced Scheduled Voltage

108
Figure 6.63: Dynamic simulation results showing pilot nodes voltages for
Optimal Scheduled Voltage

6.5.3.3 Figures 6.64, 6.65, 6.66, and Figure 6.67 compare unregulated voltage and the
four scheduled voltage modes for each pilot node.

Figure 6.64: Dynamic simulation results for various scheduled voltages


for pilot node PAKA275

109
Figure 6.65: Dynamic simulation results for various scheduled voltages
for pilot node PRGS275

Figure 6.66: Dynamic simulation results for various scheduled voltages


for pilot node OLPT275

110
Figure 6.67: Dynamic simulation results for various scheduled voltages
for pilot node BBTU275

6.5.3.4 Figures 6.68 through 6.71 compare for each pilot node the MVAR output of the
most influential generating unit with and without SVR using optimal voltage
schedule at the pilot node.

111
Figure 6.68: Comparison for Total MVAR Generation by PGAU U1 for pilot
node PAKA275

Figure 6.69: Comparison for Total MVAR Generation by JMJG U2 for pilot
node PRGS275
112
Figure 6.70: Comparison for Total MVAR Generation by JMAH U2 for pilot
node OLPT275

Figure 6.71: Comparison for Total MVAR Generation by TBIN U1 for pilot
node BBTU275

113
6.5.3.5 Based on optimal voltage regulation, total system MW loss with and without SVR
are compared in Figure 6.72.

Figure 6.72: Comparison of System Loss for with and without SVR

6.5.4 Conclusion of Multi Zone SVR Load Flow and Dynamic


Simulation Model and Method

6.5.4.1 Based on the results of simulations presented in 6.5.2 and 6.5.3, both SVR load
flow and dynamic simulation models and methods have been successfully
implemented and this is an important achievement of the research work. It is now
possible to apply the developed tool to analyse detailed implementation of SVR in
TNB’s Grid.

114
Chapter 7: Conclusions and Recommendations
By Sallehhudin Yusof

7.1 Summary of Completed Tasks


7.1.1 In this project, TNB Research Working Group on Coordinated Voltage Control (WG-
CVC) has completed the following tasks:

(1) Reviewed existing secondary voltage controls practices in TNB’s


Transmission Network and recognized that improvement in voltage controls
through CVC could enhance network performance;

(2) Carried out literature review of several documents on CVC and found that
approaches as described in CIGRE Report 310 “Coordinated Voltage
Controls in Transmission Network”, February 2007, could be emulated but
required to be complemented with a new simulation methodology;

(3) Developed both load flow and dynamic based 24-hour simulation tools to
facilitate investigations into the techniques to perform CVC in evaluating its
performance and effectiveness;

(4) Developed supporting functions for use with CVC including, identification of
voltage control areas, identification of pilot node in each voltage control
area, methods for sharing and controls of generating units reactive power
and control algorithms in dynamic simulations, and visualization tools to
facilitate analysis of results;

(5) Using the developed tools and methods, carried out simulations of typical
SVR in the network and found that the results are favourable; and

(6) Documented all the work carried out by the WG-CVC into this report;

7.2 Main Findings and Conclusions


7.2.1 Currently, secondary voltage controls in the transmission network are being carried
out manually by the control operators based on the given guidelines and control
actions and results could vary from one operator to another depending on their
experience and system information and knowledge and therefore, the applications
of SVR could offer a more consistent voltage control actions.

7.2.2 Currently, voltage and reactive power sources scheduling are not included as part
of operation planning inputs in the day ahead submission to the control operators
and WG-CVC believes that there is a need to provide day ahead reactive power
115
and voltage schedules as guidelines to the control operators to further enhance
system operations.

7.2.3 In normal operation, generating unit AVR set point is normally used to affect
desired terminal voltage but being achieved through manual generator-
transformer tap control.

7.2.4 Analysis of voltage profile across the network revealed a large variation in voltage
magnitude geographically which would result in significant reactive power transfer
incurring additional losses and therefore a flatter voltage profile across the
network through the use of SVR could reduce losses.

7.2.5 Based on the investigations carried out on the applications of SVR in the network,
the WG concluded that its implementation is feasible and it could generate
potential benefits in the areas voltage security and savings in losses;

7.3 Recommendations
7.3.1 The followings are main recommendations of the WG-CVC:

(1) Use the tools developed by the WG-CVC to perform detailed investigations
of the applications of SVR and to design the SVR scheme including its
implementation plan;
(2) Initiate a process to include reactive power sources and voltage scheduling
in the day ahead report to the control operators including the necessary
control actions;
(3) Initiate a process in operational planning to improve further the day ahead
daily security assessment based on 24-hour security analysis which would
require research to be conducted in the following areas:
• Massive computation of contingency analysis, i.e., 48 snapshots of base
cases; and
• Development of visualization algorithms and tools to interpret and
summarise large number of outputs and results;

7.3.2 It is also recommended that the following technical papers be written by the
members of TNB Research WG on CVC for submissions to suitable conferences or
journals:

a) “Overview of Voltage Control Issues and Potential Applications of Secondary


Voltage Regulations”;

b) “Development of 24-Hour Load Flow Simulations and its Applications in


Operational Planning”

c) “Development of 24-Hour Dynamic Simulations and its Potential Applications”;

d) “Methods for Identifying Voltage Control Areas, Pilot Nodes and Participating
Generators in Secondary Voltage Control Scheme”;

116
e) “Modeling of Secondary Voltage Control Component for 24-Hour Dynamic
Simulations”

117
APPENDIX 1A – Literature Survey Presentations

118
APPENDIX 2B – Extracting and Assembling
Voltage Change Data from Output of QV Runs

Input Data Files:


1. genlist.dat
2. <plant_hv_bus_id>.dat
3. :
4. :

Python Program: (“saveout.py” and “saveout2.py”)


1. saveout.py – output basecase pu voltages of 132kV and above buses
(before incrementing Q)
h = open("G:\\TNB\\QV Sensitivity\\Base.dat",'r')
g = open("G:\\TNB\\QV Sensitivity\\out0.dat",'w')
eof = 1
line = h.readline()
g.write('BusNo BusId BasekV kV(pu) \n')
if line<>"":
eof = 0
line = h.readline()
line = h.readline()
line = h.readline()
line = h.readline()
line = h.readline()
while not eof:
busno=int(line[0:6])
busid=line[7:18].strip()
basekv=float(line[19:25])
kv=float(line[51:58])
g.write(str(busno)+' '+busid+' '+str(basekv)+' '+str(kv)+'\n')
line = h.readline()
if line<>"":
eof = 0
else:
eof = 1
h.close
g.close

2. saveout2.py – output pu voltages of 132kV and above buses after Q


increments
kvstr=[]
kvstr2=[]
f = open(r"""G:\TNB\QV Sensitivity\genlist.dat""",'r')
g = open(r"""G:\TNB\QV Sensitivity\out1.dat""",'w')
e = open(r"""G:\TNB\QV Sensitivity\out2.dat""",'w')
eof=1
line = f.readline()
plant = line.strip()
if plant<>"":
eof = 0
stn=0
hdr = 'BusNo Bus BaseKV'
while not eof:
hdr = hdr+' '+plant
bn=0
stn=stn+1
h = open("G:\\TNB\\QV Sensitivity\\"+plant+".dat",'r')
eof2 = 1

119
line = h.readline()
if line<>"":
eof2 = 0
line = h.readline()
line = h.readline()
line = h.readline()
line = h.readline()
line = h.readline()
while not eof2:
busno=int(line[0:6])
busid=line[7:18].strip()
basekv=float(line[19:25])
kv=float(line[51:58])
bn=bn+1
if stn==1:
if bn<401:
kvstr.append('')
kvstr[bn-1]=str(busno)+' '+busid+' '+str(basekv)+' '+str(kv)
else:
kvstr2.append('')
kvstr2[bn-401]=str(busno)+' '+busid+' '+str(basekv)+'
'+str(kv)
else:
if bn<401:
kvstr[bn-1]=kvstr[bn-1]+' '+str(kv)
else:
kvstr2[bn-401]=kvstr2[bn-401]+' '+str(kv)
line = h.readline()
if line<>"":
eof2 = 0
else:
eof2 = 1
line = f.readline()
plant = line.strip()
if plant<>"":
eof = 0
else:
eof = 1

print len(kvstr),kvstr[389]
print len(kvstr2),kvstr2[226]
g.write(hdr+'\n')
for i in range(400):
g.write(kvstr[i]+'\n')
for j in range(227):
e.write(kvstr2[j]+'\n')
h.close
f.close
g.close
e.close

Output Files:
1. out0.dat - basecase pu voltages
2. out1.dat - pu voltages of first 400 buses
3. out2.dat - pu voltages of remaining buses

120
APPENDIX 3A – GREF Verifications
Results of GREF verification by injecting 5 MW to selected
machines
IEEEG1

Increase JMJG 5MW to initial generation 668MW


GREF AT BUS 63937 [JMJG_U1 23.000] MACHINE "1" CHANGED FROM 0.70879 TO 0.71761

121
GAST

Increase PLPSGT1 5MW to initial generation 143MW


GREF AT BUS 61901 [PLPSGT11 15.750] MACHINE "1" CHANGED FROM 0.71622 TO 0.74338

HYGOV

Increase KNRG U1 5MW to initial generation 20MW

GREF AT BUS 63908 [KNRG_U1 11.000] MACHINE "1" CHANGED FROM 0.02046 TO 0.02392

122
IEEESGO

Increase SYPS U1 5MW to initial generation 0MW

GREF AT BUS 63911 [SYPS_U1 11.000] MACHINE "1" CHANGED FROM 0.0 TO 0.17986

GAST2A

Increase PAKAGT1A 5MW to initial generation 66MW

GREF AT BUS 75911 [PAKAGT1A 11.500] MACHINE "1" CHANGED FROM 0.04323 TO 0.04658

123
Results of GREF verification by reducing 5 MW to selected
machines

GAST2A

Decrease KLPPGT13 5MW to initial generation 140MW


GREF AT BUS 59001 [KLPPGT13 15.800] MACHINE "1" CHANGED FROM 0.04967 TO 0.04791

HYGOV

Decrease KNRG U1 5MW to initial generation 30MW


GREF AT BUS 63908 [KNRG_U1 11.000] MACHINE "1" CHANGED FROM 0.02764 TO 0.02429

124
IEEESGO

Decrease SYPS U1 5MW to initial generation 24MW


GREF AT BUS 63911 [SYPS_U1 11.000] MACHINE "1" CHANGED FROM 0.86897 TO 0.68911

125
APPENDIX 3B - Python code for GREF
verification by injecting 5 MW to selected
machines

Input files:
1) The python code file (Single Mac Test_Final.py)
2) A converted power flow case in PSS/E version 32 (25032010_0000_TNBcnv_v32.sav)
3) A snapshot file (Dynamics Data-2Apr2010.snp)
4) A text files for list of governor models (GovList.txt)
The format is as below:
Machine Bus Number, ‘Turbine-Governor Model’, Bus ID number
(Note: there is no need to put comma in between. This is done for clarity)
Example:
75911 'GAST2A' 1

Output files:
• Output files (Bus number.out) for selected machines.

126
Python code (Single Mac Test_Final.py):
#------------------------------------------------------------------
# Execution from within PSSE32
#------------------------------------------------------------------
import os
xp = os.getcwd() + "\\"
#------------------------------------------------------------------
#READ LOAD AND GENERATION DISPATCH
#------------------------------------------------------------------
#READ INPUT FROM LOADFLOW FILE
f = open(xp + 'GovList.txt') } Text file for governor list
lfc = '25032010_0000_TNBcnv_v32.sav' } Converted power flow case
lfs = 'Dynamics Data-2Apr2010.snp' } Snapshot file
for line in f:
psspy.case(xp + lfc)
psspy.rstr(xp + lfs)
tmp=line.split(' ')
print tmp
bno = int(tmp[0])
print bno
psspy.strt(0,xp + str(bno) + '.out') } Output files
psspy.dynamics_solution_param_2([_i,_i,_i,_i,_i,_i,_i,_i],[_f,_f, 0.005,_f,_f,_f,_f,_f])
psspy.run(0,1,0,5,0)
ierr, genP = psspy.macdat(bno, '1', 'P')
print genP
#CHANGE MW OUTPUT
genP = genP + 5
ierr, mbase = psspy.macdat(bno, '1', 'MBASE')
ierrgov, govmodel = psspy.mdlnam(bno, '1', 'GOV')
print bno, ierrgov, govmodel
#CHANGE GREF
if (ierrgov == 4):
print 'No Gov Model'
elif (govmodel.strip() == 'TGOV1'):
print 'GREF TGOV1 changed'
ierr, J = psspy.mdlind(bno, '1', 'GOV', 'CON')
ierr, CONJ = psspy.dsrval('CON', J)
gref = (genP/mbase)*CONJ
ierr = psspy.change_gref(bno, '1', gref)
elif (govmodel.strip() == 'HYGOV'):
print 'GREF HYGOV changed'
ierr, J = psspy.mdlind(bno, '1', 'GOV', 'CON')
ierr, CONJ = psspy.dsrval('CON', J)
ierr, CONJ9 = psspy.dsrval('CON', J+9)
ierr, CONJ11 = psspy.dsrval('CON', J+11)
D=((genP/mbase)/CONJ9)+CONJ11
gref=D*CONJ
ierr = psspy.change_gref(bno, '1', gref)
elif (govmodel.strip() == 'GAST'):
print 'GREF GAST changed'
A = (genP/mbase)
gref = A
ierr = psspy.change_gref(bno, '1', gref)
elif (govmodel.strip() == 'IEESGO'):
print 'GREF IEESGO changed'
OUT2 = (genP/mbase)
gref = OUT2
ierr = psspy.change_gref(bno, '1', gref)
elif (govmodel.strip() == 'IEEEG1'):
print 'GREF IEEEG1 changed'
ierr, J = psspy.mdlind(bno, '1', 'GOV', 'CON')
ierr, CONJ9 = psspy.dsrval('CON', J+9)
ierr, CONJ12 = psspy.dsrval('CON', J+12)
ierr, CONJ15 = psspy.dsrval('CON', J+15)
ierr, CONJ18 = psspy.dsrval('CON', J+18)
V1 = CONJ9 + CONJ12 + CONJ15 + CONJ18
gref = (genP/mbase)/V1
ierr = psspy.change_gref(bno, '1', gref)
elif (govmodel.strip() == 'GAST2A'):
print 'GREF GAST2A changed'
ierr, J = psspy.mdlind(bno, '1', 'GOV', 'CON')
ierr, CONJ6 = psspy.dsrval('CON', J+6)
ierr, CONJ25 = psspy.dsrval('CON', J+25)
ierr, CONJ26 = psspy.dsrval('CON', J+26)
ierr, CONJ14 = psspy.dsrval('CON', J+14)
ierr, CONJ12 = psspy.dsrval('CON', J+12)
ierr, CONJ16 = psspy.dsrval('CON', J+16)
ierr, CONJ29 = psspy.dsrval('CON', J+29)
ierr, CONJ11 = psspy.dsrval('CON', J+11)
ierr, CONJ3 = psspy.dsrval('CON', J+3)
ierr, CONJ = psspy.dsrval('CON', J)
OUT2 = ((genP/CONJ6) - CONJ25)/CONJ26
OUT12 = (OUT2*((CONJ14/CONJ12)+CONJ16)) - CONJ29
OUT0 = OUT12/CONJ11
A = OUT0*CONJ3
gref = A/CONJ
ierr = psspy.change_gref(bno, '1', gref)
psspy.run(0,10,0,5,0)
127
f.close
#------------------------------------------------------------------
# End of Hourly Run
#------------------------------------------------------------------
print 'End of Run'

128
APPENDIX 3C - Python code for full dynamic
simulation

Input files:
1) The python code file (LearnCVC TNB data.py)
2) A converted power flow case in PSS/E version 32 (25032010_0000_TNBcnv_v32.sav)
3) A snapshot file (Dynamics Data-2Apr2010.snp)
4) 23 unconverted power cases
5) A text files listing the names of 24 cases and snapshot file (LFList.txt)

Output files:
• test.out

129
Python code (LearnCVC TNB data.py):
##------------------------------------------------------------------
## Execution within PSSE 32
##------------------------------------------------------------------
import os,datetime
import win32com.client
xp = os.getcwd() + "\\"

##------------------------------------------------------------------
## Read Load, Generation Dispatch, Switched Shunt
## Read *.sav(converted) ,*.snp, *.snp(24hrs)
##------------------------------------------------------------------
fl = open(xp + 'LFList.txt')
lfc = fl.readline().replace('\n','')
lfs = fl.readline().replace('\n','')
Load = []
Gen = []
SwitchShunt =[]
HourLoss = []
HourLossCVC = []
i = 0

print '-------Start Read Loadflow Files------------------------------'


for lf in fl:
lf = lf.replace('\n','')
print 'Read Loadflow Hour:%3d - %s' % (i, lf)
print '------------------------------------------------------------'
tl = []
tg = []
PQloss = []
tSwitchShunt = []
psspy.case(xp + lf)
psspy.fnsl([0,0,0,1,1,0,99,0])
##------------------------------------------------------------
## Hourly Loss Before CVC
##------------------------------------------------------------
ierr, cmpval = psspy.systot('LOSS')
PQLoss =[str(i) + "00",cmpval.real,cmpval.imag]
i = i+1
ierr = psspy.inibus(0) #starting bus number = 0
ierr, ibus, cval = psspy.nxtbus()
while ibus > 0:
##------------------------------------------------------------
## Check each ibus for a load & get the loads ID,P,Q
##------------------------------------------------------------
ierr = psspy.inilod(ibus)
if ierr == 0:
ierr, lid = psspy.nxtlod(ibus)
while ierr == 0:
ierr, cmpval = psspy.loddt2(ibus, lid.strip(), 'MVA', 'NOM') #Salleh 'ACT',Daniel 'NOM'
tl.append([ibus,lid.strip(),cmpval.real,cmpval.imag])
ierr, lid = psspy.nxtlod(ibus)
##------------------------------------------------------------
## Check each ibus for a machine & get the machine ID,P,V
##------------------------------------------------------------
ierr = psspy.inimac(ibus)
if ierr == 0:
ierr, gid = psspy.nxtmac(ibus)
while ierr == 0:
ierr, p = psspy.macdat(ibus, gid, 'P')
ierr, v = psspy.macdat(ibus, gid, 'VSCHED')
tg.append([ibus,gid.strip(),p,v])
ierr, gid = psspy.nxtmac(ibus)
##------------------------------------------------------------
## Check each ibus for a switched shunt &
## Get Vhi, Vlo,Ctrl Mode, Binit
##------------------------------------------------------------
ierr, vhi, vlo = psspy.swsdat(ibus)
if ierr == 0:
ierr, qin = psspy.swsdt1(ibus, 'BINIT') #There is another option 'O_BINIT'
ierr, ctrl = psspy.swsint(ibus, 'MODE')
tSwitchShunt.append([ibus,vhi,vlo,qin,ctrl])
ierr, ibus, cval = psspy.nxtbus()

Load.append(tl)
Gen.append(tg)
SwitchShunt.append(tSwitchShunt)
HourLoss.append(PQLoss)
fl.close()

##------------------------------------------------------------------
##End of Read Load, Generation Dispatch, & Swithced Shunt
##Data stored in nested array Load, Gen & SwitchShunt
##------------------------------------------------------------------
##OPEN THE CONVERTED CASE AND RESTORE THE CORRESPONDING SNAPSHOT FILE
##FOR 24-HOUR SIMULATION OF LOAD AND DISPATCH CHANGES, THIS SHOULD START

130
##AT THE FIRST HOUR
##------------------------------------------------------------------
psspy.case(xp + lfc)
psspy.rstr(xp + lfs)
#INITIALISE AND PROVIDE THE OUTPUT FILE
psspy.strt(0,xp + 'test.out')
psspy.dynamics_solution_param_2([50,_i,_i,_i,_i,_i,_i,_i],[ 0.5, 0.001,0.01,_f,_f,_f,_f,_f])

##------------------------------------------------------------------
## COMMON DATA FOR LOAD DATA CONVERSION
##------------------------------------------------------------------
CIA = 100 # % OF CONST CURRENT ACTIVE LOAD
CIR = 0 # % OF CONST CURRENT REACTIVE LOAD
CYA = 0 # % OF CONST ADMITTANCE ACTIVE LOAD
CYR = 100 # % OF CONST ADMITTANCE REACTIVE LOAD
CPA = 0 # % OF CONST POWER ACTIVE LOAD
CPR = 0 # % OF CONST POWER REACTIVE LOAD
tr = 0.0
##------------------------------------------------------------------
## END OF COMMON DATA
##------------------------------------------------------------------
## GET COMMON DATA/NUMBERS FROM THE LOAD FLOW OR DYNAMIC DATA
##------------------------------------------------------------------
#NUMBER OF BUSES
ierr, nb = psspy.abuscount(-1, 1)

#NUMBER OF MACHINES
ierr, nm = psspy.amachcount(-1, 1)

#NUMBER OF LOAD BUSES


ierr, nl = psspy.alodbuscount(-1, 1)

#NUMBER OF SWITCHED SHUNT


ierr, nss = psspy.aswshcount(-1, 1)

##------------------------------------------------------------------
##END OF GET COMMON DATA/NUMBERS FROM THE LOAD FLOW OR DYNAMIC DATA
##------------------------------------------------------------------
###GET GENERATOR DATA
###------------------------------------------------------------------
###BUS NUMBERS, ID
##ierr, busno = psspy.amachint(-1, 1, 'NUMBER')
##ierr, busid = psspy.amachchar(-1, 1, 'ID')
###------------------------------------------------------------------
###END GET GENERATOR DATA
###------------------------------------------------------------------
###START DYNAMIC & RUN FOR 1 Sec WITHOUT LOAD CHANGE (DELT = 0.005)
###------------------------------------------------------------------
##psspy.dynamics_solution_param_2([_i,_i,_i,_i,_i,_i,_i,_i],[_f,_f, 0.005,_f,_f,_f,_f,_f])
##psspy.run(0,1,0,20,0)

###------------------------------------------------------------------
### Start of Hourly Run
###------------------------------------------------------------------
print 'Start Hourly Run'
for h in range(len(Gen)):
print '------------------------------------------------'
print 'Run Hour:%3d Start Time:%9.1fs' % (h,tr)
print '------------------------------------------------'
psspy.powerflowmode()
##------------------------------------------------------------
## Change load data
##------------------------------------------------------------
for i in range(nl):
bno = Load[h][i][0]
loadid = Load[h][i][1] #Daniel 'NOM'-no need V^2
loadP = Load[h][i][2]
loadQ = Load[h][i][3]
cip = (CIA/100)*loadP
ciq = (CIR/100)*loadQ
cyp = (CYA/100)*loadP
cyq = -(CYR/100)*loadQ
cpp = (CPA/100)*loadP
cpq = (CPR/100)*loadQ
#Insert the new converted load
psspy.load_data_3(bno,r"""1""",[_i,_i,_i,_i,_i],[ cpp, cpq, cip, ciq, cyp, cyq])
##------------------------------------------------------------
## Change Switched Shunt Data
##------------------------------------------------------------
for i in range(nss):
bno = SwitchShunt[h][i][0]
vhi = SwitchShunt[h][i][1]
vlo = SwitchShunt[h][i][2]
qin = SwitchShunt[h][i][3]
ctrl = SwitchShunt[h][i][4]
#Insert the status of the switched shunt

psspy.switched_shunt_data_3(bno,[_i,_i,_i,_i,_i,_i,_i,_i,ctrl,_i,_i,_i],[ _f,_f,_f,_f,_f,_f,_f,_f,vhi,
vlo,qin,_f],"")
psspy.dynamicsmode(1)
##------------------------------------------------------------

131
## CHANGE GREF
##------------------------------------------------------------
for i in range(nm):
bno = Gen[h][i][0]
genid = Gen[h][i][1]
genP = Gen[h][i][2]
ierrgov, govmodel = psspy.mdlnam(bno, '1', 'GOV')
ierr, ival = psspy.mdlind(bno, '1', 'GOV', 'CON')
#GEN DISPATCH MW
ierr, mbase = psspy.macdat(bno, '1', 'MBASE')
if (ierrgov == 4):
print 'No Gov Model'
elif (govmodel.strip() == 'TGOV1'):
##print 'GREF TGOV1 changed'
ierr, J = psspy.mdlind(bno, '1', 'GOV', 'CON')
ierr, CONJ = psspy.dsrval('CON', J)
gref = (genP/mbase)*CONJ
ierr = psspy.change_gref(bno, '1', gref)
elif (govmodel.strip() == 'HYGOV'):
##print 'GREF HYGOV changed'
ierr, J = psspy.mdlind(bno, '1', 'GOV', 'CON')
ierr, CONJ = psspy.dsrval('CON', J)
ierr, CONJ9 = psspy.dsrval('CON', J+9)
ierr, CONJ11 = psspy.dsrval('CON', J+11)
D=((genP/mbase)/CONJ9)+CONJ11
gref=D*CONJ
ierr = psspy.change_gref(bno, '1', gref)
elif (govmodel.strip() == 'GAST'):
##print 'GREF GAST changed'
A = (genP/mbase)
gref = A
ierr = psspy.change_gref(bno, '1', gref)
elif (govmodel.strip() == 'IEESGO'):
##print 'GREF IEESGO changed'
OUT2 = (genP/mbase)
gref = OUT2
ierr = psspy.change_gref(bno, '1', gref)
elif (govmodel.strip() == 'IEEEG1'):
##print 'GREF IEEEG1 changed'
ierr, J = psspy.mdlind(bno, '1', 'GOV', 'CON')
ierr, CONJ9 = psspy.dsrval('CON', J+9)
ierr, CONJ12 = psspy.dsrval('CON', J+12)
ierr, CONJ15 = psspy.dsrval('CON', J+15)
ierr, CONJ18 = psspy.dsrval('CON', J+18)
V1 = CONJ9 + CONJ12 + CONJ15 + CONJ18
gref = (genP/mbase)/V1
ierr = psspy.change_gref(bno, '1', gref)
elif (govmodel.strip() == 'GAST2A'):
##print 'GREF GAST2A changed'
ierr, J = psspy.mdlind(bno, '1', 'GOV', 'CON')
ierr, CONJ6 = psspy.dsrval('CON', J+6)
ierr, CONJ25 = psspy.dsrval('CON', J+25)
ierr, CONJ26 = psspy.dsrval('CON', J+26)
ierr, CONJ14 = psspy.dsrval('CON', J+14)
ierr, CONJ12 = psspy.dsrval('CON', J+12)
ierr, CONJ16 = psspy.dsrval('CON', J+16)
ierr, CONJ29 = psspy.dsrval('CON', J+29)
ierr, CONJ11 = psspy.dsrval('CON', J+11)
ierr, CONJ3 = psspy.dsrval('CON', J+3)
ierr, CONJ = psspy.dsrval('CON', J)
OUT2 = ((genP/CONJ6) - CONJ25)/CONJ26
OUT12 = (OUT2*((CONJ14/CONJ12)+CONJ16)) - CONJ29
OUT0 = OUT12/CONJ11
A = OUT0*CONJ3
gref = A/CONJ
ierr = psspy.change_gref(bno, '1', gref)
##------------------------------------------------------------
## CHANGE VREF
##------------------------------------------------------------
for i in range(nm):
bno = Gen[h][i][0]
genid = Gen[h][i][1]
Vsched = Gen[h][i][3]
#get the bus voltage
ierr, basekv = psspy.busdat(bno ,'BASE')
ierr, v = psspy.busdat(bno ,'KV')
v = v/basekv
ierr = psspy.increment_vref(bno, '1', Vsched - v)

#NEXT RUN
psspy.run(0,tr+40.0,0,20,0)
tr = tr+40.0
PQlossCVC = []
## ierr, cmpval = psspy.systot('LOSS')
## PQLossCVC =[i,cmpval.real,cmpval.imag]
## HourLossCVC.append(PQLossCVC)

##------------------------------------------------------------------
## End of Hourly Run
##------------------------------------------------------------------
print '\nEnd of Run'

132
##------------------------------------------------------------------
## Transfer Losses to Excel
##------------------------------------------------------------------
##xcl = win32com.client.Dispatch('Excel.Application')
##wb = xcl.Workbooks.Open( xp + "\\24 hrs Losses.xls")
##ws = wb.Worksheets.Item("Hourly Loss")
##ws.Activate
##ws.Cells(1,1).Value = 'Hour'
##ws.Cells(1,2).Value = 'P Loss (MW)'
##ws.Cells(1,3).Value = 'Q Loss (MVAR)'
##ws.Cells(1,4).Value = 'P Loss CVC(MW)'
##ws.Cells(1,5).Value = 'Q Loss CVC (MVAR)'
##
##for j in range(len(HourLoss)):
## k = j+ 2
## ws.Cells(k,1).Value = HourLoss[j][0]
## ws.Cells(k,2).Value = HourLoss[j][1]
## ws.Cells(k,3).Value = HourLoss[j][2]
##wb.Save()

print '\nEnd of Transfering Losses'

133
APPENDIX 4A – Short Circuit Levels and Various
Nodes in the Central Area
CURRENT SYSTEM 3-PH FAULT LEVEL
SELANGOR AND WPKL
132kV 275kV
Bus No. Bus Name kV Unit /I+/ Bus No. Bus Name kV Unit /I+/
88119 [PULU132 132.00] AMPS 31703.3 52003 [PKLG275 275.00] AMPS 39531.8
88171 [KULW132 132.00] AMPS 31351.2 52027 [OLPT275 275.00] AMPS 38794
51031 [KCPK132 132.00] AMPS 30987.7 52053 [KPAR275 275.00] AMPS 38222.6
551031 [KCPK132R 132.00] AMPS 30987.7 52020 [KLPP275 275.00] AMPS 37784.5
88111 [KULN132 132.00] AMPS 30567.6 52011 [CBPS275 275.00] AMPS 35767.6
588111 [KULN132R 132.00] AMPS 30567.6 52013 [HCOM275 275.00] AMPS 35550.6
51011 [KDSA132 132.00] AMPS 30367 52024 [BRGS275 275.00] AMPS 35052.1
88175 [PMJU132 132.00] AMPS 29983.2 88201 [KULN275 275.00] AMPS 32955.3
88136 [BTRZ132 132.00] AMPS 29806.5 152003 [PKLG275T 275.00] AMPS 32693.7
51116 [KSLS132 132.00] AMPS 29700.6 52052 [BTRK275 275.00] AMPS 30200.6
88120 [AMPG132 132.00] AMPS 29302.4 88230 [CBDK275 275.00] AMPS 28836.4
88195 [DDSA132 132.00] AMPS 29000.7 52038 [MGST275 275.00] AMPS 28771.2
51010 [SJSS132 132.00] AMPS 28910.9 52005 [SRDG275 275.00] AMPS 28753.2
51023 [NUNI132 132.00] AMPS 28618.6 88215 [AMPG275 275.00] AMPS 27766.4
88117 [KULS132N 132.00] AMPS 28567.4 88206 [PULU275 275.00] AMPS 27499.9
51006 [CBPS132 132.00] AMPS 28246.2 588204 [KULE275R 275.00] AMPS 27297.5
88196 [LJTK132 132.00] AMPS 27951.3 88204 [KULE275 275.00] AMPS 27269.2
51084 [TMSY132 132.00] AMPS 27407.8 88202 [KULS275 275.00] AMPS 26864.6
51004 [BRGS132 132.00] AMPS 27207.2 88210 [KULW275 275.00] AMPS 26272.1
51999 [ASMB132 132.00] AMPS 27171.2 52012 [BBTG275 275.00] AMPS 24734.6
50114 [MOXY132 132.00] AMPS 27005.2 388208 [SRYAFIC1 275.00] AMPS 24653
88146 [KLCC132 132.00] AMPS 26890.3 488208 [SRYAFIC2 275.00] AMPS 24653
51012 [MSWK132 132.00] AMPS 26699.4 88208 [SRYA275 275.00] AMPS 24069.4
51022 [MHTA132 132.00] AMPS 26551.2 88207 [GWAY275 275.00] AMPS 23933.6
51030 [SRDG132 132.00] AMPS 26224.4 588207 [GWAY275R 275.00] AMPS 23932.2
151075 [SJTC-T 132.00] AMPS 25589.7 88214 [VCTY275 275.00] AMPS 21959.5
51061 [ABBA132 132.00] AMPS 25461.1 88216 [PTAI275 275.00] AMPS 20991.3
51060 [BHGT132 132.00] AMPS 25397.3 88211 [BFLD275 275.00] AMPS 20471.7
51075 [SJTC132 132.00] AMPS 25272.3 152052 [BTRK-F1 275.00] AMPS 18277.6
51120 [KSJS132 132.00] AMPS 25270.6 252052 [BTRK-F2 275.00] AMPS 18277.6
88173 [SDAM132 132.00] AMPS 25182.6 55002 [BTRK500 500.00] AMPS 17139.4
588173 [SDAM132R 132.00] AMPS 25182.6 55003 [KPAR500 500.00] AMPS 15638.3
51032 [SDCA132 132.00] AMPS 25135 52021 [NUNI275 275.00] AMPS 15545.7
51025 [NSDA132 132.00] AMPS 24991.9
551025 [NSDA132R 132.00] AMPS 24991.9
51055 [KJNG132 132.00] AMPS 24852.6
51007 [SHAS132 132.00] AMPS 24426.5
51027 [SHAB132 132.00] AMPS 24332.4
51211 [KSAS132 132.00] AMPS 24252.4
51041 [SHAW132 132.00] AMPS 24104.7
88133 [GWAY132 132.00] AMPS 23742.3
51082 [PJST132 132.00] AMPS 23501.2
51038 [CJYA132 132.00] AMPS 23183.1
51018 [KLIA132 132.00] AMPS 22718.4
51062 [BLKG132 132.00] AMPS 22539.2
551062 [BLKG132R 132.00] AMPS 22539.2

134
88174 [PCHJ132 132.00] AMPS 22329.9
51070 [FSCL132 132.00] AMPS 21667.5
51003 [SHAN132 132.00] AMPS 21371.6
51017 [SHAE132 132.00] AMPS 21212.4
51083 [BJTG132 132.00] AMPS 20962.7
51087 [BBTG132 132.00] AMPS 20936.8
251042 [PMRN-T 132.00] AMPS 20892.6
51057 [MERU132 132.00] AMPS 20814.8
136 [SRDR(T) 132.00] AMPS 20725.7
88176 [PTAI132 132.00] AMPS 20143.6
588176 [PTAI132R 132.00] AMPS 20143.6
88139 [MVLY132 132.00] AMPS 20110.2
88134 [TNHQ132 132.00] AMPS 20102.8
51000 [APMR132 132.00] AMPS 20068.1
88141 [BFLD132 132.00] AMPS 20037.8
588141 [BFLD132R 132.00] AMPS 20037.8
88198 [LKRC132 132.00] AMPS 20020.2
51200 [NRWG132 132.00] AMPS 19967.6
51028 [AHTM132 132.00] AMPS 19901.1
551030 [SRDG132R 132.00] AMPS 19832.9
51112 [CBJN132 132.00] AMPS 19758.1
51078 [BCHG132 132.00] AMPS 19698
51042 [PMRN132 132.00] AMPS 19581.1
151042 [PMRN-T1 132.00] AMPS 19531.3
51051 [TPGR132 132.00] AMPS 19357.3
88112 [DMHT132 132.00] AMPS 19314.7
588112 [DMHT132R 132.00] AMPS 19314.7
88114 [BMKM132 132.00] AMPS 19197.1
51054 [SMYH132 132.00] AMPS 19153.5
88113 [DGWI132 132.00] AMPS 19000.5
588113 [DGWI132R 132.00] AMPS 19000.5
51210 [ERLA132 132.00] AMPS 18903.6
51053 [BRNG132 132.00] AMPS 18259.1
51008 [BTIN132 132.00] AMPS 18107.2
151044 [SGL-T1 132.00] AMPS 18049.8
251044 [SGL-T2 132.00] AMPS 18049.8
51044 [SGLC132 132.00] AMPS 18038.4
88156 [HKCK132 132.00] AMPS 17801.9
88177 [BJLL132 132.00] AMPS 17451.5
51091 [NSPK132 132.00] AMPS 17254.2
51218 [RWSS132 132.00] AMPS 17063.4
88124 [KULE132 132.00] AMPS 16959.5
51015 [PKLG132 132.00] AMPS 16751.3
51118 [KRWG132 132.00] AMPS 16664
51056 [BSTA132 132.00] AMPS 16482.7
51085 [LKDG132 132.00] AMPS 16468.3
51045 [BKPR132 132.00] AMPS 16357.3
51072 [HCOM132 132.00] AMPS 16357
51049 [PIDH132 132.00] AMPS 15889.3
588133 [GWAY132R 132.00] AMPS 15485.7
88161 [IMBI132 132.00] AMPS 15408.4
588114 [BMKM132R 132.00] AMPS 15346.5
88160 [VCTY132 132.00] AMPS 15145.9
51009 [PROT132 132.00] AMPS 14941.8
551009 [PROT132R 132.00] AMPS 14941.8

135
551070 [FSCL132R 132.00] AMPS 14910.5
51036 [KKMG132 132.00] AMPS 14777.9
88118 [SRYA132 132.00] AMPS 14570.1
51100 [UYAM132 132.00] AMPS 13904.7
51052 [RSID132 132.00] AMPS 13895.5
51048 [BTGA132 132.00] AMPS 13533.8
88122 [SGBT132 132.00] AMPS 12722
588122 [SGBT132R 132.00] AMPS 12722
88194 [BCVS132 132.00] AMPS 12667.4
51014 [KSBG132 132.00] AMPS 12312.7
51029 [SSWW132 132.00] AMPS 12174
51047 [IGBK132 132.00] AMPS 12083.6
51005 [NKST132 132.00] AMPS 11510.5
51026 [KPNG132 132.00] AMPS 10233
51001 [BTAI132 132.00] AMPS 9848.3
88121 [KLJT132 132.00] AMPS 9457.9
51071 [BBST132 132.00] AMPS 9274.7
588146 [KLCC132R 132.00] AMPS 9088.4
88137 [TWSA132 132.00] AMPS 9080
51035 [BBDG132 132.00] AMPS 8998.5
51043 [BARG132 132.00] AMPS 8172.2
63102 [PCTY132 132.00] AMPS 7531.5
263102 [PCTY_F2 132.00] AMPS 7438.8
51016 [KSGR132 132.00] AMPS 5458.6
151016 [KSGR-F 132.00] AMPS 5446.7
51034 [SBSR132 132.00] AMPS 3946

136
APPENDIX 5A – Single Zone SVR Simulation

Input Data File: (“onezon.dat”)


88210 KULW275 } Pilot Node Bus No
1.0311 } Pilot Node Schedule Voltage
59001 KLPPGT13 } Machine Bus Nos
59002 KLPPGT14 }
: }
63939 JMJG_U3 }

Python Program: (“OneZone.py”)


# single zone Secondary Voltage Regulation
#initialize variables
ierr = 0
ibus = 0
id = '1'
ival, rval = 0, 0.0
qgen,qmx,qmn =0.0,0.0,0.0
genstat = 0
mac = []
qori = []
qlambda = []
qmac = []
qmax = []
pvolt = 1.0
qtot = 0.0
tol = 0.01

# open input data file defining the pilot node, pilot node voltage and the participating
generators
f = open(r"""E:\Program Files\PTI\PSSE32\EXAMPLE\TNB\onezon.dat""",'r')

# readin pilot node


line = f.readline()
ibus = int(line[0:5])

# read in pilot node voltage


line = f.readline()
pvolt = float(line)
print pvolt

#read in participating generators


for line in f:
mac.append(int(line[0:5]))
f.close

# insert plant & synchronous condenser machine at ibus


psspy.plant_data(ibus,0,[ 1.0, 100.0])
psspy.machine_data_2(ibus,r"""1""",[_i,_i,_i,_i,_i,_i],[_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f
,_f,_f,_f,_f,_f])
# change ibus type code to 2
psspy.bus_data_2(ibus,[2,_i,_i,_i],[_f,_f,_f],_s)
# set target voltage to pvolt
psspy.plant_data(ibus,_i,[ pvolt,_f])

# get current Qgen and max Q capability


for i in mac:
ierr, qgen = psspy.macdat(i, id, 'Q')
ierr, qmx = psspy.macdat(i, id, 'QMAX')
qori.append(qgen)
qmac.append(0.0)
qmax.append(qmx)
qtot = qtot + qmx

# calculate participation factor, lambda for all participating generators


for qmx in qmax:
qlambda.append(qmx/qtot)

137
# set var generation at all generators to zero
for i in mac:
ierr =
psspy.machine_data_2(i,r"""1""",[_i,_i,_i,_i,_i,_i],[_f,_f,0.0,0.0,_f,_f,_f,_f,_f,_f,_f,_f,
_f,_f,_f,_f,_f])

# solve powerflow
psspy.fdns([0,0,0,1,1,0,99,0])

# get initial Qgen from synchronous condenser


ierr, qcon = psspy.macdat(ibus, id, 'Q')
print qcon

k = 0
# main loop to determine Qgen for each generator to replace synchronous condensor Q
while abs(qcon) > tol:
k = k + 1
for j in range(len(mac)):
i = mac[j]
qgen = qmac[j]
qchg = qcon*qlambda[j]
qmx = qmax[j]
if qgen + qchg > qmx:
qgen = qmx
else:
qgen = qgen + qchg
ierr =
psspy.machine_data_2(i,r"""1""",[_i,_i,_i,_i,_i,_i],[_f,_f,qgen,qgen,_f,_f,_f,_f,_f,_f,_f,_
f,_f,_f,_f,_f,_f])
qmac[j] = qgen
# print j, mac[j],qmac[j]

# solve powerflow
psspy.fdns([0,0,0,1,1,0,99,0])
# get Qgen from synchronous condenser
ierr, qcon = psspy.macdat(ibus, id, 'Q')
print 'round ', k, qcon

print 'reactive generation are as follows'


print ' id ', 'Qgen', 'Qorig'

for j in range(len(mac)):
print mac[j], qmac[j], qori[j]

# delete synchronous condenser machine at ibus


#psspy.purgmac(88210,r"""1""")

138
APPENDIX 5B – Multi Zone SVR Simulation

Input Data File: (“multizon.dat”)


ZONE 7 } No of Voltage Control Zones
1 61115 1.037054 BDNG132 } Zone No, Pilot Node Bus No, Schedule Voltage, Pilot Node ID
2 62137 1.045572 PRGS132 }
3 52027 1.038474 OLAK275 }
4 96227 1.041988 RTAU275 }
5 97212 1.045768 BBTU275 }
6 75203 1.049684 PAKA275 }
7 63213 1.043775 ATWR275 }
MACHINE 137 } No of Machines
59001 3 KLPPGT13 } Machine Bus No, Zone No, Machine ID
59002 3 KLPPGT14 }
: }
97963 5 TBIN_U3 }

Python Program: (“MultiZone.py”)


# multizone secondary voltage regulation, SVR
#initialize variables
ierr = 0
ibus = 0
pvolt = 1.0
id = '1'
ival, rval = 0, 0.0
qgen,qmx,qmn =0.0,0.0,0.0
genstat = 0
mac = [ ]
mzon = [ ]
qori = [ ]
qlambda = [ ]
qmac = [ ]
qmax = [ ]
pzon = [ ]
vzon = [ ]
qcon = [ ]
qtot = [ ]
tol = 0.01
nzon = 0
ngen = 0

# open input data file defining the pilot node, pilot node voltage and the participating
generators
f = open(“multizon.dat",'r')

# readin pilot modes and voltages


line = f.readline()
tmp = line.split(' ')
nzon = int(tmp[1])
for i in range(nzon):
line = f.readline()
tmp = line.split(' ')
pzon.append(int(tmp[1]))
vzon.append(float(tmp[2]))
qtot.append(0.0)

# readin generators and zones


line = f.readline()
tmp = line.split(' ')
ngen = int(tmp[1])

for i in range(ngen):
line = f.readline()
tmp = line.split(' ')
ibus = int(tmp[0])
ierr, ival = psspy.macstt(ibus, id)
if ival:
mac.append(ibus)
mzon.append(int(tmp[1]))

139
f.close

for i in range(nzon):
ibus = pzon[i]
pvolt = vzon[i]
# insert plant & synchronous condenser machine at ibus
psspy.plant_data(ibus,0,[ 1.0, 100.0])

psspy.machine_data_2(ibus,r"""1""",[_i,_i,_i,_i,_i,_i],[_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f
,_f,_f,_f,_f,_f])
# change ibus type code to 2
psspy.bus_data_2(ibus,[2,_i,_i,_i],[_f,_f,_f],_s)
# set target voltage to pvolt
psspy.plant_data(ibus,_i,[ pvolt,_f])

# get current Qgen and max Q capability


for j in range(len(mac)):
i = mac[j]
zon = mzon[j]
ierr, qgen = psspy.macdat(i, id, 'Q')
ierr, qmx = psspy.macdat(i, id, 'QMAX')
qori.append(qgen)
qmac.append(0.0)
qmax.append(qmx)
qtot[zon-1] = qtot[zon-1] + qmx

#print qtot

# calculate participation factor, lambda for all participating generators


for j in range(len(mzon)):
zon = mzon[j]
qlambda.append(qmax[j]/qtot[zon-1])

#print qlambda

# set var generation at all generators to zero


for i in mac:
ierr =
psspy.machine_data_2(i,r"""1""",[_i,_i,_i,_i,_i,_i],[_f,_f,0.0,0.0,_f,_f,_f,_f,_f,_f,_f,_f,
_f,_f,_f,_f,_f])

# solve powerflow
psspy.fdns([0,0,0,1,1,0,99,0])

# get initial Qgen from synchronous condenser


for ibus in pzon:
ierr, qp = psspy.macdat(ibus, id, 'Q')
qcon.append(qp)

k = 0
nosoln = 1
# main loop to determine Qgen for each generator to replace synchronous condensor Q
while nosoln:
k = k + 1
nosoln = 0
for j in range(len(mac)):
i = mac[j]
zon = mzon[j]
qgen = qmac[j]
qchg = qcon[zon-1]*qlambda[j]
qmx = qmax[j]
if qgen + qchg > qmx:
qgen = qmx
else:
qgen = qgen + qchg
ierr =
psspy.machine_data_2(i,r"""1""",[_i,_i,_i,_i,_i,_i],[_f,_f,qgen,qgen,_f,_f,_f,_f,_f,_f,_f,_
f,_f,_f,_f,_f,_f])
qmac[j] = qgen

# solve powerflow
psspy.fdns([0,0,0,1,1,0,99,0])
# get Qgen from synchronous condensers
for m in range(len(pzon)):
ibus = pzon[m]
ierr, qp = psspy.macdat(ibus, id, 'Q')
qcon[m] = qp
if abs(qp) > tol:
nosoln = 1

print 'reactive generation are as follows'


print ' id ', 'Qgen', 'Qorig'

140
for j in range(len(mac)):
print mac[j], qmac[j], qori[j]

# delete synchronous condenser machine at ibus


#for i in pzon:
# psspy.purgmac(i,r"""1""")

141
APPENDIX 5C – QV Sensitivity Calculations

Input Data File: (“genbus.dat”)


KLPP275 4 } HV Bus ID, Number of Machines Sharing HV Bus
59001 KLPPGT13 } Machine Bus No, Machine ID
59002 KLPPGT14 }
59003 KLPPGT15 }
59004 KLPPST17 }
PKLG275 6 } HV Bus ID, Number of Machines Sharing HV Bus
59011 PKLG_U1 } Machine Bus No, Machine ID
59012 PKLG_U2 }
: }

Python Program: (“Volt_Sens.py”)


ierr = 0
ival = 0
qgen = 0.0
e = open('genlist.dat','w')
# Output base case bus voltages
psspy.case('171209d.sav')
psspy.fdns([0,0,0,1,1,0,99,0])
psspy.lines_per_page_one_device(1,10000)
fname = 'Base.dat'
psspy.report_output(2,fname,[0,0])
psspy.bsys(0,1,[ 132., 500.],1,[1],0,[],0,[],0,[])
psspy.list(0,0,2,0)
psspy.report_output(1,"",[0,0])

# Perform Q increments and output bus voltages


f = open('genbus.dat','r')
k = 0
eof = 1
line = f.readline()
if line<>"":
eof = 0
while not eof:
psspy.case('171209d.sav')
busid = line[0:7]
noun = int(line[8:])
print busid
inc = float(50.0/noun)
print inc
for i in range(noun):
line = f.readline()
genno = int(line[0:6])
print 'gen no',genno
ierr, ival = psspy.macstt(genno, '1')
if ival:
ierr, qgen = psspy.macdat(genno, '1', 'Q')
qgen = qgen + inc
ierr =
psspy.machine_data_2(genno,r"""1""",[_i,_i,_i,_i,_i,_i],[_f,_f,qgen,qgen,_f,_f,_f,
_f,_f,_f,_f,_f,_f,_f,_f,_f,_f])
else:
qgen = inc
ierr =
psspy.machine_data_2(genno,r"""1""",[1,_i,_i,_i,_i,_i],[0.0,_f,qgen,qgen,_f,_f,_f,
_f,_f,_f,_f,_f,_f,_f,_f,_f,_f])
psspy.fdns([0,0,0,1,1,0,99,0])
psspy.lines_per_page_one_device(1,10000)
fname = busid + '.dat'
psspy.report_output(2,fname,[0,0])
142
psspy.bsys(0,1,[ 132., 500.],1,[1],0,[],0,[],0,[])
psspy.list(0,0,2,0)
psspy.report_output(1,"",[0,0])
e.write(busid+'\n')

line = f.readline()
if line<>"":
eof = 0
else:
eof = 1
print 'end'
f.close
e.close
Output Files:

1. genlist.dat
2. <plant_hv_bus_id>.dat
3. :
4. :

143
APPENDIX 6A – Generation of 24 Hour Load Flow
Savecases

Input Data Files:


(1) Zone Demand fractions (LoadPattern.dat)
(2) Generation dispatch schedule (GenPattern.dat)

Python Program: (“24HrLoad.py” )


ierr = 0
cmpld = 0.0+0.0j
ldzon = []
mwzon = 0.0
mvzon = 0.0
genzon = 0.0
mwtot = 0.0
mvtot = 0.0
gentot = 0.0
f = open("loadpattern.dat",'r')
line = f.readline()
for j in range(12):
ldzon.append(0.0)

for i in range(24):
psspy.case("Newcase.sav")
psspy.fdns([0,0,0,1,1,0,99,0])
ierr, cmpld = psspy.ardat(1, 'LOAD')
mwtot = cmpld.real
mvtot = cmpld.imag
ierr, cmpld = psspy.ardat(1, 'GEN')
gentot = cmpld.imag
line = f.readline()
tmp = line.split('\t')
for j in range(12):
ldzon[j]=float(tmp[j])
for j in range(12):
izn = j+1
ierr, cmpld = psspy.zndat(izn, 'LOAD')
mwzon = cmpld.real
mvzon = cmpld.imag
mwnew = ldzon[j]
mvnew = mwnew*mvzon/mwzon
ierr, cmpld = psspy.zndat(izn, 'GEN')
if ierr==0:
genzon = cmpld.real
else:
genzon=0
print '----------------'
print 'zone no',izn,ierr
print '----------------'
print 'zone no',izn,mwnew,mvnew,genzon
psspy.bsys(0,0,[ 1.0, 500.],0,[],0,[],0,[],1,izn)
psspy.scal(0,0,1,[0,0,0,0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0])
psspy.scal(0,1,2,[1,0,2,0],[mwnew, genzon,0.0,0.0,0.0,0.0, mvnew])
fname = str(i)+'.sav'
psspy.save(fname)

f.close

144
Python Program: (“24HrGen.py”)
ierr = 0
ibus = 0
id = '1'
macno = []
cmpgen = 0.0+0.0j
cmpld = 0.0+0.0j
f = open("GenPattern.dat",'r')
line = f.readline()
tmp = line.split('\t')
nogen=len(tmp)
for j in range(nogen):
macno.append(int(tmp[j]))
for k in range(24):
caseid = str(k) +'.sav'
print caseid
psspy.case(caseid)
line = f.readline()
tmp = line.split('\t')
for j in range(nogen):
gen=float(tmp[j])
i = macno[j]
# print k,macno[j],mw[j]
if gen <> 0:
ierr =
psspy.machine_data_2(i,r"""1""",[1,_i,_i,_i,_i,_i],[gen,_f,_f,_f,_f,_f,_f,_f,_f,_f
,_f,_f,_f,_f,_f,_f,_f])
else:
ierr =
psspy.machine_data_2(i,r"""1""",[0,_i,_i,_i,_i,_i],[0.0,_f,_f,_f,_f,_f,_f,_f,_f,_f
,_f,_f,_f,_f,_f,_f,_f])
ierr, cmpgen = psspy.ardat(1, 'GEN')
gentot = cmpgen.real
ierr, cmpld = psspy.ardat(1, 'LOAD')
mwld = cmpld.real
mvld = cmpld.imag
mwnew = gentot*0.985
mvnew = mvld*mwnew/mwld
print gentot,mwnew,mvnew
psspy.bsys(0,0,[ 1.0, 500.],1,[1],0,[],0,[],0,[])
psspy.scal(0,0,1,[0,0,0,0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0])
psspy.scal(0,1,2,[1,0,2,0],[mwnew,gentot,0.0,0.0,0.0,0.0, mvnew])
psspy.fdns([0,0,0,1,1,1,99,0])
psspy.save(caseid)
f.close

145
APPENDIX 6B – 24 Hour Optimal Power Flow
Runs

Input Data Files:


(1) 24 Hour Load Flow Savecases

Python Program: (“24HrOpt.py” )


for k in range(24):
caseid = str(k) +'.sav'
print caseid
psspy.case(caseid)
psspy.ropf('NewCase.rop')
psspy.bsys(0,0,[ 1.0, 500.],1,[1],0,[],0,[],0,[])
psspy.bsys(0,0,[ 1.0, 500.],1,[1],0,[],0,[],0,[])
psspy.set_opf_report_subsystem(3,1)
psspy.nopf(0,0)
psspy.fnsl([0,0,0,1,1,0,99,0])
psspy.fnsl([0,0,0,1,1,0,99,0])
psspy.save(caseid)

Python Program: (“getpv.py” )


tpnode=''
pnode =[]
nonode=4
# PRGS132
# OLAK275
# BBTU275
# PAKA275
pnode.append(62137)
pnode.append(52027)
pnode.append(97212)
pnode.append(75203)
f = open('pnodekV.dat','w')
for m in range(nonode):
tpnode = tpnode+' '+str(pnode[m])
f.write(tpnode+'\n')
for k in range(24):
caseid = str(k) +'.sav'
print caseid
psspy.case(caseid)
tpnkv=''
for m in range(nonode):
ibus = pnode[m]
ierr, rval = psspy.busdat(ibus ,'PU')
tpnkv = tpnkv+' '+str(rval)
f.write(tpnkv+'\n')
f.close

146
Python Program: (“getTxRatio.py” )
pval=[]
sval=[]
hdr='from , to'
for k in range(24):
caseid = str(k) +'.sav'
print caseid
hdr=hdr+','+str(k)
psspy.case(caseid)
farray=[]
tarray=[]
pratio=[]
sratio=[]
psspy.bsys(0,0,[ 275., 500.],1,[1],0,[],1,[1],0,[])
ierr, brnchs = psspy.atrncount(0, 1, 1, 1, 1)
ierr, farray = psspy.atrnint(0, 1, 1, 1, 1, 'FROMNUMBER')
ierr, tarray = psspy.atrnint(0, 1, 1, 1, 1, 'TONUMBER')
ierr, pratio = psspy.atrnreal(0, 1, 1, 1, 1, 'RATIO')
ierr, sratio = psspy.atrnreal(0, 1, 1, 1, 1, 'RATIO2')
print k, brnchs
for i in range(brnchs):
if k==0:
pval.append(str(farray[0][i])+','+str(tarray[0][i]))
sval.append(str(farray[0][i])+','+str(tarray[0][i]))
pval[i]=pval[i]+','+str(pratio[0][i])
sval[i]=sval[i]+','+str(sratio[0][i])

#print farray[0][i],',',tarray[0][i],',',pratio[0][i],',',sratio[0][i]
f = open('pritap.dat','w')
g = open('sectap.dat','w')
f.write(hdr+'\n')
g.write(hdr+'\n')
for i in range(brnchs):
f.write(pval[i]+'\n')
g.write(sval[i]+'\n')

f.close
g.close

147
Python Program: (“getshunt.py” )
shcap =[]
pnode =[]
tshcap =''
g = open('shunt.dat','r')
for line in g:
print line
shcap.append(int(line))
g.close
f = open('shstat.dat','w')
noshcap=len(shcap)
for m in range(noshcap):
print shcap[m]
tshcap = tshcap+' '+str(shcap[m])
print tshcap
f.write(tshcap+'\n')
for k in range(24):
caseid = str(k) +'.sav'
print caseid
psspy.case(caseid)
tval=''
for m in range(noshcap):
ibus = shcap[m]
ierr, rval = psspy.swsdt1(ibus, 'BINIT')
tval = tval+' '+str(float(int(rval*10))/10)
print tval
f.write(tval+'\n')
f.close

148
APPENDIX 6C – 24 Hour Multizone SVR Load
Flow Simulation

Input Data Files:


(1) 24 Hour Load Flow Savecases including optimal transformer tap positions and
shunt compensation
(2) 24 Hour Target Voltages for Pilot Nodes (“pnodekV.dat”)
(3) controlling generators associated with each zone (“mz.dat”)

Python Program: (“mz.py” )


# multizone secondary voltage regulation, SVR
#initialize variables
ierr = 0
ibus = 0
pvolt = 0.0
id = '1'
ival, rval = 0, 0.0
genstat = 0
qtot = []
pzon = []
vzon = []
vz1 =[]
tol = 0.01
nzon = 0
ngen = 0

# open input data file defining the pilot node, pilot node voltage and the
participating generators
f = open("pnodekV.dat",'r')
e = open("mzsvr.out",'w')
# readin pilot modes and voltages
line = f.readline()
line = line.strip()
tmp = line.split(' ')
nzon = len(tmp)
#print nzon

for i in range(nzon):
pzon.append(int(tmp[i]))
qtot.append(0.0)
#print pzon[i]
for hr in range(24):
line = f.readline()
line=line.strip()
tmp = line.split(' ')
for i in range(nzon):
vz1.append(float(tmp[i]))
vzon.append(vz1)
f.close
# Start of hourly interation
for hr in range(24):
caseid = str(hr) +'.sav'
psspy.case(caseid)
print caseid
mac = []
mzon = []
qori = []

149
qmac = []
qmax = []
qlambda = []
qcon = []
qgen,qmx,qmn =0.0,0.0,0.0
# readin generators and zones
g = open("mz.dat",'r')
line = g.readline()
tmp = line.split(' ')
ngen = int(tmp[1])
#print ngen
for i in range(ngen):
line = g.readline()
tmp = line.split(' ')
ibus = int(tmp[0])
ierr, ival = psspy.macstt(ibus, id)
if ival:
mac.append(ibus)
mzon.append(int(tmp[1]))
#for i in range(len(mac)):
#print mac[i],mzon[i]
g.close
for i in range(nzon):
ibus = pzon[i]
pvolt = vzon[hr][i]
qtot[i]=0.0
# insert plant & synchronous condenser machine at ibus
psspy.plant_data(ibus,0,[ 1.0, 100.0])
psspy.machine_data_2(ibus,r"""1""",[_i,_i,_i,_i,_i,_i],[_f,_f,_f,_f,_f,_f,_f,_f,_f
,_f,_f,_f,_f,_f,_f,_f,_f])
# change ibus type code to 2
psspy.bus_data_2(ibus,[2,_i,_i,_i],[_f,_f,_f],_s)
# set target voltage to pvolt
psspy.plant_data(ibus,_i,[ pvolt,_f])

# get current Qgen and max Q capability


for j in range(len(mac)):
i = mac[j]
zon = mzon[j]
ierr, qgen = psspy.macdat(i, id, 'Q')
ierr, qmx = psspy.macdat(i, id, 'QMAX')
qori.append(qgen)
qmac.append(0.0)
qmax.append(qmx)
qtot[zon-1] = qtot[zon-1] + qmx
# calculate participation factor, lambda for all participating generators
for j in range(len(mac)):
zon = mzon[j]
qlambda.append(qmax[j]/qtot[zon-1])
#print qlambda
# set var generation at all generators to zero
for i in mac:
ierr =
psspy.machine_data_2(i,r"""1""",[_i,_i,_i,_i,_i,_i],[_f,_f,0.0,0.0,_f,_f,_f,_f,_f,
_f,_f,_f,_f,_f,_f,_f,_f])

# solve powerflow
psspy.fdns([0,0,0,0,0,1,99,0])
# get initial Qgen from synchronous condenser
for ibus in pzon:
ierr, qp = psspy.macdat(ibus, id, 'Q')
qcon.append(qp)
k = 0
150
nosoln = 1
# main loop to determine Qgen for each generator to replace synchronous condensor
Q
while nosoln and k < 20000:
k = k + 1
print 'iteration no', k
nosoln = 0
for j in range(len(mac)):
i = mac[j]
zon = mzon[j]
qgen = qmac[j]
qchg = qcon[zon-1]*qlambda[j]
qmx = qmax[j]
if qgen + qchg > qmx:
qgen = qmx
else:
qgen = qgen + qchg
ierr =
psspy.machine_data_2(i,r"""1""",[_i,_i,_i,_i,_i,_i],[_f,_f,qgen,qgen,_f,_f,_f,_f,_
f,_f,_f,_f,_f,_f,_f,_f,_f])
qmac[j] = qgen
# solve powerflow
psspy.fdns([0,0,0,0,0,1,99,0])
# get Qgen from synchronous condensers
for m in range(len(pzon)):
ibus = pzon[m]
ierr, qp = psspy.macdat(ibus, id, 'Q')
qcon[m] = qp
if abs(qp) > tol:
nosoln = 1

caseid=str(hr)+'D.sav'
psspy.save(caseid)
e.write('iteration for hour '+str(hr)+'\n')
e.write('machine_id,zone_no,Q_gen,Q_ori'+'\n')
for j in range(len(mac)):
outtxt= str(mac[j])+','+str(mzon[j])+','+str(qmac[j])+','+str(qori[j])
e.write(outtxt+'\n')

e.close
# delete synchronous condenser machine at ibus
#for i in pzon:
# psspy.purgmac(i,r"""1""")

151
APPENDIX 6D – Data Extraction from 24 Hour
Load Flow Routines

Input Data Files:


(1) 24 Hour Load Flow Savecases

Python Program: (“prtkV.py” )


# Output base case bus voltages
for i in range(24):
psspy.case(str(i)+'D.sav')
psspy.fnsl([0,0,0,1,1,0,99,0])
psspy.lines_per_page_one_device(1,10000)
fname = str(i)+'.dat'
psspy.report_output(2,fname,[0,0])
psspy.bsys(0,1,[ 132., 500.],1,[1],0,[],0,[],0,[])
psspy.list(0,0,2,0)
psspy.report_output(1,"",[0,0])

Python Program: (“getkV.py” )


kvstr=[]
kvstr2=[]
hdr = 'BusNo Bus BaseKV'
for i in range(24):
h = open(str(i)+".dat",'r')
bn = 0
eof = 0
hdr = hdr+' '+ str(i)
line = h.readline()
line = h.readline()
line = h.readline()
line = h.readline()
line = h.readline()
line = h.readline()
while not eof:
bn=bn+1
if i==0:
busno=int(line[0:6])
busid=line[7:18].strip()
basekv=float(line[19:25])
kv=float(line[51:58])
if bn<401:
kvstr.append('')
kvstr[bn-1]=str(busno)+' '+busid+' '+str(basekv)+' '+str(kv)
else:
kvstr2.append('')
kvstr2[bn-401]=str(busno)+' '+busid+' '+str(basekv)+' '+str(kv)
else:
kv=float(line[51:58])
if bn<401:
kvstr[bn-1]=kvstr[bn-1]+' '+str(kv)
else:
kvstr2[bn-401]=kvstr2[bn-401]+' '+str(kv)
line = h.readline()
if line<>"":
eof = 0
else:
eof = 1
h.close
print len(kvstr), len(kvstr2)

152
f = open("kVout1.dat",'w')
g = open("kVout2.dat",'w')
f.write(hdr+'\n')
g.write(hdr+'\n')
for i in range(400):
f.write(kvstr[i]+'\n')
for i in range(227):
g.write(kvstr2[i]+'\n')
f.close
g.close

Python Program: (“getPFlow.py” )


p=[]
hdr='from , to'
for k in range(24):
caseid = str(k) +'D.sav'
print caseid
hdr=hdr+','+str(k)
psspy.case(caseid)
farray=[]
tarray=[]
p_val=[]

psspy.bsys(0,1,[ 132., 500.],1,[1],0,[],0,[],0,[])


ierr, brnchs = psspy.aflowcount(0, 1, 1, 1)
ierr, farray = psspy.aflowint(0, 1, 1, 1, 'FROMNUMBER')
ierr, tarray = psspy.aflowint(0, 1, 1, 1, 'TONUMBER')
ierr, p_val = psspy.aflowreal(0, 1, 1, 1, 'P')

print k, brnchs
for i in range(brnchs):
if k==0:
p.append(str(farray[0][i])+','+str(tarray[0][i]))
p[i]=p[i]+','+str(p_val[0][i])
#print farray[0][i],',',tarray[0][i],',',p_val[0][i]

f = open('pflow.dat','w')
f.write(hdr+'\n')
for i in range(brnchs):
f.write(p[i]+'\n')
f.close

Python Program: (“getQFlow.py” )


q=[]
hdr='from , to'
for k in range(24):
caseid = str(k) +'D.sav'
print caseid
hdr=hdr+','+str(k)
psspy.case(caseid)
farray=[]
tarray=[]
q_val=[]
153
psspy.bsys(0,1,[ 132., 500.],1,[1],0,[],0,[],0,[])
ierr, brnchs = psspy.aflowcount(0, 1, 1, 1)
ierr, farray = psspy.aflowint(0, 1, 1, 1, 'FROMNUMBER')
ierr, tarray = psspy.aflowint(0, 1, 1, 1, 'TONUMBER')
ierr, q_val = psspy.aflowreal(0, 1, 1, 1, 'Q')

print k, brnchs
for i in range(brnchs):
if k==0:
q.append(str(farray[0][i])+','+str(tarray[0][i]))
q[i]=q[i]+','+str(q_val[0][i])

#print farray[0][i],',',tarray[0][i],',',q_val[0][i]
f = open('qflow.dat','w')
f.write(hdr+'\n')

for i in range(brnchs):
f.write(q[i]+'\n')
f.close

Python Program: (“getMVA.py” )


mva=[]
hdr='from , to'
for k in range(24):
caseid = str(k) +'D.sav'
print caseid
hdr=hdr+','+str(k)
psspy.case(caseid)
farray=[]
tarray=[]
mva_val=[]
psspy.bsys(0,1,[ 132., 500.],1,[1],0,[],0,[],0,[])
ierr, brnchs = psspy.aflowcount(0, 1, 1, 1)
ierr, farray = psspy.aflowint(0, 1, 1, 1, 'FROMNUMBER')
ierr, tarray = psspy.aflowint(0, 1, 1, 1, 'TONUMBER')
ierr, mva_val = psspy.aflowreal(0, 1, 1, 1, 'MVA')

print k, brnchs

for i in range(brnchs):
if k==0:
mva.append(str(farray[0][i])+','+str(tarray[0][i]))
mva[i]=mva[i]+','+str(mva_val[0][i])
#print farray[0][i],',',tarray[0][i],',',mva_val[0][i]
f = open('mva.dat','w')
f.write(hdr+'\n')

for i in range(brnchs):
f.write(mva[i]+'\n')
f.close

154
Python Program: (“getloss.py” )
ploss='PLOSS'
qloss='QLOSS'
hdr='LOSS'
iar = 1
for k in range(24):
caseid = str(k) +'D.sav'
print caseid
hdr=hdr+','+str(k)
psspy.case(caseid)
ierr, cmpval = psspy.ardat(iar, 'LOSS')
print cmpval.real, cmpval.imag
ploss=ploss+','+str(cmpval.real)
qloss=qloss+','+str(cmpval.imag)
f = open('loss.dat','w')
f.write(hdr+'\n')
f.write(ploss+'\n')
f.write(qloss+'\n')
f.close

155
APPENDIX 6E - FORTRAN CODE FOR CVC MODEL
SUBROUTINE CONEC
C
INCLUDE 'COMON4.INS'
INTEGER(8) BUSNO, IB, IG, TOTGEN, HR, I, GTEMP
REAL(8) VU, Y, KP, KI, VPILOT
REAL(8) DS, ST, TOTPART, TOTQ, TINV, TNXT
INTEGER(8), DIMENSION(30):: GENNO
REAL(8), DIMENSION(30):: STM, DSM, YM, QM, QPART, QU, KPQ, KIQ
REAL(8), DIMENSION(50):: VPREF
COMMON /CVC1/ BUSNO, TOTGEN, HR, TINV, TNXT
COMMON /CVC2/ KP, KI, VPREF
COMMON /CVC3/ ST, DS, TOTPART
COMMON /CVC4/ GENNO, QPART, DSM, STM, YM, KPQ, KIQ
C
C MODIFY INPUT AFTER 0.0 SECONDS
C
IF (TIME.GT.0.0) THEN
C IF END OF HOUR SIM, UPDATE HOUR, NEXT HOUR SIM TIME & RESET TOTPART
IF (TIME.GT.TNXT+1.0) THEN
WRITE(LPDEV,*) 'TNXT', TIME, FLOAT(HR)/2.0
HR = HR + 1
TNXT = TNXT + TINV
TOTPART = -1.0
ENDIF
C RECALCULATE TOTPART FOR NEW HOUR
IF (TOTPART.LE.0.0) THEN
TOTPART = 0.0
DO I = 1, TOTGEN
IF (PMECH(GENNO(I)).GT.0.1) THEN
QPART(I) = PELEC(GENNO(I))
TOTPART = TOTPART + QPART(I)
WRITE(LPDEV,'(A5,I5,3F10.5)') 'XXXXX', I, TIME, TOTPART,
QPART(I)
ENDIF
END DO
C WRITE(LPDEV,*) 'XXXXX', TIME, TOTPART
ENDIF
C CALCULATE TOTAL VAR GENERATION
TOTQ = 0.0
DO I = 1, TOTGEN
QM(I) = 0.0
IF (PMECH(GENNO(I)).GT.0.1) THEN
QM(I) = QELEC(GENNO(I))*SBASE
TOTQ = TOTQ + QM(I)
ENDIF
END DO
C DETERMINE SVR VOLTAGE ERROR
CALL BSSEQN(BUSNO,IB)
VPILOT = ABS(VOLT(IB))
VU = VPREF(HR) - VPILOT
C WRITE(LPDEV,*) TIME, VPREF(HR), VPILOT, VU
C DETERMINE VAR ERROR FOR EACH GENERATOR
DO I = 1,TOTGEN
IF (PMECH(GENNO(I)).GT.0.1) THEN
QU(I) = QPART(I) / TOTPART*TOTQ - QM(I)
ELSE
QU(I) = 0.0
ENDIF
C WRITE(LPDEV,*) NUMBUS(NUMTRM(GENNO(I))), TOTPART, TOTQ, QM(I), QU(I)
END DO
C
ELSE
C ZERO SVR & Q CTRL INPUT ERROR
VU=0.0
DO I = 1,5
QU(I)=0.0
END DO
C
ENDIF
156
CALL SOLVED(IVAL)
IF (IVAL.GT.0) THEN
WRITE(LPDEV,'(A6,F10.5,I3)') 'LDFLOW', TIME, IVAL
END IF
C
C MODE 1 - INITIALIZE
C
IF (MODE.EQ.1) THEN
C WRITE(LPDEV,*) 'MODE 1'
C
C READ IN PILOT NOTE VOLTAGE REFERENCES
OPEN (12, FILE='cvc.log')
OPEN (11, FILE='vpn.dat')
I = 0
DO WHILE (.NOT. EOF(11))
I = I + 1
READ (11,*) VPREF(I)
WRITE(12,'(I4,F8.5)') I, VPREF(I)
C WRITE(LPDEV,*) I, VPREF(I)
END DO
CLOSE (11)
C READ IN SVR AND GENERATOR DATA
OPEN (11, FILE='svr.dat')
READ (11,*) TINV
READ (11,*) BUSNO, KP, KI
WRITE(12,'(F8.1,I8,2F8.5)') TINV, BUSNO, KP, KI
I = 0
DO WHILE (.NOT. EOF(11))
I = I + 1
READ (11,*) GTEMP, KPQ(I), KIQ(I)
CALL GENCHK(GTEMP,'1',IG,'GENERATOR NOT FOUND')
GENNO(I) = IG
WRITE(12,'(2I8,2F8.5,I24,I8)') I, GTEMP, KPQ(I), KIQ(I), IG,
NUMBUS(NUMTRM(IG))
C INITILIASE MC CONTROLLER STATES AND DSTATES
DSM(I)=0.0
STM(I)=0.0
C WRITE(LPDEV,*) GENNO(I),KPQ(I),KIQ(I)
END DO
TOTGEN = I
CLOSE (11)
CLOSE (12)
C INITILIASE SVC CONTROLLER STATE AND DSTATE
DS=0.0
ST=0.0
C SET HOUR TO ONE & NEXT HOUR SIM TIME
HR = 1
C TNXT=TINV+DELT
TNXT = TINV
TOTPART = -1.0
C WRITE(LPDEV,*) 'TINV', TINV, TNXT
ENDIF
C
C MODE 2 - CALCULATE DERIVATIVES
C
IF (MODE.EQ.2) THEN
C WRITE(LPDEV,*) 'MODE 2'
C CALCULATE DSTATE OF SVR
DS=VU*KI
C CALCULATE DSTATE OF Q CTRL FOR EACH GENERATOR
DO I = 1,TOTGEN
DSM(I) = QU(I)*KIQ(I)
END DO
C
ENDIF
C
C MODE 3 - UPDATE VARIABLES
C
IF (MODE.EQ.3) THEN
C WRITE(LPDEV,*) 'MODE 3'
C
C PERFORM EULER INTEGRATION & UPDATE SVR OUTPUT
ST=ST+DELT*DS
Y=KP*VU+ST
157
C PERFORM EULER INTEGRATION & UPDATE Q CTRL OUTPUT
DO I = 1,TOTGEN
STM(I) = STM(I) + DELT*DSM(I)
YM(I) = KPQ(I)*QU(I) + STM(I)
IF (PMECH(GENNO(I)).GT.0.1) THEN
VOTHSG(GENNO(I)) = Y + YM(I)
ELSE
VOTHSG(GENNO(I)) = 0.0
ENDIF
END DO
C
ENDIF
C
RETURN
END

158
APPENDIX 6F - PYTHON CODE FOR SIMULATION
RUN
#------------------------------------------------------------------
# psse initialization
#------------------------------------------------------------------
p = 'C:\Program Files\PTI\PSSE32\PSSBIN'
import os,sys,datetime
lg = open('CVCHalfHourlyDBRun.log', 'a')
lg.write('Start Run - ' + datetime.datetime.now().strftime("%d %b %Y %H:%M:%S") + '\n')
lg.close()
sys.path.append(p)
os.environ['PATH'] = p + ';' + os.environ['PATH']
import psspy
import redirect
_i,_f=psspy.getbatdefaults()
redirect.psse2py()
psspy.psseinit(12000)
#------------------------------------------------------------------
# psse execution
#------------------------------------------------------------------
if os.path.exists('WrkDir.ini'):
f = open('WrkDir.ini')
xp = f.readline().replace('\n','').strip()
if xp[len(xp)-1:] != '\\': xp = xp + '\\'
f.close()
else:
xp = os.getcwd() + '\\'
if not os.path.isdir(xp):
lg = open('CVCHalfHourlyDBRun.log', 'a')
lg.write(datetime.datetime.now().strftime("%d %b %Y %H:%M:%S") + ' - Working Directory
Not Found\n')
lg.close()
quit()
lg = open('CVCHalfHourlyDBRun.log', 'a')
lg.write(' \233 Working Directory \233 ' + xp + '\n')
lg.close()
for i in range(99):
pout = '00' + str(i)
if not os.path.exists(xp + 'CVCHalfHourly' + pout[len(pout)-2:] + '.out'):
pout = 'CVCHalfHourly' + pout[len(pout)-2:] + '.out'
break
#------------------------------------------------------------------
# Constant
#------------------------------------------------------------------
LossConst = 0.988
TNBArea = 1
TInt = 200.0
#------------------------------------------------------------------
f = xp + 'CVCHalfHourlyProgress.log'
r = xp + 'CVCHalfHourlyReport.log'
a = xp + 'CVCHalfHourlyAlert.log'
if os.path.exists(f): os.remove(f)
if os.path.exists(r): os.remove(r)
if os.path.exists(a): os.remove(a)
psspy.lines_per_page_one_device(1,100000)
psspy.report_output(2,r,[0,0])
psspy.progress_output(2,f,[0,0])
psspy.alert_output(2,a,[0,0])
psspy.prompt_output(2,f,[0,0])
#------------------------------------------------------------------
fl = open(xp + 'FileList.txt')
bcf = fl.readline().replace('\n','')
dbf = fl.readline().replace('\n','')
lfs = fl.readline().replace('\n','')
fl.close
#------------------------------------------------------------------
# Access Database Initialisation
#------------------------------------------------------------------
import win32com.client
dg = win32com.client.Dispatch('DAO.DBEngine.36')
db = dg.OpenDatabase(xp + dbf,False,False)

ierr = db.Execute('DELETE * FROM TotalArea')


ierr = db.Execute('DELETE * FROM Bus')
ierr = db.Execute('DELETE * FROM Gen')

159
ierr = db.Execute('DELETE * FROM Load')
ierr = db.Execute('DELETE * FROM SwitchedShunt')

scn = []
scd = []
rs = db.OpenRecordset('SELECT DTRead, Format([DTRead],\'yyyy-mm-dd-hh-mm-ss\') AS scn,
Format([DTRead],\'d mmm yyyy h:mm:ss\') AS scd FROM Gen10 GROUP BY DTRead ORDER BY DTRead',
8, 4, 4)
while not rs.EOF:
scn.append(str(rs.Fields('scn').Value))
scd.append(str(rs.Fields('scd').Value))
rs.MoveNext()
rs.Close()

print 'Start Generate Loadflow Files'

Load = []
Gen = []
SwS = []

for i in range(len(scn)):

ierr = psspy.case(xp + bcf)


ierr = psspy.solution_parameters_3([_i,999])

rs = db.OpenRecordset('SELECT BusNo, LoadID, IIf(Abs([P])<0.001,0,1) AS st,


IIf([P]<=0.0,0,1) AS sc, IIf(Abs([P])<0.001,0.0,[P]) AS PLoad, IIf(Abs([P])<0.001,0.0,[Q])
AS QLoad FROM Load10 INNER JOIN Load10Map ON (Load10.CP = Load10Map.CP) AND
(Load10.Substation = Load10Map.Mnem) WHERE DTRead = #' + scd[i] + '# ORDER BY BusNo,
LoadID', 8, 4, 4)
while not rs.EOF:
ierr = psspy.load_data_3(rs.Fields('BusNo').Value, rs.Fields('LoadID').Value,
[rs.Fields('st').Value,_i,_i,_i,rs.Fields('sc').Value], [rs.Fields('PLoad').Value,
rs.Fields('QLoad').Value])
rs.MoveNext()
rs.Close()

isb = 0
isg = 0.0
rs = db.OpenRecordset('SELECT BusNo, IIf(Abs([P])<0.001,0,1) AS st,
IIf(Abs([P])<0.001,0.0,[P]) AS PGen FROM Gen10 INNER JOIN Gen10Map ON (Gen10.Substation =
Gen10Map.Mnem) AND (Gen10.CP = Gen10Map.CP) WHERE DTRead = #' + scd[i] + '# ORDER BY BusNo',
8, 4, 4)
while not rs.EOF:
ierr = psspy.machine_data_2(rs.Fields('BusNo').Value, '1', [rs.Fields('st').Value],
[rs.Fields('PGen').Value])
ierr, ival = psspy.busint(rs.Fields('BusNo').Value ,'TYPE')
if ival == 3:
isb = rs.Fields('BusNo').Value
isg = rs.Fields('PGen').Value
rs.MoveNext()
rs.Close()

rs = db.OpenRecordset('SELECT Sum(P) AS tgref FROM ZoneGenerator INNER JOIN (Gen10Map


INNER JOIN Gen10 ON (Gen10Map.Mnem = Gen10.Substation) AND (Gen10Map.CP = Gen10.CP)) ON
ZoneGenerator.GenBusNo = Gen10Map.BusNo WHERE DTRead = #' + scd[i] + '#', 8, 4, 4)
tgref = rs.Fields('tgref').Value
rs.Close()
rs = db.OpenRecordset('SELECT Avg(VPREF) AS AvgVREF FROM ZonePilotBusVREF', 8, 4, 4)
vpref = rs.Fields('AvgVREF').Value
rs.Close()
rs = db.OpenRecordset('SELECT PilotBusNo FROM ZonePilotBus', 8, 4, 4)
vbref = rs.Fields('PilotBusNo').Value
rs.Close()
rs = db.OpenRecordset('SELECT GenBusNo, P FROM ZoneGenerator INNER JOIN (Gen10Map INNER
JOIN Gen10 ON (Gen10Map.CP = Gen10.CP) AND (Gen10Map.Mnem = Gen10.Substation)) ON
ZoneGenerator.GenBusNo = Gen10Map.BusNo WHERE DTRead = #' + scd[i] + '# ORDER BY GenBusNo',
8, 4, 4)
while not rs.EOF:
if rs.Fields('P').Value > 0.1: ierr =
psspy.plant_data(rs.Fields('GenBusNo').Value,vbref,[vpref,rs.Fields('P').Value / tgref *
100.0])
rs.MoveNext()
rs.Close()

ierr, cmpval = psspy.ardat(TNBArea, 'LOAD')


totl = cmpval.real
ierr, cmpval = psspy.ardat(TNBArea, 'GEN')
totg = cmpval.real

if abs(LossConst*totg - totl) > 1.0: ierr,totals,moto =


psspy.scal(0,1,0,[3,0,1,0],[LossConst*totg - totl])

160
ierr = psspy.fnsl([0,0,0,1,1,1,99,0])
ierr = psspy.fnsl([0,0,0,1,1,0,99,0])
ierr, cmpval = psspy.gendat(isb)
ish = cmpval.real
ocnt = 0
while abs(isg - ish) > 0.1:
ocnt += 1
ierr,totals,moto = psspy.scal(0,1,0,[3,0,1,0],[isg - ish])
ierr = psspy.fnsl([0,0,0,1,1,0,99,0])
ierr, cmpval = psspy.gendat(isb)
ish = cmpval.real

psspy.save(xp + scn[i])

islv = psspy.solved()

print 'Loadflow File ', scn[i], ' Created', islv, ocnt

hr = str(float(i)/2.0)

tl = []
tg = []
ts = []

ierr = db.Execute('INSERT INTO Solved VALUES (' + hr + ',' + str(islv) + ')')


ierr, tlod = psspy.ardat(TNBArea, 'LOAD')
ierr, tgen = psspy.ardat(TNBArea, 'GEN')
ierr, tlos = psspy.ardat(TNBArea, 'LOSS')
ierr = db.Execute('INSERT INTO TotalArea VALUES (' + hr + ',' + str(tlod.real) + ',' +
str(tlod.imag) + ',' + str(tgen.real) + ',' + str(tgen.imag) + ',' + str(tlos.real) + ',' +
str(tlos.imag) + ')')
ierr = psspy.inibus(0)
ierr, ibus, cval = psspy.nxtbus()
while ibus > 0:
ierr, rval = psspy.busdat(ibus ,'PU')
ierr, vval = psspy.busdat(ibus ,'BASE')
ierr, aval = psspy.busint(ibus, 'AREA')
ierr, ival = psspy.busint(ibus, 'ZONE')
ierr, tval = psspy.busint(ibus, 'TYPE')
ierr = db.Execute('INSERT INTO Bus VALUES (' + hr + ',' + str(ibus) + ',\'' + cval +
'\',\'' + cval[0:4] + '\',' + cval[12:18] + ',' + str(aval) + ',' + str(ival) + ',' +
str(tval) + ',' + str(rval) + ')')
ierr, rval = psspy.swsdt1(ibus, 'BINIT')
if ierr == 0:
ierr = db.Execute('INSERT INTO SwitchedShunt VALUES (' + hr + ',' + str(ibus) + ',' +
str(rval) + ')')
ts.append([ibus,rval])
ierr = psspy.inimac(ibus)
if ierr == 0:
ierr, gid = psspy.nxtmac(ibus)
while ierr == 0:
ierr, s = psspy.macint(ibus, gid, 'STATUS')
ierr, p = psspy.macdat(ibus, gid, 'P')
ierr, q = psspy.macdat(ibus, gid, 'Q')
ierr, x = psspy.macdat(ibus, gid, 'PMAX')
ierr, v = psspy.macdat(ibus, gid, 'VSCHED')
ierr = db.Execute('INSERT INTO Gen VALUES (' + hr + ',' + str(ibus) + ',\'' +
gid.strip() + '\',' + str(s) + ',' + str(p) + ',' + str(q) + ',' + str(x) + ',' + str(v) +
')')
tg.append([ibus,gid.strip(),p,v])
ierr, gid = psspy.nxtmac(ibus)
ierr = psspy.inilod(ibus)
if ierr == 0:
ierr, lid = psspy.nxtlod(ibus)
while ierr == 0:
ierr, s = psspy.lodint(ibus, lid, 'STATUS')
ierr, cmpval = psspy.loddt2(ibus, lid, 'MVA', 'ACT')
ierr = db.Execute('INSERT INTO Load VALUES (' + hr + ',' + str(ibus) + ',\'' +
lid.strip() + '\',' + str(s) + ',' + str(cmpval.real) + ',' + str(cmpval.imag) + ')')
tl.append([ibus,lid.strip(),cmpval.real,cmpval.imag])
ierr, lid = psspy.nxtlod(ibus)
ierr, ibus, cval = psspy.nxtbus()
Load.append(tl)
Gen.append(tg)
SwS.append(ts)
#------------------------------------------------------------------
#END OF READ LOAD AND GENERATION DISPATCH
#------------------------------------------------------------------
lfc = scn[0] + 'cnvstat'
psspy.case(xp + scn[0])

161
rs = db.OpenRecordset('SELECT GenBusNo, P FROM ZoneGenerator INNER JOIN (Gen10Map INNER
JOIN Gen10 ON (Gen10Map.CP = Gen10.CP) AND (Gen10Map.Mnem = Gen10.Substation)) ON
ZoneGenerator.GenBusNo = Gen10Map.BusNo WHERE DTRead = #' + scd[i] + '# ORDER BY GenBusNo',
8, 4, 4)
while not rs.EOF:
ierr = psspy.plant_data(rs.Fields('GenBusNo').Value,0,[1.0,100.0])
rs.MoveNext()
rs.Close()
rs = db.OpenRecordset('SELECT BusNo, Max(IIf(Abs([P])<0.001,0,1)) AS st FROM Gen10 INNER
JOIN Gen10Map ON (Gen10.CP = Gen10Map.CP) AND (Gen10.Substation = Gen10Map.Mnem) GROUP BY
BusNo ORDER BY BusNo', 8, 4, 4)
while not rs.EOF:
ierr = psspy.machine_data_2(rs.Fields('BusNo').Value, '1', [rs.Fields('st').Value])
rs.MoveNext()
rs.Close()
rs = db.OpenRecordset('SELECT BusNo, LoadID, Max(IIf(Abs([P])<0.001,0,1)) AS st FROM Load10
INNER JOIN Load10Map ON (Load10.CP = Load10Map.CP) AND (Load10.Substation = Load10Map.Mnem)
GROUP BY BusNo, LoadID ORDER BY BusNo', 8, 4, 4)
while not rs.EOF:
ierr = psspy.load_data_3(rs.Fields('BusNo').Value, rs.Fields('LoadID').Value,
[rs.Fields('st').Value])
rs.MoveNext()
rs.Close()
psspy.cong(0)
psspy.conl(0,1,1,[0,0],[100.0,0.0,0.0,100.0])
psspy.conl(0,1,2,[0,0],[100.0,0.0,0.0,100.0])
psspy.conl(0,1,3,[0,0],[100.0,0.0,0.0,100.0])
psspy.ordr(0)
psspy.fact()
psspy.tysl(0)
psspy.save(xp + lfc)
#------------------------------------------------------------------
#END OF LOADFLOW CONVERSION
#------------------------------------------------------------------
# CREATE CVC INPUT FILE
#------------------------------------------------------------------
lg = open('svr.dat', 'w')
lg.write(str(TInt) + '\n')

rs = db.OpenRecordset('SELECT PilotBusNo, KP, KI FROM ZonePilotBus', 8, 4, 4)


lg.write('%10d %10.5f %10.5f\n' %
(rs.Fields('PilotBusNo').Value,rs.Fields('KP').Value,rs.Fields('KI').Value))
rs.Close()

rs = db.OpenRecordset('SELECT GenBusNo, KPQ, KIQ FROM ZoneGenerator ORDER BY GenBusNo', 8,


4, 4)
while not rs.EOF:
lg.write('%10d %10.5f %10.5f\n' %
(rs.Fields('GenBusNo').Value,rs.Fields('KPQ').Value,rs.Fields('KIQ').Value))
rs.MoveNext()
rs.Close()
lg.close()

lg = open('vpn.dat', 'w')
rs = db.OpenRecordset('SELECT VPREF FROM ZonePilotBusVREF ORDER BY dt', 8, 4, 4)
while not rs.EOF:
lg.write('%10.5f\n' % (rs.Fields('VPREF').Value))
rs.MoveNext()
rs.Close()
lg.close()
#------------------------------------------------------------------
db.Close
#------------------------------------------------------------------
#END OF CVC INPUT FILE
#------------------------------------------------------------------
#OPEN THE CONVERTED CASE AND RESTORE THE CORRESPONDING SNAPSHOT FILE
#FOR 24-HOUR SIMULATION OF LOAD AND DISPATCH CHANGES, THIS SHOULD START
#AT THE FIRST HOUR
psspy.addmodellibrary('cvc.dll')
psspy.case(xp + lfc)
psspy.rstr(xp + lfs)
#INITIALISE AND PROVIDE THE OUTPUT FILE
#psspy.strt(0,xp + 'test.out')
ierr = psspy.mstr(0,xp + pout)
while ierr > 0:
ierr = psspy.mstr(0)
psspy.mrun(0,0.0,0,0,0)
#------------------------------------------------------------------
#COMMON DATA
#------------------------------------------------------------------
#LOAD CONVERSION FACTORS USED
CPA = 0.0 # % OF CONST POWER ACTIVE LOAD

162
CPR = 0.0 # % OF CONST POWER REACTIVE LOAD
CIA = 100.0 # % OF CONST CURRENT ACTIVE LOAD
CIR = 0.0 # % OF CONST CURRENT REACTIVE LOAD
CYA = 0.0 # % OF CONST ADMITTANCE ACTIVE LOAD
CYR = 100.0 # % OF CONST ADMITTANCE REACTIVE LOAD
#------------------------------------------------------------------
#END OF COMMON DATA
#------------------------------------------------------------------
#START DYNAMIC RUN
#------------------------------------------------------------------
#SET PARAMETER AND RUN FIRST LOADFLOW
psspy.dynamics_solution_param_2([200],[1.0,0.010,0.010])
print 'Start Dynamic Hourly Run'
print 'Run Hour: ', scd[0]
psspy.mrun(0, 5.0,0, 1,0)
psspy.mrun(0,10.0,0,10,0)
psspy.mrun(0,TInt,0,50,0)
tr = TInt
#------------------------------------------------------------------
# Start of Hourly Run
#------------------------------------------------------------------
for h in range(1,len(Gen)):
print 'Run Hour: ', scd[h]
#CHANGE LOAD
#move to power flow mode
psspy.powerflowmode()
#LOAD FROM Load1
for i in range(len(Load[h])):
bno = Load[h][i][0]
lid = Load[h][i][1]
ierr, s = psspy.lodint(bno, lid, 'STATUS')
if s == 1:
loadP = Load[h][i][2]
loadQ = Load[h][i][3]
#get the bus voltage
ierr, v = psspy.busdat(bno ,'PU')
ierr, ang = psspy.busdat(bno ,'ANGLE')
#load conversion
cpp = (CPA/100.0)*loadP/(v**0.0)
cpq = (CPR/100.0)*loadQ/(v**0.0)
cip = (CIA/100.0)*loadP/(v**1.0)
ciq = (CIR/100.0)*loadQ/(v**1.0)
cyp = (CYA/100.0)*loadP/(v**2.0)
cyq = -1.0*(CYR/100.0)*loadQ/(v**2.0)
#Insert the new converted load
psspy.load_data_3(bno,lid,[],[ cpp, cpq, cip, ciq, cyp, cyq])

#CHANGE SWITCHED SHUNT


for i in range(len(SwS[h])):
ierr, rval = psspy.swsdt1(SwS[h][i][0], 'BINIT')
if abs(rval - SwS[h][i][1]) > 0.1: ierr =
psspy.switched_shunt_data_3(SwS[h][i][0],[],[_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,SwS[h][i][1]])

#move back to dynamic


psspy.dynamicsmode(1)

for i in range(len(Gen[h])):
bno = Gen[h][i][0]
gid = Gen[h][i][1]
genP = Gen[h][i][2]
ierr, s = psspy.macint(bno, gid, 'STATUS')
if s == 1:
#CHANGE GREF
ierrgov, govmodel = psspy.mdlnam(bno, gid, 'GOV')
ierr, ival = psspy.mdlind(bno, gid, 'GOV', 'CON')
#GEN DISPATCH MW
ierr, mbase = psspy.macdat(bno, gid, 'MBASE')
if (ierrgov == 4):
psspy.alert(' \233 No Model for Governor at bus %10d for Hour %s\n' %
(bno,scd[h]))
elif (govmodel.strip() == 'TGOV1'):
##print 'GREF TGOV1 changed'
ierr, J = psspy.mdlind(bno, gid, 'GOV', 'CON')
ierr, CONJ = psspy.dsrval('CON', J)
gref = (genP/mbase)*CONJ
ierr = psspy.change_gref(bno, gid, gref)
elif (govmodel.strip() == 'HYGOV'):
##print 'GREF HYGOV changed'
ierr, J = psspy.mdlind(bno, gid, 'GOV', 'CON')
ierr, CONJ = psspy.dsrval('CON', J)
ierr, CONJ9 = psspy.dsrval('CON', J+9)
ierr, CONJ11 = psspy.dsrval('CON', J+11)

163
D=((genP/mbase)/CONJ9)+CONJ11
gref=D*CONJ
ierr = psspy.change_gref(bno, gid, gref)
elif (govmodel.strip() == 'GAST'):
##print 'GREF GAST changed'
A = (genP/mbase)
gref = A
ierr = psspy.change_gref(bno, gid, gref)
elif (govmodel.strip() == 'IEESGO'):
##print 'GREF IEESGO changed'
OUT2 = (genP/mbase)
gref = OUT2
ierr = psspy.change_gref(bno, gid, gref)
elif (govmodel.strip() == 'IEEEG1'):
##print 'GREF IEEEG1 changed'
ierr, J = psspy.mdlind(bno, gid, 'GOV', 'CON')
ierr, CONJ9 = psspy.dsrval('CON', J+9)
ierr, CONJ12 = psspy.dsrval('CON', J+12)
ierr, CONJ15 = psspy.dsrval('CON', J+15)
ierr, CONJ18 = psspy.dsrval('CON', J+18)
V1 = CONJ9 + CONJ12 + CONJ15 + CONJ18
gref = (genP/mbase)/V1
ierr = psspy.change_gref(bno, gid, gref)
elif (govmodel.strip() == 'GAST2A'):
##print 'GREF GAST2A changed'
ierr, J = psspy.mdlind(bno, gid, 'GOV', 'CON')
ierr, CONJ6 = psspy.dsrval('CON', J+6)
ierr, CONJ25 = psspy.dsrval('CON', J+25)
ierr, CONJ26 = psspy.dsrval('CON', J+26)
ierr, CONJ14 = psspy.dsrval('CON', J+14)
ierr, CONJ12 = psspy.dsrval('CON', J+12)
ierr, CONJ16 = psspy.dsrval('CON', J+16)
ierr, CONJ29 = psspy.dsrval('CON', J+29)
ierr, CONJ11 = psspy.dsrval('CON', J+11)
ierr, CONJ3 = psspy.dsrval('CON', J+3)
ierr, CONJ = psspy.dsrval('CON', J)
OUT2 = ((genP/CONJ6) - CONJ25)/CONJ26
OUT12 = (OUT2*((CONJ14/CONJ12)+CONJ16)) - CONJ29
OUT0 = OUT12/CONJ11
A = OUT0*CONJ3
gref = A/CONJ
ierr = psspy.change_gref(bno, gid, gref)
else:
psspy.alert(' \233 No Computation for Governor at bus %10d for Hour %s\n' %
(bno,scd[h]))

#CHANGE VREF
ierrexc, excmodel = psspy.mdlnam(bno, gid, 'EXC')
if ierrexc == 4:
psspy.alert(' \233 No Model for Exciter at bus %10d for Hour %s\n' % (bno,scd[h]))
elif Gen[h][i][2] < 0.1:
psspy.progress(' \233 Small Generation assumed outage at bus %10d for Hour %s\n' %
(bno,scd[h]))
elif bno == 59036 or bno == 59037:
psspy.progress(' \233 Remote Regulation for bus %10d at Hour %s\n' % (bno,scd[h]))
else:
Vsched = Gen[h][i][3]
#get the bus voltage p.u.
ierr, v = psspy.busdat(bno ,'PU')
ierr = psspy.increment_vref(bno, gid, Vsched - v)

#NEXT RUN
psspy.mrun(0, tr + 5.0,0, 1,0)
psspy.mrun(0, tr + 10.0,0,10,0)
psspy.mrun(0, tr + TInt,0,50,0)
tr += TInt
#------------------------------------------------------------------
# End of Half-Hourly Dynamic Run
#------------------------------------------------------------------
print 'End of Run'
#------------------------------------------------------------------
psspy.close_report()
psspy.report_output(1,'',[0,0])
psspy.progress_output(1,'',[0,0])
psspy.alert_output(1,'',[0,0])
psspy.prompt_output(1,'',[0,0])
if os.path.exists('svr.dat'): os.remove('svr.dat')
if os.path.exists('vpn.dat'): os.remove('vpn.dat')
lg = open('CVCHalfHourlyDBRun.log', 'a')
lg.write('End Run - ' + datetime.datetime.now().strftime("%d %b %Y %H:%M:%S") + '\n')
lg.close()
ierr = psspy.close_powerflow()

164
ierr = ps

165

Вам также может понравиться