Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability...

115
FOR REFERENCE ONLY INSTITUTE FOR ENERGY SYSTEMS SCHOOL OF ENGINEERING MSC DISSERTATION THESIS MSC IN SUSTAINABLE ENERGY SYSTEMS MAXIMISING GENERATOR CONNECTIONS IN ELECTRICITY NETWORKS UNDER STABILITY CONSTRAINTS DHANA RAJ MARKANDU S1024415 AUGUST 2011

description

Postgraduate Dissertation. MSc. Sustainable Energy Systems (2010/11), University of Edinburgh. Supervisor: Professor Gareth P. Harrison, University of Edinburgh.

Transcript of Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability...

Page 1: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

INSTITUTE FOR ENERGY SYSTEMS

SCHOOL OF ENGINEERING

MSC DISSERTATION THESIS

MSC IN SUSTAINABLE ENERGY SYSTEMS

MAXIMISING GENERATOR CONNECTIONS

IN ELECTRICITY NETWORKS UNDER

STABILITY CONSTRAINTS

DHANA RAJ MARKANDU

S1024415

AUGUST 2011

Page 2: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

i

ABSTRACT

The twin concerns of climate change and energy security are driving the increased

penetration of renewable generation in distribution networks. Conventional networks are not

designed to handle this change and several technical issues can arise as a result of this.

Transient stability, which is a measure of the dynamic response of a generator to large

disturbances, is one of the issues that requires scrutiny. Tools are needed to model and

analyse its behaviour for networks with increased distributed generation.

This project uses optimal power flow to determine maximum generation capacity under

transient stability constraints for single-generator networks. The Swing Equation and the

Equal Area Criterion were selected as the basis to evaluate stability. A transient stability-

constrained optimal power flow was iteratively developed from basic principles and applied

to a theoretical case study. The project concludes that the model developed was functional

under specific conditions, but additional work is required in order for it to accurately

represent a true distribution network. Finally, suggested paths for future work are described

towards the eventual goal of developing a model capable of analysing generator capacity

allocation for multiple-machine distribution networks under transient stability constraints.

Page 3: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

ii

DECLARATION OF ORIGINALITY

I declare that this thesis is my original work except where stated.

This thesis has never been submitted for any degree or examination to

any other University.

………………….………..……………….

Dhana Raj Markandu

MSc. Sustainable Energy Systems

University of Edinburgh

16th August 2011

Page 4: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

iii

CONTENTS (I)

1 Introduction 1

2 Objectives & Methodology 3

2.1 Project Objectives 3

2.2 Project Methodology 3

3 Background & Technical Fundamentals 6

3.1 Distributed generation 6

3.2 Generator transient stability 9

3.2.1 Influence of distributed generation on transient stability 10

3.2.2 Methods for evaluating transient stability 10

3.2.3 Classical model of a synchronous generator 11

3.2.4 The Power-angle Curve 14

3.2.5 Equivalent circuit of a faulted power line 15

3.2.6 The Swing Equation 19

3.2.7 Solving the Swing Equation 21

3.2.8 The Equal Area Criterion 22

3.3 Optimal power flow 26

4 Modelling Transient Stability 29

4.1 Modelling the Equal Area Criterion in Microsoft Excel 29

4.1.1 Structure and functionality of the Microsoft Excel model 30

4.1.2 Verification of the Microsoft Excel model against PowerWorld 34

4.1.3 Application of the Microsoft Excel model to determine maximum generator capacity

37

4.2 Solving the Swing Equation with Matlab 40

4.2.1 Structure and functionality of the Matlab solver 40

4.2.2 Verification of the Matlab solver against PowerWorld 41

Page 5: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

iv

CONTENTS (II)

5 Transient Stability-Constrained Optimal Power Flow (TSC-OPF)

45

5.1 TSC-OPF Version 1 46

5.1.1 Structure and functionality of TSC-OPF-1 47

5.1.2 Verification of TSC-OPF-1 against the Microsoft Excel model 54

5.1.3 Limitations of TSC-OPF-1 55

5.2 TSC-OPF Version 2 56

5.2.1 Structure and functionality of TSC-OPF-2 56

5.2.2 Verification of TSC-OPF-2 against the Microsoft Excel model 59

5.3 TSC-OPF Version 3 60

5.3.1 Structure and functionality of TSC-OPF-3 61

5.3.2 Verification of TSC-OPF-3 against PowerWorld 63

6 Case Study: Transient Stability-Constrained Power Capacity Allocation

64

6.1 Description of the test network 64

6.2 Results 67

6.3 Discussion 68

6.3.1 Performance of the optimal power flow model 68

6.3.2 Analysis of generation capacity allocation 68

7 Project Status & Future Development 70

7.1 Project closing status 70

7.2 Proposals for future work 70

7.2.1 Improving the optimal power flow formulation 71

7.2.2 Expanding the scope of the component models 71

7.2.3 Analysing the system behaviour at the stability limit 73

8 Conclusions 74

Page 6: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

v

CONTENTS (III)

Acknowledgements 75

References 76

Appendix A: The Microsoft Excel Model of the Equal

Area Criterion

A1

Appendix B: Visual Basic Application (VBA) Code for

Automatic Maximum Generation

Calculation in the Microsoft Excel Model of

the Equal Area Criterion

B1

Appendix C: Matlab Code for Solving the Non-Linear

Swing Equation

C1

Appendix D: Definition of Transient Stability-

Constrained Optimal Power Flow Version 3

(TSC-OPF-3)

D1

Appendix E: Definition of Transient Stability-

Constrained Optimal Power Flow Version 4

(TSC-OPF-4)

E1

Page 7: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

vi

LIST OF FIGURES

3.1 Conventional power system architecture 8 3.2 Conventional power system architecture with distributed generation 8 3.3 Classical model of a synchronous generator connected to an infinite bus 12

3.4 Power-angle curve for the classical model of the classical model of a synchronous generator

15

3.5 Non-faulted circuit for transient stability fault modelling 16 3.6 Faulted circuit for transient stability fault modelling 17 3.7 Star representation of a faulted circuit 17 3.8 Delta representation of a faulted circuit 17 3.9 Power-angle curves for prefault, fault and postfault conditions 19

3.10 The Equal Area Criterion 23

4.1 Microsoft Excel model – Network used for the Equal Area Criterion 29 4.2 Microsoft Excel model – Graphical representation of the Equal Area Criterion 33 4.3 PowerWorld model – Circuit used for verification 35 4.4 PowerWorld model – Transient stability simulations for Microsoft Excel verification 36 4.5 Microsoft Excel Goal Seek dialog box 38

4.6 Microsoft Excel model – Stability-constrained maximum generator capacity for different fault clearing times and inertia constants

39

4.7 PowerWorld model – Transient stability simulations for Matlab verification 43

5.1 Network used for TSC-OPF-1 46

6.1 Test network for case study of transient stability-constrained capacity allocation 65

Page 8: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

vii

LIST OF TABLES

4.1 Structure of the Microsoft Excel model – User defined variable network parameters 31 4.2 Structure of the Microsoft Excel model – User defined fixed network parameters 31 4.3 Structure of the Microsoft Excel model – Calculated network parameters 32 4.4 Structure of the Microsoft Excel model – Calculated complex network parameters 32 4.5 Structure of the Microsoft Excel model – Calculated transient stability parameters 32 4.6 Microsoft Excel model – Consolidated values for verification with PowerWorld 34 4.7 Microsoft Excel model – Verification of steady-state parameters with PowerWorld 35 4.8 Microsoft Excel model – Verification of stability parameters with PowerWorld 37

4.9 Microsoft Excel model with Matlab solver - Consolidated values for verification with PowerWorld

42

4.10 Microsoft Excel model with Matlab solver - Verification of stability parameters against PowerWorld

43

5.1 TSC-OPF-1 – Network sets 48 5.2 TSC-OPF-1 – Network optimisation 48 5.3 TSC-OPF-1 – User-defined network parameters 48 5.4 TSC-OPF-1 – Calculated network variables 49 5.5 TSC-OPF-1 – Network constraints 49 5.6 TSC-OPF-1 – Transient stability optimisation 49 5.7 TSC-OPF-1 – Transient stability parameters 50 5.8 TSC-OPF-1 – Calculated transient stability variables 50 5.9 TSC-OPF-1 – Transient stability constraints 51

5.10 TSC-OPF-1 – Input parameters for verification against the Microsoft Excel model 54 5.11 TSC-OPF-1 – Results for verification against the Microsoft Excel model 55 5.12 TSC-OPF-1 – Example of high θs value for network-only optimisation 56 5.13 TSC-OPF-2 – Network sets (added or changed only) 57 5.14 TSC-OPF-2 – User-defined network parameters (added or changed only) 57 5.15 TSC-OPF-2 – Calculated network variables (added or changed only) 58 5.16 TSC-OPF-2 – Network constraints (added or changed only) 58 5.17 TSC-OPF-2 – Results for verification against the Microsoft Excel model 59 5.18 TSC-OPF-2 – Example of constrained θs value for network-only optimisation 60 5.19 TSC-OPF-3 – User-defined network parameters (added or changed only) 61 5.20 TSC-OPF-3 – Calculated network variables (added or changed only) 61 5.21 TSC-OPF-3 – Network constraints (added or changed only) 62

6.1 Line reactances for the test network 65 6.2 Case study results for maximum capacity 67 6.3 Case study sample results for bus phases and voltages 67

B.1 Critical cell references for VBA code B1

D.1 TSC-OPF-3 – Network sets D1 D.2 TSC-OPF-3 – Network optimisation D1 D.3 TSC-OPF-3 – User-defined network parameters D2 D.4 TSC-OPF-3 – Calculated network variables D2 D.5 TSC-OPF-3 – Network constraints D3 D.6 TSC-OPF-3 – Transient stability optimisation D3 D.7 TSC-OPF-3 – Transient stability parameters D4 D.8 TSC-OPF-3 – Calculated transient stability variables D4 D.9 TSC-OPF-3 – Transient stability constraints D5

Page 9: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

viii

LIST OF SYMBOLS

* This list does not include symbols for OPF formulation. Kindly refer to main text where the OPF is defined.

* Symbols with accents in the main text indicate vectors of the magnitude quantities listed here

δ : Generator internal voltage angle (power angle)

δ0 : Steady-state power angle

δc : Clearing angle

δcc : Critical clearing angle

δm : Generator stator synchronous rotating reference axis

δmax : Maximum generator power angle

θr : Infinite bus (receiving bus) voltage angle

θs : Generator terminal (sending bus) voltage angle

ωm : Mechanical angular velocity

ωsm : Synchronous mechanical angular velocity E’ : Generator internal voltage magnitude

f : System frequency H : Per-unit inertia constant I : Generator current magnitude

IL1 : Generator Line 1 current magnitude IL2 : Generator Line 1 current magnitude J : Combined moment of inertia of turbine and generator

M : Inertia constant p : Number of generator poles

Pe : Generator electrical power output Pe(fault) : Faulted generator electrical power output

Pe(postfault) : Postfault generator electrical power output Pe(prefault) : Prefault generator electrical power output

Pm : Generator mechanical power input Pmax : Maximum active power

Q : Reactive power S : Complex power

SB : System base power tc : Clearing time

tcc : Critical clearing time Ta : Accelerating torque Te : Electromagnetic torque Tm : Mechanical torque Vr : Infinite bus (receiving bus) voltage magnitude Vs : Generator terminal (sending bus) voltage magnitude Wk : Kinetic energy in a rotation mass X’d : Generator direct axis transient reactance XL : Network reactance

XL1 : Network reactance of Line 1 XL2 : Network reactance of Line 2

XL2A : Network reactance of Line 2 before fault location XL2B : Network reactance of Line 2 after fault location XAB : Equivalent delta reactance of faulted Line 2 XBC : Equivalent delta reactance of faulted Line 2 XCA : Equivalent delta reactance of faulted Line 2

Page 10: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

ix

GLOSSARY

ACOPF : A non-linear OPF (not abbreviation) AIMMS : Advanced Integrated Multidimensional Modelling Software

CG : Conventional generation / conventional generator (context-specific) DCOPF : A linearised OPF (not abbreviation)

DG : Distributed generation / distributed generator (context-specific) KCL : Kirchhoffs Current Law KVL : Kirchhoffs Voltage Law

OMIB : One-machine infinite-bus OPF : Optimal power flow

TSC-OPF : Transient stability-constrained optimal power flow VBA : Visual Basic Application

Page 11: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

1

I INTRODUCTION

The increasing use of renewable energy sources for power generation is being driven by

the twin concerns of climate change and energy security. Greater capacities of renewable

generation are now being deployed to meet ambitious national targets for the production of

cleaner energy from more diversified sources as well as for the reduction of carbon

emissions. However, these renewable resources tend to be located in remote or non-urban

regions and their integration into power grids occurring typically at the distribution network.

This runs contrary to the conventional design philosophy of power system infrastructure,

which favours large, centralised generation facilities with unidirectional power flow from

source to load through reducing voltage levels.

Incorporating high volumes of distributed generation from renewables at the edges of these

networks introduces several technical challenges that must be addressed, such as bi-

directional power flow, local voltage rise, increasing fault levels and power quality, among

others. A common practise among network operators is to connect distributed generation

facilities on a first-come first-served basis while ensuring that measures are taken, either by

themselves or the project developer, to address these technical issues for the short-term as

part of the project scope.

However, suboptimal allocation of distributed generation sites and connection points may

pose hidden long-term risks such as inadvertently sterilising portions of the network and

limiting future development by prematurely pushing it to its operational limits. Whilst these

issues could generally be overcome with network expansion or reinforcement, such

measures may not always be possible due to planning restrictions, environmental concerns,

public objections as well as reluctance to finance investment in new infrastructure. Given

these potential obstacles, it is often desirable that any new development is carried out in a

manner that maximises the utilisation of existing assets. Therefore, tools and methods are

required to provide network operators with the capability to study the effects of, and

efficiently plan for, the long-term deployment of distributed generation within their regions.

Page 12: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

2

Studies carried out by the Institute of Energy Systems at the University of Edinburgh have

led to the development of optimal power flow as a technique to model the allocation of

distributed generation capacity. Assessment models for maximising generation capacity

have been produced for constraints such as active network management, loss minimisation,

fault levels, network security and voltage step changes. Continuing work at the Institute in

this field involves expanding this concept by developing models for more network constraints

that can be integrated into the optimal power flow formulation and analysing how they

influence, and can be influenced by, the allocation of distributed generation.

This project seeks to develop generator transient stability as a new optimal power flow

constraint for the allocation of distributed generation capacity. The project aims to describe

the fundamental methods for analysing transient stability, develop and verify mathematical

models of it and eventually use these models to produce a functional prototype of a

transient-stability constrained optimal power flow, which will form the key deliverable of the

project in the time allocated. Within this scope, the project will also propose suitable areas

for future work on the subject that will allow the model to be developed further into a more

accurate representation of the dynamic network that it is intended to simulate.

Page 13: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

3

II

OBJECTIVES & METHODOLOGY

2.1 Project objectives

The objectives of this project are to:

a) understand the use of optimal power flow (OPF) to assess capacity allocation of

distributed generation.

b) understand the concept of generator transient stability, evaluate some of the available

methods to calculate it and select the most suitable method for use in this project, with a

view to the project duration and deliverables.

c) develop and verify stand-alone mathematical models for transient stability to further

understand its behaviour and cement the theoretical knowledge gained previously.

d) develop and verify a functional transient stability-constrained generation capacity

allocation OPF for a single generator.

e) conduct a theoretical case study using the model developed.

f) propose opportunities for further work in the area.

2.2 Project methodology

The project was initiated with a review of the existing literature and theory relevant to the

subject matter from published papers, textbooks as well as videos of online lectures. From

these sources, the Equal Area Criterion was selected as the basis upon which transient

stability models would be modelled. Although other techniques do exist, as will be described

in Section 3.2.2, it was decided that a realistic goal would be to initially focus on using an

OPF to model the fundamental concepts of stability, with the intention that it would provide

the foundation upon which more advanced models could be built upon in future work.

Page 14: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

4

The following software were used in this project:

a) Microsoft Excel - version 2007

b) Matlab – version 7.10.0.499 (R2010a)

c) AIMMS [1] – version 3.10 PR – SU3 (Non-commercial educational stand-alone license)

d) PowerWorld Simulator [2] – version 15 with Transient Stability add-on [3][4] (Evaluation

and University Education license)

Microsoft Excel and Matlab are well-known applications commonly used in engineering and

a wide range of other fields.

AIMMS stands for “Advanced Integrated Multidimensional Modelling Software” and is a

modelling package used to develop the optimal power flow for this project. The following

documents were used as references for modelling with AIMMS:

a) AIMMS Tutorial for Beginners [5]

b) AIMMS Users Guide [6]

c) AIMMS Language Reference [7]

d) AIMMS Optimisation Modelling [8]

e) AIMMS Application Examples [9]

PowerWorld is a visual power system simulation and analysis package. The Transient

Stability add-on in PowerWorld was used to verify the calculations and results of the models

developed.

The modelling phase of the project was carried out using the methodology described

below. The concepts mentioned here are given detailed treatment in Section 3.

1. Practical understanding of transient stability was gained by developing an initial

mathematical model of the Equal Area Criterion using Microsoft Excel, which was

selected due to its ease of use and the familiarity of the author with several of its

advanced features that would facilitate development of the model. The model calculated

the fault critical clearing time by utilising the linear formulation of the Swing Equation for

the special case when the fault occurs on the sending bus and the fault power is zero. In

addition, the model also provided a graphical display of the Equal Area Criterion that

dynamically changed based on the input settings.

Page 15: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

5

2. The Microsoft Excel model was generalised to accommodate a fault occurring anywhere

along the line. Matlab was used as the calculation engine to solve the non-linear

formulation of the Swing Equation to obtain the critical clearing time as it had the

capability to do so more efficiently then Microsoft Excel.

3. A basic DCOPF model for a single generator connected to an infinite bus with transient

stability constraints was implemented in AIMMS. As the author did not have prior

experience using AIMMS, the DCOPF was chosen in order to reduce the configuration

complexity of the initial model. In doing so, more focus could be given to the formulation

of the transient stability constraint within AIMMS and its integration with the OPF.

Furthermore, the transient stability calculations developed previously in Microsoft Excel

did not require reactive power as an input and assumed that network resistance was

negligible. Therefore, it was decided that using the DCOPF would be a suitable starting

point that would not detract from the accuracy of the transient stability calculations.

4. As the authors’ familiarity with AIMMS increased, the basic stability-constrained DCOPF

was developed further to improve its accuracy and extend its applicability to larger

networks. Some characteristics of an ACOPF were introduced to the model in order to

increase its accuracy, creating a hybrid OPF formulation. Additional constraints and

error-checking mechanisms were implemented in AIMMS to make the model more

robust and prevent spurious computation errors.

5. A version of the OPF that could model a single-generator multiple-bus network was used

to conduct a case study of a theoretical network that contained several scenarios for

possible connection of a distributed generation facility. Analysis of the results as well as

critical evaluation of the models’ validity were carried out as part of the study.

6. Work on the model was continued, albeit at a lesser priority, during the process of thesis

writing with the intention of producing a full ACOPF formulation that would be capable of

analysing an actual distribution network. Despite some progress being made, the

ACOPF model that incorporated reactive power was not yet fully functional at the end of

the project. However, the author strongly believes that it is close to completion.

Page 16: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

6

III BACKGROUND & TECHNICAL FUNDAMENTALS

The background study carried out for this project can be divided into three main categories,

namely distributed generation, generator transient stability and optimal power flow. An

overview of distributed generation and the issues raised by its increased penetration is first

provided to establish the motivation behind the aims of this project. This is followed by a

review of the effects that increased penetration of distributed generation has on transient

stability and a brief summary of the methods that can be used to evaluate limits of stability.

The technical concepts required to understand and model generator transient stability within

the scope of the project, including derivation of the relevant formulae, are then presented in

detail. Finally, the framework which will be used, capacity-allocation optimal power flow, is

reviewed with reference to the previous work carried out in the area at the University of

Edinburgh.

3.1 Distributed generation

The term “distributed generation”, also known as “embedded generation” or “decentralised

generation”, can have a wide range of definitions, from those that are generic and

descriptive in nature to more specific ones that may include the type of technology used,

size of facility, power or voltage levels and other parameters [10]. These can differ

significantly between countries and technical bodies, as well as the context in which the term

is utilised, with no single standard being prevalent [11]. For the purpose of this project, a

generic definition shall be used where distributed generation (DG) is considered to be the

production of electricity located within the distribution network.

While DGs are now commonly inferred to mean renewable generation, the term itself does

not automatically imply that the source is renewable. Conventional generation, such as

diesel generators and small scale combined heat and power (CHP) plants, can be broadly

classified as DGs as well. However, environmental and energy security concerns have

become key energy policy drivers in many countries, leading to ever-increasing targets for

Page 17: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

7

the deployment of renewable sources of power generation. The growing penetration of

renewable technologies such as solar photovoltaic (PV), biomass, wind, mini-hydro and

marine which are connected at distribution levels has, therefore, created a greater impetus

to explore their impact upon the electricity network that is currently in place.

The conventional power system architecture has been primarily based upon the concept

of large power plants constructed at strategic locations that permit cost-effective generation

of electricity, usually close to the sources of primary energy or other resources required to

support the process, such as cooling water. The power delivery network was developed to

transport bulk power unidirectionally over great distances from the source to the loads, via a

hierarchical series of reducing voltage levels. This resulted in systems that were designed

and optimised specifically to connect a relatively small number of high-capacity, centralised

power sources to a relatively large number of distributed users, with factors such as loss

minimisation, network redundancy, protection and power quality playing important roles to

define the operational layout of the network [11].

However, sites suitable for renewable generation are typically distributed over wide

geographical regions based on natural resource availability and connections to the network

are usually made at distribution level where these resources are more prevalent. This does

not conform to the philosophy governing the design of conventional networks and must be

accounted for as larger capacities of renewable generation come online in parts of the

network that used to contain only loads. Figures 3.1 and 3.2 illustrate the changes in the

electricity network from the conventional design to the current scenario in areas where DG

capacity is increasing.

The effects of connecting more DG to distribution networks have been the subject of a

large number of studies, with work by Ackerman et. al. [10], Dondi et. al. [11] and Pecas et.

al. [12] being just some of the many examples. The details of these studies are not

presented here, but key issues commonly highlighted include reverse power flows,

increased fault levels, voltage regulation, harmonics, power quality and system stability [13].

These are generally not of significant concern when DG penetration is small as their impact

can be absorbed by the conventional network architecture. However, the risk they pose to

the integrity of the supply network increases with installed capacity.

Compounding the inherent technical issues is the general practise commonly adopted by

network operators for the connection of new DG installations, which is usually done based

on a first-come-first-served basis and may possibly sterilise portions of the network [14].

Page 18: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

8

This would occur if a poorly-sited DG facility pushes the network close to the brink of its

operating limits, thereby excluding future installations in the area and resulting in the waste

of generating potential from renewable sources.

Figure 3.1: Conventional power system architecture

High

Voltage

Medium

Voltage

Low

Voltage

Load

Distributed

Generation

POWER FLOW

Centralised

GenerationDistributed

Generation

(Bidirectional)

Figure 3.2: Conventional power system architecture with distributed generation

While network reinforcement may help to mitigate the problem, availability of finances to

invest in new equipment and obtaining the required planning permissions are often uncertain

factors and may delay or prevent such projects. It is therefore a more desirable option for

Page 19: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

9

network operators to leverage upon existing infrastructure in order to achieve the maximum

possible capacity from renewable resources. In order to do so, tools and methods are

needed for network operators to optimally allocate generating capacity by carrying out

holistic, long-term planning. A large number of studies have been carried out with this aim

using various techniques such as optimal power flow [14 - 20], multiobjective impact indices

[21] and genetic algorithms [22].

The limitations of the existing network architecture in a regime of high DG penetration are

becoming increasingly obvious. It is, therefore, critical that the body of knowledge in this

field continues to grow in order to prevent the network from turning into a significant limiting

factor towards the increased deployment of renewable power generation.

3.2 Generator transient stability

The stability of a synchronous generator refers to its ability to maintain synchronism after

being subjected to an external disturbance. Stability analysis can be broadly categorised as

either steady-state stability or transient stability. Steady-state stability is the response of a

generator to small or slow disturbances such as gradual changes to load and generation,

while transient stability involves larger or more abrupt disturbances such as those caused by

system faults, loss of generation or sudden load changes. Only the effects of transient

stability are examined within the scope of this project.

A transient stability event can be summarised as follows. During steady-state operation,

with losses neglected, the mechanical power supplied from the turbine is in equilibrium with

the output electrical power of the generator and the generator rotor rotates synchronously

with the stator magnetic field at a fixed angular offset. The occurrence of a transient fault in

the electrical network alters the properties of the network and reduces the power-producing

capabilities of the generator during the period of the fault. The duration of transient faults

are typically too short to allow the turbine and its upstream processes to respond and an

imbalance occurs where the input power to the generator is greater than the output power.

As a result, the generator rotor gains speed in order to store the excess energy supplied to it

and this increases the angle between the rotor and the stator field. When the fault is

cleared, the rotor acts to discharge this energy causing it to slow down again. This causes

the rotor to swing as it first gains and then discharges energy alternately. If the rotor angle

swings beyond a prescribed limit, then synchronism will be lost.

Page 20: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

10

3.2.1 Influence of distributed generation on transient stability

As discussed in Section 3.1, the increasing amount of DG in conventional power networks

causes several technical issues, with transient stability being one of properties affected. A

summary of the impact that high DG penetration can have on transient stability has been

carried out by Boemer et. al. [23] based on numerous other studies conducted on the matter.

Their findings indicate that DG can play both a positive and negative influence on the

transient stability properties of a network.

From a positive aspect, they note that high penetration of DG can reduce the overall

loading of large conventional generators (CG) and transmission lines as the power

generated is spread over a wider geographical area and located closer to the loads. As a

result, the imbalance between CGs and loads during any network disturbance is less,

causing smaller rotor swings. Furthermore, as DGs typically have lower power ratings than

CGs, their individual tripping would have less impact on the overall network.

On the other hand, they stress that being smaller machines with lesser inertia, DGs

themselves have lower inherent stability and respond to changes much quicker than larger,

conventional machines. They note observations that networks with high penetration of DG

exhibit increased frequency oscillation after a disturbance with longer settling times. They

also caution that increased replacement of CG with DG would require current methods of

network modelling to be re-evaluated to account for the impact that this change may have.

Within the context of this study, it can be inferred that more effective tools are required to

model the relationship between of DG and transient stability in order to determine the correct

balance in terms of capacity and siting that will accentuate the positive effects and minimise

the negative ones. It is hoped that this project will lay the foundations for developing optimal

power flow methods as a tool for this purpose.

3.2.2 Methods for evaluating transient stability

The concepts of transient stability used in this project are the Swing Equation, also known

as the time-domain approach, and the Equal Area Criterion. The theory behind these are

readily available in many electrical power textbooks and the details outlined in Sections 3.2.3

to 3.2.9 are amalgamated primarily from the writings of Glover and Sarma [24], Weedy and

Page 21: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

11

Cory [25] and Saadat [26], as well as online video lectures made available by the Indian

National Program of Technology Enhanced Learning [27].

Some other ways of evaluating stability have been reviewed by Suampun and Chiang [28].

These were direct methods such as the transient energy function method and the controlling

unstable equilibrium point method, as well as less commonly used techniques such as the

hyperplane method and the quadratic approximation approach. Each of these were

concluded to embody specific trade-offs in terms of accuracy of results, computational time

and mathematical complexity. Additional methods that have been published include the

Extended Equal Area Criterion [29 - 30], the primal-dual Newton interior point method [31]

and differential evolution algorithms [32].

The Swing Equation and Equal Area Criterion were chosen over the more advanced

methods as they provided the best option to successfully develop a basic, but functional

transient-stability constrained optimal power flow within the duration of this project. With a

view that any selected method would have to be implemented in the AIMMS modelling

environment, which was unfamiliar to the author at the start of the project, it was decided

that using stability concepts that were well established and did not require the application of

advanced or exotic mathematical concepts would keep the project focused on its key

objective. It was envisioned that the models developed in this project would be used as a

foundation for more complex versions in future work that may incorporate some of the other

methods of evaluating transient stability.

Sections 3.2.3 to 3.2.9 that follow present the technical background that was applied to

develop mathematical models for transient stability.

3.2.3 Classical model of a synchronous generator

The classical model of a synchronous generator was used throughout this project as it was

deemed to be sufficient to develop an initial transient stability-constrained capacity dispatch

OPF. Integration of other complex models that would permit more accurate representations

of generator dynamics could be an opportunity for future work in this area.

The classical model represents a generator as a constant internal voltage located behind a

direct axis transient reactance and includes the following assumptions:

Page 22: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

12

a) The generator operates under balanced three-phase positive sequence conditions.

b) Excitation of the generator is assumed to be constant and input powers do not change

during the period of simulation.

c) Losses, saturation, damping and saliency effects are neglected.

Figure 3.3 depicts the classical generator model connected to an infinite bus through a

purely inductive network. The infinite bus is assumed to have a fixed voltage magnitude and

an angle of 0°, and can absorb all the active power supplied from the generator. The

description is simplified by neglecting generator transformer reactance.

Figure 3.3: Classical model of a synchronous generator connected to an infinite bus

The key parameter required for stability calculations is the generator internal voltage vector,

Ē’. However, this is usually not automatically known in a power system and must be

calculated from other network parameters. The following derivation assumes that Pm, Vs, Vr,

θr, X’d and XL are all known values, and at steady-state, Pm = Pe.

E’ : Generator internal voltage magnitude

δ : Generator internal voltage angle (power angle) Vs : Generator terminal (sending bus) voltage magnitude

θs : Generator terminal (sending bus) voltage angle Vr : Infinite bus (receiving bus) voltage magnitude

θr : Infinite bus (receiving bus) voltage angle jX’d : Generator direct axis transient reactance jXL : Network reactance Pm : Generator mechanical power input Pe : Generator electrical power output I : Generator current

Synchronous generator Infinite bus

E’ ∠δ

jX’d jXL Pe

I

Vs

∠θs Vr

∠θr = 0°

Pm

Generator terminal

Page 23: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

13

The sending bus voltage angle is:

�� = sin� �� ����� � +�� (3.1)

The generator current is:

� ̅ = ���� − ���� � � (3.2)

The generator internal voltage can then be calculated by:

��� =��� + � ̅′� = �∠� (3.3)

Generator current, I, can also be expressed in terms of the vector Ē’:

� ̅ = �� −��� �� + �! = � sin � �� + � − � � cos � − �� �� + � � (3.4)

The complex power output at the generator terminals is:

$̅ = �% + �& = ����∗̅ =�� ( �′ sin � �� + � + � )�′ cos � − �� �� + � *+ (3.5)

The active power delivered is:

�% = ���′ �� + � sin � (3.6)

Maximum active power is delivered when sin δ = 1 at δ = 90°:

��,- = ���′ �� + � sin 90° = ���′ �� + � (3.7)

Equation 3.6 can be written in terms of Pmax as:

�% =��,- sin � (3.8)

Page 24: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

14

At steady-state, Pe = Pm, therefore the steady-state operating angle is:

�1 = sin� ����,- (3.9)

3.2.4 The Power-angle Curve

Equation 3.6 shows that the active power delivered by the generator is dependent upon the

angle between the sending and receiving voltages, known as the power angle, δ.

The relationship between the input and output powers at the generator can be illustrated by

the Power-Angle curve shown in Figure 3.4. Curve Pe represents the electrical output power

from the relationship given by Equation 3.8 while line Pm is the mechanical input power from

the turbine. Pm is in equilibrium with Pe at two operating points, X and Y, where the power

angles are δx and δy respectively. δx is given by Equation 3.9, while δy can be calculated by

�2 =180° − sin� ����,- =��,- (3.10)

Point X is known as the stable operating point because any small perturbations in the

system will be self-corrected by the generator, as long as the disturbance does not increase

the power angle beyond 90°. If the power angle exceeded δx, Pe would become greater than

Pm. Since there is more power leaving the generator than entering it, the rotor would lose

energy and decelerate, causing the power angle to decrease. The power angle would then

undergo a damped oscillation and eventually restabilise at the equilibrium point X if the

network properties remain the same. Similarly, if the power angle was below δx, Pe would be

less than Pm causing the rotor to accelerate and increasing the power angle back to the

equilibrium point.

Point Y is known as the unstable operating point because any small perturbations around

this region that increase the power angle will not be self-corrected by the generator. If the

power angle exceeded δy, Pe would become less than Pm and the rotor would continue

absorbing power from the turbine. This would cause the power angle to increase further and

reduce Pe even more, resulting in a positive feedback loop that would cause instability.

Page 25: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

15

Figure 3.4: Power-angle curve for the classical model of a synchronous generator

It is also worth noting that, as Pm is increased, the operating power angle gets closer to 90°

and the margin for stability reduces. It is therefore desirable for the generator to operate in a

region where the power angle is less than 90° and the input power Pm is not close to the

output power capability limit, Pmax.

3.2.5 Equivalent circuit of a faulted power line

Transient faults in this project were modelled as a balanced three-phase-to-ground short-

circuit faults with no impedance that occurs on one branch of a double circuit power line.

The fault is cleared by disconnecting both ends of the faulted line. Modelling other types of

fault conditions could be an opportunity for future work in this area.

Pm : Turbine mechanical power input Pe : Generator electrical power output

δ : Generator power angle X : Stable operating point

δX : Power angle for stable operating point Y : unstable operating point

δy : Power angle for unstable operating point

Page 26: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

16

Figure 3.5 shows a non-faulted network with a double circuit power line that connects a

classical model of a generator to an infinite bus. The active power transferred from the

generator to the infinite bus under prefault conditions is given by Equation 3.6 previously:

�% 5�%6,789! = ���′ �� + � sin � (3.11)

XL is the parallel line impedance given by:

� = � �: � + �: (3.12)

Figure 3.5: Non-faulted circuit for transient stability fault modelling

Figure 3.6 shows the same circuit with a fault occurring at Point F on Line 2. The line

reactances before and after the fault are labelled as XL2A and XL2B respectively, where:

�: = �:; + �:< (3.13)

E’ : Generator internal voltage magnitude

δ : Generator internal voltage angle (power angle) Vinf : Infinite bus voltage magnitude jX’d : Generator direct axis transient reactance jXL1 : Line 1 reactance jXL2 : Line 2 reactance

Synchronous generator Infinite bus

E’ ∠δ

jX’d jXL1

jXL2 Vr

∠θr = 0°

Page 27: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

17

Figure 3.6: Faulted circuit for transient stability fault modelling

Figure 3.6 is redrawn as shown in Figure 3.7 to represent it as a star-circuit, with AD, BD

and CD being the branches of the circuit and D as the common node.

Figure 3.7: Star representation of a faulted circuit

Star-delta transformation is applied to convert Figure 3.7 to a delta-circuit as shown in

Figure 3.8, with AB, AC and BC the branches of the circuit.

Figure 3.8: Delta representation of a faulted circuit

Synchronous generator Infinite bus

E’ ∠δ

jX’d jXL1

Vr

∠θr = 0°

jXL2A jXL2B

F

Infinite bus

E’ ∠δ

jX’d jXL1

Vr

∠θr = 0°

jXL2A jXL2B

C

A B D

Infinite bus

E’ ∠δ

jXAB

Vr

∠θr = 0°

jXL2B

C

A B

jXAC jXBC

Page 28: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

18

The equivalent reactances of the delta-circuit are:

;< = �� �! + �� �:;! + � �:;! �:; (3.14)

<= = �� �! + �� �:;! + � �:;! �� (3.15)

;= = �� �! + �� �:;! + � �:;! � (3.16)

The equivalent fault reactance between the generator and the infinite bus is XAB given by

Equation 3.14. Therefore under fault conditions, Equation 3.11 can be modified to calculate

the power delivered by the generator by replacing the reactances with XAB, giving:

�% 6,789! =���′ ;< sin � (3.17)

When the fault is cleared by disconnecting Line 2, the postfault power delivery is given by:

�% 5>�96,789! = ���′ �� + � sin � (3.18)

Equations 3.11, 3.17 and 3.18 describe the 3 power-angle curves under prefault, fault and

postfault conditions. Further algebraic manipulation will show that Pe(prefault) > Pe(postfault) >

Pe(fault) (this is not derived here, but can be seen from the example in Section 4.1.1) and the

respective power-angle curves can be plotted as shown in Figure 3.9, which will form the

basis of transient stability analysis using the Equal-Area Criterion detailed in Section 3.2.8.

It is worth noting a special case of the fault power-angle curve when the fault occurs at the

generator, or sending bus. Under such conditions: the line reactance before the fault, XL2A,

is zero, resulting in no output power delivery during the duration of the fault.

�:; = 0 (3.19) ;< = ∞ (3.20) �% 6,789! ≈ 0 (3.21)

Page 29: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

19

Figure 3.9: Power-angle curves for prefault, fault and postfault conditions

3.2.6 The Swing Equation

The Swing Equation describes the relative motion of the generator rotor to the stator

magnetic field and the variation of the power angle with time during a disturbance, or the

amount that the rotor swings. It is the primary relationship used in this project to determine

conditions for transient stability. An abridged derivation of the Swing Equation is

demonstrated below.

Under steady-state conditions and neglecting losses, the input mechanical torque, Tm to a

synchronous generator will be equal to the electromagnetic torque, Te, developed. During a

disturbance, the difference between Tm and Te results in an accelerating torque, Ta.

A, =A� −A% (3.22)

From the laws of rotation, Ta can be described in terms of the combined moment of inertia

of the turbine and generator, J, and the mechanical displacement angle of the rotor with

respect to the synchronously rotating reference axis of the stator, δm.

Page 30: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

20

A, = B C:��CD: =A� −A% (3.23)

It is convenient to express Equation 3.23 in terms of power, P, where:

� = EA (3.24)

Hence, multiplying both sides of Equation 3.23 by mechanical angular velocity ωm gives:

BE� C:��CD: =E�A� −E�A% =�� −�% (3.25)

The term Jωm is known as the inertia constant and denoted by M, which can also be written

in terms of the kinetic energy in the rotating mass, Wk and the synchronous mechanical

angular velocity ωsm. The definition of M can be summarised as:

BE� = F = 2HIE�� (3.26)

The mechanical rotor angle displacement, δm, and synchronous mechanical angular

velocity, ωsm, are respectively related to the electrical power angle, δ, and the synchronous

electrical angular velocity, ωs, by the number of generator poles, p. The synchronous

electrical angular velocity, ωs is also more conveniently denoted in terms of frequency, f.

� = J2 �� (3.27)

E� =J2E�� = 2KL (3.28)

Equation 3.25 can be rewritten in terms of Equations 3.26, 3.27 and 3.28 as:

HIKL C:�CD: =�� −�% (3.29)

Equation 3.29 can be expressed in terms of per-unit values by dividing it with the base

power, SB.

Page 31: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

21

HI$<KL C:�CD: =��$< − �%$< =�� 57! −�% 57! (3.30)

The per-unit inertia constant, H, can be defined as the ratio of kinetic energy in the rotor to

the machine rating. H is a critical parameter in analysing the dynamics of synchronous

generators and has a value that ranges between 1 to 10 seconds. Smaller machines with

less inertia have a lower value of H and vice versa.

M =HI$< (3.31)

Substituting Equation 3.31 into Equation 3.30, and omitting the subscript pu for

convenience, results in the final Swing Equation shown in 3.32.

MKL C:�CD: =�� −�% (3.32)

3.2.7 Solving the Swing Equation

The electrical power delivered, Pe, from 3.8 can be substituted into Equation 3.32 to give:

MKL C:�CD: =�� −��,- NOP� (3.33)

Equation 3.33 is a second-order non-linear differential equation in terms of the power

angle, δ, and cannot be easily solved manually as long as Pe ≠ 0. However, if the transient

line fault occurs on the sending bus as described by Equations 3.19 to 3.21 and Pe ≈ 0, the

Swing Equation becomes

MKL C:�CD: =�� (3.34)

Equation 3.34 is a second-order linear differential equation which can be readily solved

manually and allows the power angle to be expressed in terms of time. This is more useful

Page 32: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

22

in practice as it allows the stability limits to be described as the time taken to clear a

transient fault.

Rearranging and integrating both sides of Equation 3.34 twice gives:

Q)QC:�CD: CD* CD = QQKL��M CD� CD (3.35)

Which solves to:

� = KL��D:2M + �1 (3.36)

The initial condition term after the first integration is the electrical angular velocity of the

rotor relative to the stator field. At time t = 0 under steady-state conditions, both rotor and

stator field are rotating in synchronism, hence:

� 0!CD = 0 (3.37)

The initial condition term after the second integration is the steady-state power angle of the

rotor, δ0, which can be calculated from Equation 3.9.

Rearranging Equation 3.36 to express for time gives:

D = R2M � − �1!KL�� (3.38)

3.2.8 The Equal Area Criterion

Solving the non-linear Swing Equation 3.33 allows stability conditions to be determined

from a time-series behaviour of the system. However, for a simplified model containing a

single generator connected to an infinite bus, such as that shown in Section 3.2.3, a concept

called the Equal Area Criterion can be applied to calculate the stability angle limit.

Page 33: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

23

The Equal Area Criterion uses a graphical interpretation of the energy stored and

dissipated in the generator rotor during a transient fault to evaluate stability and assumes

that synchronism is either retained or lost during the first swing of the rotor. Figures 3.4 and

3.9 described previously are combined to create Figure 3.10, which shall be used to explain

the Equal Area Criterion in further detail.

Under steady-state conditions the input power Pm and output power Pe(prefault) at the

generator are in equilibrium. The generator operates at point U with power angle δ0.

Figure 3.10: The Equal Area Criterion

At the instance the fault occurs, the power delivery capability of the generator is reduced to

curve Pe(fault), as explained previously in Section 3.2.5, and the operating point moves

Pm : Turbine mechanical power input Pe : Generator electrical power output

δ0 : Steady-state power angle

δc : Clearing angle

δmax : Maximum swing angle

Page 34: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

24

instantaneously to point V, creating an imbalance between Pm and Pe. Assuming that the

input power does not change for the duration of the transient fault, the rotor begins to absorb

the excess energy supplied causing it to accelerate. The rotor angle increases and the

operating point moves along curve Pe(fault).

The fault is cleared by disconnecting the faulted line after a period of time, during which the

rotor has moved to point W at power angle δc, which is called the clearing angle. Upon

clearing of the fault, the power delivery capability changes to curve Pe(postfault) and the

operating point instantaneously moves to point Y. Since Pe is now greater than Pm, the rotor

dissipates energy and decelerates while its momentum continues to cause the power angle

to increase along curve Pe(postfault).

As explained in Section 3.2.4, the power angle should remain less than the unstable

operating point, δmax, in order to prevent the rotor from losing synchronism. Therefore, point

Z represents the maximum limit that the rotor can continue to swing after the fault has been

cleared in order to remain stable. If this condition is satisfied, the rotor will experience a

damped oscillation along Pe(postfault) before eventually reaching a new steady-state point.

The region bounded by points UVWX with area A1 represents the total amount of energy

absorbed by the rotor during the period of the fault. This excess energy must be dissipated

by the rotor before it can return to a new equilibrium point on curve Pe(postfault). The region

bounded by points XYZ with area A2 represents the total amount of energy that can be

dissipated by the rotor after the fault is cleared before it becomes unstable. The condition

for stability is that A1 must be less or equal to A2, as this will allow the rotor to release all the

energy absorbed without violating the limit, δmax.

The specific value of the clearing angle, δc, that causes A1 to be exactly equal to A2 is

called the critical clearing angle, δcc. It represents the maximum amount that the rotor can

swing before the fault must be cleared in order for stability to be retained. Referring to

Section 3.2.7, solving the Swing Equation for δcc will give the maximum time, known as the

critical clearing time tcc, that a fault can be sustained to prevent loss of synchronism. This

readily translates into protection relay settings for transmission or distribution systems.

A mathematical representation of the Equal Area Criterion to determine the critical clearing

angle can be derived as given below.

Page 35: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

25

From the generic Equation 3.8, the following can be written:

�% 5�%6,789! =�% 5�%6,789!�,- sin � (3.39)

�% 6,789! =�% 6,789!�,- sin � (3.40)

�% 5>�96,789! =�% 5>�96,789!�,- sin � (3.41)

Area A1 can be calculated as:

S1 = �� �TT − �1! − UQ �% 6,789!�,- sin � C�VW

VXY

= �� �TT − �1! +�% 6,789!�,- cos �TT − cos �1!

(3.42)

Area A2 can be calculated as:

S2 = U Q �% 5>�96,789!�,- sin � C�VZ[\

VWY −�� ��,- − �TT!

= �% 5>�96,789!�,- cos �TT −cos ��,-! −�� ��,- − �TT!

(3.43)

Equating A1 and A2 to satisfy the Equal Area Criterion gives:

�TT = cos� (�� ��,- − �>! + �% 5>�96,789!�,- cos ��,- − �% 6,789!�,- cos �1�% 5>�96,789!�,- − �% 6,789!�,- + (3.44)

The critical clearing angle, δcc, can then be applied to either Equation 3.33 (if Pe(fault) ≠ 0) or

Equation 3.38 (if Pe(fault) = 0) to obtain the critical clearing time, tcc, which is the key constraint

for the capacity dispatch optimal power flow developed in this project.

Page 36: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

26

3.3 Optimal power flow

The optimal power flow (OPF) technique has long been used in power systems to solve a

variety of optimisation problems. While its most common use has been for the economic

dispatch of power, applications such as loss minimisation, efficient use of fuel and security

contingencies have also been implemented using the OPF method [33]. At its most basic,

the OPF combines the solving of a networks’ power flow with a linear programming (LP)

problem, such as minimising cost, to arrive at the optimal solution for the LP that also

satisfies the physical and electrical constraints of the network [24].

The Institute of Energy Systems at the University of Edinburgh has developed methods for

using an OPF as a tool to assess the allocation of DG capacity as presented in the works of

Harrison et. al. [14 - 20]. This method has been used to evaluate the impact that various

constraints such as fault-levels [15], network security [16], voltage step changes [17] as well

as active network control methods [18 - 20], have on the allocation of DG capacity.

The formulation of an OPF can generally be stated in terms of the maximisation or

minimisation of an objective function subject to certain constraints. The capacity-allocation

OPF can be defined both descriptively and mathematically as follows [20]:

• The objective function is to maximise the total active DG capacity p of a set of generators

G that are indexed by g.

]^_`Jaabc (3.45)

The maximisation is done subject to the following constraints:

• Voltage magnitudes V at each bus b (in the set of buses B) are constrained by their

permitted minimum and maximum levels.

�d_�fg ≤ �d ≤�d_�,-∀jkl (3.46)

• Thermal limits constrain the apparent power flow f on each line l (in the set of lines L) to

its maximum level, where p and q are the active and reactive power injections into the

end of line l respectively.

Page 37: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

27

J8: + m8: ≤ L8_�,-:∀nko (3.47)

• Kirchhoffs’ Current Law models the power balance at each bus b (in the set of buses B)

so that the total power p and q generated by all generators g (in the set of buses G)

located at that specific bus is equal to sum of the demands on that bus d p and d q and

the power leaving that bus pl b1b2 and ql

b1b2 on line l (in the set of lines L). b1 and b2

represent the sending and receiving bus of line l respectively.

` Ja = Cd5 + ` J8dpdq 8b�|studabc|stud ∀jkl (3.48)

` ma = Cdv + ` m8dpdq 8b�|studabc|stud ∀jkl (3.49)

• Kirchhoffs’ Voltage Law models the active and reactive power injections p and q into the

end of each line l (in the set of lines L), where b1 and b2 represent the sending and

receiving bus of line l respectively, g is the line conductance, b is the line susceptance

and δ is the voltage phase angle.

J8dpdq = w8�dp: −�dp�dqxw8 cosy�dp −�dqz +j8 siny�dp −�dqz{∀nko (3.50)

m8dpdq = −j8�dp: −�dp�dqxw8 siny�dp −�dqz+j8 cosy�dp −�dqz{∀nko (3.51)

• The reference bus voltage phase angle is defined explicitly as being zero

�sX = 0 (3.52)

Equations 3.45 to 3.52 describe the generic formulation for the capacity allocation OPF.

The terms for active power, reactive power, voltage magnitude and voltage phase are the

OPF variables. Additional terms or constraints can be included to model the effects of

constant power factors [15], external connections [18] or other network properties if required.

While some OPFs, such as those for economic dispatch, may also impose constraints for

the active and reactive power capacity limits, this may be optional for a capacity allocation

OPF depending on the context of analysis. Neglecting this constraint will provide the

Page 38: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

28

theoretical maximum achievable power capacity that can be installed at a given site, but

resource or regulatory limits may impose restrictions on it.

The OPF described by Equations 3.45 to 3.52 is categorised as an ACOPF due to the non-

linear formulation of Kirchhoffs’ Voltage Law (Equations 3.50 and 3.51). The ACOPF can be

simplified by linearising the equations to create a DCOPF, with the assumptions that voltage

level is constant across the network at the nominal voltage V0 and the phase difference is

small such that the terms sin (δb1-δb2) = (δb1-δb2) and cos (δb1-δb2) = 1 [34]. With a further

assumption that line resistance is significantly smaller than reactance and can be neglected,

Equation 3.50 can be simplified to:

J8dpdq = −�1:_8 y�dp −�dqz∀nko (3.53)

The reactive power in Equation 3.51 equates to zero, hence reactive power flows are not

modelled in a DCOPF. This removes Equation 3.49 from the formulation while Equation

3.47 simplifies to:

J8 ≤ L8_�,-∀nko (3.54)

The assumptions made for DCOPFs are more suited to model transmissions systems, as

they are long-distance, high-voltage and high-capacity [34]. For distribution networks, the

line resistances are comparable to the reactances while voltage level becomes an important

constraint as well, hence the ACOPF is more appropriate for accurate representation of the

network. Nonetheless, a DCOPF is easier to implement and its linearity allows for quicker

convergence, making it an acceptable option for the development of initial prototypes.

Page 39: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

29

IV

MODELLING TRANSIENT STABILITY

4.1 Modelling the Equal Area Criterion in Microsoft Excel

The concepts outlined in Sections 3.2.3 to 3.2.8 were used to model the Equal Area

Criterion using Microsoft Excel based on the circuit shown in Figure 4.1, which is the One

Machine-Infinite Bus (OMIB) system with a double circuit transmission line described in

Sections 3.2.3 and 3.2.5. The generator is assumed to always supply power at its maximum

capacity. The infinite bus is assumed to have a fixed voltage magnitude and an angle of 0°,

and absorbs all the power supplied by the synchronous generator.

Figure 4.1: Microsoft Excel model - Network used for the Equal Area Criterion

The model simulates a transient fault at the sending bus (point A) that is cleared by

disconnecting the faulted line at both ends (points A and B). Limiting the fault to point A

Pm : Generator power E’ : Generator internal voltage magnitude

δ : Generator internal voltage angle (power angle) Vs : Generator terminal (sending bus) voltage magnitude

θs : Generator terminal (sending bus) voltage angle Vr : Infinite bus (receiving bus) voltage magnitude

θr : Infinite bus (receiving bus) voltage angle jX’d : Generator direct axis transient reactance jXL1 : Line 1 reactance jXL2 : Line 2 reactance

Vs

∠θs

Generator terminals

Synchronous generator Infinite bus

E’ ∠δ

jX’d jXL1

Vr

∠θr = 0

jXL2 A B

Pm

Page 40: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

30

allows the Excel model to solve the linear case of the Swing Equation (Equation 3.38) in

order to obtain the critical clearing time. The Excel model was not developed to solve the full

non-linear Swing Equation as it can be done more efficiently using Matlab. This is described

further in Section 4.2.

The following sections describe the structure and functionality of the model, the method to

verify the results produced by the model and an example application of the model.

4.1.1 Structure and functionality of the Microsoft Excel model

The structure of the Excel model is shown in Tables 4.1 to 4.5 and a screen-capture of the

actual spreadsheet is provided in Appendix A. The calculations used in the model are cross-

referenced to the equations defined in Section 3 where relevant and the table row numbers

continue sequentially across all five tables. The values displayed in the tables are used in a

sample calculation to verify the accuracy of the model in Section 4.1.2. These values are

not representative of any specific network, but chosen merely to demonstrate the

functionality of the model.

Table 4.1 contains the values that the end user must provide to describe the network based

on parameters that should be readily known and would be typically changed to analyse

different scenarios of stability. These parameters include the sending and receiving bus

voltages, reactances, input power and the generator inertia constant. In addition, Row 9

contains a field that allows the user to toggle the fault on Line 2 and while Row 10 defines

the location of the fault along the line. However, as the Excel model is only capable of

calculating the critical clearing time for the linear version of the Swing Equation when the

fault is at the sending bus, Row 10 should remain at 0% if a result in terms of time is

required. If it is non-zero, then the critical clearing time field in Table 4.5 will display the

word “Matlab”, which is a reference to the solver that will be described further in Section 4.2.

The result in terms of the critical clearing angle, however, can be calculated for any fault

location.

Table 4.2 also contains values that the end user must provide but these will typically remain

unchanged during modelling. They comprise of the system frequency as well as base

values for power and voltage. It should be noted that the calculation of stability parameters

is done purely in per-unit and is independent of the base values defined. The bases are

Page 41: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

31

included to allow convenient verification of the calculated power and current values with

PowerWorld, which displays them as ohmic values by default.

User Defined Variable Network Parameters Sample Value Units

1 Generator terminal voltage magnitude, Vs 1.000 pu

2 Receiving bus voltage, Vr 1.000 pu

3 Receiving bus voltage angle, θr 0.000 rad

4 Line 1 reactance, XL1 0.400 pu

5 Line 2 reactance, XL2 0.400 pu

6 Generator direct transient reactance, Xd' 0.200 pu

7 Mechanical power input, Pm 1.000 pu

8 Inertia constant, H 3 s

9 Line 2 faulted? Yes -

10 Fault location (0=sending end, 100=receiving end) 0 %

Table 4.1: Structure of Microsoft Excel model – User-defined variable network parameters

User Defined Fixed Network Parameters Sample Value Units

11 Frequency, f 50 Hz

12 Base power 100 MVA

13 Base voltage 138 kV

Table 4.2: Structure of the Microsoft Excel model – User-defined fixed network parameters

The third, fourth and fifth tables contain calculated parameters as detailed in Section 3 and

should not be modified by the user. The network parameters in complex terms are explicitly

defined in Table 4.4 to facilitate calculations in Excel. The model neglects generator losses,

hence the electrical output power of the generator (Table 3, Row 14) is set to be equal to the

mechanical input power from the turbine (Table 1, Row 7).

The end result of the model is to determine the critical clearing time (Table 5, Row 37) in

milliseconds. This represents the maximum time that the fault can be sustained under the

network conditions listed in Table 4.1 before the generator loses stability.

Page 42: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

32

Equation Calculated Network Parameters Sample Value Units

- 14 Real electrical power output, Pe 1.000 pu

3.12 15 Equivalent line reactance, XL 0.200 pu

3.1 16 Generator terminal voltage angle, θs 0.201 rad

3.2 17 Generator current, I 1.005 pu

3.3 18 Generator internal voltage magnitude, E' 1.040 pu

- 19 Faulted line reactance (sending end), XL2A 0.000 pu

3.14 20 Equivalent delta reactance, XAB 0.000 pu

Table 4.3: Structure of the Microsoft Excel model – Calculated network parameters

Equation Calculated Complex Network Parameters Sample Value

Real Imaginary Complex

- 21 Receiving bus voltage, Vr 1.000 0.000 1

- 22 Generator terminal voltage, Vs 0.980 0.200 0.98+0.2i

- 23 Generator direct transient reactance, Xd' 0.000 0.200 0.2i

- 24 Line 1 reactance, XL1 0.000 0.400 0.4i

- 25 Line 2 reactance, XL2 0.000 0.400 0.4i

3.12 26 Equivalent line reactance, XL 0.000 0.200 0.2i

3.2 27 Generator current, I 1.000 0.101 1+0.1i

3.3 28 Generator internal voltage, E' 0.960 0.400 0.96+0.4i

Table 4.4: Structure of the Microsoft Excel model – Calculated complex network parameters

Equation Calculated Transient Stability Parameters Sample Value Units

3.11 29 Pre-fault maximum power, Pmax(prefault) 2.599 pu

3.17 30 Fault maximum power, Pmax(fault) 0.000 pu

3.18 31 Post-fault maximum power, Pmax(postfault) 1.733 pu

3.9 32 Steady-state operating angle, δ0 0.395 rad

3.10 33 Stability limit angle, δmax 2.526 rad

3.42 34 Area A1 0.750 -

3.43 35 Area A2 0.750 -

3.44 36 Critical clearing angle, δcc 1.145 rad

3.38 37 Critical clearing time, tcc 169.2 ms

Table 4.5: Structure of the Microsoft Excel model – Calculated transient stability parameters

Page 43: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

33

The model also includes a graphical representation of the Equal Area Criterion that

displays the three power angles curves as well as key angles δ0, δcc and δmax. This is shown

in Figure 4.2. The curves will automatically change to reflect the input values supplied.

Limitations with Excel do not permit the relevant bounded areas of the diagram to be

emphasised easily, but this can be inferred by comparing Figure 4.2 to Figure 3.10.

Figure 4.2: Microsoft Excel model – Graphical representation of the Equal Area Criterion

The results obtained from the model can be verified with PowerWorld to ascertain its

accuracy. To facilitate verification, an additional table that consolidates all the information

that will be relevant to the PowerWorld simulation is made available for the user. This is

shown in Table 4.6.

0.0

0.5

1.0

1.5

2.0

2.5

3.0

0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5

Po

we

r, p

u

Delta , rad

Microsoft Excel model of the Equal Area Criterion

P (prefault)

P (fault)

P (postfault)

Pm

δδδδ0 δδδδmax δδδδcc

Page 44: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

34

PowerWorld network verification parameters Sample Value Units

USER INPUT

Real electrical power output, Pe = Pm 100.00 MW

Generator terminal voltage, Vs 1.000 pu

Infinite bus voltage, Vr 1.000 pu

Infinite bus voltage angle, θr 0.00 deg

Line 1 reactance, XL1 0.400 pu

Line 2 reactance, XL2 0.400 pu

Generator direct transient reactance, Xd' 0.200 pu

Inertia constant, H 3 s

Fault location (0=sending end, 100=receiving end) 0 %

STAGE 1 VERIFICATION - NETWORK PARAMETERS

Generator terminal voltage angle, θs 11.54 deg

Line 1 current, IL1 210.25 A

Line 2 current, IL2 210.25 A

STAGE 2 VERIFICATION - GENERATOR TRANSIENT PARAMETERS

Steady-state operating angle, δ0 22.63 deg

Critical clearing angle, δcc 65.58 deg

Stability limit angle, δmax 144.75 deg

Critical clearing time, tcc 169.2 ms

Table 4.6: Microsoft Excel model - Consolidated values for verification with PowerWorld

4.1.2 Verification of the Microsoft Excel model against PowerWorld

Various critical clearing time values calculated by the model under different conditions were

compared with PowerWorld simulations for verification. A verification example for the set of

network parameters and output power shown in Table 4.6 is described below.

Figure 4.3 shows a PowerWorld model that was configured and run for the circuit shown in

Figure 4.1 with the configured network parameters of Table 4.6. The generator terminal was

modelled as a PV bus, with the generator automatic voltage regulator (AVR) switched on in

order to lock the sending bus voltage at 1 pu. The reactive power output of the generator is

not displayed as it is not relevant to the stability model at this stage. The slack generator on

the infinite bus absorbs all the active power output of the modelled generator.

Page 45: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

35

Figure 4.3: PowerWorld model – Circuit used for verification

The first level of verification was done before the transient stability simulation was carried

out. Only θs, IL1 and IL2 were examined at this stage (shown as boxed values in Figure 4.3),

which are calculated steady-state network values in both the Excel model and PowerWorld.

The results produced by the two models are compared in Table 4.7 and show that the same

values, with negligible decimal differences. This indicated that the Excel model accurately

models the steady-state network.

Parameter Microsoft Excel PowerWorld

Generator terminal voltage angle, θs 11.54° 11.53°

Line 1 current, IL1 210.25 A 210.21 A

Line 2 current, IL2 210.25 A 210.21 A

Table 4.7: Microsoft Excel model – Verification of steady-state parameters with PowerWorld

The next level of verification was done by running transient stability simulations with

PowerWorld and checking the accuracy of the stability parameters δ0, δcc, δmax and tcc. Three

simulations were carried out, where the fault was applied at t = 1s and cleared at different

times in each. The relevant results of each simulation are summarised in Figure 4.4.

Page 46: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

36

In the first simulation, the fault was cleared instantaneously and the generator remained

stable. This indicated that the configuration was correct. The rotor angle continued to

oscillate between 22° to 46° after the fault was cleared because damping effects were not

modelled. In practise, the oscillations should gradually recede due to damping and the

generator should return to a new stable operating point as described in Section 3.2.8.

In the second simulation, the fault was cleared at the critical clearing time of 169.2 ms

given by the Excel model. While the generator still remained stable, the rotor angle

oscillated between -25° to 144° in a distorted pattern. The distortion of the rotor angle

movement warrants further analysis but this is left as an opportunity for future work as it has

no immediate bearing on the model utilised and lies outside the primary scope of the project.

In the third simulation, the fault was cleared at 169.3 ms, just after the critical clearing time.

The rotor angle continued to increase exponentially after the fault was cleared, indicating

that synchronism was lost and the generator was no longer stable.

Figure 4.4: PowerWorld model – Simulations for Microsoft Excel verification

-50

-25

0

25

50

75

100

125

150

175

200

225

250

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5

Ro

tor

an

gle

, d

eg

ree

s

Time, s

Transient stability simulations with Powerworld

Fault duration = 0 ms

Fault duration = 169.2 ms

Fault duration = 169.3 msSteady-state

operation Post-fault operation

Fault applied

X

Page 47: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

37

The “first swing” assumption of the Equal Area Criterion described in Section 3.2.8 is

evident from Figure 4.4, as it can be seen that the 169.3 ms curve tracks the 169.2 ms curve

until the peak of the first swing before it separates at point “X” and increases exponentially.

PowerWorld values for δ0, δcc, δmax and tcc were recorded in Table 4.8 and found to be

similar to the Excel values, with negligible decimal variations in some cases, showing that

the Excel model accurately represented the transient stability response of the generator.

Parameter Microsoft Excel PowerWorld

Steady-state operating angle, δ0 22.63° 22.63°

Critical clearing angle, δcc 65.58° 65.57°

Stability limit angle, δmax 144.75° 144.86°

Critical clearing time, tcc 169.2 ms 169.2 ms

Table 4.8: Microsoft Excel model – Verification of stability parameters with PowerWorld

In this example, the critical clearing time calculated by Excel was exactly the same as that

demonstrated by PowerWorld. However, it is worth noting that the Excel value may not

always be precise due to rounding errors in the calculation. In this situation, the second and

third simulations may need to be repeated several times with minor adjustments in order to

determine to the actual value of the critical clearing empirically.

4.1.3 Application of the Microsoft Excel model to determine maximum

generator capacity

The Microsoft Excel model was used to determine the maximum capacity of a single

generator subjected to transient stability constraints. This was carried out without using an

OPF formulation and neglecting network constraints to test the capabilities of the model.

The ‘Goal Seek’ function of Excel, shown in Figure 4.5, was utilised for this purpose.

The procedure used is listed below:

Page 48: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

38

1. The ‘Set cell’ field was configured to the cell containing the critical clearing time, tcc

(Table 4.5, Row 37).

2. The ‘To value’ field was set to a user-defined clearing time in milliseconds.

3. The ‘By changing cell’ field was configured to the cell containing the mechanical power

input to the generator, Pm (Table 4.1, Row 7).

Figure 4.5: Microsoft Excel Goal Seek dialog box

When ‘Goal Seek’ was run with the configuration above, the Excel model automatically

iterated through values of generator power in order to obtain a value of critical clearing time

that equates to the user-defined clearing time. The result was the power capacity that

brought the generator to the brink of stability for a specified clearing time.

A simple Visual Basic Application (VBA) program was written in Excel to automatically run

iterations of the ‘Goal Seek’ function to obtain the maximum capacity with different clearing

times. In addition, the inertia constant, H, was also changed to observe the effect that it had

on maximum capacity. The VBA code used for this purpose is provided in Appendix B and

has been configured as a macro within the Excel model to facilitate future users.

Figure 4.6 shows the results obtained. The network parameters used were the same as

listed in Table 4.1, except that different inertia constants were used and mechanical input

power, Pm, was treated as variable that depended upon the user-defined critical clearing

time value, tcc. As this is a generic example to demonstrate the functionality of the model,

the specific values are not relevant and only the trends observed are discussed. It should be

noted that the values of inertia constant used are not representative of any specific

generator or turbine type, but generic values chosen to represent low, medium and high

samples of the range.

Page 49: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

39

Figure 4.6: Microsoft Excel model - Stability-constrained maximum generator capacity for

different fault clearing times and inertia constants

The results indicate that the maximum stability-constrained capacity of a generator

decreases non-linearly as the clearing time is increased. The longer a sustained fault must

be tolerated, the smaller the output power is permitted to be. Referring to the explanation of

the Equal Area Criterion given in Section 3.2.8, higher input power to the generator would

mean that the rotor would absorb more energy during the period of the fault when there is no

output power delivery (assuming the fault occurs at the sending bus). Dissipating this

energy would require a longer duration, resulting in a larger angular movement for the rotor.

Hence, in order for the respective pre- and post-fault clearing regions illustrated in Figure

3.10 to have the same area without violating the limit imposed by the maximum clearing

angle, the critical clearing angle must reduce, which also reduces the critical clearing time.

Higher inertia constants permit greater generator capacities for the same clearing time.

Machines with larger inertia are generally physically bigger and have slower responses to

transient disturbances. Therefore, it would take a longer period of time for their rotors to

travel to the critical clearing angle and they are able to tolerate a longer clearing time for a

given power output compared to a generator with smaller inertia.

0.00

0.25

0.50

0.75

1.00

1.25

1.50

1.75

0 100 200 300 400 500 600 700 800 900 1000

Po

we

r, p

u

Time, ms

Stability-constrained maximum generator capacity

(ignoring network constraints)

H = 3

H = 6

H = 9

Page 50: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

40

The rate of change in capacity is most significant at lower clearing times and plateaus

towards the maximum time. Generators with smaller inertia constants display a faster rate of

change since they are quicker to respond to any transient disturbances.

If the user-defined clearing time in this application of the model is assumed to be a

protection relay setting and only transient stability limits are considered, then the model may

be used to determine the maximum capacity for a given protection relay configuration for a

theoretical single generator system. Conversely, it may also be used to evaluate maximum

relay clearing times for a given generator power output.

The use of the Excel “Goal Seek” function with the Equal Area Criterion in order to

determine maximum generation capacity provided valuable insight into methods of

formulating the optimal power flow model in Section 5, which forms the primary aim of this

project. However, the Excel model on its own has been developed to a stage where it would

serve as a useful tool for learning, teaching or modelling the Equal Area Criterion, which will

benefit any future work carried out to advance the scope of this project.

4.2 Solving the Swing Equation with Matlab

The Microsoft Excel model of the Equal Area Criterion was limited to solving the linear case

of the Swing Equation when the fault occurred at the sending bus and the fault power was

zero (Equation 3.34). By using Matlab to solve the full non-linear version of the Swing

Equation (Equation 3.33), the functionality of the Excel model can be expanded to

encompass a fault at any location on the line between points A and B on Figure 4.1 shown

previously. While it was possible to translate the entire Equal Area Criterion model from

Excel to Matlab, it was decided to retain the main model in Excel as the spreadsheet format

provided more flexibility and was more user-friendly. Hence, Matlab was only used as the

calculation engine to solve the differential equation and calculate the critical clearing time.

4.2.1 Structure and functionality of the Matlab solver

The Matlab program consists of two parts, the first being the main program file swing.m,

while the second is the function file f.m. The function defines the non-linear second-order

differential equation in terms of two first order differential equations, which is required by

Page 51: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

41

Matlab in order to solve it. The full Matlab code developed is given in Appendix C, while a

description of the codes’ functionality is as follows.

The main program requires input values for Pm, Pmax(fault), δ0, δcc, f and H, which are obtained

manually from the Excel model described previously. In addition, a time range for the

solution is defined, along with the initial values described in Section 3.2.7. The program first

uses the Matlab differential equation solver ode45 to solve the equations defined by function

f.m with the inputs provided and produces a plot of rotor angle against time. A conditional

loop is used to iterate the solver by incrementing the solution time range in fixed steps until

the critical clearing angle is located in the middle of the rotor angle range. This method

provides some flexibility to the program by allowing it to solve up to an optimum time range

depending on the input parameters, hence avoiding a solution time range that is too short

(which would cause a program error and require user intervention to increase the time by

trial-and-error) or too long (which would unnecessarily increase the computation time).

Additionally, accuracy of the solution is improved by locating the critical clearing angle in the

middle of the solved range.

After the solver routine is complete, the Matlab curve-fitting functions polyfit and polyval are

then used to calculate the critical clearing time from the critical clearing angle provided by

the Excel model. Another conditional loop is implemented to improve the accuracy of the

result by increasing the order of the polynomial used until the curve-fitting error calculated by

the polyval function becomes less than 1%. The final result extracted from Matlab is not only

the calculated critical clearing time, but also a minimum and maximum value based on the

curve-fitting error. Verification with PowerWorld is required to determine the exact value,

which should lie within the range given by Matlab.

4.2.2 Verification of the Matlab solver against PowerWorld

Various critical clearing time values calculated by the Matlab solver for different fault

locations were verified against PowerWorld simulations. An example verification exercise for

the set of network parameters shown in Table 4.9 is described below.

The parameters shown were the same as those used in Section 4.1.2, except that the fault

location was set to 50%. This increased the power output during the fault duration, Pmax(fault)

Page 52: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

42

from 0 pu to 1.04 pu and changed the critical clearing angle values from 65.58° to 110.54°.

All other parameters were unchanged in the model.

PowerWorld network verification parameters Sample Value Units

USER INPUT

Real electrical power output, Pe = Pm 100.00 MW

Generator terminal voltage, Vs 1.000 pu

Infinite bus voltage, Vr 1.000 pu

Infinite bus voltage angle, θr 0.00 deg

Line 1 reactance, XL1 0.400 pu

Line 2 reactance, XL2 0.400 pu

Generator direct transient reactance, Xd' 0.200 pu

Inertia constant, H 3 s

Fault location (0=sending end, 100=receiving end) 50 %

STAGE 1 VERIFICATION - NETWORK PARAMETERS

Generator terminal voltage angle, θs 11.54 deg

Line 1 current, IL1 210.25 A

Line 2 current, IL2 210.25 A

STAGE 2 VERIFICATION - GENERATOR TRANSIENT PARAMETERS

Steady-state operating angle, δ0 22.63 deg

Critical clearing angle, δcc 110.54 deg

Stability limit angle, δmax 144.75 deg

Critical clearing time, tcc MATLAB ms

Table 4.9: Microsoft Excel model with Matlab solver - Consolidated values for

verification with PowerWorld

The required values were input into Matlab and the solver was run to obtain the critical

clearing time. This result was then used in PowerWorld for verification. The results of the

first stage of verification were same as the previous example shown in Table 4.7 since the

steady-state parameters of the network were unchanged. The results of the second stage of

verification are shown in Table 4.10.

Matlab calculated the critical clearing time to be 411.1 ms. However, running the

PowerWorld simulation with this value resulted in an unstable system. The simulation was

Page 53: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

43

rerun several times with slightly different time values and the accurate result was found to be

410.4 ms, which was within the minimum range given by Matlab. The rotor angle plots for

both the time values are shown in Figure 4.7.

Parameter Microsoft Excel Matlab PowerWorld

Steady-state operating angle, δ0 22.63° - 22.63°

Critical clearing angle, δcc 110.54° - 110.54°

Stability limit angle, δmax 144.75° - 144.70°

Critical clearing time, tcc - 411.1 ms

410.4 ms Minimum critical clearing time, tcc(min) - 407.3 ms

Maximum critical clearing time, tcc(max) - 415.0 ms

Table 4.10: Microsoft Excel model with Matlab solver – Verification of stability parameters

against PowerWorld

Figure 4.7: PowerWorld model - Transient stability simulations for Matlab verification

-50

-25

0

25

50

75

100

125

150

175

200

225

250

275

300

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6

Ro

tor

an

gle

, d

eg

ree

s

Time, s

Transient stability simulations with Powerworld for Matlab verification

tcc = 410.4 ms

tcc = 411.1 msSteady-state operation

Post-fault operation

Fault applied

Page 54: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

44

In this example, although the critical clearing time value demonstrated by PowerWorld was

not exactly the same as that calculated by Matlab, it remained within the tolerance range

defined by the curve-fitting error. This demonstrated that the Excel model can be used in

conjunction with Matlab to determine the transient stability response of a generator for any

fault location between the sending and receiving buses.

Work on the Matlab solver was not progressed further as it was decided that the OPF

modelling in AIMMS would focus on using only the linear case of the Swing Equation.

Comparing Tables 4.8 and 4.10, it can be seen that the critical clearing time increased as

the fault moved further away from the generator bus. Therefore, limiting the fault condition

modelled by the OPF to the generator bus would simulate a worst-case scenario with the

most stringent clearing time forming the bounding constraint.

Page 55: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

45

V TRANSIENT STABILITY-CONSTRAINED

OPTIMAL POWER FLOW (TSC-OPF)

The AIMMS modelling software was used to develop the transient stability-constrained

optimal power flow (TSC-OPF) model. The optimisation concept used is similar to that of the

Microsoft Excel ‘Goal Seek’ function outlined in Section 4.1.3, where the critical clearing time

is defined as a fixed value and generator power is allowed to vary. The computation

algorithm then seeks to determine the maximum generator power that would bring the

system to the brink of stability if the actual fault clearing time was the same as the critical

clearing time. Only the linear case of the Swing Equation will be modelled in the TSC-OPF

as a fault on the sending bus causes represents the worst-case scenario when the critical

clearing time of the transient fault is the shortest.

The approach taken in model development was to start with a basic version of the TSC-

OPF and progressively build upon a working model at each iteration to make it more

complex, with the ultimate goal of eventually having a version that could be applied to any

generic distribution network. As the author did not have prior experience in using AIMMS,

this approach facilitated the configuration and troubleshooting at each stage of the

development and allowed for the gradual improvement of competency in the software and

understanding of the models behaviour. It should be noted that the configurations described

in this section do not represent the only or most optimal method of implementing the TSC-

OPF within AIMMS. The goal of developing prototype models that were functional was given

precedence over programming elegance or computational efficiency.

The AIMMS configuration defines the OPF by the declaration of sets, parameters,

variables, constraints and executables. The declarations used for each TSC-OPF are

provided for each version along with descriptive notes. The mathematical notation of the

OPF is also provided for each version. For ease of reference, the declarations are denoted

both by the name used within AIMMS as well as the mathematical symbol used in the formal

notation. For the final version developed in this project, the complete tabular description and

text representation of the AIMMS code is supplied in Appendix D.

Page 56: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

46

5.1 TSC-OPF version 1

The first version of the transient stability-constrained optimal power flow (TSC-OPF-1) was

developed to specifically implement the circuit shown in Figure 5.1, which is similar to the

One Machine-Infinite Bus (OMIB) system with a double circuit transmission line described in

Sections 3.2.3 and 3.2.5 and previously modelled with Microsoft Excel in Section 4.1.

The same assumptions used in Section 4.1 also apply to TSC-OPF-1:

a) The generator is assumed to always supply power at its maximum capacity, subject to

the constraints specified.

b) The infinite bus is assumed to have a fixed voltage magnitude of 1 pu and an angle of 0°,

and absorbs all the power supplied by the generator.

c) The fault is simulated at the sending bus (point A) that is cleared by disconnecting the

faulted line at both ends (points A and B), therefore the fault current is zero and the

linear case of the Swing Equation is used to determine the critical clearing time.

Figure 5.1: Network used for TSC-OPF-1

Pm : Generator power E’ : Generator internal voltage magnitude

δ : Generator internal voltage angle (power angle) Vs : Generator terminal (sending bus) voltage magnitude

θs : Generator terminal (sending bus) voltage angle Vr : Infinite bus (receiving bus) voltage magnitude

θr : Infinite bus (receiving bus) voltage angle jX’d : Generator direct axis transient reactance jXL1 : Line 1 reactance jXL2 : Line 2 reactance

Pm

Vs

∠θs

Generator terminals

Synchronous generator Infinite bus

E’ ∠δ

jX’d jXL12_1

Vr

∠θr = 0

jXL12_2 A B

B1 B2

Page 57: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

47

5.1.1 Structure and functionality of TSC-OPF-1

A pure DCOPF representation of Figure 5.1 was used to implement TSC-OPF-1. The

primary objective with this version of the model was to produce a functional prototype that

successfully integrated the transient stability calculations as an OPF constraint and to verify

the results obtained against the Microsoft Excel model. This goal was eventually achieved

after several iterations of testing and troubleshooting.

The general formulation of TSC-OPF-1 was in accordance with the theory presented in

Section 3. However, there were several key configuration decisions made during the

development process that were instrumental in producing a functional prototype as

described below

a) The network power flow and transient stability calculations were compartmentalised as

separate segments with their own unique variables and constraints. Any common

physical quantities were declared separately in each segment and then explicitly linked

by equality constraints to construct an integrated TSC-OPF. This allowed the network

OPF to be solved with or without the transient stability constraints and facilitated testing

and troubleshooting.

b) The output quantity at each stage of the transient stability calculation was declared as a

free variable which was then constrained by the respective formula. This allowed the

quantities to be bounded by maximum or minimum limits to preserve the physical

representation of the Equal Area Criterion and avoid computational errors. Examples of

these include limiting the post-fault power, Pmax(postfault), to be less than the pre-fault

power, Pmax(prefault), and bounding the clearing angle, δc, between the steady-state

operating angle, δ0, and the maximum stability limit angle, δmax. In addition, some parts

of the calculation were combined into a single formulation in order to reduce the number

of variables.

Tables 5.1 to 5.9 describe the full AIMMS declarations used in the formulation of TSC-OPF-

1, which consisted of 16 parameters, 12 variables and 20 constraints. Tables 5.1 to 5.5 refer

to the network power flow segment while Tables 5.6 to 5.9 refer to the transient stability

segment. Equations 5.1 to 5.22 describe the OPF using mathematical notation. The

formulas used repeated from those presented previously in Section 3.

Page 58: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

48

Set AIMMS Name AIMMS Index Symbol Description

S1 Buses b B Set of busbars in the network.

S2 Lines l L Set of lines in the network.

S3 DG g G Set of distributed generators in the network.

Table 5.1: TSC-OPF-1 - Network sets

Network Optimisation

AIMMS Name

Equation Description

NO1 DG_Network

Power Equation 5.22 Variable to be maximised.

NO2 NetworkOnly_

Variables -

Limits the variables used to those listed in Table 5.4 so that only the network OPF is optimised. Transient stability variables listed in Table 5.8 are omitted.

NO3 NetworkOnly_

Constraints -

Limits the constraints used to those listed in Table 5.5 so that only the network OPF is optimised. Transient stability constraints listed in Table 5.9 are omitted.

NO4 MaxDG_

NetworkOnly Equation 5.22

Defines the objective function and direction of optimisation

Table 5.2: TSC-OPF-1 - Network optimisation

Network Parameter

AIMMS Name

AIMMS Index

Symbol Description

NP1 DG_Location - - The busbar on which the distributed generator is located.

NP2 Demand b D Active power demand at each busbar.

NP3 Reactance l X Reactance of each line.

NP4 Flow_Limit l fmax Thermal flow limit of each line. Since reactive power is not modelled, it is assumed that this relates to the active power flow limit.

NP5 Capacity g Pmax Power generating capacity of each distributed generator.

NP6 Connections b, l c

Two-dimensional matrix that forms the definition of the network connections. The value ‘1’ indicates the start busbar for a line, while the value of ‘-1’ indicates the end busbar for a line.

Table 5.3: TSC-OPF-1 - User-defined network parameters

Page 59: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

49

Network Variables

AIMMS Name

AIMMS Index

Symbol Description

NV1 Power_ Network

g Pm Power output of the distributed generator.

NV2 Phase b θ Voltage phase angle at each busbar.

NV3 Flow l f Active power flow in each line. Negative values indicate that the powerflow is in the opposite direction than that defined by the ‘Connections’ parameter.

Table 5.4: TSC-OPF-1 - Calculated network variables

Network Constraint

AIMMS Name

AIMMS Index

Equation Description

NC1 Phase_

SlackBus - Equation 5.2

Explicitly defines the voltage phase angle of the slack/infinite bus to the zero.

NC2 Flow_Min l Equation 5.3 Sets the lower active powerflow limit on the lines when power flows in the opposite direction than that defined by the ‘Connections’ parameter

NC3 Flow_Max l Equation 5.4 Sets the upper active power flow limit on the lines when power flows in the same direction as that defined by the ‘Connections’ parameter.

NC4 Power_ Capacity

g Equation 5.5 Limits the upper boundary of the power generated by the distributed generator.

NC5 KVL l Equation 5.6 Defines Kirchhoffs Voltage Law constraint.

NC6 KCL b Equation 5.7 Defines a modified version of Kirchhoffs Current Law constraint.

Table 5.5: TSC-OPF-1 - Network constraints

Stability Optimisation

AIMMS Name Equation Description

SO1 DG_StabilityPower Equation 5.1 Variable to be maximised.

SO2 MaxDG_ TSCOPF Equation 5.1 Defines the objective function and direction of optimisation.

Table 5.6: TSC-OPF-1 - Transient stability optimisation

Page 60: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

50

Stability Parameter

Parameter Type

AIMMS Name

Symbol Description

SP1 User-

defined Xd Xd

’ Generator direct-axis transient reactance.

SP2 User-

defined H H Machine inertia constant.

SP3 User-

defined F F System frequency.

SP4 User-

defined t_c tc Desired clearing time limit in milliseconds.

SP5 Fixed X_prefault Xprefault Prefault reactance between generator and infinite bus. This is the parallel reactance of the values in NP3.

SP6 Fixed X_postfault Xpostfault Postfault reactance between generator and infinite bus. This is the reactance of L21_1 after the fault is cleared by opening L21_2.

SP7 Fixed Vs_mag Vs Sending bus voltage magnitude fixed at 1 pu.

SP8 Fixed Vr_mag Vr Receiving bus voltage magnitude fixed at 1pu.

SP9 Fixed Vr_ang θr Receiving bus phase angle fixed at 0 radians.

SP10 Fixed Pmax_fault Pmax(fault) Fault power delivery fixed a 0 pu due to simulated fault on the sending bus.

Table 5.7: TSC-OPF-1 - Transient stability parameters

Stability Variables

AIMMS Name Symbol Description

SV1 Power_Stability Pt Power output of the distributed generator.

SV2 Vs_ang θs Voltage phase angle at the sending busbar.

SV3 E_mag E’ Internal voltage magnitude of the generator

SV4 Pmax_prefault Pmax(prefault) Maximum prefault power of the generator

SV5 Pmax__postfault Pmax(postfault) Maximum postfault power of the generator

SV6 delta_0 θ0 Steady-state operating power angle of the generator

SV7 delta_max θmax Maximum allowable power angle of the generator

SV8 delta_cc θcc Critical clearing angle of the generator

SV9 t_cc tcc Critical clearing time of the distributed generator

Table 5.8: TSC-OPF-1 - Calculated transient stability variables

Page 61: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

51

Stability Constraint

AIMMS Name Equation Description

SC1 Power_ Equality

Equation 5.8 Explicitly binds the variables Power_Network and Power_Stability.

SC2 Phase_

GeneratorBus Equation 5.9 Explicitly binds the variables Phase and Vs_ang.

SC3 Power_Max Equation 5.10

Sets the upper bound of Power_Stability so that it does not exceed Pmax_postfault.

This constraint is required to satisfy the assumption made in Section 3.2.3 that the generator output power does not change during the duration of the analysis. Without this, then it would be possible for the prefault output power to exceed the maximum possible postfault power, which would invalidate the assumption and result in computational errors.

SC4 Vs_ang_ Formula

Equation 5.11 Calculation for the generator terminal bus voltage angle, Vs_ang

SC5 E_mag_ Formula

Equation 5.12 Calculation for the internal voltage magnitude of the generator, E_mag.

SC6 Pmax_

prefault_ Formula

Equation 5.13 Calculation for the maximum prefault output power delivery of the generator, Pmax_prefault.

SC7 Pmax_

postfault_ Formula

Equation 5.14 Calculation for the maximum postfault output power delivery of the generator, Pmax_postfault.

SC8 delta_0_ Formula

Equation 5.15 Calculation for the steady-state operating power angle of the generator, delta_0

SC9 delta_max_

Formula Equation 5.16

Calculation for the maximum allowable power angle of the generator, delta_max

SC10 delta_cc_ Formula

Equation 5.17 Calculation for the critical clearing angle of the generator, delta_cc.

SC11 delta_cc_min Equation 5.18 Sets the lower bound for delta_cc so that it does not become less than delta_0.

SC12 delta_cc_max Equation 5.19 Sets the upper bound for delta_cc so that it does not exceed delta_max.

SC13 t_cc_Formula Equation 5.20 Calculation for the critical clearing time, t_cc.

SC14 t_cc_limit Equation 5.21 Sets the upper bound for clearing time, t_c, so that it does not exceed the critical clearing time, t_cc.

Table 5.9: TSC-OPF-1 - Transient stability constraints

As stated previously, the TSC-OPF can also be described using mathematical notation that

is commonly used to define OPFs. For the full integrated version of TSC-OPF-1, where the

network is solved with transient stability constraints, this can be written as:

Page 62: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

52

• Objective function

]^_` �9a∈c (5.1)

• Subject to the following network constraints

�<: = 0 (5.2)

L8_�fg ≤ L8 ∀nko (5.3)

L8 ≤ L8_�,- ∀nko (5.4)

�g ≤ �a_�,-∀w ∈ } (5.5)

L8d~d� = ���� 8 ` �d8d∈< �d∀nko (5.6)

` �ga|<tud − `�d8L88 ≤ Cd∀jkl (5.7)

• Subject to the following transient stability constraints

�9 = �� (5.8)

�� = �<: (5.9)

�9 ≤ ���� 5>�96,789! (5.10)

�� = sin� �9 ∗ 5�%6,789���� � +�� (5.11)

�� = R)�� cos �� + �� cos �� − �� cos ��! 5�%6,789 ∗ �*: + )�� sin �� + �� sin �� − �� sin ��! 5�%6,789 ∗ �*: (5.12)

Page 63: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

53

���� 5�%6,789! = ���� � + 5�%6,789 (5.13)

���� 5>�96,789! = ���� � + 5>�96,789 (5.14)

�1 = sin� ) �9���� 5>�96,789!* (5.15)

��,- =π − sin� ) �9���� 5>�96,789!* (5.16)

�TT = cos� (�9 ��,- − �1! + ���� 5>�96,789! cos��,- − ���� 6,789! cos�1���� 5>�96,789! −���� 6,789! + (5.17)

�1 ≤ �TT (5.18)

�TT ≤ ��,- (5.19)

DTT = 1000R2M �TT − �1!K��9 (5.20)

DT ≤ DTT (5.21)

For the network-only OPF, where the network is solved without transient stability

constraints, the mathematical notation can be summarised as:

• Objective function

]^_` ��a∈c (5.22)

• Subject to network constraints (5.2) to (5.7)

Page 64: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

54

5.1.2 Verification of TSC-OPF-1 against the Microsoft Excel model

Several test optimisations were run using TSC-OPF-1 and the results verified against the

Microsoft Excel model, which has already been demonstrated in Section 4.1.2 to represent

the Equal Area Criterion accurately for an OMIB network. An example of the verification

carried out is given in Tables 5.10 and 5.11. To facilitate the verification, input parameters

for TSC-OPF-1 used in this example are the same as those used for the Excel model in

Section 4.1.2. Some input parameters that are not relevant in the Excel model, such as the

network limits and demand, but are required in order for the OPF formulation to function are

also listed in Table 5.10 for completeness.

The numerical values are given in per-unit with the same base as that used in Section

4.1.2. They are not representative of any specific network, but chosen to demonstrate the

functionality of the model. The constraints for flow, demand and capacity (NP2, NP4 and

NP5 in Table 5.3 respectively) were set to arbitrarily high values so that they would not limit

the OPF and allow only the stability critical clearing time would form the bounding constraint.

Declaration Reference

Parameter TSC-OPF-1 Microsoft Excel

NP1 DG Location B1 -

NP2 Demand, db (Arbitrarily high value) 99 pu -

NP4 Flow Limit, fmax (Arbitrarily high value) 99 pu -

NP5 Capacity, Pmax (Arbitrarily high value) 99 pu -

NP6 Connections, cbl

C (B1,L12_1) = 1

C (B1,L12_2) = 1

C (B2,L12_1) = -1

C (B2,L12_2) = -1

-

NP3 Reactance, Xl XL12_1 = 0.4 pu

XL12_2 = 0.4 pu

SP1 Generator direct transient reactance, Xd' 0.2 pu

SP2 Inertia constant, H 3 s

SP3 Frequency, F 50 Hz

SP10 Maximum fault power, Pmax(fault) 0 pu

SP7 Generator terminal voltage magnitude, Vs 1 pu

SP8 Infinite bus voltage magnitude, Vr 1 pu

SP9 Infinite bus voltage angle, θr 0 rad

SP4 Clearing time limit, tc 169.2 ms

Table 5.10: TSC-OPF-1 - Input parameters for verification against the Microsoft Excel model

Page 65: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

55

Declaration Reference

Parameter TSC-OPF-1 Microsoft Excel

(Tables 4.3 & 4.5)

Intermediate Transient Stability Calculations

SV3 Generator internal voltage, E’ 1.04 pu 1.04 pu

SV4 Maximum fault power, Pmax(prefault) 2.599 pu 2.599 pu

SV5 Maximum fault power, Pmax(postfault) 1.733 pu 1.733 pu

SV6 Steady-state power angle, θ0 0.395 rad 0.395 rad

SV7 Maximum power angle, θmax 2.526 rad 2.526 rad

SV8 Critical clearing angle, θcc 1.144 rad 1.145 rad

Final Transient Stability-Constrained Calculations

SV9 Critical clearing time, tcc 169.2 ms 169.2 ms

SV2 Generator terminal phase angle, θs 0.201 rad 0.201 rad

NV3 Line active power flow, fl L21_1 = 0.503 pu

L21_2 = 0.503 pu Not calculated

SV1 Generator output power, Pt 1 pu 1 pu

Table 5.11: TSC-OPF-1 - Results for verification against the Microsoft Excel model

Table 5.11 shows that both the intermediate and final calculations carried out by TSC-OPF-

1 match the values from the Excel model. In the Excel model described in Section 4.1.2, the

critical clearing time calculated for a user-defined generator power of 1 pu was 169.2 ms. In

the AIMMS TSC-OPF-1 model, where power is the variable and time is defined, the

maximum generator power achieved for a user-defined critical clearing time of 169.2 ms was

1 pu. The same results obtained show that, in the absence of other network limitations,

TSC-OPF-1 correctly models the transient stability constraint.

5.1.3 Limitations of TSC-OPF-1

Although TSC-OPF-1 correctly modelled the Equal Area Criterion and successfully

imposed the critical clearing time as an OPF constraint for an OMIB network, there were

several limitations and inaccuracies identified in the model as listed below:

a) There were discrepancies in value of the line power flow variables when TSC-OPF-1

was used with the transient stability constraint. For the example in Table 5.11, the value

given by the OPF for each line was 0.503 pu, with the total for both lines adding to 1.06

pu. This is greater than the total power generated, which was only 1.00 pu.

Page 66: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

56

b) The slack generator is not explicitly modelled in TSC-OPF-1. This caused incorrect

calculation of the power balance at each busbar under certain scenarios. As a result,

Kirchhoffs Current Law constraint had to be specified as an inequality constraint

(Equation 5.7) instead of an equality constraint (Equation 3.48) in order for the model to

work.

c) If the network was modelled without applying the transient stability constraint, it was

possible for the generator terminal phase angle to reach unrealistically high values.

Table 5.12 shows an example for this for the same input parameters in Table 5.10, but

with only the network power flow optimised.

Parameter Value

Generator terminal phase angle, θs 19.8 rad

Line active power flow, fl L21_1 = 49.5 pu

L21_2 = 49.5 pu

Generator output power, Pm 99 pu

Table 5.12: TSC-OPF-1 - Example of high θs value for network-only optimisation

5.2 TSC-OPF version 2

TSC-OPF-1 was able to successfully integrate a transient stability constraint into a

functional DCOPF. However, the limitations highlighted Section 5.1.3 indicated that the

modelling of the underlying network could be improved further. TSC-OPF-2 was developed

with the primary objective of rectifying these limitations. The same circuit used for TSC-

OPF-1 (Figure 5.1) was modelled in TSC-OPF-2 using the same set of assumptions.

5.2.1 Structure and functionality of TSC-OPF-2

Several modifications were made for TSC-OPF-2 to address the limitations discussed

previously. All the changes were implemented in the network OPF segment only as none of

the issues involved the transient stability segment. The method in which each issue was

rectified is briefly described below:

Page 67: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

57

a) Line power flow discrepancies

Changing the “θb” term in the Kirchhoff Voltage Law constraint (Equation 5.6) to “sin θb”,

as it is defined in the ACOPF, fixed this issue. With this change, the OPF formulation

was neither a pure DCOPF nor a full ACOPF, but a hybrid-OPF that was not linear but

also did not account for reactive power flow yet.

b) Slack generator

The slack generator was explicitly defined by adding a new set, parameter and variable.

It is assumed that the slack generator will be able to supply or absorb any amount of

power required to balance the network. Kirchhoffs Current Law constraint was modified

to include the power from the slack generator and redefined as an equality constraint.

c) Generator terminal phase angle limits

A new parameter and two constraints were added to limit the voltage phase variation.

Tables 5.13 to 5.16 describe AIMMS declarations that were changed or added for TSC-

OPF-2 while Equations 5.23 to 5.27 list the new additions to the OPF mathematical

notation. This version consisted of 18 parameters, 13 variables and 22 constraints. For

brevity, parts of the formulation that were unchanged from TSC-OPF-1 are not repeated

here.

Set AIMMS Name

AIMMS Index

Symbol Description

S1 –S3 Unchanged – refer to Table 5.1

S4 SlackGen S S Set of slack generators in the network.

Table 5.13: TSC-OPF-2 - Network sets (added or changed only)

Network Parameter

AIMMS Name AIMMS Index

Symbol Description

NP1 – NP6 Unchanged – refer to Table 5.3

NP7 Slack_Location - - The busbar on which the slack generator is located.

NP8 Phase_Limit - θmax The voltage phase angle limits

Table 5.14: TSC-OPF-2 – User-defined network parameters (added or changed only)

Page 68: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

58

Network Variables

AIMMS Name

AIMMS Index

Symbol Description

NV1 – NV3 Unchanged – refer to Table 5.4

NV4 Power_Slack s P∞ Power output of the slack generator.

Table 5.15: TSC-OPF-2 - Calculated network variables (added or changed only)

Network Constraint

AIMMS Name

AIMMS Index

Equation Description

NC1 – NC4 Unchanged – refer to Table 5.5

NC5 KVL l Equation 5.24 Defines Kirchhoffs Voltage Law constraint

NC6 KCL b Equation 5.25 Defines Kirchhoffs Current Law constraint

NC7 Phase_Min b Equation 5.26 Sets the lower voltage phase limit.

NC8 Phase_Max b Equation 5.27 Sets the upper voltage phase limit.

Table 5.16: TSC-OPF-2 - Network constraints (added or changed only)

The mathematical notation for the full integrated version of TSC-OPF-2, where the network

is solved with transient stability constraints, can be written as:

• Objective function

]^_` �9a∈c (5.23)

• Subject to the previous network constraints (5.2) to (5.5), the previous transient stability

constraints (5.8) to (5.21) and the following new network constraints:

L8d~d� = ���� 8 ` �d8d∈< sin �d∀nko (5.24)

` �ga|<tud + ` ��a|<tud − `�d8L88 =Cd∀jkl (5.25)

Page 69: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

59

�d_�fg ≤ �d∀jkl (5.26)

�d ≤ �d_�,-∀jkl (5.27)

The formulation for the network-only version, without the transient stability constraints, is

similar except that Pt is replaced with Pm and only constraints (5.2) to (5.5) and (5.24) to

(5.27) apply.

5.2.2 Verification of TSC-OPF-2 against the Microsoft Excel model

TSC-OPF-2 was verified with the same input values and in the same manner described in

Section 5.1.2. The results of the optimisation output are given in Table 5.17.

Declaration Reference

Parameter TSC-OPF-2 Microsoft Excel

(Tables 4.3 & 4.5)

SV9 Critical clearing time, tcc 169.2 ms 169.2 ms

SV2 Generator terminal phase angle, θs 0.201 rad 0.201 rad

NV3 Line active power flow, fl L21_1 = 0.5 pu

L21_2 = 0.5 pu Not calculated

SV1 Distributed generator output power, Pt 1 pu 1 pu

NV4 Slack generator output power, P∞ 98 pu Not calculated

Table 5.17: TSC-OPF-2 - Results for verification against the Microsoft Excel model

The results show that the issues related to the line active power flow and the slack

generator were resolved by the modifications without affecting the transient stability segment

of the OPF formulation. The demand of 99 pu in the example was located at Bus 2. The

sum of the line power flows are exactly equal to the distributed generator output, indicating

that the correct power is flowing from Bus 1 to Bus 2. Furthermore, there is no power flow

on the lines from the slack generator since the demand is on its local bus. The value of

power output from the slack generator also corresponds to the excess demand of 98 pu that

is not being met by the distributed generator.

Page 70: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

60

Table 5.18 shows that the issue of high phase angle values was also resolved by explicitly

defining limits. In this example, limits of ± 90° (or ± π/2 rad) were used to demonstrate the

functionality. When the network was modelled without the transient stability constraint,

phase angle stayed within these limits and constrained the maximum power output as well.

Parameter Value

Generator terminal phase angle, θs 1.57 rad

Line active power flow, fl L21_1 = 2.5 pu

L21_2 = 2.5 pu

Generator output power, Pm 5 pu

Table 5.18: TSC-OPF-2 – Example of constrained θs value for network-only optimisation

With the modifications made, TSC-OPF-2 was demonstrated to be a functional OPF that

correctly modelled the simple test network of a single generator connected to an infinite bus

when subjected to transient stability constraints.

5.3 TSC-OPF version 3

TSC-OPF-2 was limited to only modelling a generator that was directly connected to an

infinite bus as the values for the receiving bus voltage magnitude and phase were explicitly

defined as being 1 pu and 0 radians respectively. In order to model more complex networks,

a more flexible definition of the relevant constraints was required and this formed the basis

for the development of TSC-OPF-3.

TSC-OPF-3 was initially developed with the intention to form a full ACOPF formulation that

incorporated bus voltage magnitude and phase variations, reactive power flows as well as

generator capacity factors. However, several issues, which are further discussed in Section

7, were encountered during the development process that were not able to be resolved

before the end of the project duration. As a result, the scope of TSC-OPF-3 was scaled

down to incorporate only the voltage and phase variations between different buses This

formed the final version that could be developed within the timescale of the project and was

used to carry out a case study as detailed in Section 6.

Page 71: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

61

5.3.1 Structure and functionality of TSC-OPF-3

As with TSC-OPF-2, all the modifications made for TSC-OPF-3 were confined to the

network OPF segment only. The key changes involved explicitly defining the starting and

ending buses for each line as well as introducing voltage as a new variable with the

appropriate limit constraints. These changes were then incorporated into the Kirchhoff

Voltage Constraint.

Tables 5.19 to 5.21 describe AIMMS declarations that were changed or added for TSC-

OPF-3 while Equations 5.29 to 5.33 list the new additions to the OPF mathematical notation.

This version consisted of 21 parameters, 14 variables and 26 constraints. As in Section

5.2.1, parts of the formulation that were unchanged from TSC-OPF-1 and TSC-OPF-2 are

not repeated in this section, but presented in full in Appendix D.

Network Parameter

AIMMS Name AIMMS Index

Symbol Description

NP1 – NP8 Unchanged – refer to Tables 5.3 and 5.14

NP9 VoltageDeviation

_Limit - Vvar

Allowable voltage deviation from nominal value.

NP10 LineStartBus l - Explicitly defines the start bus of each line.

NP11 LineEndBus l - Explicitly defines the end bus of each line.

Table 5.19: TSC-OPF-3 - User-defined network parameters (added or changed only)

Network Variables

AIMMS Name

AIMMS Index

Symbol Description

NV1 – NV4 Unchanged – refer to Tables 5.4 and 5.15

NV5 Voltage b V Voltage magnitude at each busbar.

Table 5.20: TSC-OPF-3 - Calculated network variables (added or changed only)

Page 72: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

62

Network Constraint

AIMMS Name

AIMMS Index

Equation Description

NC1 - NC4

NC6 - NC8 Unchanged – refer to Tables 5.5 and 5.16

NC5 KVL l Equation

5.29 Defines Kirchhoffs Voltage Law constraint with variable start and end buses at each line.

NC9 Voltage_Min b Equation

5.30 Sets the lower voltage magnitude limit.

NC10 Voltage_Max b Equation

5.31 Sets the upper voltage magnitude limit.

NC11 Voltage _DGBus

- Equation

5.32

Fixes the generator bus voltage to 1 pu.

Since reactive power is not modelled, it is assumed that the generator bus is a PV bus.

NC12 Voltage

_SlackBus -

Equation 5.33

Fixes the infinite bus voltage to 1 pu

Table 5.21: TSC-OPF-3 - Network constraints (added or changed only)

The mathematical notation for the full integrated version of TSC-OPF-3, where the network

is solved with transient stability constraints, can be written as:

• Objective function

]^_` �9a∈c (5.28)

• Subject to the network constraints (5.2) to (5.5) and (5.24) to (5.27), the previous

transient stability constraints (5.8) to (5.21) and the following new network constraints:

L8d~d� = ���� 8 ` �d8d∈< sin �� − ��!∀nko (5.29)

�d_�fg ≤ �d∀jkl (5.30)

�d ≤ �d_�,-∀jkl (5.31)

�a = 1∀wk} (5.32)

�∞ = 1∀Nk$ (5.33)

Page 73: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

63

The formulation for the network-only version, without the transient stability constraints, is

similar except that Pt is replaced with Pm and only constraints (5.2) to (5.5), (5.24) to (5.27)

and (5.29) to (5.33) apply.

5.3.2 Verification of TSC-OPF-3 against PowerWorld

TSC-OPF-3 was verified against PowerWorld as part of the case study conducted in

Section 6 and the results are listed in Table 6.2 and 6.3. It was found that the model was

able to determine the maximum generator capacity in OMIB networks as well has more

complex radial and mesh networks that did not have internal load demands with reasonable

accuracy.

However, the results were not precise when the complex networks had load demands

attached to them. In addition, discrepancies were observed in the values of busbar phase

angles calculated when the model was applied to complex networks and the intermediate

busbar voltages appeared to saturate at the limits. Further discussion on this is given as

part of the case study analysis in Section 6.

Attempts were made to address the limitations discovered with the development of TSC-

OPF-4. However, this version could not be completed and tested in time for inclusion in this

thesis. Further discussion on the issues regarding the TSC-OPF model and proposals on its

future development is given in Section 7.

Page 74: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

64

VI CASE STUDY: TRANSIENT STABILITY-CONSTRAINED POWER CAPACITY ALLOCATION

TSC-OPF-3 described in Section 5.3 was used to conduct a case study for transient-

stability constrained power capacity allocation on a theoretical 9-bus test network. Since the

model is not yet fully representative of an actual distribution network due to the omission of

reactive power and line resistance, a bespoke theoretical network was used instead of a

common test network such as those from the UK Generic Distribution System (UKGDS) [35].

The results obtained from the OPF were then applied to a PowerWorld simulation of the

same network for verification. Assumptions are made for the test network based on those

applied during the development of the model used, namely that line resistance is neglected

and voltage remains nominal throughout.

6.1 Description of the test network

The test network used for this case study is shown in Figure 6.1. It is a theoretical 9-bus

network with four possible distributed generation (DG) sites. The infinite bus is envisioned to

be a grid supply link to a strong network, with the slack generator capable of supplying or

absorbing any amount of power while maintaining a bus voltage magnitude of 1 pu and bus

voltage angle of 0 radians. A constant demand of 1 pu is configured on the infinite bus.

Site 1 and Site 2 are directly connected to the infinite bus, differing only in the distance from

it. The line reactance is used as a proxy for actual distance with Site 2 being further away

from the connection point than Site 1 and, hence, having greater line reactance. Site 3 is

located 3 times as far as Site 1 and simulates a connection to a radial network with

intervening busbars while Site 4, located at a similar distance as Site 2, simulates a

connection to a mesh network. Simulations for low, medium and high demands within the

local sub-network of the selected site can be applied for Sites 3 and 4. DG connection is

modelled one site at a time and no other generators are assumed to be connected

downstream of the infinite bus.

Page 75: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

65

The potential DG facility is simplified as a single machine per site using the classical model

of a synchronous generator described in Section 3.2.3. The values for machine inertia

constant, H, and the direct-axis transient reactance, Xd’ are chosen to be representative of a

generic wind turbine based on sample values from various studies [36][37][38]. These

parameters are set to 3 s and 0.2 pu respectively.

The line reactances of the test network are listed in Table 6.1. In general, the same

reactance value is used for all the branches except L31a, L31b and L79. The first two have

larger reactances to simulate Site 2 being farther away from the infinite bus than Site 1,

while the last has a smaller reactance to simulate a shorter distance between B7 and B9

relative to the other branches. The outgoing connection from the generator bus to the next

immediate bus is modelled as a double-circuit to enable the transient fault simulation on one

of the lines. The remaining branches are represented as single power lines for simplicity.

Figure 6.1: Test network for case study of transient stability-constrained capacity allocation

Line L21a L21b L31a L31b L41 L54 L65a L65b L71 L91 L79 L87a L87b

Reactance (pu)

0.4 0.4 0.8 0.8 0.4 0.4 0.4 0.4 0.4 0.4 0.2 0.4 0.4

Table 6.1: Line reactances for the test network

Page 76: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

66

The thermal limits for all lines are set to infinity so that they do not constrain the results, an

approach that has also been used previously in [15] and [19], while the bus voltage variation

is limited to ± 0.1 pu. The nominal network voltage is set at 11kV and all values are

calculated in per unit on a 100MVA base.

The fault simulated was a balanced three-phase-to-ground short-circuit fault with no

impedance that occurs on the second branch of a double circuit power line. The fault is

cleared by disconnecting both ends of the faulted line.

Simulations were carried out for a critical clearing time of 100 ms. Although the Distribution

Code issued by the Office of the Gas and Electricity Markets (Ofgem) states a protection

setting of 500 ms for the most stringent band of over/under voltage and over/under

frequency faults [39], preliminary simulations with this value provided very small variations in

generation capacity, in the order of 0.001 pu, between different test cases. Hence a shorter

clearing time was chosen to produce a wider range of variation results and facilitate more

effective comparison of the differences between each case.

The tests were carried out as follows:

1. The static network parameters were input to TSC-OPF-3.

2. A single potential DG site was selected.

3. The appropriate pre- and post-fault reactances for that site between the DG and infinite

bus were calculated manually and input to TSC-OPF-3.

4. Any sub-network demand scenarios were defined (for Sites 3 and 4 only).

5. The AIMMS OPF algorithm was run with the selected critical clearing time and the

results for capacity, bus voltage magnitude and bus voltage phase were noted.

6. The generation capacity value provided by the OPF was configured for the respective

DG site in PowerWorld.

7. The PowerWorld transient stability simulation was run with the same network

configuration as TSC-OPF-3 to determine if the system remained stable.

8. The generation capacity was manually adjusted by minute amounts to verify the exact

value that caused the transition to instability. The final capacity value just prior to loss of

synchronisation, along with the bus voltage magnitudes and bus voltage phases, were

noted.

Page 77: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

67

6.2 Results

The results obtained for each site with various sub-network demand conditions, where

relevant, are listed in Tables 6.2 and 6.3.

DG Site

Prefault reactance

(pu)

Postfault reactance

(pu)

Demand (pu)

AIMMS capacity (pu)

PowerWorld capacity (pu)

Error (%)

1 0.2 0.4 - 1.316 1.315 0.08

2 0.4 0.8 - 0.822 0.822 0.00

3 1.0 1.2

- 0.622 0.621 0.16

D5 = 0.5 0.598 0.623 -4.01

D4 = 0.5 0.607 0.622 -2.41

D5 = 1 0.598 0.624 -4.16

D4 = 1 0.598 0.622 -3.86

D5 = 5 Error

Max D5 = 3 0.635 -

D4 = 5 Error

Max D6 = 3 0.625 -

4 0.44 0.64

- 0.987 0.983 0.41

D9 = 0.5 0.968 0.986 -1.83

D9 = 1 0.953 0.985 -3.25

D9 = 5 1.009 0.985 2.44

D9 = 10 Error

Max D9 = 5 0.986 -

Table 6.2: Case study results for maximum capacity

DG Site

Bus AIMMS

bus phase angle (rad)

PowerWorld

bus phase angle

(rad)

AIMMS

bus voltage (pu)

PowerWorld bus voltage

(pu)

1 B2 0.266 0.266 1.00 1.00

2 B3 0.335 0.335 1.00 1.00

3

B6 0.676 0.670 1.00 1.00

B5 0.544 0.541 0.95 0.96

B4 0.265 0.265 0.95 0.95

4

B8 0.462 0.447 1.00 1.00

B7 0.253 0.244 0.95 0.98

B9 0.166 0.162 0.95 0.98

Table 6.3: Case study sample results for bus phases and voltages

Page 78: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

68

6.3 Discussion

The results of the case study can be used to both verify the OPF model, as previously

summarised in Section 5.3.2, and conduct preliminary analysis on the capacity allocation of

DG at various sites.

6.3.1 Performance of the optimal power flow model

The performance of TSC-OPF-3 in terms of the maximum DG power capacity was found to

be good for OMIB, radial and mesh networks without load demands. The error between the

AIMMS model and PowerWorld was less than 0.5% for the specific scenarios examined.

However, TSC-OPF-3 did not perform as well when sub-network load demands were

added to the simulation, with capacity errors ranging between ±4%. In addition, the model

became totally infeasible when high demands were used.

In terms of the underlying representation of the network, the performance of the model

appeared to be unsatisfactory. Calculation of busbar phase angles in radial and mesh

networks by TSC-OPF-3 showed discrepancies compared to PowerWorld and the voltages

of intermediate busbars between the generator and infinite bus were saturated at the defined

lower limit of 0.95 pu. Experimentally increasing this limit, which is not shown in the results,

further aggravated the discrepancies in phase angle and power capacity, with the new limit

automatically forming the bounding constraint.

To summarise, TSC-OPF-3 is applicable under limited conditions, but is still not suitable to

model a complex network. The transient stability calculations are correctly implemented, but

additional work is required to improve the OPF formulation in order to accurately model the

underlying network.

6.3.2 Analysis of generation capacity allocation

The analysis of DG capacity allocation under transient stability constraints shall be based

upon the values given by PowerWorld. From Table 6.2, the key factor that determined the

maximum capacity for a site that brought the system to its stability limit imposed by a fault

Page 79: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

69

clearing time of 100 ms was the reactance between the DG and the infinite bus. The

influence of internal load demands was not significantly evident.

Comparing the OMIB examples of Sites 1 and 2, the longer connection distance, and

hence larger reactance, between Site 2 and the strong network represented by the infinite

bus caused a reduction in maximum installable capacity. The change was nonlinear

however, as doubling the distance reduced the capacity by 37.5%. This is also evident from

the case of Site 3 without internal demands, which is essentially an OMIB network with triple

the distance of Site 1. The capacity reduction in this case was 52.7% from Site 1. From this

simple case it can be summarised that, for direct connections, DGs installed closer to a

strong network will be more stable and can tolerate higher maximum capacities.

The straight-line reactance between the infinite bus and Sites 2 (L31a) and 4 (L87a + L71)

are the same at 0.8 pu, hence, both these sites can be assumed to be located at similar

geographical distances from it. However, the potential capacity of Site 4, without any

intermediate loads, was 19.6% higher than that of Site 2 because the meshed nature of the

network lowers the effective postfault reactance. While this was evident in the examples

used for this case study, further simulations with a wider variety of test networks are required

before a more general conclusion can be reached to support this observation.

When load demands were added to the simulations for Sites 3 and 4, the maximum

capacity allocation did not show significant variation, remaining below 1% for all but one

case. The only exception to this was when high demand was added close to the DG at Site

3 (case D5 = 5), which caused the potential capacity to increase by 2.3%. As with the

previous observation for mesh networks, further simulation is required to formulate a more

general conclusion to this behaviour.

While it was possible, and tempting, to conduct more simulations using PowerWorld to

explore the behaviour of various network configurations under stability constraints in greater

depth (including multi-machine behaviour), this would not serve to advance the primary goal

of this project with regards to developing functional optimal power flow models.

Furthermore, using PowerWorld to determine stability limits for this purpose would mainly

involve adjusting power output and critical clearing times by trial-and-error without an

effective methodology, which would be inefficient. For these reasons, PowerWorld was left

as a verification tool only to determine the accuracy of OPF models developed in the project.

Page 80: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

70

VII PROJECT STATUS & FUTURE DEVELOPMENT

7.1 Project closing status

At the end of the project, the final functional version of the model completed was TSC-OPF-

3, which has been demonstrated to work in Section 6, but with several limitations. The

transient stability calculations in this model are accurate but the representation of the

underlying network is correct only for certain specific conditions. Additional work was

undertaken to address this by converting it into a full ACOPF formulation that incorporated

reactive power flow and generator capacity factors. The AIMMS formulation for this has

been completed, however the integration with the transient stability calculations result in

infeasible solutions or computational errors. Unfortunately, this model was not able to be

completed and tested before the end of the project duration. The current, non-functional

AIMMS text-representation of TSC-OPF-4 is provided in Appendix E.

7.2 Proposals for future work

There remains significant scope for future work in developing a transient stability-

constrained optimal power flow that can be used to evaluate generation capacity. Both the

OPF formulation itself and the models used for various segments of the optimisation can be

improved and expanded upon in various ways, while the behaviour of the system at the

stability limit is also worthy of further investigation.

Any future work on the subject will be facilitated by the consolidation of relevant

background theory within this thesis and also the availability of the learning tools developed

with Microsoft Excel and Matlab as part of this project.

Page 81: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

71

7.2.1 Improving the optimal power flow formulation

The author strongly believes that the formulation of a functional ACOPF network model for

transient stability within AIMMS is close to completion. The availability of this would be

essential in order to use the model for analysis of actual networks and would form the logical

starting point for the next stage of work on this subject. This is highly recommended as

being the immediate goal of any future work.

One of the key challenges faced during the course of the project involved the development

of models using the AIMMS package. Given the authors’ lack of familiarity with the software

at the start of the project, there was a learning curve involved to develop the knowledge

required for its use. Competency in using AIMMS was gained and improved continuously

throughout the course of this project. However, priority was given to making the model

functional instead of efficient or robust. As a result, the models exhibited occasional

feasibility or computational errors when executed. Some errors appeared to be spurious and

were not always repeatable under similar conditions, while others consistently arose under

certain specific conditions such as the high loading cases shown in Table 6.2 of the case

study.

While some of the error-generating conditions were successfully eliminated during the

course of the development as the authors’ knowledge of AIMMS improved, others are still

inherent in the final version of the functional code. Hence, another key area of future work

would be to make the AIMMS model more robust and efficient by introducing some measure

of intelligence to the code to prevent it entering into an error state (such as attempting to

calculate invalid trigonometric values or dividing by zero) and adding error-handling

mechanisms to deal with such contingencies if they occur.

7.2.2 Expanding the scope of component models

This project utilised basic component models for network representation, transient stability

evaluation, generator dynamics and fault simulation in order to develop a prototype TSC-

OPF. Each of these components can be expanded upon in future iterations of the project to

improve the accuracy of the existing model or provide alternative models for comparison.

Page 82: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

72

For the immediate future, the inclusion of network resistance should be prioritised to allow

the modelling of distribution networks, where the resistance is comparable to reactance.

Incorporating resistance into the OPF formulation itself is expected to be a reasonably

straightforward but doing so for the transient stability calculations would require re-evaluating

the equations used. This would perhaps also necessitate the modification and re-verification

of the Microsoft Excel model before the new formulae are integrated into AIMMS.

Once the development of a full ACOPF model that incorporates network resistance has

been achieved, the next stage of the project would be to simulate a network with multiple

generators. If this is accomplished, the TSC-OPF would be complete as a tool to analyse

capacity allocation within existing networks. Both the positive and negative influences of

increased DG penetration on system stability can be examined as well as scenarios of

network sterilisation, as described in Section 3.

Modelling multiple generators, however, will require different methods of evaluating

transient stability as the Equal Area Criterion used in this project is only applicable for single

machine networks. Some of the more complex methods listed in Section 3.2.2 would need

to be appraised for this purpose. Among these, the Extended Equal Area Criterion [29 - 30]

appears to be suited as an extension of the methods used this project and is recommended

for first consideration in any future work. It applies certain transformation techniques to

reduce a multiple-machine network into an equivalent one-machine infinite-bus (OMIB)

system. The Equal Area Criterion is then applied to the equivalent OMIB circuit, similar in

the manner done for this project to obtain the stability limit, before being transformed back to

its original configuration.

Future work could also attempt to use different dynamic generator models to replace the

basic classical model used in this project. This may allow the generator response to be

more representative of actual machines and also enable behaviour between different

generator types or plant facilities in the same network to be analysed [4].

The final component that could be considered for future expansion is the fault model. In

this project, only a balanced three-phase-to-ground short-circuit fault with no impedance that

occurs on the sending bus of a double circuit power line was simulated. While a Matlab

solver was developed to model the fault at other locations on the line, it was not utilised in

the subsequent OPF formulations as a fault on the sending bus represented the worst-case

scenario in terms of critical clearing times.

Page 83: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

73

Being able to incorporate a variety of generator and fault models would increase the

flexibility of the TSC-OPF in analysing actual networks.

7.2.3 Analysing the system behaviour at the stability limit

The transient stability simulation results from Figures 4.4 and 4.7 indicate that the

generator rotor response became significantly distorted as it approached the stability limit.

This could have additional influence on other electrical properties of the machine such as

voltage and power. This warrants further investigation, as it may be possible that the

constraints imposed by variations to other parameters as the system nears its stability limit

may have more influence on maximum capacity than rotor displacement does. The transient

stability add-on in PowerWorld is recommended as a tool to analyse such behaviour.

Page 84: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

74

VIII CONCLUSIONS

The project has accomplished its primary aim of integrating a transient stability constraint

within an optimal power flow for a single-generator network.

The Swing Equation and the Equal Area Criterion were utilised to determine conditions for

stability and software tools were developed using Microsoft Excel and Matlab to model their

behaviour. AIMMS was used as the modelling platform to develop the optimal power flow

while the results obtained were verified by PowerWorld.

The final version of the transient stability-constrained optimal power flow model available at

the end of the project was functional and produced accurate results under certain network

configurations. This was demonstrated by applying the model to a case study of a

theoretical 9-bus network to determine the maximum power capacity allocation for potential

distributed generation sites. The model worked best when applied to networks that

resembled a one-machine infinite-bus equivalent and did not contain any internal demands.

Other configurations displayed results that exhibited various degrees of discrepancy.

For a single generator supplying power to an infinite bus, the case study showed that

stability-constrained generation capacity was related to the reactance between the two. In a

radial network, the capacity of a site that was closer to a strong network, hence having lower

line reactance, was higher than one further away. For similar distances, mesh networks may

provide higher capacities than radial networks, but more simulation is required confirm this.

Further work was proposed to improve the accuracy of the network modelling by

incorporating reactive power flow and line resistances, which were omitted previously. In

addition, the coding of the model in AIMMS could also be made more robust. Expanding the

capability of the model to analyse the behaviour of a multiple-machine network would

complete its primary envisaged functionality as a tool to determine maximum capacity

allocation for distributed generation sites under stability constraints.

Page 85: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

75

ACKNOWLEDGEMENTS

I would like to thank Professor Gareth Harrison for his supervision throughout the course of

this project. His knowledge and encouragement have been valuable in guiding its

development and progress. I would also like to express my thanks to Professor Robin

Wallace for his timely advice that assisted me in focusing my area of work.

From a wider perspective, the year spent undertaking this Masters program has been a

continuous learning and relearning process in many aspects, especially for someone who

has been away from an academic environment for over a decade. I would like to take this

opportunity to acknowledge the contributions of the lecturers and colleagues who have been

a vital part of this journey.

A debt of gratitude is owed to the British Council and the University of Edinburgh for

graciously funding my studies. I can only hope that what I have achieved during the course

of the program has justified their selection and that what I go on to achieve after this will

suffice in repaying that generosity.

From a personal point of view, being away for a year has imposed the burden of managing

the various logistics of my life back in Malaysia, from the mundane to the unexpected, upon

my parents and siblings. I am thankful for all the invaluable help they have provided, going

above and beyond the call of duty in a manner that only family will, hence allowing me the

freedom to focus on my studies without undue distractions from across the globe.

Ultimately and most importantly, I give thanks to the two ladies who have been and will

always be my source of inspiration, strength and motivation. Daveena, thank you for

infusing my days with the joy that only a child can bring and for letting me be a two year old

again. And Gomathy, thank you for being a peerless embodiment of sacrifice and

selflessness.

Page 86: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

76

REFERENCES

1. Paragon Decision Technology. AIMMS - The Modelling System. [Online] [Cited: Aug 4, 2011.] http://www.aimms.com/.

2. The PowerWorld Corporation. PowerWorld - The Visual Approach to Analysing Power Systems. [Online] [Cited: Aug 4, 2011.] http://www.powerworld.com/.

3. The PowerWorld Corporation. PowerWorld - Transient Stability. [Online] [Cited: Aug 04, 2011.] http://www.powerworld.com/products/TransientStability.asp.

4. The PowerWorld Corporation, T.J.Overbye, J.Weber. PowerWorld - General Downloads (Quick Start for Using PowerWorld Simulator with Transient Stability). [Online] [Cited: Aug 04, 2011.] http://www.powerworld.com/demosoftware/quickstartexamples.zip.

5. Paragon Decision Technology. AIMMS Tutorial for Beginners. [Online] [Cited: Aug 4, 2011.] http://www.aimms.com/downloads/tutorials/tutorial-for-beginners.

6. Paragon Decision Technology. AIMMS Users Guide. [Online] [Cited: Aug 4, 2011.] http://www.aimms.com/downloads/manuals/user-s-guide.

7. Paragon Decision Technology. AIMMS Language Reference. [Online] [Cited: Aug 4, 2011.] http://www.aimms.com/downloads/manuals/language-reference.

8. Paragon Decision Technology. AIMMS Optimisation Modelling. [Online] [Cited: Aug 4, 2011.] http://www.aimms.com/downloads/manuals/optimization-modeling.

9. Paragon Decision Technology. AIMMS Application Examples. [Online] [Cited: Aug 4, 2011.] http://www.aimms.com/downloads/application-examples.

10. T.Ackermann, G.Andersson, L.Soder. Distributed generation: A definition. Electric Power Systems Research. 2001, Vol. 57, 3.

11. P.Dondi, D.Bayoumi, C.Haederli, D.Julian, M.Suter. Network integration of distributed power generation. Journal of Power Sources. 2002, Vol. 106, 1-2.

12. J.A.Pecas Lopes, N.Hatziargyriou, J.Mutale, P.Djapic, N.Jenkins. Integrating distributed generation into electric power systems: A review of drivers, challenges and opportunities. Electric Power Systems Research. 2007, Vol. 77, 9.

13. A.R.Wallace. Power Systems Engineering & Economics. Institute of Energy Systems, University of Edinburgh. 2011. Lecture Notes.

14. G.P.Harrison, A.R.Wallace. Optimal power flow evaluation of distribution network capacity for the connection of distributed generation. IEE Proceedings on Generation, Transmission and Distribution. Jan 2005, Vol. 152, 1.

15. P.N.Vovos, G.P.Harrison, A.R.Wallace, J.W.Bialek. Optimal power flow as a tool for fault level-constrained network capacity analysis. IEEE Transactions on Power Systems. May 2005, Vol. 20, 2.

16. C.J.Dent, L.F.Ochoa, G.P.Harrison, J.W.Bialek. Efficient Secure AC OPF for Network Generation Capacity Assessment. IEEE Transactions on Power Systems. Feb 2010, Vol. 25, 1.

17. C.J.Dent, L.F.Ochoa, G.P.Harrison. Network Distributed Generation Capacity Analysis Using OPF With Voltage Step Constraints. IEEE Transactions on Power Systems. Feb 2010, Vol. 25, 1.

18. L.F.Ochoa, G.P.Harrison. Using AC Optimal Power Flow for DG Planning and Optimisation. Power and Energy Society General Meeting, 2010 IEEE. July 2010.

19. P.N.Vovos, A.E.Kiprakis, A.R.Wallace, G.P.Harrison. Centralized and Distributed Voltage Control: Impact on Distributed Generation Penetration. IEEE Transactions on Power Systems. Feb 2007, Vol. 22, 1.

20. L.F.Ochoa, C.J.Dent, G.P.Harrison. Distribution Network Capacity Assessment: Variable DG and Active Networks. IEEE Transactions on Power Systems. Feb 2010, Vol. 25, 1.

Page 87: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

77

21. L.F.Ochoa, A.Padilha-Feltrin, G.P.Harrison. Evaluating Distributed Time-Varying Generation Through a Multiobjective Index. IEEE Transactions on Power Delivery. Apr 2008, Vol. 23, 8.

22. A.Silvestri, A.Berizzi, S.Buonanno. Distributed generation planning using genetic algorithms. International Conference on Electric Power Engineering. 1999.

23. J.C.Boemer, M.Gibescu, W.L.Kling. Dynamic models for transient stability analysis of transmission and distribution systems with distributed generation: An overview. IEEE PowerTech Bucharest. 2009.

24. J.D.Glover, M.S.Sarma. Power System Analysis and Design, 3rd Edition. 25. B.M.Weedy, B.J.Cory. Electric Power Systems, 4th Edition. 26. H.Saadat. Power System Analysis, 2nd Edition. 27. National Program on Technology Enhanced Learning (NPTEL). Power System

Dynamics. E-learning courses from the IITs and IISc. [Online] http://nptel.iitm.ac.in/video.php?subjectId=108102080.

28. W.Suampun, H-D.Chiang. Critical evaluation of methods for estimating stability boundary for transient stability analysis in power systems. 2010 IEEE Power and Energy Society General Meeting. Jul 2010.

29. Y.Xue, T.Van Custem, M. Ribbens-Pavella. "Extended equal area criterion justifications, generalizations, applications. IEEE Transactions on Power Systems. Feb 1989, Vol. 4, 1.

30. Y.Xue, L.Wehenkel, R.Belhomme, P.Rousseaux, M.Pavella, E.Euxibie, B.Heilbronn, J.F. Lesigne. "Extended equal area criterion revisited [EHV power systems]. IEEE Transactions on Power Systems. Aug 1922, Vol. 7, 3.

31. Yue Yuan, J.Kubokawa, H.Sasaki. A solution of optimal power flow with multicontingency transient stability constraints. IEEE Transactions on Power Systems. Aug 2003, Vol. 18, 3.

32. H.R.Cai, C.Y.Chung, K.P.Wong. "Application of Differential Evolution Algorithm for Transient Stability Constrained Optimal Power Flow. IEEE Transactions on Power Systems. May 2008, Vol. 23, 2.

33. M.Huneault, F.D.Galiana. A survey of the optimal power flow literature. IEEE Transactions on Power Systems. 1991, Vol. 6, 2.

34. C.Dent. Operational Research in the Energy Industry. School of Engineering and Computing Sciences, Durham University. 2011. Lecture Notes.

35. Centre for Sustainable Energy and Distributed Generation. United Kingdom Generic Distribution System. SEDG Centre. [Online] [Cited: Aug 14, 2011.] http://www.sedg.ac.uk/.

36. J.B.Ekanayake, L.Holdsworth, XueGuang Wu, N.Jenkins. Dynamic Modeling of Doubly Fed Induction Generator Wind Turbines. IEEE Transactions on Power Systems. May 2003, Vol. 18, 2.

37. R.M. Zavadil, EnerNex Corporation. Wind Generation Technical Characteristics for the NYSERDA Wind Impacts Study. 2003.

38. J.Martínez, P.C. Kjær, P.Rodriguez, R.Teodorescu. Parameterization of a synchronous generator to represent a doubly fed induction generator with chopper protection for fault studies. Wind Energy. 2011, Vol. 14, 1.

39. Office of Gas and Electricity Markets (Ofgem). The Distribution Code. 2011.

Page 88: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

A1

APPENDIX A THE MICROSOFT EXCEL MODEL OF THE

EQUAL AREA CRITERION. A screen capture of the Microsoft Excel model of the Equal Area Criterion is shown below.

Page 89: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

B1

APPENDIX B VISUAL BASIC APPLICATION (VBA) CODE FOR AUTOMATIC MAXIMUM GENERATION

CALCULATION IN THE MICROSOFT EXCEL

MODEL OF THE EQUAL AREA CRITERION.

An automated algorithm was used in Section 4.1.3 to facilitate repeated calculations of the

maximum generation capacity for a given set of fault clearing times and inertial constant

values in the Microsoft Excel model of the Equal Area Criterion. This algorithm was

programmed using the in-built Visual Basic Application (VBA) component of Microsoft Excel.

The Excel cell references are explicitly defined in the VBA code, hence any changes made

to the layout of the spreadsheet may result in an error. If the position of the cells that

contained key values is modified, then the code will need to be modified as well to ensure

that it functions. These key cells are given in Table B.1 below.

Parameter Sheet Cell

First value of inertia constant, H, to be evaluated Maximum Power D3

First value of critical clearing time, tcc, to be evaluated Maximum Power E2

Value of inertia constant, H, used in stability calculations Equal Area Criterion E10

Value of critical clearing time, tcc, used in stability calculations Equal Area Criterion J21

Value of generator power, Pm, used in stability calculations Equal Area Criterion E9

Table B.1: Critical cell references for VBA code

The full version of the code used, with comments, is presented in the following page.

Page 90: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

B2

BEGIN CODE

Sub Maximum_power()

' CAUTION: Cell references are hard-coded

' Changes to spreadsheet layout will cause errors

' Maximum Power Calculation Macro

' Keyboard Shortcut: Ctrl+Shift+M

' Declare variables

Dim x As Integer

Dim y As Integer

' Initialise offset values

x = 0

y = 0

' Iterate Goal Seek calculation

' Starts from cell D3 along Row 3 until it reaches an empty column

' Moves to next row and repeats

' Ends when it reaches an empty row in Column D

Sheets("Maximum Power").Range("D3").Select

Do While IsEmpty(ActiveCell.Value) = False

Sheets("Equal Area Criterion").Range("E10") = ActiveCell.Value

Sheets("Maximum Power").Range("E2").Offset(0).Select

Do While IsEmpty(ActiveCell.Value) = False

Sheets("Equal Area Criterion").Range("J21").GoalSeek _

Goal:=ActiveCell.Value, _

ChangingCell:=Sheets("Equal Area Criterion").Range("E9")

ActiveCell.Offset(y + 1, 0) = _

Sheets("Equal Area Criterion").Range("E9").Value

x = x + 1

Sheets("Maximum Power").Range("E2").Offset(0, x).Select

Loop

y = y + 1

x = 0

Sheets("Maximum Power").Range("D3").Offset(y, 0).Select

Loop

End Sub

END CODE

Page 91: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

C1

APPENDIX C MATLAB CODE FOR SOLVING THE NON-LINEAR

SWING EQUATION

Section 4.2 describes the use of Matlab for solving the Swing Equation. The Matlab code

written for this purpose comprises of two sections. The main program swing.m contains the

primary code to be executed while the function f.m defines the second-order differential

swing equation in terms of two first order differential equations, which is a requirement by

Matlab solver used.

The swing equation from Equation 3.33 can be rewritten as:

C:�CD: = KLM �� −��,- NOP�! (C.1)

Equation C.1 is a second-order differential equation. This can be redefined as shown in

Equations C.2 and C.3, which are first-order differential equations.

C�CD = � (C.2)

C�CD = KLM �� −��,- NOP�! (C.3)

The initial conditions for each equation are:

C� 0!CD = 0 (C.4)

� 0! = �1 (C.5)

Equation C.4 represents the initial relative velocity between the rotor and the stator

magnetic field before the transient disturbance. This is equal to zero because both rotor and

stator are synchronised prior to the fault with no relative velocity between them. Equation

Page 92: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

C2

C.5 represents the operating angle of the rotor at the time of the fault, which is equivalent to

the steady-state operating angle.

The variables δ and z are then defined within the Matlab function file f.m as components of

vector y, where y = [δ z]. Both variable are solved when the main program swing.m is

executed, however, only the value of δ is of interest for this application.

The main program requires input values for generator power Pm, maximum fault power

Pmax(fault), steady-state operating angle δ0, critical clearing angle δcc, system frequency f and

inertial constant H, which are all obtained manually from the Excel model described in

Section 4.1. In addition, a time range for the solution is defined, along with the initial values

described in Equations C.4 and C.5. The program first uses the Matlab differential equation

solver ode45 to solve the equations defined by function f.m with the inputs provided and

produces a plot of rotor angle against time. A conditional loop is used to iterate the solver by

incrementing the solution time range in fixed steps until the critical clearing angle is located

in the middle of the rotor angle range. This method provides some flexibility to the program

by allowing it to solve up to an optimum time range depending on the input parameters,

hence avoiding a solution time range that is too short (which would cause a program error

and require user intervention to increase the time by trial and error) or too long (which would

unnecessarily increase the computation time). Additionally, accuracy of the solution is

improved by locating the critical clearing angle in the middle of the solved range.

After the solver routine is complete, the Matlab curve-fitting functions polyfit and polyval are

used to calculate the critical clearing time from the critical clearing angle provided by the

Excel model. Another conditional loop is implemented to improve the accuracy of the result

by increasing the order of the polynomial used until the curve-fitting error calculated by the

polyval function becomes less than 1%. The final result extracted from Matlab is not only the

calculated critical clearing time, but also a minimum and maximum value based on the

curve-fitting error. Verification with PowerWorld is required to determine the exact value

which should lie within the range given by Matlab.

The full version of the codes used, with comments, is presented in the following pages.

Page 93: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

C3

BEGIN CODE – SWING.M

% swing.m -> Solve 2nd Order Non-Linear Swing Equation

% Makes use of function f.m

% Declare variables to be passed to f.m

global Pm Pmaxfault M;

% User-defined variables - get values from Excel model

Pm = 1;

Pmaxfault = 0;

delta_0 = 0.395;

delta_cc = 1.145;

freq = 50;

H = 3;

% Change only if Matlab displays warning messages when solving

endtime = 0.1;

% Do not change these parameters

starttime = 0;

time = [starttime endtime]; % Time range of solution

initialvalue = [delta_0 0]; % Initial values for differential equations

M=H/(pi*freq);

errorpercent = 100; % Initial curve-fitting error value

order = 2; % Initial curve-fitting order

% Solve differential equation - Call f.m with time & initial values

[t,y]=ode45(@f,time,initialvalue);

% Iterate solution until delta_cc lies in the middle of the solution range

while y(end,1) < delta_cc + delta_0

endtime = endtime + 0.1;

time = [starttime endtime];

[t,y]=ode45(@f,time,initialvalue);

end

% Curve fitting & tcc value extraction

% Loop and increase polynomial order until error is < 1%

while errorpercent > 1

[P,S,MU] = polyfit(y(:,1),t,order);

[tcc, error] = polyval(P,delta_cc,S,MU);

errorpercent = error/tcc*100;

x = y(1,1):(y(end,1)-y(1,1))/10:y(end,1);

order = order + 1;

end

% Curve plotting

plot (y(:,1),t);

hold on;

plot (x,polyval(P,x,S,MU),'g');

hold off

% Display results

error,

errorpercent,

order,

endtime,

delta_cc,

tcmin = tcc - error

tcmax = tcc + error

tcc

END CODE – SWING.M

Page 94: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

C4

BEGIN CODE – F.M

% f.m -> Solve 2nd Order Non-Linear Swing Equation

% Is called from program swing.m

function diff_eq = f(t,y)

global Pm Pmaxfault M;

diff_eq=[y(2);(Pm/M)-((Pmaxfault/M)*sin(y(1)))];

end

END CODE – F.M

Page 95: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

D1

APPENDIX D DEFINITION OF TRANSIENT STABILITY-CONSTRAINED OPTIMAL POWER FLOW:

VERSION 3 (TSC-OPF-3)

D.1 Tabular description

Set AIMMS Name

AIMMS Index

Symbol Description

S1 Buses b B Set of busbars in the network.

S2 Lines l L Set of lines in the network.

S3 DG g G Set of distributed generators in the network.

S4 SlackGen S S Set of slack generators in the network.

Table D.1: TSC-OPF-3 - Network sets

Network Optimisation

AIMMS Name

Equation Description

NO1 DG_Network

Power Equation

D.27 Variable to be maximised.

NO2 NetworkOnly_

Variables -

Limits the variables used to those listed in Table C.4 so that only the network OPF is optimised. Transient stability variables listed in Table 5.8 are omitted.

NO3 NetworkOnly_

Constraints -

Limits the constraints used to those listed in Table C.5 so that only the network OPF is optimised. Transient stability constraints listed in Table 5.9 are omitted.

NO4 MaxDG_

NetworkOnly Equation

D.27 Defines the objective function and direction of optimisation

Table D.2: TSC-OPF-3 - Network optimisation

Page 96: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

D2

Network Parameter

AIMMS Name AIMMS Index

Symbol Description

NP1 DG_Location - - The busbar on which the distributed generator is located.

NP2 Demand b D Active power demand at each busbar.

NP3 Reactance l X Reactance of each line.

NP4 Flow_Limit l fmax Thermal flow limit of each line. Since reactive power is not modelled, it is assumed that this relates to the active power flow limit.

NP5 Capacity g Pmax Power generating capacity of each distributed generator.

NP6 Connections b, l c

Two-dimensional matrix that forms the definition of the network connections. The value ‘1’ indicates the start busbar for a line, while the value of ‘-1’ indicates the end busbar for a line.

NP7 Slack_Location - - The busbar on which the slack generator is located.

NP8 Phase_Limit - θmax The voltage phase angle limits

NP9 VoltageDeviation

_Limit - Vvar

Allowable voltage deviation from nominal value.

NP10 LineStartBus l - Explicitly defines the start bus of each line.

NP11 LineEndBus l - Explicitly defines the end bus of each line.

Table D.3: TSC-OPF-3 - User-defined network parameters

Network Variables

AIMMS Name

AIMMS Index

Symbol Description

NV1 Power_ Network

g Pm Power output of the distributed generator.

NV2 Phase b θ Voltage phase angle at each busbar.

NV3 Flow l F

Active power flow in each line. Negative values indicate that the powerflow is in the opposite direction than that defined by the ‘Connections’ parameter.

NV4 Power_Slack s P∞ Power output of the slack generator.

NV5 Voltage b V Voltage magnitude at each busbar.

Table D.4: TSC-OPF-3 - Calculated network variables

Page 97: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

D3

Network Constraint

AIMMS Name

AIMMS Index

Equation Description

NC1 Phase_

SlackBus -

Equation D.2

Explicitly defines the voltage phase angle of the slack/infinite bus to the zero.

NC2 Flow_Min l Equation

D.3

Sets the lower active powerflow limit on the lines when power flows in the opposite direction than that defined by the ‘Connections’ parameter

NC3 Flow_Max l Equation

D.4

Sets the upper active power flow limit on the lines when power flows in the same direction as that defined by the ‘Connections’ parameter.

NC4 Power_ Capacity

g Equation

D.5 Limits the upper boundary of the power generated by the distributed generator.

NC5 KVL l Equation

D.6 Defines Kirchhoffs Voltage Law constraint

NC6 KCL b Equation

D.7 Defines Kirchhoffs Current Law constraint

NC7 Phase_Min b Equation

D.8 Sets the lower voltage phase limit.

NC8 Phase_Max b Equation

D.9 Sets the upper voltage phase limit.

NC9 Voltage_Min b Equation

D.10 Sets the lower voltage magnitude limit.

NC10 Voltage_Max b Equation

D.11 Sets the upper voltage magnitude limit.

NC11 Voltage _DGBus

- Equation

D.12

Fixes the generator bus voltage to 1 pu.

Since reactive power is not modelled, it is assumed that the generator bus is a PV bus.

NC12 Voltage

_SlackBus -

Equation D.13

Fixes the infinite bus voltage to 1 pu

Table D.5: TSC-OPF-3 - Network constraints

Stability Optimisation

AIMMS Name Equation Description

SO1 DG_StabilityPower Equation D.1 Variable to be maximised.

SO2 MaxDG_ TSCOPF Equation D.1 Defines the objective function and direction of optimisation.

Table D.6: TSC-OPF-3 - Transient stability optimisation

Page 98: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

D4

Stability Parameter

Parameter Type

AIMMS Name

Symbol Description

SP1 User-

defined Xd Xd

’ Generator direct-axis transient reactance.

SP2 User-

defined H H Machine inertia constant.

SP3 User-

defined F F System frequency.

SP4 User-

defined t_c tc Desired clearing time limit in milliseconds.

SP5 Fixed X_prefault Xprefault Prefault reactance between generator and infinite bus. This is the parallel reactance of the values in NP3.

SP6 Fixed X_postfault Xpostfault Postfault reactance between generator and infinite bus. This is the reactance of L21_1 after the fault is cleared by opening L21_2.

SP7 Fixed Vs_mag Vs Sending bus voltage magnitude fixed at 1 pu.

SP8 Fixed Vr_mag Vr Receiving bus voltage magnitude fixed at 1pu.

SP9 Fixed Vr_ang θr Receiving bus phase angle fixed at 0 radians.

SP10 Fixed Pmax_fault Pmax(fault) Fault power delivery fixed a 0 pu due to simulated fault on the sending bus.

Table D.7: TSC-OPF-3 - Transient stability parameters

Stability Variables

AIMMS Name Symbol Description

SV1 Power_Stability Pt Power output of the distributed generator.

SV2 Vs_ang θs Voltage phase angle at the sending busbar.

SV3 E_mag E’ Internal voltage magnitude of the generator

SV4 Pmax_prefault Pmax(prefault) Maximum prefault power of the generator

SV5 Pmax__postfault Pmax(postfault) Maximum postfault power of the generator

SV6 delta_0 θ0 Steady-state operating power angle of the generator

SV7 delta_max θmax Maximum allowable power angle of the generator

SV8 delta_cc θcc Critical clearing angle of the generator

SV9 t_cc tcc Critical clearing time of the distributed generator

Table D.8: TSC-OPF-3 - Calculated transient stability variables

Page 99: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

D5

Stability Constraint

AIMMS Name Equation Description

SC1 Power_ Equality

Equation D.13 Explicitly binds the variables Power_Network and Power_Stability.

SC2 Phase_

GeneratorBus Equation D.14 Explicitly binds the variables Phase and Vs_ang.

SC3 Power_Max Equation D.15

Sets the upper bound of Power_Stability so that it does not exceed Pmax_postfault.

This constraint is required to satisfy the assumption made in Section 3.2.3 that the generator output power does not change during the duration of the analysis. Without this, then it would be possible for the prefault output power to exceed the maximum possible postfault power, which would invalidate the assumption and result in computational errors.

SC4 Vs_ang_ Formula

Equation D.16 Calculation for the generator terminal bus voltage angle, Vs_ang

SC5 E_mag_ Formula

Equation D.17 Calculation for the internal voltage magnitude of the generator, E_mag.

SC6 Pmax_

prefault_ Formula

Equation D.18 Calculation for the maximum prefault output power delivery of the generator, Pmax_prefault.

SC7 Pmax_

postfault_ Formula

Equation D.19 Calculation for the maximum postfault output power delivery of the generator, Pmax_postfault.

SC8 delta_0_ Formula

Equation D.20 Calculation for the steady-state operating power angle of the generator, delta_0

SC9 delta_max_

Formula Equation D.21

Calculation for the maximum allowable power angle of the generator, delta_max

SC10 delta_cc_ Formula

Equation D.22 Calculation for the critical clearing angle of the generator, delta_cc.

SC11 delta_cc_min Equation D.23 Sets the lower bound for delta_cc so that it does not become less than delta_0.

SC12 delta_cc_max Equation D.24 Sets the upper bound for delta_cc so that it does not exceed delta_max.

SC13 t_cc_Formula Equation D.25 Calculation for the critical clearing time, t_cc.

SC14 t_cc_limit Equation D.26 Sets the upper bound for clearing time, t_c, so that it does not exceed the critical clearing time, t_cc.

Table D.9: TSC-OPF-3 - Transient stability constraints

Page 100: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

D6

D.2 Mathematical notation

• Objective function

]^_` �9a∈c (D.1)

• Subject to the following network constraints

�<: = 0 (D.2)

L8_�fg ≤ L8 ∀nko (D.3)

L8 ≤ L8_�,- ∀nko (D.4)

�g ≤ �a_�,-∀w ∈ } (D.5)

L8d~d� = ���� 8 ` �d8d∈< sin �� − ��!∀nko (D.6)

` �ga|<tud + ` ��a|<tud − `�d8L88 =Cd∀jkl (D.7)

�d_�fg ≤ �d∀jkl (D.8)

�d ≤ �d_�,-∀jkl (D.9)

�d_�fg ≤ �d∀jkl (D.10)

�d ≤ �d_�,-∀jkl (D.11)

�a = 1∀wk} (D.12)

�∞ = 1∀Nk$ (D.13)

Page 101: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

D7

• Subject to the following transient stability constraints

�9 = �� (D.13)

�� = �<: (D.14)

�9 ≤ ���� 5>�96,789! (D.15)

�� = sin� �9 ∗ 5�%6,789���� � +�� (D.16)

�� = R)�� cos �� + �� cos �� − �� cos ��! 5�%6,789 ∗ �*: + )�� sin �� + �� sin �� − �� sin ��! 5�%6,789 ∗ �*: (D.17)

���� 5�%6,789! = ���� � + 5�%6,789 (D.18)

���� 5>�96,789! = ���� � + 5>�96,789 (D.19)

�1 = sin� ) �9���� 5>�96,789!* (D.20)

��,- =π − sin� ) �9���� 5>�96,789!* (D.21)

�TT = cos� (�9 ��,- − �1! + ���� 5>�96,789! cos��,- − ���� 6,789! cos�1���� 5>�96,789! −���� 6,789! + (D.22)

�1 ≤ �TT (D.23)

�TT ≤ ��,- (D.24)

Page 102: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

D8

DTT = 1000R2M �TT − �1!K��9 (D.25)

DT ≤ DTT (D.26)

For the network-only OPF, where the network is solved without transient stability

constraints, the mathematical notation can be summarised as:

• Objective function

]^_` ��a∈c (D.27)

• Subject to network constraints (D.2) to (D.13)

D.3 AIMMS text representation

MAIN MODEL Main_TSC_OPF_3

SECTION Network_OPF

DECLARATION SECTION sets

SET:

identifier : Buses

index : b ;

SET:

identifier : Lines

index : l ;

SET:

identifier : DG

index : g ;

SET:

identifier : SlackGen

index : s ;

ENDSECTION ;

DECLARATION SECTION Network_Parameters

ELEMENT PARAMETER:

identifier : DG_Location

range : Buses ;

Page 103: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

D9

ELEMENT PARAMETER:

identifier : Slack_Location

range : Buses ;

PARAMETER:

identifier : Demand_P

index domain : (b) ;

PARAMETER:

identifier : Reactance

index domain : (l) ;

PARAMETER:

identifier : Flow_Limit

index domain : (l) ;

PARAMETER:

identifier : Phase_Limit ;

PARAMETER:

identifier : Capacity

index domain : (g) ;

PARAMETER:

identifier : Connections

index domain : (b,l) ;

PARAMETER:

identifier : VoltageDeviation_Limit ;

ELEMENT PARAMETER:

identifier : LineStartBus

index domain : l

range : Buses ;

ELEMENT PARAMETER:

identifier : LineEndBus

index domain : l

range : Buses ;

ENDSECTION ;

DECLARATION SECTION Network_Variables

VARIABLE:

identifier : Power_Network

index domain : (g)

range : nonnegative ;

VARIABLE:

identifier : Phase

index domain : (b)

range : free ;

VARIABLE:

identifier : Flow

index domain : (l)

range : free ;

VARIABLE:

identifier : Slack

index domain : (s)

range : free ;

VARIABLE:

identifier : Voltage

index domain : (b)

range : free ;

Page 104: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

D10

ENDSECTION ;

DECLARATION SECTION Network_Constraints

CONSTRAINT:

identifier : Phase_SlackBus

definition : Phase(Slack_Location)=0 ;

CONSTRAINT:

identifier : Flow_Min

index domain : l

definition : -Flow_Limit(l)<=Flow(l) ;

CONSTRAINT:

identifier : Flow_Max

index domain : (l)

definition : Flow(l)<=Flow_Limit(l) ;

CONSTRAINT:

identifier : Phase_Min

index domain : (b)

definition : -Phase_Limit<=Phase(b) ;

CONSTRAINT:

identifier : Phase_Max

index domain : (b)

definition : Phase(b)<=Phase_Limit ;

CONSTRAINT:

identifier : Power_Capacity

index domain : (g)

definition : Power_Network(g)<=Capacity(g) ;

CONSTRAINT:

identifier : KVL

index domain : l

definition : (Voltage(LineStartBus(l))*Voltage(LineEndBus(l)))

*(1/Reactance(l))* sum[(b),(sin(Phase(b)

- Phase(LineEndBus(l)))* Connections(b,l))]=Flow(l) ;

CONSTRAINT:

identifier : KCL

index domain : b

definition : sum[(g)|DG_Location=b,Power_Network(g)] +

sum[(s)|Slack_Location=b,Slack(s)] = Demand_P(b)

+sum[(l),Connections(b,l)*Flow(l)] ;

CONSTRAINT:

identifier : Voltage_Min

index domain : (b)

definition : (1-VoltageDeviation_Limit)<=Voltage(b) ;

CONSTRAINT:

identifier : Voltage_Max

index domain : (b)

definition : Voltage(b)<=(1+VoltageDeviation_Limit) ;

CONSTRAINT:

identifier : Voltage_SlackBus

definition : Voltage(Slack_Location)=1 ;

CONSTRAINT:

identifier : Voltage_DGBus

definition : Voltage(DG_Location)=1 ;

ENDSECTION ;

Page 105: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

D11

DECLARATION SECTION Network_Optimisation

VARIABLE:

identifier : DG_NetworkPower

range : free

definition : Power_Network('DG1') ;

SET:

identifier : NetworkOnly_Variables

subset of : AllIdentifiers

definition : data { Power_Network,

Phase,

Flow,

Slack,

Voltage } ;

SET:

identifier : NetworkOnly_Constraints

subset of : AllIdentifiers

definition : data { Phase_Min,

Phase_Max,

Phase_SlackBus,

Flow_Min,

Flow_Max,

Power_Capacity,

KVL,

KCL,

Voltage_Min,

Voltage_Max,

Voltage_SlackBus,

Voltage_DGBus } ;

MATHEMATICAL PROGRAM:

identifier : MaxDG_NetworkOnly

objective : DG_NetworkPower

direction : maximize

constraints : NetworkOnly_Constraints

variables : NetworkOnly_Variables

type : Automatic ;

ENDSECTION ;

PROCEDURE

identifier : solve_MaxDG_NetworkOnly

body :

solve MaxDG_NetworkOnly;

ENDPROCEDURE ;

ENDSECTION Network_OPF ;

SECTION Transient_Stability

DECLARATION SECTION Stability_Parameters

PARAMETER:

identifier : Xd ;

PARAMETER:

identifier : H

default : 4 ;

PARAMETER:

identifier : F

default : 50 ;

PARAMETER:

identifier : t_c ;

Page 106: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

D12

PARAMETER:

identifier : X_prefault ;

PARAMETER:

identifier : X_postfault ;

PARAMETER:

identifier : Vs_mag

default : 1 ;

PARAMETER:

identifier : Vr_mag

default : 1 ;

PARAMETER:

identifier : Vr_ang

default : 0 ;

PARAMETER:

identifier : Pmax_fault

default : 0 ;

ENDSECTION ;

DECLARATION SECTION Stability_Constraints

CONSTRAINT:

identifier : Power_Equality

definition : Power_Stability=Power_Network('DG1') ;

CONSTRAINT:

identifier : Phase_GeneratorBus

definition : Vs_ang = Phase(DG_Location) ;

CONSTRAINT:

identifier : Power_Max

definition : Power_Stability <= Pmax_postfault ;

CONSTRAINT:

identifier : Vs_ang_Formula

definition : Vs_ang= arcsin(Power_Stability*X_prefault/(Vs_mag*Vr_mag))

+ Vr_ang;

CONSTRAINT:

identifier : E_mag_Formula

definition : E_mag= sqrt((Vs_mag*cos(Vs_ang)-((-1*((Vs_mag*cos(Vs_ang))-

(Vr_mag*cos(Vr_ang)))/(X_prefault))*Xd))^2 +

(Vs_mag*sin(Vs_ang)+((((Vs_mag*sin(Vs_ang))-

(Vr_mag*sin(Vr_ang)))/(X_prefault))*Xd))^2) ;

CONSTRAINT:

identifier : Pmax_prefault_Formula

definition : Pmax_prefault= (E_mag*Vr_mag)/(Xd+X_prefault) ;

CONSTRAINT:

identifier : Pmax_postfault_Formula

definition : Pmax_postfault= (E_mag*Vr_mag)/(Xd+X_postfault) ;

CONSTRAINT:

identifier : delta_0_Formula

definition : delta_0= arcsin(Power_Stability/Pmax_prefault) ;

CONSTRAINT:

identifier : delta_max_Formula

definition : delta_max= 3.1416-arcsin(Power_Stability/Pmax_postfault) ;

Page 107: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

D13

CONSTRAINT:

identifier : delta_cc_Formula

definition : delta_cc= arccos((Power_Stability*(delta_max-delta_0)

+(Pmax_postfault*cos(delta_max))

-(Pmax_fault*cos(delta_0)))/(Pmax_postfault-Pmax_fault)) ;

CONSTRAINT:

identifier : delta_cc_min

definition : delta_cc >= delta_0 ;

CONSTRAINT:

identifier : delta_cc_max

definition : delta_cc <= delta_max ;

CONSTRAINT:

identifier : t_cc_Formula

definition : t_cc= 1000*sqrt((2*H*(delta_cc-delta_0))

/(3.1416*F*Power_Stability)) ;

CONSTRAINT:

identifier : t_cc_Limit

definition : t_cc>=t_c ;

ENDSECTION ;

DECLARATION SECTION Stability_Variables

VARIABLE:

identifier : Power_Stability

range : nonnegative ;

VARIABLE:

identifier : Vs_ang ;

VARIABLE:

identifier : E_mag ;

VARIABLE:

identifier : Pmax_prefault ;

VARIABLE:

identifier : Pmax_postfault ;

VARIABLE:

identifier : delta_0 ;

VARIABLE:

identifier : delta_max ;

VARIABLE:

identifier : delta_cc ;

VARIABLE:

identifier : t_cc ;

ENDSECTION ;

DECLARATION SECTION Stability_Optimisation

VARIABLE:

identifier : DG_StabilityPower

range : free

definition : Power_Stability ;

MATHEMATICAL PROGRAM:

identifier : MaxDG_TSCOPF_3

objective : DG_StabilityPower

direction : maximize

Page 108: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

D14

constraints : AllConstraints

variables : AllVariables

type : Automatic ;

ENDSECTION ;

PROCEDURE

identifier : solve_MaxDG_TSCOPF_3

body :

solve MaxDG_TSCOPF_3;

ENDPROCEDURE ;

ENDSECTION Transient_Stability ;

PROCEDURE

identifier : MainInitialization

ENDPROCEDURE ;

PROCEDURE

identifier : MainTermination

body :

if ( CaseSaveAll( confirm:2 ) = 1 ) then

return 1;

else

return 0;

endif ;

ENDPROCEDURE ;

ENDMODEL Main_TSC_OPF_3 ;

Page 109: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

E1

APPENDIX E DEFINITION OF TRANSIENT STABILITY-CONSTRAINED OPTIMAL POWER FLOW:

VERSION 4 (TSC-OPF-4)

The AIMMS text representation for TSC-OPF-4 is given below. This version was not yet

functional at the end of the project and requires additional work.

MAIN MODEL Main_TSC_OPF_4

SECTION Network_OPF

DECLARATION SECTION sets

SET:

identifier : Buses

index : b ;

SET:

identifier : Lines

index : l ;

SET:

identifier : DG

index : g ;

SET:

identifier : SlackGen

index : s ;

ENDSECTION ;

DECLARATION SECTION Network_Parameters

ELEMENT PARAMETER:

identifier : LineStartBus

index domain : l

range : Buses ;

ELEMENT PARAMETER:

identifier : LineEndBus

index domain : l

range : Buses ;

ELEMENT PARAMETER:

identifier : DG_Location

range : Buses ;

ELEMENT PARAMETER:

identifier : Slack_Location

range : Buses ;

PARAMETER:

identifier : Demand_P

index domain : (b) ;

Page 110: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

E2

PARAMETER:

identifier : Reactance

index domain : (l) ;

PARAMETER:

identifier : Flow_Limit

index domain : (l) ;

PARAMETER:

identifier : Phase_Limit ;

PARAMETER:

identifier : Capacity

index domain : (g) ;

PARAMETER:

identifier : Connections

index domain : (b,l) ;

PARAMETER:

identifier : VoltageVar_Limit ;

PARAMETER:

identifier : Demand_Q

index domain : (b) ;

ENDSECTION ;

DECLARATION SECTION Network_Variables

VARIABLE:

identifier : P_Network

index domain : (g)

range : nonnegative ;

VARIABLE:

identifier : Phase

index domain : (b)

range : free ;

VARIABLE:

identifier : Flow_P

index domain : (l)

range : free ;

VARIABLE:

identifier : P_Slack

index domain : (s)

range : free ;

VARIABLE:

identifier : Voltage

index domain : (b)

range : free ;

VARIABLE:

identifier : Q_Network

index domain : (g)

range : nonnegative ;

VARIABLE:

identifier : Q_Slack

index domain : (s)

range : free ;

Page 111: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

E3

VARIABLE:

identifier : Flow_Q

index domain : (l)

range : free ;

ENDSECTION ;

DECLARATION SECTION Network_Constraints

CONSTRAINT:

identifier : Phase_Min

index domain : (b)

definition : -Phase_Limit<=Phase(b) ;

CONSTRAINT:

identifier : Phase_Max

index domain : (b)

definition : Phase(b)<=Phase_Limit ;

CONSTRAINT:

identifier : Phase_Slack_Bus

definition : Phase(Slack_Location)=0 ;

CONSTRAINT:

identifier : Flow_Min

index domain : l

definition : -Flow_Limit(l)<=Flow_P(l) ;

CONSTRAINT:

identifier : Flow_Max

index domain : (l)

definition : Flow_P(l)<=Flow_Limit(l) ;

CONSTRAINT:

identifier : Power_Capacity

index domain : (g)

definition : P_Network(g)<=Capacity(g) ;

CONSTRAINT:

identifier : KVL_P

index domain : l

definition : (Voltage(LineStartBus(l))*Voltage(LineEndBus(l)))

*(1/Reactance(l))*sum[(b),(sin(Phase(b)

-Phase(LineEndBus(l)))*Connections(b,l))]=Flow_P(l) ;

CONSTRAINT:

identifier : KCL_P

index domain : b

definition : sum[(g)|DG_Location=b,P_Network(g)]

+sum[(s)|Slack_Location=b,P_Slack(s)] = Demand_P(b)

+sum[(l),Connections(b,l)*Flow_P(l)] ;

CONSTRAINT:

identifier : Voltage_Min

index domain : (b)

definition : (1-VoltageVar_Limit)<=Voltage(b) ;

CONSTRAINT:

identifier : Voltage_Max

index domain : (b)

definition : Voltage(b)<=(1+VoltageVar_Limit) ;

CONSTRAINT:

identifier : Voltage_Slack_Bus

definition : Voltage(Slack_Location)=1 ;

Page 112: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

E4

CONSTRAINT:

identifier : Voltage_DG_Bus

definition : Voltage(DG_Location)=1 ;

CONSTRAINT:

identifier : KVL_Q

index domain : l

definition : -(1/Reactance(l))*(Voltage(LineStartBus(l)))^2

-(Voltage(LineStartBus(l))

*Voltage(LineEndBus(l)))

*(1/Reactance(l))*sum[(b),(-cos(Phase(b)

-Phase(LineEndBus(l)))*Connections(b,l))]=Flow_Q(l) ;

CONSTRAINT:

identifier : KCL_Q

index domain : b

definition : sum[(g)|DG_Location=b,Q_Network(g)]

+sum[(s)|Slack_Location=b,Q_Slack(s)] = Demand_Q(b)

+sum[(l),Connections(b,l)*Flow_Q(l)] ;

ENDSECTION ;

DECLARATION SECTION Network_Optimisation

VARIABLE:

identifier : DG_NetworkPower

range : free

definition : P_Network('DG1') ;

SET:

identifier : NetworkOnly_Variables

subset of : AllIdentifiers

definition : data { P_Network,

Phase,

Flow_P,

P_Slack,

Voltage,

Q_Network,

Q_Slack,

Flow_Q } ;

SET:

identifier : NetworkOnly_Constraints

subset of : AllIdentifiers

definition : data { Phase_Min,

Phase_Max,

Phase_Slack_Bus,

Flow_Min,

Flow_Max,

Power_Capacity,

KVL_P,

KCL_P,

Voltage_Min,

Voltage_Max,

Voltage_Slack_Bus,

Voltage_DG_Bus,

KVL_Q,

KCL_Q } ;

MATHEMATICAL PROGRAM:

identifier : MaxDG_NetworkOnly

objective : DG_NetworkPower

direction : maximize

constraints : NetworkOnly_Constraints

variables : NetworkOnly_Variables

type : Automatic ;

ENDSECTION ;

Page 113: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

E5

PROCEDURE

identifier : solve_MaxDG_NetworkOnly

body :

solve MaxDG_NetworkOnly;

ENDPROCEDURE ;

ENDSECTION Network_OPF ;

SECTION Transient_Stability

DECLARATION SECTION Stability_Parameters

PARAMETER:

identifier : Xd ;

PARAMETER:

identifier : H

default : 4 ;

PARAMETER:

identifier : F

default : 50 ;

PARAMETER:

identifier : t_c ;

PARAMETER:

identifier : X_prefault ;

PARAMETER:

identifier : X_postfault ;

PARAMETER:

identifier : Vs_mag

default : 1 ;

PARAMETER:

identifier : Vr_mag

default : 1 ;

PARAMETER:

identifier : Vr_ang

default : 0 ;

PARAMETER:

identifier : Pmax_fault

default : 0 ;

ENDSECTION ;

DECLARATION SECTION Stability_Constraints

CONSTRAINT:

identifier : Power_Equality

definition : Power_Stability=P_Network('DG1') ;

CONSTRAINT:

identifier : Phase_GeneratorBus

definition : Vs_ang = Phase(DG_Location) ;

CONSTRAINT:

identifier : Phase_SlackBus

definition : Phase(Slack_Location) = Vr_ang

Page 114: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

E6

CONSTRAINT:

identifier : Power_Max

definition : Power_Stability <= Pmax_postfault ;

CONSTRAINT:

identifier : Vs_ang_Formula

definition : Vs_ang= arcsin(Power_Stability*X_prefault

/(Vs_mag*Vr_mag)) + Vr_ang;

CONSTRAINT:

identifier : E_mag_Formula

definition : E_mag= sqrt((Vs_mag*cos(Vs_ang)-((-1*((Vs_mag*cos(Vs_ang))

-(Vr_mag*cos(Vr_ang)))/(X_prefault))*Xd))^2

+(Vs_mag*sin(Vs_ang)+((((Vs_mag*sin(Vs_ang))

-(Vr_mag*sin(Vr_ang)))/(X_prefault))*Xd))^2) ;

CONSTRAINT:

identifier : Pmax_prefault_Formula

definition : Pmax_prefault= (E_mag*Vr_mag)/(Xd+X_prefault) ;

CONSTRAINT:

identifier : Pmax_postfault_Formula

definition : Pmax_postfault= (E_mag*Vr_mag)/(Xd+X_postfault) ;

CONSTRAINT:

identifier : delta_0_Formula

definition : delta_0= arcsin(Power_Stability/Pmax_prefault) ;

CONSTRAINT:

identifier : delta_max_Formula

definition : delta_max= 3.1416-arcsin(Power_Stability/Pmax_postfault) ;

CONSTRAINT:

identifier : delta_cc_Formula

definition : delta_cc= arccos((Power_Stability*(delta_max-delta_0)

+(Pmax_postfault*cos(delta_max))

-(Pmax_fault*cos(delta_0)))/(Pmax_postfault-Pmax_fault)) ;

CONSTRAINT:

identifier : delta_cc_min

definition : delta_cc >= delta_0 ;

CONSTRAINT:

identifier : delta_cc_max

definition : delta_cc <= delta_max ;

CONSTRAINT:

identifier : t_cc_Formula

definition : t_cc= 1000*sqrt((2*H*(delta_cc-delta_0))

/(3.1416*F*Power_Stability)) ;

CONSTRAINT:

identifier : t_cc_Limit

definition : t_cc>=t_c ;

ENDSECTION ;

DECLARATION SECTION Stability_Variables

VARIABLE:

identifier : Power_Stability

range : nonnegative ;

VARIABLE:

identifier : Vs_ang ;

VARIABLE:

identifier : E_mag ;

Page 115: Dhana Raj Markandu: Maximising Generator Connections in Distributed Networks under Stability Constraints

FOR R

EFER

ENCE

ONLY

E7

VARIABLE:

identifier : Pmax_prefault ;

VARIABLE:

identifier : Pmax_postfault ;

VARIABLE:

identifier : delta_0 ;

VARIABLE:

identifier : delta_max ;

VARIABLE:

identifier : delta_cc ;

VARIABLE:

identifier : t_cc ;

ENDSECTION ;

DECLARATION SECTION Stability_Optimisation

VARIABLE:

identifier : DG_StabilityPower

range : free

definition : Power_Stability ;

MATHEMATICAL PROGRAM:

identifier : MaxDG_TSCOPF_4

objective : DG_StabilityPower

direction : maximize

constraints : AllConstraints

variables : AllVariables

type : Automatic ;

ENDSECTION ;

PROCEDURE

identifier : solve_MaxDG_TSCOPF_4

body :

solve MaxDG_TSCOPF_4;

ENDPROCEDURE ;

ENDSECTION Transient_Stability ;

PROCEDURE

identifier : MainInitialization

ENDPROCEDURE ;

PROCEDURE

identifier : MainTermination

body :

if ( CaseSaveAll( confirm:2 ) = 1 ) then

return 1;

else

return 0;

endif ;

ENDPROCEDURE ;

ENDMODEL Main_TSC_OPF_4 ;