Documente Academic
Documente Profesional
Documente Cultură
Diploma Thesis
by
Robert Schmaranz
University of Edinburgh
Department of Electronics and Electrical Engineering
Edinburgh, United Kingdom
May 2000
Submitted to
Technical University Graz
Institute of Electric Power Systems
Graz, Austria
Preface 1
Preface
This project was performed at the University of Edinburgh, Department of Electronics and
Electrical Engineering, and submitted to the Technical University Graz, Institute of
Electric Power Systems.
This work is intended to be my final thesis for diploma at the Technical University Graz.
I would like to thank Dr. Robin Wallace, my project supervisor at the University of
Edinburgh, for the proposal of the topic, the discussions and his help encouragement and
professionalism during the course of the project.
Thanks also go to Dr. Gary Conner for his invaluable advice and information provided
with regard to the work I carried out, Gareth Harrison for the help he gave me when
learning the VC++ programming language and the whole Energy System Group for their
aid when writing the report.
Many thanks also go to Professor Lothar Fickert at the Technical University Graz, Institute
of Electric Power Systems, for his help during the application process and encouragement
in the beginning of the project.
A final word of thanks goes out to my dearest friends and family back home for their
never-ending encouragement and support.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Abstract 2
Abstract
Electricity is being demanded at an ever increasing rate by modern society. Due to the
depletion of fossil fuel energy sources to generate electricity this increasing demand must
be met by some other means. Government initiatives and the privatisation of the electricity
supply industry in recent years has encouraged the development of wind farms, mini-hydro
schemes and industrial Combined Heat and Power (CHP) generating plants which are
embedded in the electricity distribution network. The operation of these embedded
generators may improve or adversely effect the quality or stability of the electricity
supplied to costumers. Each embedded generation scheme must be assessed for its
technical feasibility as many of the plants may propose to connect in remote areas where
the grid system is already weak. Due to the shear number of proposed schemes there is a
need for a hierarchical rule-base which could identify, at an early stage in development,
any problems that would be encountered by the connection. The effects an embedded
generator has on the distribution system can be determined by different computer
simulations.
This report explains the basics of embedded generation, the problems an embedded
generator has on the rural distribution network and describes the construction of circle
diagrams for a short- and long-transmission line, to determine the absorbence of the grid.
With the developed knowledge a program in Microsoft Visual C++ Version 6.0 is written
to visualise the obtained results.
The Visual C++ simulation shows an universal power circle diagram for a short-
transmission line similar to the power circle diagram of a synchronous machine. It obtains
an active and reactive power area for the receiving end and an area for the receiving- and
sending-end voltage. The program additionally calculates the sending-end values for the
active, reactive and complex power, the power factor, the phase angle, the current and the
load angle.
Keywords: circle diagram, embedded generation, grid absorbence, power flow, voltage
violation
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Table of Contents 3
Table of Contents
1 INTRODUCTION .......................................................................................................8
1.1 General Background ..................................................................................................8
1.2 Worldwide Energy Reserves – Forecast....................................................................9
1.3 Worldwide Energy Consumption – Forecast ..........................................................10
1.4 Situation in the United Kingdom.............................................................................11
1.5 The Future of Distributed Generation in the United Kingdom ...............................13
1.6 Scope of this Project ................................................................................................14
2 EMBEDDED GENERATION..................................................................................15
2.1 Basics.......................................................................................................................15
2.2 The Electricity Supply System ................................................................................15
2.3 Types of Embedded Generation ..............................................................................17
2.3.1 Combined Heat and Power Schemes.................................................................17
2.3.2 Mini-Hydro Schemes.........................................................................................17
2.3.3 Wind Power .......................................................................................................17
2.3.4 Others ................................................................................................................18
2.4 Advantages of Embedded Generators .....................................................................19
2.5 Legislation in the United Kingdom .........................................................................20
2.6 Types of Generators ................................................................................................21
2.6.1 The Synchronous Generator ..............................................................................21
2.6.2 The Induction Generator....................................................................................22
2.6.3 Fault Contribution .............................................................................................24
2.6.4 Choice of Generator ..........................................................................................24
2.7 Solid-State Power Convertors .................................................................................25
2.8 Effects of Embedded Generators on Weak Rural Grids..........................................26
2.8.1 Load Flow and Losses .......................................................................................26
2.8.2 Power Quality ....................................................................................................29
2.8.3 Fault Levels .......................................................................................................29
2.8.4 Steady-State and Transient Stability..................................................................30
2.8.5 Voltage Variations.............................................................................................30
2.9 Protection Considerations........................................................................................32
2.9.1 Generator Protection..........................................................................................32
2.9.2 Loss of Main Protection ....................................................................................32
2.9.3 G59/1 Protection................................................................................................33
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Table of Contents 4
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Table of Contents 5
7 LIST OF FIGURES...................................................................................................85
8 REFERENCES ..........................................................................................................87
9 BIBLIOGRAPHY......................................................................................................89
10 APPENDIX ................................................................................................................90
10.1 Class Calculation .....................................................................................................90
10.2 Class Circle DiagramDoc ........................................................................................94
10.3 Class Circle DiagramView ....................................................................................100
10.4 Class Draw Axis ....................................................................................................112
10.5 Class Input Dialog .................................................................................................119
10.6 Class MainFrm ......................................................................................................130
10.7 Class P1Out ...........................................................................................................133
10.8 Class PowerFactor Dialog .....................................................................................136
10.9 Class PrintScreenDlg Dialog .................................................................................139
10.10 Class Sconstant Dialog ........................................................................................141
10.11 Resource.h ...........................................................................................................144
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Glossary 6
Glossary
1
definition taken from [5]
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Glossary 7
There are some important differences between the United Kingdom (UK) and the Austrian
system for circuit notation which are explained below:
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Introduction 8
1 Introduction
Increasing environmental concern since the beginning of the decade has promoted
considerable interest in the improvement of energy efficiency, the reduction of pollution,
and the development of non-fossil-fuel and renewable energy generating schemes.
Liberalisation of the electricity supply industries in many industrialised countries has
resulted in the market-driven dispatch of privately-owned generating plants of capacity
ranging from a few hundred kW up to 600 MW. Because such plant cannot be centrally
constrained and since it can be connected to national electricity systems at distribution
voltage, it is termed Embedded Generation (EG). System expansion in recent years in the
United Kingdom has largely been met by the installation of privately-owned EG plant
(mainly fast-access gas-turbine plant) which makes a significant contribution to total
capacity.
Many European Union (EU) member states actively encourage renewable energy
development by providing enhanced tariffs for energy produced from non-fossil fuel
sources or by subsidy of investment in renewable energy plant. Among the truly renewable
energy sources, wind and hydro power offer the greatest natural potential and the
technologies are mature, proven and market-ready. Wind turbines offer economy of scale
and commercially viable expansion tends to take the form of multi-machine wind farms,
with unit capacities below 500 kW. Water turbines do not offer the same economy of scale
and in many industrialised countries much of the large-scale hydro schemes were
developed many years ago, requiring considerable government-led investment that will
never again take place on the same scale, but there is considerable private interest in small
and mini-hydro power stations [22].
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Introduction 9
Figure 1-1 shows the worldwide consumption of crude oil, natural gas, coal and the ‘static
range’ of secure reserves in the years 1970, 1980, 1990 and 1997. ‘Static range’ defines the
temporal range for unchangeable production in the year specified and on the assumption of
no further prospecting.
mio. t oil-equivalent
It is noted that the discovery of new resources in the last two decades has increased at a
rate higher than consumption. The secured crude oil and natural gas reserves for 1970 were
only for 36 and 42 years respectively. Twenty-seven years later, in 1997, the static range
was 41 and 64 years respectively. It can be assumed that there will be the discovery and
development of considerable new resources in the future, and thereby no decrease in the
static range of fossil fuel. Another factor to be considered is that of political instability, as a
2
Data source: [1]
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Introduction 10
considerable part of the natural gas and crude oil reserves lies in potential crisis
regions [3].
Figure 1-2 shows the worldwide consumption of primary energy until 2050 in three
different scenarios predicted by the World Energy Council (WEC) and the International
Institutes for Applied Systems Analysis (IIASA).
24,8
Giga Tons Oil Equivalent [GTOE]
22%
A ...’high growth’
B ...’middle course’
19,8
C ...’ecologically driven’
22%
19%
15,4
13,6 14,2
16% 23%
11,4 32% 39%
17%
24%
9,0 24% 21%
20%
Case A (‘high growth’) addresses key development in energy supply. It varies principally
in the future to envisage coal on the one side, and nuclear and renewables, on the other.
Dominance of oil and gas is perpetuated to the end of the 21st century. After 2020 rapid
technological change in nuclear and renewable energy technologies will result in a
phaseout of fossil fuels for economic reasons rather than due to resource scarcity.
3
Data source: [29]
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Introduction 11
Course B (‘middle course’) incorporates more modest estimates of economic growth and
technological development, and the demise of trade barriers and expansion of new
arrangements facilitating international exchange. Compared with the Case A and C
scenario, it is more ‘pragmatic’, which is its main appeal.
Case C (‘ecologically driven’) is the most challenging. It is optimistic about technology
and geopolitics, but unlike Case A, it assumes unprecedented progressive international
cooperation focused explicitly on environmental protection and international equity. In
Case C, nuclear energy is at a crossroad. In this case there is a reduction of carbon
emissions in 2100 to 2 Gigatonnes of Carbon per year, one-third of today’s level [29].
World population is expected to double by the middle of the 21st century and economic
development will continue. According to the scenarios of the forecast, this results in a 1.5
to 3 fold increase in world economic output by 2020 and a 3 to 5 fold increase by 2050.
The average percentage increase of renewables for all three scenarios will be about 50%
between 1990 and 2020 and about 220% between 1990 and 2050.
In 1919 there were some 570 separate electricity undertakings in the UK operating 430
generating stations. There was no national transmission system and so the generators were
connected directly to distribution networks serving their local area. The 132 kV National
Grid was then built which allowed larger, more efficient generating stations to be used and
electricity to be transmitted to remote loads. After nationalisation in 1948 the power
system was developed using very large central power stations feeding a 275 kV or 400 kV
supergrid which provided the bulk supplies to the distribution networks.
The Energy Act of 1983 contained an obligation on the area electricity boards to purchase
power from independent generators, but this legislation failed to stimulate the wide scale
development of EG [10].
In 1990, UK’s Central Electricity Generating Board (CEGB) was privatised as part of the
restructuring of the electrical supply industry. This privatisation established conditions
which are likely to be more favourable, although the commercial and administrative
arrangements for EG in the new electricity market are complex and still being developed.
The economic benefits of promoting competition between the resulting companies have
been well documented, but attention must also be paid to the effects on the technical and
operational aspects of such a change.
Previously, the nationalised industry was effectively a monopolistic structure in which the
CEGB sold electricity to the 12 area distribution boards who each supplied a particular
defined geographical area. Under this structure the CEGB had control of both the
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Introduction 12
generation and the transmission system. Within the new structure, the ownership and
operation of the 400 kV and 275 kV transmission system was transferred to the newly
formed National Grid Company (NGC), with generation going to National Power,
PowerGen and Nuclear Electric, with exception of 2100 MW of hydroelectric pumped
storage capacity which remained within NGC. Since privatisation, an additional 46
generation licences have been issued to 22 independent generators. NGC was given the
remit to ‘develop and maintain an efficient, coordinated and economical transmission
system and to facilitate competition in the generation of electricity’. Local distribution
remained with the 12 area distribution boards, now known as Regional Electricity
Companies (REC), to which NGC supplies power.
The key features of this structure are that power is traded through an open commodity
market known as the Pool, and that generators have no assurance of market share, but have
to compete for business [14].
There has been a gradual increase in the amount of commissioned capacity of CHP and
renewable energy schemes throughout the country in recent years. Figure 1-3 shows that
the capacity of DG is about 3 GW, and this represents approximately 5% of the peak
demand in the UK.
4
Data source: [4]
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Introduction 13
The CHP schemes in Figure 1-3 tend to be less than 1 MW sites (83% of CHP sites were
less than 1 MW in 1998) although the 5% of sites which were above 10 MW generate 79%
of the total electricity. If we assume that the sites above 10 MW are not DG, then about
822 MW (21% of total) is DG. The remaining 3107 MW would then be transmission-
connected.
The renewable plant is generally contracted under the Non-Fossil Fuel Obligation (NFFO)
and the Scottish Renewable Order (SRO) and does not include large hydro or pumped
storage stations. The growth in renewable project development is driven by government
announcements of NFFO orders.
Large hydro plant, of which the majority is located in Scotland, are also defined as DG [5].
Large hydro is defined as plant belonging to companies with an aggregate hydro capacity
of more than 5 MW and the data used in Figure 1-3 exclude pumped storage schemes [4].
European initiatives, UK Government Renewable Orders NFFO 1-5, SRO 1-3, and
revisions to energy trading arrangement will increase significantly the European and UK
capacity of embedded and renewable generators. The renewed interest in EG has been
stimulated by a number of technical, commercial and environmental factors. These include
the high overall thermal efficiencies possible with CHP and the Government’s
commitment to new renewable energy sources such as landfill gas and wind power.
Permission for the construction of overhead circuits is difficult to obtain in certain areas
and so the use of diesel or small gas turbine generators is being considered for
reinforcement of the local distribution network.
There will be a large expansion of EG-capacity in the UK, if the Government is to meet its
targets of:
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Introduction 14
Embedded unconstrained renewable and CHP generating plant (EGs) at remote locations
in the rural distribution system nearly always results in unacceptable voltage violations –
both when the plant is in and out of service. The extent of this violation is determined by
the net reversal of load flow, which varies with time of day and seasonally, because the
availability of the energy resource and local load each vary to different chronological
patterns.
To ensure that the distribution system will absorb the exported power within a statutory
voltage envelope RECs include in the EG connection cost the reinforcement of those areas
of the distribution system at which violation would occur. In many cases the attribution of
these costs to new projects render them unfeasible and curtails the development of many
otherwise suitable sites.
The aim of this project is to develop a body of knowledge and software that will readily
establish the absorbence of the rural distribution network at a proposed point of
connection. This will not be a single capacity but an area of active and reactive power
within which the EG can operate without the net export leading to voltage violation.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 15
2 Embedded Generation
2.1 Basics
The supply of electricity to the distribution network by most EGs is determined either by
the heat demand and internal load of a CHP scheme or by the energy available from a
renewable energy source. Thus the power output of CHP schemes may be described as
‘heat lead’ while renewable energy schemes may be considered to be ‘source led’.
Small generators are not subject to central dispatch by the NGC and so do not respond
directly to the national electricity demand. However, some generators may respond to
system loading conditions indirectly through pricing signals received via tariffs or other
charging mechanisms. Although a small number of generators have been installed
specifically to support the distribution system, most schemes are operating independently
of the loading and voltage conditions on the local network. Wind turbines and some micro-
hydro plants use induction generators with no direct control over reactive power flow
while even CHP plant with synchronous generators may either use rather simple excitation
equipment or choose to run at unity power factor in order to minimise charges for reactive
power. Even those types of plants which technically can respond to distribution network
conditions may be quite inflexible for commercial or contractual reasons.
At present most EG is viewed as a source of energy, rather than generation capacity, and
the rules governing its connection reflect this. In the future, as the quantity of EG continues
to increase it may be necessary to integrate its operation much more closely with that of the
distribution network and to recognise its contribution to the capacity of the power system.
Although technically this is quite feasible, the required commercial and institutional
arrangements are not yet in place [10].
There are two ways generators can feed into the electricity supply system:
• At the level of the high voltage transmission network, i.e. into the National Grid. This
is what all large generators do and it is known as centralised generation.
• At the level of the lower voltage distribution network, i.e. directly into the Regional
Electricity Companies (RECs) network. This is known as Embedded Generation.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 16
REC Distribution
Network
Embedded
REC/PES REC/PES REC/PES REC/PES REC/PES
Generator
= Electricity meter
Figure 2-1: UK electricity supply industry
Basically, EGs deliver electricity to consumers in a more direct way than centralised
generators. The electricity is generated in closer proximity to the user, reducing the
distance over which the electricity has to travel and therefore reducing electrical losses.
The electricity is also delivered either at or closer to the correct voltage for distribution.
The electrical output from centralised generators has to be transformed up to a high
voltage, transmitted, and then transformed back down to the lower voltage.
Many problems can occur when renewable-energy generators are installed at the remote
extremities of power systems due both to the characteristics of the generators and the
weakness of the electricity network. There can be variations and reversals in load flow
causing electrical power transmission to exceed system thermal capacities, unacceptable
voltage regulation, increased fault levels and loss of stability.
To accept safely the power produced by new renewable energy generators it is frequently
necessary to up-grade and reinforce the existing electricity distribution system. This is an
expensive process that can jeopardise the economic feasibility of many new seemingly
attractive renewable energy schemes [22].
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 17
Many large industrial sites utilise CHP schemes. Steam is used to run a turbine and
generate electricity for the site. The steam leaves the turbine at a temperature that makes it
useful for heating the site or delivery to any processes that require heat. Some industrial
processes produce steam as a by-product and this makes this type of scheme a very viable
alternative to buying in electricity. In the past most of these schemes operated in isolation
but now with the change of legislation they can be embedded into the rest of the electricity
network. Excess power generated can be sold to the local distribution company increasing
profitability. Most of these types of plant use synchronous generators so that they can
operate in isolation.
The total installed hydro-electrical capacity in the world is currently close to 650 GW,
meeting approximately 18.5% of global electricity demand. The World Council estimates
that the world-wide growth of small-hydro capacity (general defined as less than 10 MW)
between 1990-2020 will be 12%, rising to a predicted total capacity of 65 GW, with
greatest investment in newly-industrialised or less-developed countries [22].
In the UK most potential large-scale hydro schemes have being exploited. In Scotland
hydro-generated electricity accounts for 40% of electricity capacity. The development of
small scale hydro generators has increased in the UK with the change of legislation and the
obligation to renewable energy sources. Now, previously unviable schemes can be
developed as an EG. Within the UK, the total small-scale accessible and practicable
resource by 2005 is estimated to reach 3.9 TWh/yr (including existing sites) with 80% of
the unexploited resources in Scotland [19].
• Single generators which have a large diameter blade and a medium generating
capacity. Because of their large size they are not considered as EG and in some cases
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 18
they form the main source of generating especially on Island communities. Most large
wind generators were developed from research and usually exist in prototype form.
Their experimental status makes them unreliable and there is usually difficulty in
obtaining spare parts [19].
• Wind farms, which are the most common type of wind generation, contain a number
of small generators in one area. The size of each individual generator may be small
but the aggregate capacity can be large. Wind farms are becoming increasingly more
widespread and the technology is becoming standardised and reliable. The large
number at any one site means that some turbines can be switched off for repairs
without having any major effects. These farms are normally placed in remote rural
areas and are connected into the local distribution network.
2.3.4 Others
There has been much research into ways of harnessing renewable energy from different
natural sources. Much of the research was carried out in 1970s, during the oil crises but
now with the commitments to enhance development of renewable energy sources funds for
research have been increased. These include:
• Geothermal energy
Geothermal energy, in the broadest sense, is the natural heat of the earth.
Temperatures in the earth rise with increasing depth. Geothermal energy may be
relevant in those parts of the world where the heat of the earth’s core penetrates the
cold crust and comes near to the surface [13].
• Ocean energy
There are two different types of ocean energy: wave power and tidal power. Wave
power uses small machines that can tap the power of the waves by bobbing up and
down. Tidal power is similar in all essential respects to hydroelectric power. The
difference is that tidal-electric power is obtained from the oscillatory flow of water in
the filling and emptying of partially enclosed coastal basins during the semidiurnal
rise and fall of the ocean tides [16].
• Photovoltaic energy
This means converting the sun’s energy directly into electricity, using photovoltaic
cells.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 19
The commercial advantages of small generating plant arise from the benefits of being
‘embedded’ in distribution networks and the costs which it can avoid [5]:
• DG plant contracted to a supplier can reduce the suppliers liability for electrical
losses in the transmission- and distribution-system as well as some charges for the use
of the distribution network;
• the operating regime of CHP plant is governed by the heat and/or steam demand on-
site and so it can run as and when it is required;
• both CHP and renewables are promoted as part of the Government’s energy and
environmental programmes.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 20
The statutory requirements for the operation of a private generating plant connected to the
electricity supply network are set out in the Electricity Supply Regulation from 1988. The
Energy Act (1983) permits any private person or company to use the electricity utility’s
transmission and distribution networks to transmit energy [19].
In the Electricity Supply Industry there are extensive statutory requirements covering the
transmission and distribution of electricity. These requirements include statutory
obligations with respect to frequency, voltage, fault level, fault detection and protection.
Before permission to connect an EG is given by the REC there is an established procedure
that a design and application has to go through [2]:
• Connection Quotation: When the details are agreed between REC and developer the
REC makes a formal connection quotation. Planning permission and wayleaves must
be obtained both for the connection to the grid and also the necessary buildings and
structures.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 21
Once the output power and speed of the prime mover are determined, a fundamental choice
that developers must make is whether to install synchronous or induction generators. The
major differences between these two include method of excitation, operating efficiency and
power factor, fault contribution and harmonic generation [6].
Synchronous generators are the traditional form of EGs. They are widely used and make
up the bulk of EGs. They are called synchronous generators because they generate
electricity only at synchronous speed. In the case of a generator acting in isolation this
speed is set by the governor. When a synchronous generator is brought on-line it is first
brought up to speed and then carefully synchronised. This is done by comparing frequency,
voltage and phase. After the connection the frequency of the grid controls the speed of the
generator.
In the steady-state a synchronous generator with a constant terminal voltage may be
represented by the simplified diagram and the phasor diagram shown in Figure 2-2, where
M is the mechanical prime mover, E is the voltage induced in the stator due to the rotating
flux from the rotor, XS is the armature reaction, V is the voltage of the network, δ is the
load angle, φ is the phase angle and cosφ the power factor.
XS E
IXS
M E V
δ
φ V
I
Figure 2-2: Small synchronous generator connected to the network and phasor diagram
It is common to find descriptions of how the governors of large generators may be set to
maintain system frequency and the excitation system to control voltage. These
considerations do not apply to a small generator connected to a utility distribution system.
The generator has little control over its terminal voltage and none over the system
frequency, which is fixed by the network. Therefore the governor is used to control the real
power output of the unit and the excitation system determine the reactive power flow [10].
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 22
For the simple circuit of Figure 2-2 it may be shown that the generator output, per phase,
of real and reactive power is given by:
E⋅V
P= ⋅ sin δ Equ. 2-1
XS
E⋅V V2
Q= ⋅ cos δ − Equ. 2-2
XS XS
Recalling that both V and XS are constant and that δ is likely to be less than 30°, these
simple equations illustrate how:
• The real power output (P) is controlled by the governor or the mechanical prime
mover which determines the applied torque and hence the power angle (δ).
• The reactive power (Q) is controlled by the excitation system which varies the
magnitude of the induced stator voltage (E).
A synchronous generator is excited by a dc-current applied by the field winding. In
statically excited machines this dc is derived from the generator output by rectifying the ac
and applying it to the rotor via slip rings. Modern brushless excitation systems use a
permanent magnet exciter to supply this power. The armature of the exciter and the
rectifier bridge are located on the rotor so power is transferred without the need of slip
rings. This assists voltage build up at start but means that the generator will continue to
provide fault current even with a short-circuit close to its terminals.
Synchronous generators are attractive as they can operate in a number of modes and allow
independent control of real and reactive power flow. However, they need to be carefully
synchronised to the grid and brushless excitation leads to complex rotor constructions
which makes them expensive, although the large number of synchronous machines which
are used in packaged standby diesel generating sets leads to economies of scale in their
production [10].
Induction generators are simpler than synchronous generators, only the stator is excited.
They are, in principle, motors with torque applied to the rotor shaft. Induction generators
are becoming popular because of their simple construction, the fact that they do not need to
be synchronised to the grid and their ability to introduce damping into the drive train of the
generating set. They are commonly used in wind generators as they are able to absorb the
fluctuating torque produced by the blades passing the tower. Small synchronous generators
are not capable of providing adequate damping to control this torque. Small, high slip
induction generators possess very good damping characteristics but it may be noted that, as
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 23
they increases in size, the transient response of induction generators to applied torque starts
resemble that of synchronous machines [10].
The operation of an induction generator may be understood using the familiar induction
motor equivalent circuit of Figure 2-3, where s is the slip, R1 is the stator resistance (stator
copper loss), X1 is the stator reactance, Xm is the magnetising reactance, RC is the
magnetising resistance (iron loss), X2’ is the rotor reactance referred to the stator and R2’ is
the rotor resistance referred to the stator (rotor copper loss).
R1 R2’
V1 RC R2’(1-s)/s
The usual simple analysis of this circuit leads to the torque/speed characteristic shown in
Figure 2-4, where s is the slip, τ is the shaft torque, sM is the slip at τmax, -sM is the slip at
τmin, ω is the shaft speed and ωs is the synchronous shaft speed.
motoring generating
τ
τmax
1 sM 0 -sM -1 s
0 no ωS 2ωS ω
load
normal
generation
τmin
Operating as a generator the slip is negative and the peak torque is larger than when the
same machine is motoring. Variations in prime mover torque are absorbed by an increase
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 24
in rotor slip. Induction machines require magnetising current to create a magnetic field,
thus an induction generator can not operate without a connected electricity supply unless it
is separately excited. The field in the stator rotates at the same frequency as the grid and
does not vary with torque applied or time. To produce active power the rotor rotates at
above synchronous speed. The percentage difference between the speed of the rotor and
the synchronous speed of the magnetic field of the stator is called the slip. The slip varies
with the torque supplied by the prime mover. Unlike the synchronous machine the reactive
power requirement of an induction machine remains constant and the power factor will
vary from 0 to 0.9 leading and cannot be set like synchronous generators. The generator’s
power factor will progressively decrease as the output power is reduced and falls off
rapidly at light load.
Switching in of induction generators is simpler than of synchronous generators. The
generator may be brought up to speed as a motor with the reactive and real power being
supplied by the grid. Then the active supply to the prime mover can be switched, the prime
mover accelerates above synchronous speed and the generator then supplies real power to
the grid.
The initial fault contribution from an induction generator is likely to be lower than that
from a synchronous generator of equivalent capacity. An induction generator cannot make
a sustained contribution to a ‘close-up’ short-circuit in the system. Provided that the short-
circuit causes the voltage on the stator to collapse, the rotating magnetic field will
disappear and the machine will stop generating. Therefore the fault current of an induction
machine is generally not relied on for the operation of any protective relays. The sub-
transient fault current of a synchronous generator will contribute to the fault current of the
network and may lead to overstressing of switchgear. In both cases the initial fault
contribution may be estimated from the sub-transient reactance of the machines, with
induction generators having a higher reactance than synchronous.
The choice of the type of machines to use for an EG is always left to the developer.
Induction machines are usually cheaper than synchronous machines, they are simpler and
more robust in construction, there is no apparent need for a governor or voltage regulator
and synchronising and protection equipment is simpler and less expensive [24]. For these
reasons induction machines are usually chosen initially provided that they can be
magnetised from the grid. Developers may forget the possibility that they may have to
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 25
purchase the reactive power to magnetise their machine from the REC and this will be
expensive.
In some cases the choice will be determined by the nature of the prime mover. The
generators of wind turbines experience strong periodic torque pulsations as the blades pass
the tower as well as those brought about by changes in wind speed. Synchronous machines
have only limited damping and careful design is necessary to control even the cyclic torque
variation in a reciprocating engine. For this reason induction machines are normally used
for wind power generation and synchronous machines are used where the delivery of
mechanical power from the prime mover has a much lower torque variance. Examples of
these are:
prime
rectifier X transformer
mover
M
generator current source grid
naturally commutated
convertor
Figure 2-5: Variable speed convertor (using thyristors)
This arrangement is well proven and uses thyristors as switching devices. However, the
power factor of the network side convertor is proportional to the dc link voltage which, on
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 26
weak networks, must be kept low. Also, significant harmonics currents are injected into the
network and so filtering is likely to be required [10].
A more recent development is the voltage source, forced commutated convertor, shown in
Figure 2-6. This uses either Insulated-Gate Bipolar Transistors (IGBTs) or Gate-Turn-Off
thyristors (GTOs) as the switches.
prime rectifier
mover transformer
M C
generator voltage source grid
forced commutated
convertor
Figure 2-6: Variable speed convertor (using IGBTs)
This convertor can run at any desired power factor and, using fast switching in a Pulse
Width Modulation (PWM) pattern, does not produce low-order harmonics. Although much
more benign to the network, these convertors are at present rather expensive and rapid
switching of the devices can lead to significant power losses [10].
Energy schemes with exploit renewable energy resources in particular have to be located
where the source of primary energy is available. This may be in a geographically or
electrically remote area, therefore the EG is often installed in areas where the grid system
is weak. The presence of the EG can lead to real and reactive power flows in rather
direction depending on the powers produced and absorbed locally, and this must be
predicted carefully for all local loads [5]. The design, selection and application of EG plant
requires to be assessed carefully to ensure satisfactory operation under all conditions,
including the ability of the distribution grid to successfully integrate the generators
presence.
Passive distribution networks were originally designed to deliver electricity from the main
transmission system to remote consumers, with real and reactive power generally flowing
towards the edge of the system in the direction of the voltage gradient. Particularly with
single source radial distribution feeders, transformers along the feeders are tapped up to
compensate for the voltage drop along the line under maximum loading to ensure that
consumers at the remote end receive supplies within the statutory voltage limits. Due to the
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 27
remote location of renewable energy resources, many EGs are now connected to the
remote ends of distribution networks at, or below 33kV, operating in parallel with the
existing grid system. Integrating EGs to operate in parallel with the existing grid system
produces an active distribution network with bi-directional power flows (depending on
loading conditions), resulting in a change in losses and variations in voltage. This is
illustrated in Figure 2-7 by considering the effects of increasing generator output power in
a feeder with a fixed local load.
33 kV
AVC
11 kV
Power transmitted
PLine, QLine
400 V
Local Load
Embedded PL, QL
Generator
PG, QG
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 28
3. If the generator output increases until the kW and kVAr generated just meets that
demanded by the local load or load distributed along the line, losses in the line are zero
and the voltage profile is virtually flat.
4. Where the active and reactive power produced exceed that consumed locally, but is less
than twice the local load demand, the excesses are exported along the line towards the
bulk supply point, causing an increase in losses and local voltage rise, but these will be
comparable in magnitude with those of the voltage drops where the grid supplies the
local load.
5. If the active and reactive power produced is more than twice the local load demand, the
increase in load flow and losses may exceed the thermal limits of the line and the local
voltage may exceed the statutory maximum.
The 11 kV or 33 kV circuit breakers within the supply authority boundary may have
current- or impedance-operated protection relays set to protect the system for
unidirectional power flow. Their operation may become ineffective or spurious as a result
in the re-direction and changes to current flow in the system.
The transmission of additional real or reactive power – in either direction increases feeder
losses. A large synchronous generator operated overexcited exports reactive power that
exaggerates voltage rise and increases system losses. The presence of a large induction
generator which requires to be magnetised from the grid will add to the system losses as
reactive power is supplied to magnetise it, but a fortunate consequence is that absorbing
reactive power at the remote end reduces voltage rise. If a large quantity of reactive power
is carried, then the maximum real power that can be transmitted within the thermal limit of
the line is reduced.
Larger sites such as multi-machine wind farms or large-hydro power stations are usually
thermally limited by the capacity of the rural system, and the costs of upgrading
substations and/or re-conductoring sections of line are most frequently attributed to the
scheme proposed. Even if there are no problems brought about by thermal limits the next
most prevalent limit occurs due to increased voltage variations [22].
It is conventional practice for the network voltage to be controlled by Automatic Voltage
Control (AVC), such as auto-tap changing transformers, (negative reactance) Line Drop
Compensation schemes (LDC) and AVC relays. The AVC voltage reference is usually on
the second winding of the supply transformer, as shown in Figure 2-7. When the EG is
exporting, reverse power flow through the transformer causes erroneous operation of the
voltage sensing relay and tap-changing mechanism. Protection settings for the supply
authority under- and over-voltage relays that are appropriate for the condition where the
generator is out of service may cause the relays to operate and trip the authority circuit
breakers when the generator is in service and loaded (or vice-versa). Time variant energy
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 29
sources (wind farms, wave-devices) without storage produce power and voltage variations.
This is a serious problem because it causes the AVC equipment operating continually
rather than occasionally, leading to increased wear and maintenance [11].
Embedded generation will influence the power quality of distribution networks. The usual
causes of concern are transient network voltage disturbance, referred to as ‘flicker’ because
of its effects on lighting, and harmonic distortion of the voltage waveform. Voltage flicker
may be caused either by the connection and disconnection of generators or by transient
torque pulsations from the prime mover being translated into network voltage variations.
Harmonic distortion of the network voltage is generally caused by the power electronic
interfaces which are being used increasingly for the connection of EGs, although directly
connected generators may also have an effect.
Standards are in place to control the connection of loads likely to degrade the power
quality of the distribution network, and these are also applied to EGs. Voltage flicker and
harmonic voltage distortion tend to be most significant in rural distribution systems which
have a low fault level and hence high source impedance. Surprisingly, the connection of
rotating EGs may act to improve the power quality of the network by increasing the fault
level and so reducing transient voltage variations [11].
Where the electricity supply system is heavily reinforced the prospective three phase
symmetrical short-circuit fault level of the grid is likely to exceed that contributed by the
EG towards an intervening fault. In such circumstances it is the developers responsibility
to ensure that their new switchgear is adequately fault rated for the total prospective (and
future) grid fault current and the contribution from the generator.
A geographical effect of installing the EG at a remote point is that the system fault level
decreases with increasing series impedance and the REC switchgear at the remote end may
have a fault capacity below that resulting once the EG was connected. Where the supply
grid is older or weaker the increases fault level due to the EG plant may cause the total
fault level at points out in the system to exceed the supply authority switchgear short-
circuit rating. If the short-circuit fault level at any point in the system exceeds the fault
rating of the switchgear this will require the installation of new switchgear whose costs
may be included in the costs of connecting the new EG.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 30
It should be noted that while the REC may quote a fault level at the point of connection,
they reserve the right to reinforce fully the network up to this point, and this future fault
level may exceed existing values and must be taken into account.
Synchronous generators with permanent magnets or otherwise secure excitation supplies
and low reactances contribute the highest short-circuit currents. Smaller EGs will have less
impact on any limit imposed by system fault level or capacity, and will integrate more
easily in remote areas. Installing the EG at a location closer to the primary substation will
mean that the existing equipment is likely to have a higher fault capacity with a margin that
would allow the connection of a larger EG. The likelihood of the EG exceeding the fault
capacity is proportional to both EG capacity and distance from the primary substation [22].
Steady-state and transient stability analysis is necessary to determine the ability of the
embedded synchronous generator to remain synchronised following small disturbances in
the grid system (e.g. gradual changes in load, excitation or prime mover input) and large
disturbances (e.g. severe load changes, switching operations and electrical faults). During
such disturbances there is a dynamic mismatch between mechanical power input to the
generator and that absorbed to produce the electrical power accepted by the grid
connection. This results in acceleration, dynamic change in shaft speed and rotor angle and
possible loss of synchronism. The generator behaviour and overall stability depends on
Many generators may be owned by organisations without any direct interest in power
quality and its main control will therefore be through the connection agreement. One of the
main concerns about the effect EG has on power quality in general is the steady-state
voltage variation, which will be considered in Chapter 3 and 4. The EG capacity is
normally limited by the maximum over-voltage created at any point in the REC
distribution network, which is usually at the most remote point closest to the EG.
Following rationalisation in 1995, the statutory voltage variation for LV-distribution
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 31
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 32
The addition of rotating EG plant will raise the network fault level and change the X/R-
ratio of the system as seen from the point of fault. In areas where the distribution system
fault level is already high, careful calculations will be required to ensure that the fault
ratings of existing switchgear and other equipment are not exceeded. If equipment ratings
are exceeded then additional impedance, in the form of transformers or reactors, may be
inserted in the connection to the generator, although this will increase voltage drops and
may influence adversely transient stability [11].
Distribution networks are normally designed to supply passive loads. To enhance supply
reliability, it is common practice in the UK to provide auto-reclose circuit breakers. Should
a fault occur, the protection will open the breaker for a limited period, then close it again.
If the fault does not persist, supply will be restored. Otherwise the breaker will open again.
There may be several reclosure operations before the protection deems the fault to be
persistent.
The presence of EG in the utility network poses a problem for the auto-reclosure operation.
There is the probability of an out-of-phase reclosure, onto what may now be an active
network. To avoid this, the UK regulations for EG require the machine to be fitted with
Loss Of Main (LOM) protection. The aim is to ensure that, should the generator and its
load become isolated from the network as a result of fault clearance on the supply line, the
ensuing auto-reclosure operation will not result in an out-of-phase reclosure. The generator
should be disconnected to clear the way for safe auto-reclosure. It may then reconnected in
the usual way.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Embedded Generation 33
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 34
In the analysis of power networks instead of using actual values or quantities it is usual to
express them as fractions of reference quantities, such as rated or full-load values. These
fractions are called per-unit (denoted by p.u.) and the p.u. value of any quantity is defined
as shown below.
Some authorities express the p.u. value as percentage. Although the use of p.u. values may
at first sight seem a rather indirect method of expression, there are in fact great advantages;
they are as follows [28]:
• The apparatus considered may vary widely in size; losses and volt drops will also
vary considerably. For apparatus of the same general type the p.u. volt drops and
losses are in the same order regardless of size.
• By the choice of appropriate voltage bases the solution of networks containing
several transformers is facilitated. Since 1.0 per-unit is the same at any level –
transformers may be represented by a single leakage reactance and no voltage ratio.
• Per-unit values lend themselves more readily to automatic computation.
• The use of 3 ’s in the three phase calculation is reduced.
For instance to a base of one minute, one second is 1/60 per-unit. To a base of one kilowatt
a 60 W light bulb is rated 0.06 p.u., and a 100 W bulb 0.1 p.u..
All of per-unit analysis rests on the correct and consistent choice of a common base, and
accurate conversion of circuit parameters into and out of that base. A minimum of four
base quantities is required to completely define a per-unit system, these are: voltage,
current, power and impedance. If two of them are set arbitrarily, then the other two are
automatically fixed. For circuit analysis a base apparent power [VA] is chosen, and 1.0 p.u.
voltage is prescribed throughout the circuit, so the base currents and base impedances are
fully defined and a per-unit computation may be carried out [23].
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 35
Base apparent power [VA] S b = Base current [A] × Base voltage [V] = I b .Vb Equ. 3-1
Actual voltage [ V]
Per-unit voltage [p.u.] Vp.u. = Equ. 3-5
Base voltage [ V]
The source of the simple circuit shown in Figure 3-1 is supplying active energy to the load
in one direction only. At the same time an interchange of reactive energy is taking place
between the source and the load of average value zero, but of peak value V.Isinφ. This
latter quantity is known as the reactive power Q and the unit is Volt-Ampere reactive
[VAr]. The interchange of energy between the source and the inductive and capacitive
elements of the load (i.e. the magnetic and electric fields) takes place at twice the supply
frequency. It is possible to think, therefore, of a power component P [Watt] of magnitude
V.Icosφ and a reactive-power component Q [VAr] equal to V.Isinφ, where φ is the phase
angle, i.e. the angle between I and V. It should be stressed, however, that the two quantities
P and Q are physically quite different.
I V
V Z=R+jωL φ I
φv φi
Figure 3-1: Voltage source and load; phasor diagram
The quantity S [VA], known as the complex power, may be found by multiplying V by the
complex conjugate of I or vice versa. The case when I lags V should be considered, and
S=V*.I assumed.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 36
S = P − jQ Equ. 3-6
Next assume
(φ V −φi )
S = V ⋅ I* = V ⋅ e jφV × I ⋅ e − jφi = V ⋅ I ⋅ e j = V ⋅ I ⋅ e jφ
S = P + jQ Equ. 3-7
Obviously both methods above give the correct magnitudes for P and Q but the sign of Q is
different. The method used is arbitrarily decided and the convention to be adopted in this
thesis is as follows:
The volt-ampere reactive absorbed by an inductive load shall be considered positive, and
by a capacitive load negative; hence S=V.I*. This convention is also recommended by the
International Electrotechnical Commission.
In a network the net energy is the sum of the various inductive and capacitive stored
energies present. The net value of reactive power is the sum of the VArs absorbed by the
various components present, taking due account of the sign. Lagging VArs can be
considered as either being produced or absorbed in a circuit; a capacitive load can be
though of as generating lagging VArs. Assuming that an inductive load is represented by
R+jX and that the V.I* convention is used then an inductive load absorbs positive or
lagging VArs and a capacitive load produces lagging VArs [28].
The magnitude of S, S = P 2 + Q 2 , is the apparent power. The apparent power gives a
direct indication of heating and is used as a rating unit of power equipment.
φ I S
Q
φi φ
φv
P
Figure 3-2: Phasor diagram and power triangle for an inductive load (lagging pf)
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 37
I V
P
φ
φ
Q
S
φv
φi
Figure 3-3: Phasor diagram and power triangle for a capacitive load (leading pf)
The reactive power Q is positive when the phase angle φ (φ = φv - φi) between voltage and
current is positive (i.e., when the load impedance is inductive, and I lags V) as shown in
Figure 3-2. Q is negative when φ is negative (i.e., when load impedance is capacitive and I
leads V) as shown in Figure 3-3 [17].
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 38
IS IR
Z1 Z2
VS Y VR
VS = VR + I R ⋅ Z 2 + I S ⋅ Z1 = VR + I R ⋅ Z 2 + Z1 ⋅ Y ⋅ VR + I R ⋅ Z1 + I R ⋅ Y ⋅ Z1 ⋅ Z 2
A = 1 + Y ⋅ Z1 B = Z1 + Z 2 + Y ⋅ Z1 ⋅ Z 2
VS = A ⋅ VR + B ⋅ I R Equ. 3-11
I S = C ⋅ VR + D ⋅ I R Equ. 3-12
⎡VS ⎤ ⎡A B ⎤ ⎡VR ⎤
⎢ I ⎥ = ⎢ C D⎥ ⎢ I ⎥ Equ. 3-13
⎣ S⎦ ⎣ ⎦⎣ R⎦
Since the unsymmetrical T-circuit is valid for measuring the end conditions of any passive,
linear, and bilateral four-terminal network Equation 3-13 is valid for any such network.
The constants A, B, C and D are called the generalized circuit constants or the ABCD-
constants of the network, and they can be evaluated for any such four-terminal network.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 39
Solving the Equation 3-13 for VR and IR and using the known relationship AD - BC = 1
[18], we obtain
⎡VR ⎤ ⎡ D − B⎤ ⎡VS ⎤
⎢ I ⎥ = ⎢− C A ⎥ ⎢ I ⎥ Equ. 3-14
⎣ R⎦ ⎣ ⎦⎣ S⎦
IS IR
VS A B C D VR
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 40
The classification of power transmission lines according to length depends upon what
approximations are justified in treating the parameters of the line. Resistance, inductance,
and capacitance are uniformly distributed along the line, and exact calculations of long
lines must recognize this fact. For short lines, the total capacitive susceptance is negligible
and may be omitted.
The parameters ABCD of a four-terminal network for a short-transmission line, as seen in
Figure 3-6, become
⎡A B ⎤ ⎡ 1 0⎤
⎢ C D⎥ = ⎢ Z = Z ∠θ 1 ⎥⎦
Equ. 3-15
⎣ ⎦ ⎣
The circuit shown in Figure 3-6 is very important as it represents the simplest electrical
model for a synchronous generator (VS) feeding into a power system represented by a
voltage source (VR). For this network the sign of power entering a boundary is assumed
positive and leaving a boundary negative.
I ∠-φ
Z ∠θ
SS VS ∠δS VR ∠δR SR
The determination of the voltages and currents in a network can obviously be achieved by
means of complex notation, but in power systems usually active power (P) and reactive
power (Q) are specified.
For the assumed direction of current
⎛ V − VR ⎞ ⎛ VS e jδS − VR e jδ R ⎞ VS j( δS −θ ) VR j(δ R −θ )
I = ⎜⎜ S ⎟⎟ = ⎜⎜ ⎟=
⎟ Z e − e Equ. 3-16
⎝ Z ⎠ ⎝ Ze jθ ⎠ Z
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 41
V ⋅V
2
V
S S = S R e j ( δ S − δ R + θ ) − S e jθ Equ. 3-17
Z Z
Thus, the real and reactive power at the sending end are
VS ⋅ VR
2
V
PS = Re (SS ) = ⋅ cos (δ S − δ R + θ) − S ⋅ cos (θ) Equ. 3-18
Z Z
V ⋅V
2
V
Q S = Im (SS ) = S R ⋅ sin (δ S − δ R + θ) − S ⋅ sin (θ) Equ. 3-19
Z Z
V ⋅V
2
V
S R = R S e j ( δ R − δ S + θ ) − R e jθ Equ. 3-20
Z Z
VR ⋅ VS
2
V
PR = Re (S R ) = ⋅ cos (δ R − δ S + θ) − R ⋅ cos (θ) Equ. 3-21
Z Z
V ⋅V
2
V
Q R = Im (S R ) = R S ⋅ sin (δ R − δ S + θ) − R ⋅ sin (θ) Equ. 3-22
Z Z
Power transmission lines have small resistance compared to the reactance. Assuming
R = 0, θ = 90 (i.e. Z = X∠90°) and δ = δ S − δ R , the above equations become
VS ⋅ VR
PS = − ⋅ sin (δ ) Equ. 3-23
X
V ⋅V
2
V
Q S = S R ⋅ cos (δ ) − S Equ. 3-24
X X
VR ⋅ VS
PR = ⋅ sin (δ ) Equ. 3-25
X
VR ⋅ VS
2
V
QR = ⋅ cos (δ ) − R Equ. 3-26
X X
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 42
Since R = 0, there are no transmission line losses and the real power sent equals the real
power received.
From the above results, for a typical power system with small R/X ratio, the following
important observations are made:
1. Equations 3-23 and 3-25 show that small changes in δS and δR will have a significant
effect in the real power flow, while small changes in voltage magnitudes will not have
appreciable effect on the real power flow. Therefore, the flow of real power on a
transmission line is governed mainly by the angle difference of the terminal voltages
(i.e., P12 ∝ sin δ), where δ = δS - δR. If VS leads VR , δ is positive and the real power
flows from the sending to the receiving end. If VS lags VR , δ is negative and the real
power flows from the receiving to the sending end.
2. Assuming R = 0, the theoretical maximum power (static transmission capacity) occurs
when δ = 90° and the maximum power transfer is given by
VS ⋅ VR
Pmax = Equ. 3-27
X
3. To maintain transient stability, the power system is usually operated with a small load
angle δ. Also, from Equations 3-24 and 3-26 it is seen that the reactive power flow is
determined by the magnitude difference of the two terminal voltages, (i.e.,
Q∝ VS − VR ).
4. For R = 0 and the assumed direction of current, voltage and power the sign of the
receiving-end real power PR and the receiving-end reactive power QR is as follows:
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 43
Icosφ.jX
φ
Isinφ.jX
I.jX
VR
VS
Isinφ
I
δ
φ
Icosφ
Figure 3-7: Phasor diagram of a synchronous machine and a short-transmission line with R = 0
respectively
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 44
The current I may be separated into real and reactive power (in- and out-of phase)
components I cos φ and I sin φ . These components may be considered to induce separate
stator voltage drops I cos φ ⋅ jX and I sin φ ⋅ jX , as shown in Figure 3-7. This resolution is
also consistent with resolving the short sides of the triangle in which I ⋅ jX is hypotenuse.
From the triangle containing VS as hypotenuse the following voltage relationships emerge
VS sin (δ ) = I cos(φ) ⋅ X
VS sin (δ )
I cos(φ ) = Equ. 3-28
X
VS cos(δ ) − VR
I sin (φ ) = Equ. 3-29
X
Multiplying each of the above active and reactive components of current by voltage gives
the real and reactive electrical powers in terms of equivalent circuit parameters:
VR ⋅ VS
PR = VR ⋅ I cos(φ ) = ⋅ sin (δ ) Equ. 3-30
X
VR ⋅ VS
2
V
Q R = VR ⋅ I sin (φ) = ⋅ cos (δ ) − R Equ. 3-31
X X
The x-direction of the phasor diagram VS.sin(δ) represents real power, and the y-direction
of the phasor diagram VS.cos(δ)-VR represents reactive power. The voltage phasor diagram
may be superimposed on the P-Q coordinate system to create the operating chart, provided
that a common means of scaling the respective axes can be established. The origin of the
P-Q plane must be located on the tip of VR such that δ = 0° and φ = 90° corresponds to
zero power. To align the two graphical representations a common scale must be found
which equates distance on a voltage plane with distance on a P-Q plane.
Since
VR ⋅ VS
PR = ⋅ sin (δ ) Equ. 3-32
X
when the system is operating at maximum power P = 1.0 p.u., VR = 1.0 p.u., and since
sin δ = 1. From these conditions
This equation defines the relationship between the scales in the voltage phasor diagram and
the P-Q plane.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 45
Q [p.u.]
1.0
0.8
0.6
st.
f =con
p
0.4
S=
con
st V
S3 =c
0.2 on
st. (
V
VS S3 >V
P [p.u.] φ )
R
1.0 0.8 0.6 0.4 0.2 VR -0.2 -0.4 -0.6 -0.8 -1.0
V
S2 =c
0.8 on
st.
(V
S2
=V
0.6
R
)
VS
0.4
1
=c
o
ns
t.(
V S1
1.25 1.0 0.8 0.6 0.4 0.2 0 0.2 0.4 0.6 0.8 1.0
Figure 3-8: Circle diagram for VR = constant and X = 1.25 p.u. (R = 0 p.u.)
Figure 3-8 shows the operating chart for a short-transmission line with the receiving-end
voltage VR = constant, the sending-end voltage VS = variable, the resistance R = 0 p.u. and
the inductive reactance X = 1.25 p.u.. This circle diagram is exactly the same as for the
synchronous machine. Rotating VS round ± 90° from VR (which defines 1.0 p.u. voltage)
to the horizontal sets the voltage scales. In this position setting VS = 1.25 p.u. defines
maximum (1 p.u.) power. Projecting lines up from VS = 1.25 p.u. till they cross the P axis
(drawn on the tip of VR) defines ± 1 p.u. power and the scale for the P and Q axes. The
framework of the diagram is complete. At any operating point P,Q in the plane the per-unit
values of P and Q now define VS and δ. Per-unit changes in VS and δ also define new P
and Q and power factors. The diagram also shows constant sending-end voltage circles
(VS1 < VR, VS2 = VR, VS3 > VR), a constant power circle (S = const.) and a constant power
factor line (pf = const.) [23].
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 46
At the next stage the equivalent circuit of a short-transmission line represented by a series
impedance Z = R + jX between the sending and receiving ends of the circuit is considered,
as shown in Figure 3-6. Figure 3-9 is the phasor diagram of the circuit and shows the
sending-end voltage VR, which is the reference, and the voltage drops in the resistance and
inductive reactance of the line, I.R and I.jX, respectively.
VS
I.Ζ
I.jX
δ VR
φ I.cosφ
I.R
I.sinφ
For these assumptions it is also possible to draw a diagram with its coordinates real power
on the horizontal axis and reactive power on the vertical axis. Each load at the receiving
end is represented on the chart by a point determined by the real and reactive power of the
load. This circle diagram is developed from the phasor diagram shown in Figure 3-10.
VS
I.Ζ
n δ VR θ−φ
φ O
θ
I
Figure 3-10: Phasor diagram of a two-sources network
All the phasors except the current I on the diagram of Figure 3-10 are voltages. Since a
diagram of real and reactive power is desired, all the quantities must be multiplied by
current, and since power at the receiving end of the network should be obtained, it is
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 47
obvious to choose VR/Z as the multiplier. VR/Z has the dimensions of current, and the
product of the voltage I.Z and the current VR/Z is VR.I, the volt-amperes at the receiving-
end of the network.
VR is the reference phasor in Figure 3-10 and its phase angle is chosen at zero degree. The
phasor VR/Z is displaced from the reference phasor by the angle -θ, since
VR ∠0° VR VR
= ∠−θ = ⋅ e − jθ Equ. 3-34
Z ∠θ Z Z
Therefore, multiplication of the phasor of voltage on the diagram of Figure 3-10 by VR/Z
shifts all the phasors, and the whole diagram, through the angle -θ. The result is the power
diagram of Figure 3-11.
reactive
power
θ−δ
2
VR VSVR
Z Z
θ real power
O φ
VRI
k
For convenience, the origin of the coordinate system is placed at point O in the new
diagram. Now VR.I lies at an angle -φ, or at an angle φ below the horizontal. Since VR.I
intersects the horizontal axis at the origin at the angle by which the current lags the
voltage, the horizontal component of VR.I is real power, and the vertical component is
reactive power. The coordinate axes may be marked in watts and VArs.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 48
In constructing Figure 3-11, current was taken as lagging the voltage at the load. Thus, the
load is inductive, and on the diagram the VArs drawn by an inductive load, or flowing into
an inductive load, are negative. In order to conform to the convention adopted in
Chapter 3.2 (a positive sign indicates the lagging VArs taken by an inductive load), the
diagram will rotate. The required alteration is the interchanging of points below and above
the horizontal axis by rotating the whole diagram about the horizontal axis. To use the
same direction of the P-axis as for the circle diagram of a synchronous machine
(Figure 3-8), it is also necessary to change +P and –P by rotating the diagram on the
vertical axis. Figure 3-12 is the result. Now the left side of the nO-line in the picture
indicates positive load angle (+δ) and the right side negative load angle (-δ).
+Q
k
|VR|.|I|
+P φ O -P
θ d
|VS|.|VR|
|Z | |VR |
2
|Z |
δ
δpositive δnegative
θ−δ
n
c
-Q
Figure 3-12: Receiving-end power diagram after rotation
Distances on Figure 3-12 are marked only as magnitudes since they do not have the same
angular relation with the horizontal reference axis as the corresponding distances of
Figure 3-11.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 49
Now some points on the power diagram of Figure 3-12 for various loads should be
determined, with fixed values of VS and VR . First it is noticed that the point n is not
dependent on the current and will not change as long as VR and Z ∠θ is constant. If VR
and Z is constant and the angle θ = arctan (X R ) is changing, then the point n will move
around a circle with the centre O between the points c and d. The point c indicates θ = 90°,
which means R = 0 and the receiving-end power diagram is the same as the circle diagram
for a synchronous machine developed in Chapter 3.4.1 (Figure 3-8). The point d indicates
θ = 0°, which means X = 0. It is noted further that the distance from point n to point k is
constant for fixed values of VS , VR and Z . Therefore, as the distance from O to k
changes with changing load, the point k, since it must remain at a constant distance from
the fixed point n, is constrained to move in a circle whose centre is at n. Thus all the points
representing loads on a network with fixed values of VS , VR and Z lie on the circle
determined by the values of the fixed voltages and the fixed impedance. If a different
voltage of VS is held constant with the same value for VR , the location of point n is
unchanged, but a new circle of radius nk is found.
Z from the origin at an angle of θ with
2
The point n may be located by measuring VR
the horizontal. Greater accuracy is obtained if the point n is located by computing its
horizontal and vertical coordinates. Examination of Figure 3-12 shows, for the receiving-
end diagram,
VS ⋅ VR
Radius of a receiving − end circle [VA ] = Equ. 3-35
Z
2
VR
Vertical [VArs] = − ⋅ sin(θ) Equ. 3-37
Z
If the voltages used in the equations above are line-to-line voltages then the coordinates of
the power diagram are three-phase quantities. If line-to-neutral voltages are used, the
coordinates of the power diagram are per-phase quantities.
The angle δ between the sending- and the receiving-end voltages is called the load angle.
As the load changes, the load angle changes. On the power diagram the load angle δ is
Z and VS ⋅ VR Z .
2
measured between the line VR
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 50
If the receiving-end voltage is held constant and receiving-end circles are drawn for
different values of sending-end voltages, the resulting circles are concentric because the
location of the centre of the receiving-end power circles is independent of the sending-end
voltage. A family of receiving-end circles is shown in Figure 3-13. The radial lines cutting
the circles are spaced at 10° intervals so that the load angle can be read for any load. The
load line marked in Figure 3-13 is convenient if the load changes in magnitude while its
power factor remains constant. The angle between the load line through the origin and the
horizontal axis is the phase angle (between IR and UR) whose cosine is the power factor of
the load.
+Q
-20° -30°
angl
e -10° |VS1|
d
loa
0°
|VS2|
l oa d 0 °
l i ne +1 |VS3|
|VS4|
0°
φ
+2
O
+P -P
0°
θ
+3
°
+40
|VR|=constant
n
-Q
Figure 3-13: Receiving-end power circle diagram for ⎟VR⎟ = constant and ⎟VS⎟ = variable
If the sending-end voltage is fixed, the receiving-end power circles for different receiving-
end voltages are not concentric. The equations 3-35 to 3-37 show that the centres of the
circles are at different points for each value of VR , but the centres all lie on the same line
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 51
through the origin. The radii of the circles change also as VR changes [18]. In the same
way as developing the receiving-end power circle diagram it is also possible to construct
the sending-end power circle diagram which is not shown in this thesis.
The power circle diagram described has several limitations, the most serious of which is
that, although a series of concentric receiving-end circles can be drawn for a number of
sending-end voltages, the resulting chart is valid for only the one receiving-end voltage for
which it is constructed. If several receiving-end voltages are to be investigated a new
receiving-end chart must be constructed for each new receiving-end voltage. If the latter
course is followed, the resulting circles are not concentric for the receiving-end chart, and
the load-angle lines are drawn from different centres for each circle. This limitation of the
power circle diagram can be overcome by a modification of the coordinate system [7].
To take full advantage of the method, each distance on the modified circle diagram must be
expressed as a ratio of the distance on the original diagram in volt-amperes to a selected
2
reference or base value of volt-ampere equal to V Z , where Z is the impedance of the
circuit and V is called the reference or base voltage and is chosen arbitrarily. Usually V
is the nominal line-to-neutral or line-to-line voltage of the system depending on whether
the coordinates of the power diagram being modified are per-phase or three-phase
quantities. Dimensionless units result from the division of the quantities on the original
2
diagram by V Z . The resulting quantities VR V and VS V are ratios of actual
voltage to the chosen base and are called per-unit receiving- and per-unit sending-end
voltages. If it is considered that VS and VR specify voltages in per-unit rather than in
volts, the Equations 3-35 to 3-37 become
Figure 3-14 shows the scaling of a universal power circle diagram with the reference
voltage V = VR = 1 p.u. , the base volt-ampere VR Z = 1 p.u. and the sending-end
2
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 52
voltage VS rotating round ± 90° from VR. It is noticed that the P/Q- and the V-axis use the
same scale in per-unit but a different origin of the axes. The point n, which is the origin of
the V-axis, rotates for a changing angle θ on a circle with the centre OR, as explained in the
previous chapter. The reason for the same scaling of both axes is the new volt-ampere base
Z = 1 p.u. . The diagram also shows three constant sending-end voltage circles
2
VR
(VS1 = 1.0 p.u., VS2 = 1.3 p.u., VS3 = 1.6 p.u.), a constant power circle (S = const.) and a
constant power factor line (pf = const.). Now it is possible to use this circle diagram in the
same way as the circle diagram of a synchronous machine.
Q [p.u.]
1.0
VS3 =
1.6 p
.u.=c
0.8 onst.
pf= 0.6 VS =
co 2 1
.3
nst p.u.
. = co n
st .
0.4
V [p.u.]
S= 1.0 V
con S1 =1
.0 p
0.2 st .u.=
co n
st
P [p.u.] 0.8
OR
1.0 0.8 0.6 0.4 0.2 θ
0.6 δ=-90°
|VR |
2
ve
ati
δ neg 0.4
e
tiv
osi
δp
0.2
V [p.u.]
1.0 0.8 0.6 0.4 0.2 n
δ=+90°
Figure 3-14: Scaling of the universal power circle diagram of a short-transmission line
If a receiving-end circle diagram according to the equations above for various per-unit
values of VS and a specified value of VR is constructed, the concentric circles shown in
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 53
Figure 3-15 with their centres at n and the origin of the coordinate system at OR are
obtained.
If a larger value of VR is chosen and circles for the same values of VS ⋅ VR are drawn, a
new family of concentric circles having the same radii as those shown in Figure 3-15 and
the same origin OR are obtained. The new circles must be drawn from a different centre
such as n’, as determined by the Equations 3-38 to 3-40 for the new value of VR . The
centre n’ lies on the same line through OR as the point n. Thus far this diagram is identical
to the original diagram discussed except for the use of per-unit quantities.
+Q [p.u.]
O’R
OR
+P [p.u.] θ -P [p.u.]
n
-Q [p.u.] n’
If the new set of circles with centres at n’ are drawn and the new diagram along the line
nOR is moved so that n and n’ coincide without the diagram being rotated, both families of
circles coincide.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 54
The origin from which power measurements are made for the new value of VR is shifted
to O’R on the extension of the line nOR. The distance from the centre n to the origin is the
square root of the sum of the squares of the horizontal and vertical coordinates given in
Equations 3-39 and 3-40, which is
2
Distance n to OR [p.u.] = VR Equ. 3-41
The method can now be extended to any number of values of receiving-end voltages.
Measurement of power are made from a different origin for each value of VR . Positive
real power is read to the left of OR, positive reactive power is read upward from OR. Per-
2
unit values measured on the diagram and multiplied by V Z give the three phase real
and reactive power respectively if V is the line-to-line base voltage from which the per-
unit voltages are determined [18].
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 55
The exact solution of any transmission line and the one required for a high degree of
accuracy must consider the fact that the parameters of the line are not lumped but are
distributed uniformly throughout the length of the line. For this assumptions and for an
equivalent Π-circuit the ABCD constants of long-transmission lines involve hyperbolic
functions. These are [18]:
⎡ ⎤
⎢ cosh (γ ⋅ l ) Z C ⋅ sinh (γ ⋅ l ) ∠θ C ⎥
⎡A B ⎤ ⎢ ⎥
⎢ C D⎥ = ⎢ ⎥ Equ. 3-42
⎣ ⎦ ⎢ sinh (γ ⋅ l ) ⎥
⎢ ∠ − θC cosh (γ ⋅ l ) ⎥
⎣⎢ Z C ⎦⎥
Z is the total series impedance per phase of the line, Y is the total shunt impedance per
phase to neutral and l is the length of the line [18].
Povejsil and Johnson [26] have published a method of obtaining simpler equations. This
method is based on the fact that the product of L and C is practically constant for overhead
lines of stranded copper or Aluminium Conductor Steel Reinforcement (ACSR). Only the
length of the line and the ratio of series resistance to inductive reactance need to be known
to calculate the values for the ABCD constants.
If the product LC is identical for all lines, γl at a given frequency is a function only of R/X
and the length of the line l, where R is the resistance of the line in ohms per mile and X is
the inductive reactance of the line in ohms per mile, since
γ ⋅l = (R + jωL ) ⋅ jωC ⋅ l = ω 2 LC ⋅ − 1 + j
R
⋅l
ωL
R
γ ⋅ l = ω 2 LC ⋅ − 1 + j ⋅l Equ. 3-44
X
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 56
⎛ R⎞
A [p.u.] = cosh⎜⎜ 2.06 ⋅ 10 −3 ⋅ l ⋅ − 1 + j ⎟⎟
⎝ X⎠
⎡ ⎛ R ⎞⎤
B [p.u.] = ⎢sinh ⎜⎜ 2.06 ⋅ 10 −3 ⋅ l ⋅ − 1 + j ⎟⎟⎥ ∠θ C Equ. 3-45
⎢⎣ ⎝ X ⎠⎥⎦
⎡ ⎛ R ⎞⎤
C [p.u.] = ⎢sinh⎜⎜ 2.06 ⋅ 10 −3 ⋅ l ⋅ − 1 + j ⎟⎟⎥ ∠ − θ C
⎣⎢ ⎝ X ⎠⎥⎦
D [p.u.] = A
The angle θ C associated with the characteristic impedance is also a function of R/X, since
z R + jωL
ZC = = Equ. 3-46
y jω C
tan −1 (ωL R ) − 90
ZC = ZC ∠ Equ. 3-47
2
and
1 ⎛R⎞
θ C = − ⋅ tan −1 ⎜ ⎟ Equ. 3-48
2 ⎝X⎠
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 57
The basics of circle diagrams were already explained in Chapter 3.4.2. The next stage is to
develop the power circle diagram for a long-transmission line and to determine the
differences between the short- and the long-transmission line diagram.
In order to draw the phasor diagram, the two constants A and B should be:
A = A ∠α
B = B ∠θ C Equ. 3-49
The constant C is not required in the development of circle diagrams, and D is only for
diagrams drawn in terms of sending-end power. Figure 3-16 is the phasor diagram of a
four-terminal network with the receiving-end voltage VR as reference. The phasor AVR
leads VR by the angle α. If the current IR is lagging VR by an angle φR the phasor BIR leads
VR by the angle (θC - φR). The sending-end voltage VS is the sum of AVR and BIR.
VS
BIR
AVR θC−φR
δ
n α O
φR VR
θC
IR
Figure 3-16: Phasor diagram of a four-terminal network
Since a diagram of real and reactive power is desired, it is necessary to multiply all the
quantities by current. The multiplier will be VR/B, which has the dimension of current.
This results, similar to the diagram of a short-transmission line, in a displacement from the
reference phasor VR by the angle -θC, since
VR ∠0° VR VR
= ∠ − θC = ⋅ e − jθ C Equ. 3-50
B ∠θ C B B
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 58
In order to conform to the convention adopted in Chapter 3.2 the diagram will rotate on the
horizontal and the vertical axis. The result is shown in Figure 3-17.
+Q
k
|VR2|
|VR|.|IR|
|Β|
+P φR O -P
θC d
θC-α
|VS|.|VR|
|Β| |Α|.|VR2|
|Β|
θC−δ
n
c
-Q
Figure 3-17: Receiving-end power diagram of a long-transmission line
VS ⋅ VR
Radius of a receiving − end circle [VA] = Equ. 3-51
B
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 59
A
Horizontal [ watts] = − ⋅ VR ⋅ cos(θ C − α)
2
Equ. 3-52
B
A
Vertical [VArs] = − ⋅ VR ⋅ sin(θ C − α)
2
Equ. 3-53
B
To determine P and Q the following equations, as seen in Figure 3-17, can be used:
A ⋅ VR
2
VS ⋅ VR
PR = cos(θ C − δ ) − cos(θ C − α ) Equ. 3-54
B B
A ⋅ VR
2
VS ⋅ VR
QR = sin (θ C − δ ) − sin (θ C − α ) Equ. 3-55
B B
The differences between the circle diagram of a long-transmission line and a short-
transmission line are as followed:
• The four-terminal network constant B and its angle θC is used instead of the
impedance Z and its angle θ.
• A long-transmission line has a new phasor labelled AVR. This phasor leads the
reference voltage VR by the angle α. The complex addition of this phasor and the
phasor BIR results in the sending-end voltage VS.
In this case dimensionless units result from the division of the quantities on the original
2 2
diagram by the reference base V B instead of V Z , where B is the generalized
circuit constant and V is the reference voltage and is chosen arbitrarily. If it is considered
that VS and VR already specify voltages in per unit, the following formulas are obtained:
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 60
Figure 3-18 shows the scaling of a universal power circle diagram for a long-transmission
line with the reference voltage V = VR = 1 p.u. , the base volt-ampere VR B = 1 p.u.
2
Q [p.u.]
1.0
0.8
VS =
1.3
p .u.=
0.6 con
st.
V [p.u.]
VS =
0.4 1.0 VR =
1.0
p .u.=
c ons
VS = t.
0.85
|VR |
2 p.u.
0.2 0.8 = con
s t.
δ=-90°
P [p.u.] OR
0.6
1.0 0.8 0.6 0.4 0.2 θC
θC-α
0.4
|Α|.|VR |
2
0.2
V [p.u.]
1.0 0.8 0.6 0.4 0.2 n
δ=+90°
Figure 3-18: Scaling of the universal power circle diagram of a long-transmission line
The distance from the centre n to the origin is the square root of the sum of the squares of
the horizontal and vertical coordinates given in Equations 3-57 and 3-58, which is
Distance n to OR [p.u.] = A ⋅ VR
2
Equ. 3-59
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 61
Once the circle diagrams have been drawn for a transmission line or any four-terminal
network, a great deal of information can be obtained very quickly. Some useful
information is the voltage that must be maintained at the sending end for a specified load
and voltage at the receiving end. It is assumed that Figure 3-19 is the receiving-end power
diagram for the value of VR which must be maintained at the load or at the primary
terminals of a transformer supplying the load. If the load varies in amount while its power
factor remains the same, a load line is drawn through the origin at an angle with the
horizontal axis equal to the phase angle of the load. The horizontal coordinate of the point
where the load line intersects a circle of constant sending-end voltage is the power at the
load for the sending-end voltage of the circle intersected. In this manner information for
plotting sending-end voltage versus power at the load for a given load voltage and power
factor is obtained rapidly.
+Q
-20°
ang
le -1 0 °
d
loa
0°
|VS1|
l oa d °
l i ne 10
|VS2|
°
φ
20
b O
+P -P
θ
|VR|=const.
-Q n
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 62
Another problem readily solved with the circle diagram is the determination of the amount
of reactive power that must be supplied by synchronous condensers at a load in order to
increase the power factor, to reduce the amount of voltage regulation, or to maintain
constant voltage at the receiving end for a given sending-end voltage. For instance, the
circle diagram of Figure 3-19 may represent the conditions on a transmission line whose
receiving-end voltage is to remain constant at the value for which the diagram is drawn,
and it may be desirable to operate the line at unity power factor. If the coordinates of the
point a on the load line are the kW and kVArs of the load, the inductive kVArs of the load
represented by the vertical line ab must be supplied by a synchronous condenser or static
capacitors. The line supplies only the real power represented by Ob, and the voltage at the
sending end must be slightly greater than VS2 .
Both the sending-end and receiving-end circle diagrams may be needed for the solution of
a problem. For instance, both diagrams are needed to find the sending-end power for a
given receiving-end load. If the load and load voltage are known and the receiving-end
power diagram is available for this load voltage, the voltage at the sending end and the
torque angle may be read. Then, on a sending-end diagram drawn for the sending-end
voltage found from the receiving-end diagram, the sending-end power may be read at the
same torque angle and receiving-end voltage. This is an example of an torque angle
measured from the reference line of a diagram being required to find corresponding points
on the two diagrams [18].
In the previous chapters the construction of power circle diagrams of long- and short-
transmission lines were explained. This chapter examines the differences in results
between these models.
Figure 3-20 shows the absolute percentage difference for the receiving-end power
calculation of a short-transmission line model compared with the accurate values of a long-
transmission line model in four cases. In these cases the values of the sending-end voltage,
the load angle and the R/X-ratio of the line are varied. The calculations use the formulas
and four-terminal network constants A, B, C and D developed in Chapter 3.4 and 3.5.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Power Flow and Absorbence 63
Figure 3-20: Absolute percentage difference of a short-transmission line model compared with a long-
transmission line model
All four cases show that the percentage error of a short-transmission line model for the
receiving-end power calculation for a line shorter than 100 miles is below one percent and
a line shorter than 200 miles below three percent. For longer distances the error increases
rapidly.
As the distance for the connection of EGs to the grid will always be under 100 miles, the
percentage error will always be smaller than one percent. Therefore, the simulation
package for universal power circle diagrams of EGs in the next chapter is developed for
the short-transmission line model. This circle diagram has the advantages of being easier to
calculate and to draw than the long-transmission one.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Development of Simulation Package 64
The basic code for this simulation is written in the C++ programming language, which is
an offspring of the C high level language. With Windows now being the standard PC
operating system, C++ is a standard Windows application development language.
The key concept in C++ is the class. Classes provide data hiding, guaranteed initialisation
of data, implicit type conversion of user-defined types, user-controlled memory
management, dynamic typing, and mechanisms for overloading parameters [20].
The software developed in this thesis does not take advantage of all the resources that C++
can offer, as the basic task of this program is to automate the drawing of circle diagrams on
a computer screen. Therefore the program uses C++ graphic utilities rather than complex
C++ structures.
Successful software, in addition to performing its basic function, should be user friendly.
This is one of the reasons why the software utilised in the environment of the Microsoft
Visual C++ Version 6.0 programming language instead of a command prompt based
environment such as DOS.
A fundamental feature of the windows environment is multi-tasking which is the ability for
several applications to run simultaneously. When an application is running, an application
window is visible which acts as the user interface, all the other functionality is hidden from
the view.
Another important feature is that windows programs are device independent. This means
that, instead of setting up the device parameter for each program individually, the windows
interface supplies an uniform set of instructions for interfacing with the necessary devices.
This makes it easier to change device parameters and use applications on different
computers as there is no need for device information to be programmed individually.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Development of Simulation Package 65
There are several different parts of a windows application that must be integrated. This is
carried out by using a so called ‘Workspace’. This ‘Workspace’ brings together all the
necessary parts of the written programme:
• Header files
The header files include declarations for the functions, variables and library header
files. These files have the extension ‘.h’.
• Source files
The source files include the different functions which are required in the program.
These functions can be split into several different files to make them easier to handle.
All source files have the extension ‘.cpp’.
• Resource files
The resource files contain the code used to create the graphics windows that form the
user interface. These files are developed through the resource editor and are given the
extension ‘.rc’.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Development of Simulation Package 66
Once all of the information required by UPCD has been entered by the user, or is loaded
from an existing file, the program calculates the base power and base voltage. After the
diagram has been drawn, the user has the choice between different features of the program.
This is shown in the flow chart of Figure 4-1.
Start
Data input
Calculation of
base-power and
base-voltage
Calculation of the
values for the
current mouse-
position
New
output
values Draw graphics
and
output text-values
Draw power-
factor or
power-circle
Recalculate
Redraw
Save data
Zoom
End program
End
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Development of Simulation Package 67
UPCD will start automatically after the compact disc is put into the compact disc drive or
by positioning the mouse pointer over the UPCD-icon and double-clicking the left mouse
button. The icon of the ‘executable’ file is shown in Figure 4-2. The software has been
written so that at any point during operation it is possible to exit from UPCD.
With a windows application the usual format is a main window displaying results and
containing a menu-bar from which various commands can be activated. In this program a
Single Document Interface (SDI) is used, which allows only one open ‘document frame
window’ at any time. This main window and one drop-down menu is shown in Figure 4-3.
Figure 4-3: The main window and one drop down menu
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Development of Simulation Package 68
The user-interface mechanism is common to most Windows applications. That is, each
application window contains an icon on the corner to minimize, maximise or close the
window. Other icons include ‘New Document’, ‘Open File’, ‘Save File’, ‘About‘ dialog
box and an icon called ‘Start’ to run UPCD. All of these commands are also available in
the pop-up menus which are explained in the chapters following.
The main frame has five additional buttons: ‘Zoom In’, ‘Zoom Out’, ‘Constant Receiving
Power Circle’, ‘Constant Power Factor’ and ‘Print Screen’. Each of these buttons opens a
dialog box which are also described in the next chapters.
Further, the main window contains a vertical and a horizontal scroll bar and the mouse
being used in a similar manner as in any other windows application.
• New
This option deletes all the data present. The screen will be cleared and the emblem of
the University of Edinburgh will be shown.
• Open
This option opens a dialog box and allows the user to choose and open an already
existing file with the extension ‘.cir’.
• Save
If the current document already has a name, this option will save all values without
opening a dialog box. For an untitled document the procedure will be the same as for
the ‘Save As’ option in this menu.
• Save As
If the data is to be used again, it must be saved. Upon saving data, the user will
encounter a dialog box. It allows the user to select a directory and enter a name for
the file which has the predefined extension ‘.cir’.
• Exit
This option is used to quit the program. If not previously saved, the current data will
be lost.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Development of Simulation Package 69
• Toolbar
The user can hide or show the toolbar by clicking on this icon.
• Status Bar
The user can hide or show the status bar by clicking on this icon.
The only option in this menu is ‘Run UPCD’. This option starts the program by opening
the System Parameters dialog box as shown in Figure 4-4.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Development of Simulation Package 70
The ‘About UPCD’ command is used to display the name of the program, the version
number of this copy, the copyright notice, and the email address for software support.
These two buttons allow the user to zoom in or out of a specific area on the screen. The
range of the zoom is from 100% to 600% in six equal steps.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Development of Simulation Package 71
This button opens the Power Circle dialog box as shown in Figure 4-5. It is possible to
enter up to three receiving-end complex power circles in mega volt-amperes.
On clicking the OK-button, an error-checking of the values entered will be carried out
automatically and the circles will be drawn. By clicking the Cancel-button the screen will
not be updated with the new values entered. To delete a circle the user must enter the value
zero in the corresponding edit box.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Development of Simulation Package 72
The Power Factor dialog box opens after clicking the Constant Power Factor button. Here
the user can enter the power factor between 0 and 1. Confirmation of the input is via the
OK-button, cancellation or deleting already drawn lines is via the Cancel-button.
This button opens a dialog box which explains in three steps a method by which the current
diagram and the output-values displayed may be printed.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Development of Simulation Package 73
After the values in the System Parameters dialog box are confirmed the program begins to
calculate and draw the universal power circle diagram for a short-transmission line as
developed in Chapter 3.4. It is important to remember that all the drawings on the screen
are receiving-end values, except of the sending-end voltage VS. Figure 4-8 shows the circle
diagram for the input values of the System Parameters dialog box from Figure 4-4.
The diagram shows the receiving-end power area with its two axes P and Q in per-unit
form and the voltage area V in per-unit form. The four half-circles drawn are constant
sending-end voltages with the values 0.8 p.u., 0.94 p.u., 1.1 p.u. and 1.2 p.u.. The two red
half-circles, 1.1 p.u. and 0.94 p.u. respectively, indicate the maximum voltage variation of
+10% and –6%. The half-circles start at the left-hand-side with a load angle of +90° and
end at the right-hand-side with a load angle of –90°.
The text-values printed on the right border of the window describe the current position of
the mouse in the diagram. For the receiving end, these values are: the voltage VR, the
active power PR, the reactive power QR, the complex power SR, the power factor cos(φR)
and the phase angle φR. There are no sending-end values (except VS) drawn in the diagram
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Development of Simulation Package 74
but for each receiving-end point on the screen it is possible to calculate the sending-end
values which are printed as text below the receiving-end output values. These are: the
voltage VS, the active power PS, the reactive power QS, the complex power SS, the power
factor cos(φS) and the phase angle φS. The text output also includes the load angle δ and the
current IR. The receiving-end current and the sending-end current have a phase difference
of 180 degrees, according to the conventions set out in Chapter 3.4.1. The sum of the two
phase angles shown on the screen is not exactly 180 degrees. The difference is the load
angle, which is the angle between the sending-end and the receiving-end voltage. As the
mouse moves all of these output-values are calculated for the actual position of the mouse
and automatically updated on the screen.
Figure 4-9 shows the same diagram as Figure 4-8 with an additional constant receiving-end
power circle of 45.0 MVA and a zoom-factor of 300%.
Figure 4-9: Circle diagram with marked point P1 and constant power circle SR
The user can mark a point in the diagram labelled with ‘P1’ by pressing the left mouse-
button. The corresponding values for this point are shown in the upper right area of the
screen. The line from zero power to P1 indicates I.Z in per-unit and also a constant
receiving-end power factor line. The line from zero voltage to P1 indicates the sending-end
voltage in per-unit and a constant load angle line. The distance between the origins of the
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Development of Simulation Package 75
power axis and the voltage axis is always the receiving-end voltage, which is the base
voltage for every calculation and therefore one per-unit. Pressing the right mouse button at
any time deletes the point marked and all output-values shown.
Figure 4-10: Circle diagram with power factor lines and the Power Factor dialog box
Figure 4-10 shows the last drawing-feature of the program, the receiving-end power factor
lines. In this example a power factor of 0.9 is chosen and entered in the Power Factor
dialog box. The program draws the lines for all four quadrants and labels them.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Development of Simulation Package 76
In this section the different sources of error are discussed and a total percentage error for a
calculation estimated. The program contains two error-sources which have to be
considered:
1. Use of the short- instead of the long-transmission line model:
This error was already explained and calculated in Chapter 3.7. It was shown that
the error for a short-transmission line model with a line-length below 100 miles is
smaller than one percent. The distance for the connection of EGs to the grid will
always be smaller than 100 miles. Therefore, this estimation assumes a maximum
error of one percent.
2. Screen resolution:
When drawing the power- and the voltage-axes on the screen, pixels are used.
Thus, all the values have to be rounded to conform to the screen pixelation and a
rounding error occurs. When calculating the output-values for the current mouse
position, the position of the according pixel is used. As the screen resolution is not
infinite, these values will jump from pixel to pixel, depending on the zoom-factor.
A comparison between the output-values of the program and Excel-based
calculations with the formulas developed in Chapter 3.4.1 shows, that the
maximum error will be up to two percent.
To calculate the total maximum error, the values of the two errors explained must be
summed. Therefore, the absolute total maximum error is estimated to be three percent. To
keep the error as small as possible it is important to zoom into the specific area, thus
minimizing pixelation rounding errors.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Case Studies 77
5 Case Studies
5.1 System fault level: 1.99 MVA, Vgrid: 400 V, Sgrid: 250 kVA
In this case a 400 V generator connected to the grid via a short-transmission line with a
fault level of 1.99 MVA is studied. The grid is as always on the receiving end and the
generator on the sending end of the transmission line. Figure 5-1 shows the universal
power circle diagram for this scenario with a receiving-end power circle of 250 kVA,
which is assumed to be full output from the generator at the receiving end . The X/R-ratio
of the transmission line is 10.
Figure 5-1: System fault level: 1.99 MVA, Vgrid: 400 V, Sgrid: 250 kVA - screen output
The area within which the EG can operate without the net export leading to voltage
violation or exceeding the 250 kVA receiving-end power circle (full generator output at the
receiving end) has four boundaries which are coloured green:
1. The top boundary is the red 1.1 p.u. sending-end voltage circle.
2. The right-hand side boundary for a generator is the Q-axis (P equals zero).
3. The bottom boundary is the red 0.94 p.u. sending-end voltage circle.
4. The left-hand side boundary is the 250 kVA receiving-end power circle.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Case Studies 78
The green painted boundary is for the benefit of the report only and is not drawn by UPCD.
One corner of this boundary is marked and labelled with ‘P1’. The corresponding values
are shown on the upper right corner of the screen. It can be seen that the sending-end
voltage has been calculated as 440 V, the maximum allowed over-voltage. What this
shows is that a generator overexcited producing 250 kVA at the receiving end with a
receiving-end power factor of 0.65 lagging will cause a voltage violation. However, the
same generation operated at rated receiving-end power factor of 0.8 lagging will produce a
sending-end voltage within the 1.1 p.u. envelope.
The values shown on the lower right corner of Figure 5-1 are related to the current mouse
position, which is indicated in the picture with an arrow. In this case it is the point with the
maximum active power which could be produced by the generator. The reactive power
received is zero, consequently the receiving-end power factor is unity and the current is in
phase with the receiving-end voltage.
The difference between the sending-end real power and the receiving-end real power are
the real power losses of the line, which are equal to I 2 × R . The difference between the
sending- and receiving-end reactive power are the reactive power line ‘losses’, which are
equal to I 2 × X . The sum of the absolute values of the receiving-end phase angle, the
sending-end phase angle and the load angle is exactly 180 degrees. This convention was
adopted in Chapter 3.4.1, where power or current leaving a boundary was signed negative
and entering a boundary positive.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Case Studies 79
5.2 System fault level: 1.99 MVA, Vgrid: 400 V, Sgrid: 500 kVA
This case studies an induction generator with the receiving-end values of 500 kVA
complex power and 0.9 power factor leading and compares it with a synchronous machine
with the receiving-end values of 500 kVA and 0.8 power factor lagging. The generators are
connected to a 400 V grid with a 1.99 MVA system fault level. The X/R-ratio is assumed
to be 10. Figure 5-2 shows the according screen output of UPCD.
Figure 5-2: System fault level: 1.99 MVA, Vgrid: 400 V, Sgrid: 500 kVA – screen output
The point labelled with ‘P1’ is the induction generator with the receiving-end power factor
of 0.9 leading. The corresponding values are shown on the upper right corner of the screen.
The values on the lower right corner indicate the current mouse position on the screen,
which is the operating point of the overexcited synchronous machine. An arrow points to
the according position in Figure 5-2.
As seen, the induction machine operates at this point with a sending-end voltage drop of
–5.5 percent, which is within the voltage limitation. The synchronous machine, exporting
500 kVA receiving-end power at a 0.8 lagging receiving-end power factor, has a sending-
end voltage rise of +18.3 percent, which exceeds the voltage limitation by +8.3 percent and
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Case Studies 80
is therefore not acceptable. To operate within the voltage limitation, the synchronous
generator has to decrease the receiving-end complex power or to increase the receiving-end
power factor. The green coloured boundaries indicates once more the area within which the
generators are allowed to operate and is not drawn by UPCD.
5.3 System fault level: 3.98 MVA, Vgrid: 400 V, Sgrid: 500 kVA
This case uses the same assumptions as the case in Chapter 5.2. The only difference is the
simulation of the reinforcement of the grid by halving the line impedance, which results in
a doubled system fault level.
Figure 5-3: System fault level: 3.98 MVA, Vgrid: 400 V, Sgrid: 500 kVA – screen output
As before, the upper values indicate the induction machine, labelled in the picture with
‘P1’, and the lower values the synchronous machine, indicated with an arrow. For these
assumptions both machines are with its operation points within the voltage limits, which is
shown in Figure 5-3.
The voltage drop of the induction generator is, compared with the latter case, reduced by
36 percent and the voltage rise of the synchronous generator by 48 percent.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Case Studies 81
5.4 System fault level: 67 MVA, Vgrid: 3.3 kV, Sgrid: 6.5 MVA
This case studies a 3.3 kV generator connected to the grid with a fault level of 67 MVA.
The generator should be operate to produce an sending-end apparent power of 6.5 MVA at
a sending-end power factor of 0.8 leading.
As explained, it is not possible to draw sending-end power values in the receiving-end
area, but it is possible to calculate all sending-end values for every single point on the
receiving-end diagram. Therefore, to find the sending-end point a 6.5 MVA receiving-end
power circle and a 0.8 lagging receiving-end power factor line is drawn. The receiving-end
point for these assumptions is found where the power circle crosses the lagging power
factor line. Now it is possible to search for the sending-end point by moving the mouse
around the area of the receiving-end point. Figure 5-4 shows the circle diagram for this
generator with the 6.5 MVA receiving-end power circle and the 0.8 receiving-end power
factor lines.
Figure 5-4: System fault level: 67 MVA, Vgrid: 3.3 kV, Sgrid: 6.5 MVA – screen output
The upper right output-values in the picture indicate the P/Q-values for the point P1 and
therefore the values for 6.5 MVA sending-end power and a sending-end power factor of
0.8 leading. The lower values indicate the point for the same assumptions at the receiving-
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Case Studies 82
end. This point is slightly above P1 where the power circle intersects the power factor line,
as seen in Figure 5-4, and is indicated in the picture with an arrow.
The figure also shows that for a constant receiving-end power circle of 6.5 MVA the over-
voltage limit will never be exceeded. In this case there are only three boundaries (drawn
green), within which the EG can operate without the net export leading to voltage violation
or exceeding the 6.5 MVA (assumed full generator output at the receiving end) receiving-
end power circle:
1. The left-hand side boundary is the 6.5 MVA receiving-end power circle.
2. The right-hand side boundary for the generator is the Q-axis (P equals zero).
3. The bottom boundary is the red 0.94 p.u. sending-end voltage circle.
The green boundary is, as explained before, for the benefit of the report only and not drawn
by UPCD.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Discussion and Conclusion 83
6.1 Overview
This chapter finishes the diploma thesis with a discussion on the problems encountered,
possible improvements to the software, a conclusion and a recommendation for future
work.
During the development of this project, many problems were experienced and solved. As
some problems were more difficult to solve than others within the time constrained, they
have yet to be corrected.
While running the program, the circle diagrams drawn could disappear and UPCD will not
start drawing them again. The user must close the program and restart it. However, the
error could not be consistently recreated. This error was observed to occur after copious
use of the scroll bars and the left mouse button respectively. In both cases the program has
to redraw the whole area. The problem is suspected to be a computer memory limitation.
Improper memory allocation may occur, thus causing a reduction in available memory.
The program code needs to be thoroughly examined to determine if this is the reason, and
solved to make the program more robust.
Another problem occurs when entering decimal numbers in the ‘Input’ dialog box. When
any numeric value is entered in one of the edit-boxes, all the other values in this dialog box
are calculated and updated automatically. Entry of a decimal point following a number is
not registered as it is not a numeric value. A decimal point must therefore be entered once
the numeric value is in place. For example, if the user wants to enter the number 29.5, he
must first enter the value 295 and add the decimal point afterwards.
The last problem is the resolution of the screen. This program works best with a resolution
of 1024 by 768 pixels. It is also possible to use UPCD with a resolution higher than that. In
this case all the drawings are further left than before and the output-values are not at the
right border of the screen. The program can not be used for a resolution smaller than 1024
by 768 as the output-values will no longer be on the screen. To avoid this problem, it
would be necessary to rewrite all drawing-commands in the source code by using a
different graphics mapping-code.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Discussion and Conclusion 84
This thesis explains the basics of embedded generation and the problems an EG has within
a rural distribution network. Further, the background, mathematical theories, development
of a methodology, software implementation and testing of power circle diagrams for short-
and long-transmission lines were explained. It was shown that it is possible to visualize the
absorbence of the rural distribution grid at a proposed point of connection by using
universal power circle diagrams. The result was not a single point (a best or worst case) but
an area of active and reactive power within which the EG can operate without the net
export leading to voltage violation.
The Visual C++ simulation shows an universal power circle diagram for a short-
transmission line. It contains an area for active and reactive power at the receiving end and
an area for the receiving- and sending-end voltage. Additionally, the program calculates
and outputs all receiving- and sending-end values.
Through the use of this software a great deal of knowledge regarding absorbence of the
grid can be attained more efficiently than through manual ‘pen and paper’ calculations.
The main advantages of this program are the ability to visualise this area, to simply and
rapidly change systems parameters and to automatically calculate and output the receiving-
and sending-end values for every single point in the diagram. As far as known, there is no
equivalent package on the market that tests and visualize the absorbence of the grid.
UPCD can be used to test induction as well as synchronous generators at the same
proposed point of connection. It is also possible to test the effects of system reinforcement
by changing the system fault level.
UPCD shows, that the voltage rise is proportional to the apparent power of the generator
and to the inductive reactance of the grid, inversely proportional to the system fault level
and also affected by the power factor. For a small load angle the magnitude difference of
the two terminal voltages is proportional to the reactive power flow which is proportional
to the sending-end voltage and therefore to the machine excitation and the power factor
control.
The maximum total on-screen error has been estimated as not exceeding three percent. As
UPCD is intended to be a fast initial feasibility tool for an EG-connection, this error is
acceptable.
A recommendation for further work is to connect UPCD to an EG- and local load-
simulation to examine the time-variation of the active and reactive power of the generator
and the load and therefore the time-variation of the voltage. This can be used to assess the
duration of the voltage-violation.
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
List of Figures 85
7 List of Figures
Figure 1-1: Range of the worldwide crude oil-, natural gas- and coal-reserves....................9
Figure 1-2: Evolution of the world energy consumption 1990, 2020 and 2050..................10
Figure 1-3: The recent growth of DG (installed capacity/MW) in the UK .........................12
Figure 2-1: UK electricity supply industry..........................................................................16
Figure 2-2: Small synchronous generator connected to the network and phasor diagram..21
Figure 2-3: Equivalent circuit of an induction machine ......................................................23
Figure 2-4: Torque/speed curve of an induction machine...................................................23
Figure 2-5: Variable speed convertor (using thyristors)......................................................25
Figure 2-6: Variable speed convertor (using IGBTs)..........................................................26
Figure 2-7: Typical EG connection .....................................................................................27
Figure 3-1: Voltage source and load; phasor diagram.........................................................35
Figure 3-2: Phasor diagram and power triangle for an inductive load (lagging pf) ............36
Figure 3-3: Phasor diagram and power triangle for a capacitive load (leading pf) .............37
Figure 3-4: Unsymmetrical T-circuit equivalent to a four terminal network ......................38
Figure 3-5: Symbolic diagram representing a four-terminal network.................................39
Figure 3-6: Power transfer of a short-transmission line .....................................................40
Figure 3-7: Phasor diagram of a synchronous machine and a short-transmission line with R
= 0 respectively....................................................................................................................43
Figure 3-8: Circle diagram for VR = constant and X = 1.25 p.u. (R = 0 p.u.) .....................45
Figure 3-9: Phasor diagram of a short-transmission line.....................................................46
Figure 3-10: Phasor diagram of a two-sources network......................................................46
Figure 3-11: Receiving-end power diagram........................................................................47
Figure 3-12: Receiving-end power diagram after rotation ..................................................48
Figure 3-13: Receiving-end power circle diagram for ⎟VR⎟ = constant and ⎟VS⎟ = variable
.............................................................................................................................................50
Figure 3-14: Scaling of the universal power circle diagram of a short-transmission line...52
Figure 3-15: Universal power circle diagram of a short-transmission line .........................53
Figure 3-16: Phasor diagram of a four-terminal network....................................................57
Figure 3-17: Receiving-end power diagram of a long-transmission line ............................58
Figure 3-18: Scaling of the universal power circle diagram of a long-transmission line....60
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
List of Figures 86
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
References 87
8 References
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
References 88
[16] Ruedisili, L.C. and Firebaugh M. W.: ‘Perspectives on Energy - Issues, Ideas, and
Environmental Dilemmas’; Oxford University Press Inc., London, 1975
[17] Saadat, H.: ‘Power System Analysis’; Milwaukee School of Engineering, 1999
[18] Stevenson, W.D. Jr.: ‘Elements of Power System Analysis’; McGraw-Hill
Publishing Company Ltd., London, 1955
[19] Stinson, J.F.: ‘Simulation of Loss of Main, Detection and Protection’; BEng
Honours Project Report HSP 1284, Department of Electrical Engineering,
University of Edinburgh, May 1997
[20] Stroustrup, B.: ‘The C++ Programming Language’; Addison-Wesley Publishing
Company, 1991
[21] Waddicor, H.: ‘The Principles of Electric Power Transmission’; Chapman and Hall
Ltd., London, 1964
[22] Wallace, A.R.: ‘Integration of embedded generation plant into electricity supply
networks’; Energy System Group, Departments of Electronics and Electrical
Engineering, University of Edinburgh, UK
[23] Wallace, A.R.: ‘Power Systems – 3th Year Notes’; Departments of Electronics and
Electrical Engineering, University of Edinburgh, UK, 1999
[24] Wallace, A.R. and Stapleton, S.A.: ‘Operation and protection of Embedded
Generation Schemes’; Departments of Electronics and Electrical Engineering,
University of Edinburgh, UK, 1997
[25] Wallace, A.R. and Whittington, H.W.: ‘Power Systems and Machines – 4th Year
Notes’; Departments of Electronics and Electrical Engineering, University of
Edinburgh, UK, 1996
[26] Ward, C.: ’Technical Requirements for a Reactive Service’; IEE Colloquium on
Economic provision of reactive power for system voltage control, pp. 2/1-4, 1996
[27] Warnock, G.J.: ‘Simulation of Loss of Grid Connection to an Embedded
Generator’; BEng Hons Project Report HSP 1373, Department of Electrical
Engineering, University of Edinburgh, May 1998
[28] Weedy, B.M.: ‘Electric Power Systems’; Department of Electrical Engineering,
The University of Southampton, Third Edition, 1989
[29] World Energy Council (WEC), International Institutes for Applied Systems
Analysis (IIASA): ‘Globally in Energy Perspectives 1998’; Austria, 1999
(http://www.iiasa.ac.at/cgi-bin/book_dyn/bookcnt.py)
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Bibliography 89
9 Bibliography
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 90
10 Appendix
The following chapters include the source code of the different Microsoft Visual C++
classes of UPCD. Each class is split up into its header- and source-file.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Calculations.h: interface for the CCalculations class.
// This class calculates the output-values for the circle diagram
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class CCircleDiagramDoc;
class CCalculations
{
public:
float P_DRAWFACTOR;
float V_DRAWFACTOR;
float BasePower;
float BaseVoltage;
float FaultLevel;
float Reactance;
float PCSS;
float Resistance;
float Voltage;
float XRratio;
float Angle;
float Impedance;
float ImpedanceCalc;
float AngleCalc;
int zoom;
int IndicationCheckBox; // indicates which checkbox is pressed, 1 for checkBoxRX,
// 2 for checkBoxZ, 3 for checkBoxPSCC and 4 for checkBoxFault
CCalculations();
virtual ~CCalculations();
protected:
CCircleDiagramDoc *pDoc;
};
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 91
#include "stdafx.h"
#include "Circle Diagram.h"
#include "Calculations.h"
#include "Input.h"
#include "Circle DiagramDoc.h"
#include <complex>
#include <math.h>
#include <stdio.h>
#define __STD_COMPLEX
using namespace std;
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CCalculations::CCalculations()
{
CCalculations::~CCalculations()
{
// This function calculates all values for the output in the Input-Dialog-Box
// and the variables P_DRAWFACTOR and V_DRAWFACTOR
void CCalculations::DoCalculation()
{
double pi = 3.1415926535;
// Calculates the impedance and its angle for four different input-cases
switch (IndicationCheckBox)
{
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 92
ImpedanceCalc = sqrt(Resistance*Resistance+Reactance*Reactance);
AngleCalc = atan(Reactance/Resistance);
pDoc->Impedance = ImpedanceCalc;
pDoc->Angle = AngleCalc*180/pi;
pDoc->PCSS = ((Voltage/sqrt(3))/ImpedanceCalc)*1000; //PSCC in Ampere
pDoc->XRratio = (Reactance/Resistance);
pDoc->FaultLevel = (Voltage*Voltage/ImpedanceCalc);
break;
}
pDoc->Resistance = (ImpedanceCalc*cos(AngleCalc));
pDoc->Reactance = (ImpedanceCalc*sin(AngleCalc));
pDoc->Impedance = ImpedanceCalc;
pDoc->Angle = AngleCalc*180/pi;
pDoc->PCSS = ((Voltage/sqrt(3))/ImpedanceCalc)*1000;
pDoc->XRratio = (tan(AngleCalc));
pDoc->FaultLevel = (Voltage*Voltage/ImpedanceCalc);
break;
}
pDoc->Resistance = (ImpedanceCalc*cos(AngleCalc));
pDoc->Reactance = (ImpedanceCalc*sin(AngleCalc));
pDoc->Impedance = ImpedanceCalc;
pDoc->Angle = AngleCalc*180/pi;
pDoc->FaultLevel = (Voltage*Voltage/ImpedanceCalc);
break;
}
pDoc->Resistance = (ImpedanceCalc*cos(AngleCalc));
pDoc->Reactance = (ImpedanceCalc*sin(AngleCalc));
pDoc->Impedance = ImpedanceCalc;
pDoc->Angle = AngleCalc*180/pi;
pDoc->PCSS = ((Voltage/sqrt(3))/ImpedanceCalc)*1000;
break;
}
default:
break;
}
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 93
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Calculating of the P_DRAWFACTOR and V_DRAWFACTOR. These factors are used
// for the scaling on the screen. It is the BasePower or BaseVoltage dividet
// through 200, where 200 is the length of one half of the axis and is
// equivalent to 1p.u.Therefore P_DRAWFACTOR indicates the power per pixel and
// V_DRAWFACTOR the voltage per pixel.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
P_DRAWFACTOR = BasePower/(200);
pDoc->P_DRAWFACTOR = P_DRAWFACTOR;
V_DRAWFACTOR = BaseVoltage/(201);
pDoc->V_DRAWFACTOR = V_DRAWFACTOR;
}
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 94
#include <complex>
using namespace std;
// Attributes
public:
// Operations
public:
void DeleteContents();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCircleDiagramDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL
// Implementation
public:
BOOLEAN SwitchSave;
BOOLEAN StartSwitch;
BOOLEAN MarkDelete;
BOOLEAN MarkSwitch;
BOOLEAN PFSwitch;
CString SaveP1Iout;
CPoint DevicePosition;
int Mark_y;
int Mark_x;
int zoom;
int YVoltage;
int XVoltage;
int IndicationCheckBox;
double Sradius;
double Sradius2;
double Sradius3;
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 95
float FaultLevel;
float Reactance;
float PCSS;
float Resistance;
float Voltage;
float XRratio;
float Angle;
float Impedance;
CString P1Iout;
CString P1AngleSendOut;
CString P1PFSendout;
CString P1Ssout;
CString P1Qsout;
CString P1Psout;
CString P1LAngleout;
CString P1Vout;
CString P1AngleOut;
CString P1PFout;
CString P1Pout;
CString P1Qout;
CString P1Sout;
CString P1VrOut;
CString SaveP1AngleSendOut;
CString SaveP1PFSendout;
CString SaveP1Ssout;
CString SaveP1Qsout;
CString SaveP1Psout;
CString SaveP1LAngleout;
CString SaveP1Vout;
CString SaveP1AngleOut;
CString SaveP1PFout;
CString SaveP1Pout;
CString SaveP1Qout;
CString SaveP1Sout;
CString SaveP1VrOut;
virtual ~CCircleDiagramDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 96
#include "stdafx.h"
#include "Circle Diagram.h"
#include "Input.h"
#include "Circle DiagramDoc.h"
#include "Calculations.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CCircleDiagramDoc
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNCREATE(CCircleDiagramDoc, CDocument)
BEGIN_MESSAGE_MAP(CCircleDiagramDoc, CDocument)
//{{AFX_MSG_MAP(CCircleDiagramDoc)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CCircleDiagramDoc construction/destruction
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CCircleDiagramDoc::CCircleDiagramDoc()
{
// TODO: add one-time construction code here
}
CCircleDiagramDoc::~CCircleDiagramDoc()
{
}
BOOL CCircleDiagramDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
{
return FALSE;
}
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CCircleDiagramDoc serialization
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This function stores and restores all datas from the document
void CCircleDiagramDoc::Serialize(CArchive& ar)
{
double RealCurrent,ImagCurrent;
if (ar.IsStoring())
{
RealCurrent = real(IComplex);
ImagCurrent = imag(IComplex);
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 97
ar << IndicationCheckBox;
ar << Mark_x;
ar << Mark_y;
ar << MarkDelete;
ar << MarkSwitch;
ar << MarkZoom;
ar << P1Iout;
ar << P1AngleSendOut;
ar << P1PFSendout;
ar << P1Ssout;
ar << P1Qsout;
ar << P1Psout;
ar << P1LAngleout;
ar << P1Vout;
ar << P1AngleOut;
ar << P1PFout;
ar << P1Pout;
ar << P1Qout;
ar << P1Sout;
ar << P1VrOut;
ar << P_DRAWFACTOR;
ar << PCSS;
ar << PFSwitch;
ar << PowerFactor;
ar << Reactance;
ar << Resistance;
ar << SaveP1AngleSendOut;
ar << SaveP1PFSendout;
ar << SaveP1Ssout;
ar << SaveP1Qsout;
ar << SaveP1Psout;
ar << SaveP1LAngleout;
ar << SaveP1Vout;
ar << SaveP1AngleOut;
ar << SaveP1PFout;
ar << SaveP1Pout;
ar << SaveP1Qout;
ar << SaveP1Sout;
ar << SaveP1VrOut;
ar << SaveP1Iout;
ar << SendingVoltage;
ar << Sradius;
ar << Sradius2;
ar << Sradius3;
ar << StartSwitch;
ar << V_DRAWFACTOR;
ar << Voltage;
ar << XRratio;
ar << XVoltage;
ar << YVoltage;
ar << zoom;
}
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 98
else
{
// TODO: add loading code here
ar >> Angle;
ar >> AngleCalc;
ar >> BasePower;
ar >> BaseVoltage;
ar >> DevicePosition;
ar >> FaultLevel;
ar >> RealCurrent;
ar >> ImagCurrent;
ar >> Impedance;
ar >> IndicationCheckBox;
ar >> Mark_x;
ar >> Mark_y;
ar >> MarkDelete;
ar >> MarkSwitch;
ar >> MarkZoom;
ar >> P1Iout;
ar >> P1AngleSendOut;
ar >> P1PFSendout;
ar >> P1Ssout;
ar >> P1Qsout;
ar >> P1Psout;
ar >> P1LAngleout;
ar >> P1Vout;
ar >> P1AngleOut;
ar >> P1PFout;
ar >> P1Pout;
ar >> P1Qout;
ar >> P1Sout;
ar >> P1VrOut;
ar >> P_DRAWFACTOR;
ar >> PCSS;
ar >> PFSwitch;
ar >> PowerFactor;
ar >> Reactance;
ar >> Resistance;
ar >> SaveP1AngleSendOut;
ar >> SaveP1PFSendout;
ar >> SaveP1Ssout;
ar >> SaveP1Qsout;
ar >> SaveP1Psout;
ar >> SaveP1LAngleout;
ar >> SaveP1Vout;
ar >> SaveP1AngleOut;
ar >> SaveP1PFout;
ar >> SaveP1Pout;
ar >> SaveP1Qout;
ar >> SaveP1Sout;
ar >> SaveP1VrOut;
ar >> SaveP1Iout;
ar >> SendingVoltage;
ar >> Sradius;
ar >> Sradius2;
ar >> Sradius3;
ar >> StartSwitch;
ar >> V_DRAWFACTOR;
ar >> Voltage;
ar >> XRratio;
ar >> XVoltage;
ar >> YVoltage;
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 99
ar >> zoom;
IComplex = complex<double>(RealCurrent,ImagCurrent);
SwitchSave = FALSE;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CCircleDiagramDoc diagnostics
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef _DEBUG
void CCircleDiagramDoc::AssertValid() const
{
CDocument::AssertValid();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CCircleDiagramDoc commands
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This function is called to set the default values for the input-variables
void CCircleDiagramDoc::DeleteContents()
{
BaseVoltage = (float) 0.4;
Voltage = (float) 0.4;
Resistance = (float) 0.0080003;
Reactance = (float) 0.080003;
XRratio = 10;
Impedance = (float) 0.080402;
Angle = (float) 84.2894;
FaultLevel = (float) 1.99;
PCSS = (float) 2872.32;
zoom=1;
PowerFactor=0;
Sradius = 0;
Sradius2 = 0;
Sradius3 = 0;
P_DRAWFACTOR=0;
V_DRAWFACTOR=0;
PFSwitch = FALSE;
MarkSwitch = FALSE;
MarkDelete = FALSE;
}
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 100
// Attributes
public:
CCircleDiagramDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCircleDiagramView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual void OnInitialUpdate(); // called first time after construct
//}}AFX_VIRTUAL
// Implementation
public:
CDC* pDC;
void CallInitialUpdate();
void CallDrawUpdate();
virtual ~CCircleDiagramView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 101
#include "stdafx.h"
#include "Circle Diagram.h"
#include "DrawAxis.h"
#include "Input.h"
#include "Calculations.h"
#include "afxwin.h"
#include "Sconstant.h"
#include "PowerFactor.h"
#include "P1Out.h"
#include "Circle DiagramDoc.h"
#include "Circle DiagramView.h"
#include "PrintScreenDlg.h"
#include <complex>
#include <stdlib.h>
#include <math.h>
using namespace std;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CCircleDiagramView
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNCREATE(CCircleDiagramView, CScrollView)
BEGIN_MESSAGE_MAP(CCircleDiagramView, CScrollView)
//{{AFX_MSG_MAP(CCircleDiagramView)
ON_BN_CLICKED(IDC_ZOOMIN, OnZoomin)
ON_BN_CLICKED(IDC_ZOOMOUT, OnZoomout)
ON_COMMAND(ID_START, OnStart)
ON_BN_CLICKED(IDC_SCONSTANT, OnSconstant)
ON_WM_MOUSEMOVE()
ON_BN_CLICKED(IDC_PowerFactor, OnPowerFactor)
ON_WM_LBUTTONUP()
ON_WM_RBUTTONDOWN()
ON_BN_CLICKED(IDC_PrintScreen, OnPrintScreen)
ON_WM_VSCROLL()
ON_WM_HSCROLL()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CScrollView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CScrollView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CScrollView::OnFilePrintPreview)
END_MESSAGE_MAP()
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CCircleDiagramView construction/destruction
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CCircleDiagramView::CCircleDiagramView()
{
// TODO: add construction code here
CCircleDiagramView::~CCircleDiagramView()
{
}
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 102
return CScrollView::PreCreateWindow(cs);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CCircleDiagramView drawing
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This funktion calles the different drawing-functions from the class DrawAxis.
// It is called every time when the screen needs to be updated.
void CCircleDiagramView::OnDraw(CDC* pDC)
{
CCircleDiagramDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
if (pDoc->StartSwitch)
{
DrawAxis AxisV;
AxisV.SetDocPointer(GetDocument());
AxisV.pDCPointer(pDC);
AxisV.DrawPQaxis(pDoc->zoom);
radius = 201*0.94;
circleName = "0.94 p.u.";
Red = 255;
AxisV.DrawCircles(pDoc->zoom, radius, circleName, Red);
radius = 201*0.8;
circleName = "0.8 p.u.";
int Black = 0;
AxisV.DrawCircles(pDoc->zoom, radius, circleName, Black);
radius = 201*1.2;
circleName = "1.2 p.u.";
Black = 0;
AxisV.DrawCircles(pDoc->zoom, radius, circleName, Black);
AxisV.DrawSCircle(pDoc->zoom, pDoc->Sradius/pDoc->P_DRAWFACTOR);
AxisV.DrawSCircle(pDoc->zoom, pDoc->Sradius2/pDoc->P_DRAWFACTOR);
AxisV.DrawSCircle(pDoc->zoom, pDoc->Sradius3/pDoc->P_DRAWFACTOR);
AxisV.DrawPowerFactorLine(pDoc->zoom);
AxisV.DrawMark(pDoc->zoom);
pDoc->MarkSwitch = FALSE;
CDC* pdc;
pdc = GetDC();
P1Out NameP1Out;
NameP1Out.SetDocPointer(pDoc);
NameP1Out.ScreenOutP1(pdc);
}
}
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 103
if(pDoc->SwitchSave)
{
pDoc->StartSwitch = FALSE;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CCircleDiagramView diagnostics
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef _DEBUG
void CCircleDiagramView::AssertValid() const
{
CScrollView::AssertValid();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CCircleDiagramView message handlers
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 104
CScrollView::OnInitialUpdate();
}
}
if (pDoc->zoom>1)
{
pDoc->zoom=pDoc->zoom/2;
pDoc->MarkZoom = pDoc->MarkZoom/2;
pDoc->MarkSwitch = FALSE;
CScrollView::OnInitialUpdate();
}
}
// Initialisation of Sradius
pDoc->Sradius=0;
// Initialisation of Point1
pDoc->MarkDelete = FALSE;
// Call Input-DialogBox
Input InputDlg;
InputDlg.SetDocPointer(GetDocument());
InputDlg.SetViewPointer(this);
InputDlg.DoModal();
// Call DoCalculation
CCalculations CalcDlg;
CalcDlg.SetDocPointer(GetDocument());
CalcDlg.DoCalculation();
}
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 105
// This function is called from the OnOK-function (class Input) after the Button 'OK'
// on the Input-Dlg-Box is pressed. It calles OnIntitialUpdate to draw the diagram
void CCircleDiagramView::CallDrawUpdate()
{
CCircleDiagramDoc* pDoc = GetDocument();
pDoc->StartSwitch=TRUE;
pDoc->zoom=1;
CScrollView::OnInitialUpdate();
}
// This function is called when the button 'constant receiving power circle' is pressed
void CCircleDiagramView::OnSconstant()
{
// TODO: Add your control notification handler code here
//Call Sconstant-DialogBox
CCircleDiagramDoc* pDoc = GetDocument();
if (pDoc->StartSwitch)
{
Sconstant SConstDlg;
SConstDlg.SetDocPointer(GetDocument());
SConstDlg.DoModal();
CScrollView::OnInitialUpdate();
}
}
// This function is called when the mouse is moved. It calculates the values
// of P, Q, V, I, the power factor, the load and the phase angles according
// to the x anc y position of the mouse
void CCircleDiagramView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
//general initialisations
double pi = 3.1415926535;
CPoint POINT1;
POINT1 = GetDeviceScrollPosition( );
CDC* pdc;
pdc = GetDC();
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Vr: convert and output
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CString VrOut;
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 106
pDoc->P1VrOut = VrOut;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Pr, Qr and Sr: Calculate, convert and output
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PQ initialisations
int x_PQaxis_zero, y_PQaxis_zero;
float MousePcalc, MouseQcalc, Scalc;
float P_DRAWFACTOR = pDoc->P_DRAWFACTOR/pDoc->zoom;
CString Pout, Qout, Sout;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Output of the SENDING-END values
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
pdc->TextOut(800,xOutput+130," ");
pdc->TextOut(800,xOutput+130,"Sending-end values:");
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Voltage (sending end): Calculate, convert and output
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// V initialisations
int x_Vaxis_zero, y_Vaxis_zero;
float MouseVcalc, Vaxis_zero;
float V_DRAWFACTOR = pDoc->V_DRAWFACTOR/pDoc->zoom;
CString Vout;
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 107
pdc->TextOut(800,xOutput+150," ");
pdc->TextOut(800,xOutput+150,Vout);
pDoc->P1Vout = Vout;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Load angle: Calculate, convert and output
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Current (flowing from the send. to the rec. end): Calculate, convert and output
//// Ir = -Is because of short transmission line
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Current initialisations
complex <double> VrComplex, VsComplex, ZComplex;
CString Iout;
VrComplex = complex<double>(pDoc->Voltage*1000,0);
ZComplex = complex<double>(pDoc->Resistance,pDoc->Reactance);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Ps, Qs and Ss (sending end): Calculate, convert and output
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Ps and Qs initialisations
float SP1, SP2, SPangle, SendingRealPower;
float SQ1, SQ2, SQangle, SendingReactivePower;
float SendingComplexPower;
CString Psout, Qsout, Ssout;
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 108
SQ1 = SP1;
SQangle = (float) (sin(LoadAngle*pi/180+pDoc->AngleCalc));
SQ2 = (float) ((MouseVcalc*MouseVcalc/pDoc->Impedance)*sin(pDoc->AngleCalc));
SendingReactivePower = SQ1*SQangle - SQ2;
SendingComplexPower = (float)(sqrt(SendingRealPower*SendingRealPower +
SendingReactivePower*SendingReactivePower));
pdc->TextOut(800,xOutput+165," ");
pdc->TextOut(800,xOutput+165,Psout);
pDoc->P1Psout = Psout;
pdc->TextOut(800,xOutput+180," ");
pdc->TextOut(800,xOutput+180,Qsout);
pDoc->P1Qsout = Qsout;
pdc->TextOut(800,xOutput+195," ");
pdc->TextOut(800,xOutput+195,Ssout);
pDoc->P1Ssout = Ssout;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Phase angle and power factor (receiving end): Calculate, convert and output
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PF initialisations
double AnglePF, PF;
CString PFout, AngleOut;
else if (MouseQcalc<0)
{
if (PF < 0) PF = PF * (-1);
AnglePF = -AnglePF;
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 109
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// Phase angle and power factor (sending end): Calculate, convert and output
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PF initialisations
double AnglePFsend, PFsend;
CString PFSendout, AngleSendOut;
CScrollView::OnMouseMove(nFlags, point);
}
// This function is called when the button 'constant power factor' is pressed
void CCircleDiagramView::OnPowerFactor()
{
// TODO: Add your control notification handler code here
// Call Sconstant-DialogBox
CCircleDiagramDoc* pDoc = GetDocument();
if (pDoc->StartSwitch)
{
PowerFactor NFactor;
NFactor.SetDocPointer(GetDocument());
NFactor.DoModal();
CScrollView::OnInitialUpdate();
}
}
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 110
if (pDoc->StartSwitch)
{
pDoc->MarkSwitch = TRUE; // for zooming if a Mark (P1) is on screen; indicates if
// a new mark is selected or zoom with old mark.
pDoc->MarkDelete = TRUE; // indicates that the rigth mouse button was pressed ->
// CLEAR SCREEN
pDoc->DevicePosition = GetDeviceScrollPosition( );
pDoc->Mark_x = point.x;
pDoc->Mark_y = point.y;
P1Out NameP1Out;
NameP1Out.SetDocPointer(pDoc);
NameP1Out.SaveValues();
CScrollView::OnInitialUpdate();
}
CScrollView::OnLButtonUp(nFlags, point);
}
// This function is called when the right mouse button is pressed -> CLEAR P1
void CCircleDiagramView::OnRButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CCircleDiagramDoc* pDoc = GetDocument();
if (pDoc->StartSwitch)
{
CCircleDiagramDoc* pDoc = GetDocument();
pDoc->MarkDelete = FALSE;
CScrollView::OnInitialUpdate();
}
CScrollView::OnRButtonDown(nFlags, point);
}
//Call PrintDlg-DialogBox
PrintScreenDlg NPrintScreen;
NPrintScreen.DoModal();
CScrollView::OnInitialUpdate();
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 111
CScrollView::OnInitialUpdate();
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 112
class CCircleDiagramDoc;
class DrawAxis
{
public:
int y;
int x;
int yV;
int xV;
float BasePower;
void SetDocPointer(CCircleDiagramDoc*);
void pDCPointer(CDC*);
void DrawPowerFactorLine(int zoom);
void DrawMark(int zoom);
void DrawPQaxis(int zoom);
void DrawCircles(int zoom, double radius, CString circleName,int Colour);
void DrawSCircle(int zoom, double radius);
DrawAxis();
virtual ~DrawAxis();
protected:
CCircleDiagramDoc *pDoc;
CDC *pDC;
};
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 113
#include "stdafx.h"
#include "DrawAxis.h"
#include "MainFrm.h"
#include "Circle DiagramDoc.h"
#include <afxwin.h>
#include <math.h>
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
DrawAxis::DrawAxis()
{
DrawAxis::~DrawAxis()
{
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 114
pDC->MoveTo(x,y-215*zoom); pDC->LineTo(x+4*zoom,y-207*zoom);
pDC->MoveTo(x,y+215*zoom); pDC->LineTo(x-4*zoom,y+207*zoom); // Draw bottom arrow
pDC->MoveTo(x,y+215*zoom); pDC->LineTo(x+4*zoom,y+207*zoom);
pDC->SelectStockObject(BLACK_PEN);
CFont Text_Achse;
Text_Achse.CreatePointFont(70*zoom, "Arial", pDC);
CFont* pOldFont = pDC->SelectObject(&Text_Achse);
pDC->SetBkMode(TRANSPARENT);
pDC->TextOut(x-250*zoom,y-6*zoom,"P [p.u.]");
pDC->TextOut(x-16*zoom,y-228*zoom,"Q [p.u.]");
pDC->TextOut(x-7*zoom,y,"0");
pDC->MoveTo(x-3*zoom,y-i*zoom); pDC->LineTo(x+3*zoom,y-i*zoom);
pDC->TextOut(x-17*zoom,y-(i+5)*zoom,axis_value);
pDC->MoveTo(x-i*zoom,y-3*zoom); pDC->LineTo(x-i*zoom,y+3*zoom);
pDC->TextOut(x-(i+6)*zoom,y+2*zoom,axis_value);
}
pDC->MoveTo(x-3*zoom,y+i*zoom); pDC->LineTo(x+3*zoom,y+i*zoom);
pDC->TextOut(x-20*zoom,y+(i-5)*zoom,axis_value);
pDC->MoveTo(x+i*zoom,y-3*zoom); pDC->LineTo(x+i*zoom,y+3*zoom);
pDC->TextOut(x+(i-9)*zoom,y+2*zoom,axis_value);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////// V axis /////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
double pi = 3.1415926535;
pDC->SelectObject(&newPen);
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 115
pDC->MoveTo(xV-215*zoom,yV); pDC->LineTo(xV-207*zoom,yV+4*zoom);
pDC->MoveTo(xV+215*zoom,yV); pDC->LineTo(xV+207*zoom,yV-4*zoom); // Draw right arrow
pDC->MoveTo(xV+215*zoom,yV); pDC->LineTo(xV+207*zoom,yV+4*zoom);
pDC->SelectStockObject(BLACK_PEN);
pDC->TextOut(xV-250*zoom,yV-6*zoom,"V [p.u.]");
pDC->TextOut(xV-16*zoom,yV-228*zoom,"V [p.u.]");
// Scale V Axis
pDC->TextOut(xV-7*zoom,yV,"0");
pDC->MoveTo(xV-3*zoom,yV+i*zoom); pDC->LineTo(xV+3*zoom,yV+i*zoom);
pDC->TextOut(xV-17*zoom,yV+(i-5)*zoom,axis_value);
pDC->MoveTo(xV-3*zoom,yV-i*zoom); pDC->LineTo(xV+3*zoom,yV-i*zoom);
pDC->TextOut(xV-17*zoom,yV-(i+5)*zoom,axis_value);
pDC->MoveTo(xV+i*zoom,yV-3*zoom); pDC->LineTo(xV+i*zoom,yV+3*zoom);
pDC->TextOut(xV+(i-6)*zoom,yV+2*zoom,axis_value);
pDC->MoveTo(xV-i*zoom,yV-3*zoom); pDC->LineTo(xV-i*zoom,yV+3*zoom);
pDC->TextOut(xV-(i+6)*zoom,yV+2*zoom,axis_value);
}
}
int i;
int xcircle1, ycircle1,xcircle2, ycircle2;
double pi = 3.1415926535;
double circle[2][181];
double angle;
// The angle StoreAngle is (90-theta); theta=artan(X/R)
double StoreAngle = (double) (90-(pDoc->AngleCalc)*180/pi);
// Draw circle
int DrawVar = 1;
if (Colour == 0) DrawVar = 2; // For black circles draw intercepted lines
if (Colour == 255) DrawVar = 1; // For red circles draw normal lines
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 116
pDC->MoveTo(xV-xcircle1,yV-ycircle1);
pDC->LineTo(xV-xcircle2,yV-ycircle2);
}
// Text circle
int intradius = (int) radius;
pDC->SetTextColor (RGB(Colour,0,0));
pDC->TextOut(xV+50*zoom,yV-(intradius+2)*zoom,circleName);
pDC->SetTextColor (RGB(0,0,0));
}
// Draw circle
for (i = 1; i<361; i=i+2)
{
xcircle1 = (int) circle[0][i-1];
ycircle1 = (int) circle[1][i-1];
pDC->MoveTo(x-xcircle1,y-ycircle1);
pDC->LineTo(x-xcircle2,y-ycircle2);
}
// TextOut
if (radius>0)
{
TextCircle.Format ("Sr = %.2f MVA",radius*pDoc->P_DRAWFACTOR);
pDC->TextOut((int) (x-circle[0][135]+5*zoom),(int)(y-circle[1][135]),TextCircle);
}
}
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 117
float PFangle;
double pi = 3.1415926535;
CPen newPen(PS_SOLID,1,RGB(0,0,0));
pDC->SelectObject(&newPen);
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 118
if (pDoc->MarkSwitch)
{
Mark_x = (x-(pDoc->DevicePosition.x + pDoc->Mark_x));
Mark_y = (y-(pDoc->DevicePosition.y + pDoc->Mark_y));
pDoc->MarkZoom = 1;
}
else
{
Mark_x = (int) ((x-(pDoc->DevicePosition.x + pDoc->Mark_x))*pDoc->MarkZoom);
Mark_y = (int) ((y-(pDoc->DevicePosition.y + pDoc->Mark_y))*pDoc->MarkZoom);
}
pDC->TextOut(x-Mark_x-6*zoom,y-Mark_y-10*zoom,"P1");
pDC->MoveTo(x,y);
pDC->LineTo(x-Mark_x,y-Mark_y);
pDC->MoveTo(xV,yV);
pDC->LineTo(x-Mark_x,y-Mark_y);
}
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 119
class CCircleDiagramDoc;
class CCircleDiagramView;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Input dialog
// Class for the Input-Dlg-Box
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void SetDocPointer(CCircleDiagramDoc*);
void SetViewPointer(CCircleDiagramView*);
// Dialog Data
//{{AFX_DATA(Input)
enum { IDD = IDD_INPUT };
float m_BaseVoltage;
float m_FaultLevel;
float m_Reactance;
float m_PCSS;
float m_Resistance;
float m_Voltage;
float m_XRratio1;
float m_Angle;
float m_Impedance;
float m_XRratio2;
BOOL m_CheckRX;
BOOL m_CheckZ;
BOOL m_CheckPSCC;
BOOL m_CheckFault;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(Input)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
CCircleDiagramDoc *pDoc;
CCircleDiagramView *pView;
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 120
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 121
#include "stdafx.h"
#include "Circle Diagram.h"
#include "Input.h"
#include "Circle DiagramDoc.h"
#include "Circle DiagramView.h"
#include "Calculations.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Input dialog
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 122
BEGIN_MESSAGE_MAP(Input, CDialog)
//{{AFX_MSG_MAP(Input)
ON_EN_CHANGE(IDC_VOLTAGE, OnChangeVoltage)
ON_BN_CLICKED(IDC_CHECK_RX, OnCheckRx)
ON_BN_CLICKED(IDC_CHECK_Z, OnCheckZ)
ON_BN_CLICKED(IDC_CHECK_PSCC, OnCheckPscc)
ON_BN_CLICKED(IDC_CHECK_Fault, OnCHECKFault)
ON_EN_CHANGE(IDC_RESISTANCE, OnChangeResistance)
ON_EN_CHANGE(IDC_Reactance, OnChangeReactance)
ON_EN_CHANGE(IDC_Impedance, OnChangeImpedance)
ON_EN_CHANGE(IDC_Angle, OnChangeAngle)
ON_EN_CHANGE(IDC_PSCC, OnChangePscc)
ON_EN_CHANGE(IDC_XRratio1, OnChangeXRratio1)
ON_EN_CHANGE(IDC_XRratio2, OnChangeXRratio2)
ON_EN_CHANGE(IDC_FAULTLEVEL, OnChangeFaultlevel)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Input message handlers
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 123
m_CheckRX = TRUE;
m_CheckZ = FALSE;
m_CheckPSCC = FALSE;
m_CheckFault = FALSE;
// Initialise IndicationCheckBox
IndicationCheckBox = 1;
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
UpdateData(TRUE);
pDoc->BaseVoltage = m_BaseVoltage;
pDoc->FaultLevel = m_FaultLevel;
pDoc->Reactance = m_Reactance;
pDoc->PCSS = m_PCSS;
pDoc->Resistance = m_Resistance;
pDoc->Voltage = m_Voltage;
if (m_CheckPSCC == TRUE) pDoc->XRratio = m_XRratio1;
pDoc->Angle = m_Angle;
pDoc->Impedance = m_Impedance;
if (m_CheckFault == TRUE) pDoc->XRratio = m_XRratio2;
pDoc->IndicationCheckBox = IndicationCheckBox;
CDialog::OnOK();
pView->CallDrawUpdate();
}
CDialog::OnCancel();
pView->CallInitialUpdate();
}
UpdateData(TRUE);
m_BaseVoltage = m_Voltage;
pDoc->Voltage = m_Voltage;
if (IndicationCheckBox == 1)
{
pDoc->IndicationCheckBox = IndicationCheckBox;
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 124
pDoc->Resistance = m_Resistance;
pDoc->Reactance = m_Reactance;
}
if (IndicationCheckBox == 2)
{
pDoc->IndicationCheckBox = IndicationCheckBox;
pDoc->Impedance = m_Impedance;
pDoc->Angle = m_Angle;
}
if (IndicationCheckBox == 3)
{
pDoc->IndicationCheckBox = IndicationCheckBox;
pDoc->PCSS = m_PCSS;
pDoc->XRratio = m_XRratio1;
}
if (IndicationCheckBox == 4)
{
pDoc->IndicationCheckBox = IndicationCheckBox;
pDoc->FaultLevel = m_FaultLevel;
pDoc->XRratio = m_XRratio2;
}
CCalculations CalcDlg;
CalcDlg.SetDocPointer(pDoc);
CalcDlg.DoCalculation();
m_Reactance = pDoc->Reactance;
m_FaultLevel = pDoc->FaultLevel;
m_PCSS = pDoc->PCSS;
m_Resistance = pDoc->Resistance;
m_XRratio1 = pDoc->XRratio;
m_Angle = pDoc->Angle;
m_Impedance = pDoc->Impedance;
m_XRratio2 = pDoc->XRratio;
UpdateData(FALSE);
}
if (m_CheckRX==TRUE)
{
m_Resistance = pDoc->Resistance; GetDlgItem(IDC_RESISTANCE)->EnableWindow(TRUE);
m_Reactance = pDoc->Reactance; GetDlgItem(IDC_Reactance)->EnableWindow(TRUE);
m_Impedance = pDoc->Impedance; GetDlgItem(IDC_Impedance)->EnableWindow(FALSE);
m_Angle = pDoc->Angle; GetDlgItem(IDC_Angle)->EnableWindow(FALSE);
m_PCSS = pDoc->PCSS; GetDlgItem(IDC_PSCC)->EnableWindow(FALSE);
m_XRratio1 = pDoc->XRratio; GetDlgItem(IDC_XRratio1)->EnableWindow(FALSE);
m_FaultLevel = pDoc->FaultLevel; GetDlgItem(IDC_FAULTLEVEL)->EnableWindow(FALSE);
m_XRratio2 = pDoc->XRratio; GetDlgItem(IDC_XRratio2)->EnableWindow(FALSE);
m_CheckZ = FALSE;
m_CheckPSCC = FALSE;
m_CheckFault = FALSE;
IndicationCheckBox = 1;
}
else
{
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 125
GetDlgItem(IDC_RESISTANCE)->EnableWindow(FALSE);
GetDlgItem(IDC_Reactance)->EnableWindow(FALSE);
}
UpdateData (FALSE);
}
if (m_CheckZ==TRUE)
{
m_Resistance = pDoc->Resistance; GetDlgItem(IDC_RESISTANCE)->EnableWindow(FALSE);
m_Reactance = pDoc->Reactance; GetDlgItem(IDC_Reactance)->EnableWindow(FALSE);
m_Impedance = pDoc->Impedance; GetDlgItem(IDC_Impedance)->EnableWindow(TRUE);
m_Angle = pDoc->Angle; GetDlgItem(IDC_Angle)->EnableWindow(TRUE);
m_PCSS = pDoc->PCSS; GetDlgItem(IDC_PSCC)->EnableWindow(FALSE);
m_XRratio1 = pDoc->XRratio; GetDlgItem(IDC_XRratio1)->EnableWindow(FALSE);
m_FaultLevel = pDoc->FaultLevel; GetDlgItem(IDC_FAULTLEVEL)->EnableWindow(FALSE);
m_XRratio2 = pDoc->XRratio; GetDlgItem(IDC_XRratio2)->EnableWindow(FALSE);
m_CheckRX = FALSE;
m_CheckPSCC = FALSE;
m_CheckFault = FALSE;
IndicationCheckBox = 2;
}
else
{
GetDlgItem(IDC_Impedance)->EnableWindow(FALSE);
GetDlgItem(IDC_Angle)->EnableWindow(FALSE);
}
UpdateData (FALSE);
}
if (m_CheckPSCC == TRUE)
{
m_Resistance = pDoc->Resistance; GetDlgItem(IDC_RESISTANCE)->EnableWindow(FALSE);
m_Reactance = pDoc->Reactance; GetDlgItem(IDC_Reactance)->EnableWindow(FALSE);
m_Impedance = pDoc->Impedance; GetDlgItem(IDC_Impedance)->EnableWindow(FALSE);
m_Angle = pDoc->Angle; GetDlgItem(IDC_Angle)->EnableWindow(FALSE);
m_PCSS = pDoc->PCSS; GetDlgItem(IDC_PSCC)->EnableWindow(TRUE);
m_XRratio1 = pDoc->XRratio; GetDlgItem(IDC_XRratio1)->EnableWindow(TRUE);
m_FaultLevel = pDoc->FaultLevel; GetDlgItem(IDC_FAULTLEVEL)->EnableWindow(FALSE);
m_XRratio2 = pDoc->XRratio; GetDlgItem(IDC_XRratio2)->EnableWindow(FALSE);
m_CheckRX = FALSE;
m_CheckZ = FALSE;
m_CheckFault = FALSE;
IndicationCheckBox = 3;
}
else
{
GetDlgItem(IDC_PSCC)->EnableWindow(FALSE);
GetDlgItem(IDC_XRratio1)->EnableWindow(FALSE);
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 126
}
UpdateData (FALSE);
}
if (m_CheckFault == TRUE)
{
m_Resistance = pDoc->Resistance; GetDlgItem(IDC_RESISTANCE)->EnableWindow(FALSE);
m_Reactance = pDoc->Reactance; GetDlgItem(IDC_Reactance)->EnableWindow(FALSE);
m_Impedance = pDoc->Impedance; GetDlgItem(IDC_Impedance)->EnableWindow(FALSE);
m_Angle = pDoc->Angle; GetDlgItem(IDC_Angle)->EnableWindow(FALSE);
m_PCSS = pDoc->PCSS; GetDlgItem(IDC_PSCC)->EnableWindow(FALSE);
m_XRratio1 = pDoc->XRratio; GetDlgItem(IDC_XRratio1)->EnableWindow(FALSE);
m_FaultLevel = pDoc->FaultLevel; GetDlgItem(IDC_FAULTLEVEL)->EnableWindow(TRUE);
m_XRratio2 = pDoc->XRratio; GetDlgItem(IDC_XRratio2)->EnableWindow(TRUE);
m_CheckRX = FALSE;
m_CheckZ = FALSE;
m_CheckPSCC = FALSE;
IndicationCheckBox = 4;
}
else
{
GetDlgItem(IDC_FAULTLEVEL)->EnableWindow(FALSE);
GetDlgItem(IDC_XRratio2)->EnableWindow(FALSE);
}
UpdateData (FALSE);
}
UpdateData(TRUE);
pDoc->Resistance = m_Resistance;
pDoc->IndicationCheckBox = IndicationCheckBox;
CCalculations CalcDlg;
CalcDlg.SetDocPointer(pDoc);
CalcDlg.DoCalculation();
m_FaultLevel = pDoc->FaultLevel;
m_Reactance = pDoc->Reactance;
m_PCSS = pDoc->PCSS;
m_XRratio1 = pDoc->XRratio;
m_Angle = pDoc->Angle;
m_Impedance = pDoc->Impedance;
m_XRratio2 = pDoc->XRratio;
UpdateData(FALSE);
}
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 127
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
UpdateData(TRUE);
pDoc->Reactance = m_Reactance;
pDoc->IndicationCheckBox = IndicationCheckBox;
CCalculations CalcDlg;
CalcDlg.SetDocPointer(pDoc);
CalcDlg.DoCalculation();
m_FaultLevel = pDoc->FaultLevel;
m_PCSS = pDoc->PCSS;
m_Resistance = pDoc->Resistance;
m_XRratio1 = pDoc->XRratio;
m_Angle = pDoc->Angle;
m_Impedance = pDoc->Impedance;
m_XRratio2 = pDoc->XRratio;
UpdateData(FALSE);
}
UpdateData(TRUE);
pDoc->Impedance = m_Impedance;
pDoc->IndicationCheckBox = IndicationCheckBox;
CCalculations CalcDlg;
CalcDlg.SetDocPointer(pDoc);
CalcDlg.DoCalculation();
m_FaultLevel = pDoc->FaultLevel;
m_Reactance = pDoc->Reactance;
m_PCSS = pDoc->PCSS;
m_Resistance = pDoc->Resistance;
m_XRratio1 = pDoc->XRratio;
m_Angle = pDoc->Angle;
m_XRratio2 = pDoc->XRratio;
UpdateData(FALSE);
}
// This function is called if the value in the 'Z angle' edit-box is changed
void Input::OnChangeAngle()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
UpdateData(TRUE);
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 128
pDoc->Angle = m_Angle;
pDoc->IndicationCheckBox = IndicationCheckBox;
CCalculations CalcDlg;
CalcDlg.SetDocPointer(pDoc);
CalcDlg.DoCalculation();
m_FaultLevel = pDoc->FaultLevel;
m_Reactance = pDoc->Reactance;
m_PCSS = pDoc->PCSS;
m_Resistance = pDoc->Resistance;
m_Impedance = pDoc->Impedance;
m_XRratio1 = pDoc->XRratio;
m_XRratio2 = pDoc->XRratio;
UpdateData(FALSE);
}
UpdateData(TRUE);
pDoc->PCSS = m_PCSS;
pDoc->IndicationCheckBox = IndicationCheckBox;
CCalculations CalcDlg;
CalcDlg.SetDocPointer(pDoc);
CalcDlg.DoCalculation();
m_FaultLevel = pDoc->FaultLevel;
m_Reactance = pDoc->Reactance;
m_Resistance = pDoc->Resistance;
m_Impedance = pDoc->Impedance;
m_XRratio1 = pDoc->XRratio;
m_Angle = pDoc->Angle;
m_XRratio2 = pDoc->XRratio;
UpdateData(FALSE);
}
UpdateData(TRUE);
pDoc->XRratio = m_XRratio1;
pDoc->IndicationCheckBox = IndicationCheckBox;
CCalculations CalcDlg;
CalcDlg.SetDocPointer(pDoc);
CalcDlg.DoCalculation();
m_FaultLevel = pDoc->FaultLevel;
m_Reactance = pDoc->Reactance;
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 129
m_PCSS = pDoc->PCSS;
m_Resistance = pDoc->Resistance;
m_Impedance = pDoc->Impedance;
m_Angle = pDoc->Angle;
m_XRratio2 = pDoc->XRratio;
UpdateData(FALSE);
}
UpdateData(TRUE);
pDoc->XRratio = m_XRratio2;
pDoc->IndicationCheckBox = IndicationCheckBox;
CCalculations CalcDlg;
CalcDlg.SetDocPointer(pDoc);
CalcDlg.DoCalculation();
m_FaultLevel = pDoc->FaultLevel;
m_Reactance = pDoc->Reactance;
m_PCSS = pDoc->PCSS;
m_Resistance = pDoc->Resistance;
m_Impedance = pDoc->Impedance;
m_XRratio1 = pDoc->XRratio;
m_Angle = pDoc->Angle;
UpdateData(FALSE);
}
// This function is called if the value in the 'Fault level' edit-box is changed
void Input::OnChangeFaultlevel()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
UpdateData(TRUE);
pDoc->FaultLevel = m_FaultLevel;
pDoc->IndicationCheckBox = IndicationCheckBox;
CCalculations CalcDlg;
CalcDlg.SetDocPointer(pDoc);
CalcDlg.DoCalculation();
m_Reactance = pDoc->Reactance;
m_PCSS = pDoc->PCSS;
m_Resistance = pDoc->Resistance;
m_Impedance = pDoc->Impedance;
m_XRratio1 = pDoc->XRratio;
m_Angle = pDoc->Angle;
m_XRratio2 = pDoc->XRratio;
UpdateData(FALSE);
}
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 130
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 131
#include "stdafx.h"
#include "Circle Diagram.h"
#include "Input.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CMainFrame
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
ON_WM_CREATE()
ON_WM_MOUSEMOVE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
CMainFrame::~CMainFrame()
{
}
if (!m_wndToolBar.CreateEx(this) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndDlgBar.Create(this, IDR_MAINFRAME,
CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR))
{
TRACE0("Failed to create dialogbar\n");
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 132
if (!m_wndReBar.Create(this) ||
!m_wndReBar.AddBar(&m_wndToolBar) ||
!m_wndReBar.AddBar(&m_wndDlgBar))
{
TRACE0("Failed to create rebar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
return 0;
}
return TRUE;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}
#endif //_DEBUG
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 133
class CCircleDiagramDoc;
class P1Out
{
public:
void SaveValues();
void SetDocPointer(CCircleDiagramDoc*);
void ScreenOutP1(CDC* pDC);
P1Out();
virtual ~P1Out();
protected:
CCircleDiagramDoc *pDoc;
};
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 134
#include "stdafx.h"
#include "Circle Diagram.h"
#include "P1Out.h"
#include "Circle DiagramDoc.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
P1Out::P1Out()
{
P1Out::~P1Out()
{
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 135
pDC->TextOut(800,xOutput+130," ");
pDC->TextOut(800,xOutput+130,"P1 - sending-end values:");
pDC->TextOut(800,xOutput+150," ");
pDC->TextOut(800,xOutput+150,pDoc->SaveP1Vout);
pDC->TextOut(800,xOutput+260," ");
pDC->TextOut(800,xOutput+260,pDoc->SaveP1LAngleout);
pDC->TextOut(800,xOutput+165," ");
pDC->TextOut(800,xOutput+165,pDoc->SaveP1Psout);
pDC->TextOut(800,xOutput+180," ");
pDC->TextOut(800,xOutput+180,pDoc->SaveP1Qsout);
pDC->TextOut(800,xOutput+195," ");
pDC->TextOut(800,xOutput+195,pDoc->SaveP1Ssout);
pDC->TextOut(800,xOutput+210," ");
pDC->TextOut(800,xOutput+210,pDoc->SaveP1PFSendout);
pDC->TextOut(800,xOutput+225," ");
pDC->TextOut(800,xOutput+225,pDoc->SaveP1AngleSendOut);
pDC->TextOut(800,xOutput+210," ");
pDC->TextOut(800,xOutput+210,pDoc->SaveP1PFSendout);
pDC->TextOut(800,xOutput+225," ");
pDC->TextOut(800,xOutput+225,pDoc->SaveP1AngleSendOut);
pDC->TextOut(800,xOutput+275," ");
pDC->TextOut(800,xOutput+275,pDoc->SaveP1Iout);
}
}
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 136
class CCircleDiagramDoc;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PowerFactor dialog
// Class for the PowerFactor-Dlg-Box
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void SetDocPointer(CCircleDiagramDoc*);
// Dialog Data
//{{AFX_DATA(PowerFactor)
enum { IDD = IDD_POWERFACTOR };
float m_PowerFactor;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(PowerFactor)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
CCircleDiagramDoc *pDoc;
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 137
#include "stdafx.h"
#include "Circle Diagram.h"
#include "PowerFactor.h"
#include "Circle DiagramDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PowerFactor dialog
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
BEGIN_MESSAGE_MAP(PowerFactor, CDialog)
//{{AFX_MSG_MAP(PowerFactor)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PowerFactor message handlers
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
pDoc->PFSwitch = TRUE;
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 138
UpdateData(TRUE);
pDoc->PowerFactor = m_PowerFactor;
CDialog::OnOK();
}
pDoc->PFSwitch = FALSE;
CDialog::OnCancel();
}
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 139
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PrintScreenDlg dialog
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Dialog Data
//{{AFX_DATA(PrintScreenDlg)
enum { IDD = IDD_PrintDlg };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(PrintScreenDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 140
#include "stdafx.h"
#include "Circle Diagram.h"
#include "PrintScreenDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PrintScreenDlg dialog
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
BEGIN_MESSAGE_MAP(PrintScreenDlg, CDialog)
//{{AFX_MSG_MAP(PrintScreenDlg)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PrintScreenDlg message handlers
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 141
class CCircleDiagramDoc;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Sconstant dialog
// Class for the Sconstant-Dlg-Box
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void SetDocPointer(CCircleDiagramDoc*);
// Dialog Data
//{{AFX_DATA(Sconstant)
enum { IDD = IDD_SCONSTANT };
double m_RadiusSCircle;
double m_RadiusSCircle2;
double m_RadiusSCircle3;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(Sconstant)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
CCircleDiagramDoc *pDoc;
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 142
#include "stdafx.h"
#include "Circle Diagram.h"
#include "Sconstant.h"
#include "Circle DiagramDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Sconstant dialog
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
BEGIN_MESSAGE_MAP(Sconstant, CDialog)
//{{AFX_MSG_MAP(Sconstant)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Sconstant message handlers
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
UpdateData(TRUE);
pDoc->Sradius = m_RadiusSCircle;
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 143
pDoc->Sradius2 = m_RadiusSCircle2;
pDoc->Sradius3 = m_RadiusSCircle3;
CDialog::OnOK();
}
BOOL Sconstant::OnInitDialog()
{
CDialog::OnInitDialog();
m_RadiusSCircle = pDoc->Sradius;
m_RadiusSCircle2 = pDoc->Sradius2;
m_RadiusSCircle3 = pDoc->Sradius3;
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 144
10.11 Resource.h
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Next default values for new objects
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz
Appendix 145
“Modelling the Absorbence of the Rural Distribution Network for Connection of EGs” Robert Schmaranz