The common information model of power system network will be written for a power system network, using that details we have to generate the network in a software. My work is given in this document.
Application of Residue Theorem to evaluate real integrations.pptx
MIMIC DIAGRAM GENERATION FOR POWER SYSTEM ANALYSIS
1. MIMIC DIAGRAMS CIM BASED
FOR BOTH POWER FLOW AND
SUBSTATION
Internship Report
Nikhil Valiveti
B.Tech 3rd year at Nit Rourkela
Guidance by
Dr.Gurunath Gurrala
2. 1
Table of contents
List of figures ........................................................................................................................ 4
List of Abbreviation’s ……………………………………………………………………………………….. 5
Chapter 1: Introduction ....................................................................................... 6
1.1 Problem statement and research objectives ……………………………………..….. 7
1.1.1 Problem statement.................................................................................... 7
1.1.2 Research Objectives ……………………………………………………………………... 8
1.2 Organization of the Report ……………………………………………………………………….. 9
Chapter 2: Technical Descriptions……………………………………………………… 10
2.1 Description of XML ………………………………………………………………………………….. 10
2.2 Description of CIM …………………………………………………………………………………... 10
2.3 Types of substation configurations ………………………………………………………… 11
2.4 Frontend Vs Backend development of software ………………………………………. 11
2.5 Description of GUI Development …………………………………………………………….. 11
2.6 Differentiation between Framework and Library ………………………………... 12
2.7 Description of Open source package …………………………………………………….. 13
Chapter 3: Project Initiation………………….………………………………………………….. 14
3.1 Cons of Updating the Open-source software………………………………………. 14
3.2 Essence of developing the new software…………………………………….. 15
Chapter 4: Fundamentals for developing the new software...... 16
4.1 Selection of the Programming language........................................................ 16
4.2 Selection of appropriate Packages…………………………………………………………… 16
3. 2
Chapter 5: Instruction for Libraries installation……………………………... 18
5.1 Installing python……………………………………………………………………………………………... 18
5.2 Installing pip ………………………………………………………………………………………………….… 18
5.3 Installing Numpy and Scipy ……………………………………………………………………...….18
Chapter 6: Objective1-Parsing of CIM XML file ………….…………………….20
6.1 Prerequisite Concepts for the parsing of CIM XML code……………………..…17
6.2 Some information regarding the prerequisites ……………………………………….. 19
6.3 sample code for parsing simple xml’s …………………………………………………………….. 20
6.4 sample code for parsing xml containing namespace …………………………..… 21
6.5 possibility of mislead in parsing CIM xml file …………………………………………. 22
6.6 Key points in parsing CIM XML file …………………………………………………………..23
6.7 Logic behind the parsing CIM XML file (IEC 61850) ………………….………...24
6.8 Demonstration of the Code parsing CIM file ………………………………………….. 26
Chapter 7: Approach to Automatic generation of one line
diagrams of PS network……………………………………………………………………………..…37
7.1 Initiating the approach ………………………………………………………………......................37
7.2 Selection of structured graph drawing package……………………………………… 38
7.3 Selection of GUI packages……………………………………………………………………………..38
7.4 Key points in the networkx usage ……………………………………………………………….38
7.5 key points the Matplotlib usage …………………………………………………………………. 40
Chapter 8: Methods to generate the power system network………43
8.1. Artificial Intelligence (AI) …………………………………………………………………………... 43
8.2. Algorithmic Approach and its types……………………………………………………….….44
4. 3
8.3 Components positioning algorithm ………………………………………………………….. 45
8.3.1 The Spring Embedder algorithm…………………………………………………...45
8.3.2 Rooted Tree Node Positioning algorithm………………………………..….46
8.3.3 Controlled Spring Embedder algorithm with Grid Aligning……46
8.4 Need for generation of all the substation configurations diagrams
individually ………………………………………………………………………………………….………………... 47
8.5 Generation of the Double bus double breaker substation configuration
diagram ………………………………………………………………………………………………………………….. 47
8.5.1 Demonstration of the python code for generation of double bus
double breaker substation configuration diagram ……………………………………..….47
8.6 Updatation of CIM file for inter conversion in the substation
configurations ………………………………………………………………………………………………………….54
Chapter 9: Line routing techniques for routing the components
in power system network……………………………………………………………………………….57
Chapter 10: Future enhancements………………………………………………………….. 58
Chapter 11: References ………………………………………………………………………………..…59
5. 4
List of figures
Fig 2.6.1 Differentiation between Framework vs library…………………………….……12
Fig 3.1 High level architecture view of Inter pss software [5]……………………..…14
Fig 6.2.1 Tree diagram representation of XML file…………………………………………...21
Fig 6.3.1 Sample xml file …………………………………………………………………………………….………..22
Fig 6.3.2 python code for parsing sample xml file………………………………………………22
Fig 6.4.1 sample xml file with namespaces in it…………………………………………….…….23
Fig 6.4.2 python code for parsing xml containing namespace…………………24
Fig 6.6.1 Sample diagram of the node breaker model……………………………..……… 26
Fig 6.7.1 Pictorial view of classes used in parsing CIM file……………………………...28
Fig 6.8 python code for parsing CIM XML………………………………………………………….…28
Fig 7.4.1 sample network graph with nodes and edges…………………………..….…….39
Fig 7.5.1 sample network graph with images as nodes…………………………………..… 42
Fig: 8.3.1.1 Output showing drawbacks of spring embedded algorithm…. 45
Fig 8.3.2.1 View of Output using rooted tree node algorithm…………………46
Fig 8.5.1.1: Double bus double breaker substation configuration………………..54
6. 5
List of Abbreviation’s
RTS Reliability Test System
INTER PSS Internet Technology based Power System Simulator
PSAT Power System Analysis Toolbox
CIM Common Information Model
IEC International Electro-technical Commission
RDF Resource Description Format
XML Extensible Markup Language
GUI Graphic User Interface
AI Artificial intelligence
IDE Integrated Development Environment
SCADA Supervisory control and data acquisition
7. 6
Chapter 1
Introduction
Electrical power systems are very complex and highly integrated. Failure in any part of
the system can cause interruptions of supply to end users. Power system reliability is
increasingly a concern to the power industry and society at large. Generally, reliability
analysis is being carried out during planning stage of power system operations. In order
to maintain the operational state of the power systems at the required levels and
subsequently to meet the load demand satisfactorily, the power system operations such
as state estimation, reliability analysis etc., are to be carried out at frequent intervals
during operation period of power systems in order to monitor the customer requirement
satisfaction at desired levels. The reliability evaluation system should be dynamically
adaptable to the current operating conditions of power systems.
The IEEE Reliability Test System [1] was developed by the IEEE Reliability
subcommittee over the years and many test system have been given for researchers to
apply the advanced algorithms to it.
Concerns about breaker frequency as fault currents increase have generated the need for
fault analysis methods that provide individual breaker fault current’s present in
substations which we can’t see in the bus/branch model’s, So the fault analysis with
models that explicitly represent the location of breakers and determine the exact fault
current through specific breakers are needed. Similarly, it is desirable to quantify the
effects of breaker topology and relaying schemes on system reliability, which leads to the
need of a breaker-oriented model [1].
Now-a-days many software’s are being developed to perform state estimation analysis,
improved fault analysis, power flow etc., but in all these most of the simulation software’s
power system network are designed with bus/branch model over the node break model
because of the lack of computational power . As the node break model increases the
number of breakers and nodes additional to bus/branch models required large
computational power. Since now a days as technology has been developed such a way that
it can give sufficient computational power to process the simulations.
Hence this made the cause for developing a software which can able to perform the
analysis required by researchers on the node breaker model of power system network
and you may ask that power world and etc., licensed software’s perform all these type
actions but the money required to pay for getting the license is enormous. Hence
research on this topic is good thing to initiate.
8. 7
Bus/branch model can be converted to the node breaker model by splitting the each bus
in the network to corresponding substation configuration like double bus double
breaker, double bus single breaker and ring bus etc., can be seen in [18] actually used in
the substations in place of a using a single bus. So now, analysis made to this network
behaves as the power system network in reality.
Graphical user interfaces (GUIs) provide interactive and intuitive visual communication
to power application programs, enhancing the ability of engineers to perform their work
with better control, flexibility, effectiveness and efficiency. Up to date, in many Gul’s for
power system applications have been developed, explored and used in aiding the design
of SCADA systems.
However, in the area of one-line diagram generation, most existing GUI’s provide only
the capability of drawing one-line diagrams manually, where components are first
placed and then linked together incrementally. On top of that it may also lead to human
errors. So this is not reliable process for performing analysis.
Mimic diagrams [6], [21], [22] are the network diagrams of power system which give
the overview of the power system network status. These are diagrams generated by the
researcher’s or professionals for performing power system analysis and get the overview
of how power system network is behaving and based on the results protective measures
could be taken to prevent the faults.
1.1 Problem Statement and Research objectives
1.1.1 Problem Statement
As far as now brief description about the introduction is given, to understand the
problems facing currently in the power system domain regarding the software
development.
To overcome the problem of placing the components in simulation software for large
networks would be a tough task. An automated power system network diagram
generator from the CIM file would be a best way to go like the [7], [8].
As of now there are already open source software’s like INTER PSS, OPEN CIM etc.,
which can perform these tasks like state estimation, load flow analysis etc., [5]
But drawback of them is that they can’t perform on it on Node/breaker model rather
they perform on Bus/branch model.
So there is a need of building the software which can generate the power system network
diagram, buses in the diagram must be interconvertible from bus/branch model to
9. 8
Node/breaker model etc., from the CIM file which represents the all the details of the
network.
1.1.2 Research objectives
With the great extensibility available in power system analysis, main objective of this
project is to understand the state of transmission system by knowing power flow and
Percentage loading of transmission lines etc., through animations.
It can also be extended to three-dimensional display which can demonstrate how
multiple types of quantities vary simultaneously in the network. Amounts of generating
power and two different kinds of reserves each generator provides like active and
reactive power can also viewed through 3D visualization. It also helps in identify critical
regions and help focus problem-solving strategies as shown in [6], [21], [22], [26].
It can be further extended, As the one line diagrams usually reflect the geographical
arrangement of system equipment, contour plots provide a valuable picture of how
quantities such as voltage or transmission loadings vary across the system and these can
arrange geographically, by map projected one line diagrams we can be able to zoom to
view port to display a wider area or to examine particular region more closely and could
pinpoint the specific area’s which are prone to the damage. For pictorial images refer the
paper [21].
So, now the main objective above can be decomposed to 3 smaller objectives
Objective 1:
Need to extract the data, connection details, breaker status from the CIM XML file of the
power system network.
Objective 2:
Automatic generation of 1-line diagrams of the power system network using the CIM file
Objective 2 can further classified into 2 parts,
2.1
Automatic positioning of power system components of the network in the canvas of the
software following the CIM file.
2.2
Automatic routing of the lines between components that are need to form the required
network.
10. 9
Objective 3:
To perform all these actions a software must be needed to build such that it can generate
the diagram on the canvas (user interface) through CIM file.
Objective 4:
Update the software such that it can be able to visualize the Power system network data,
It can display PS analysis results through animations and 3D diagrams (Mimic
diagrams)
1.2 Organization of data
Introduction is given in chapter 1 which shows the problems facing in the power systems
and the cause and use of project of initiation and also the research objectives of doing
the project.
In chapter 2, technical terms and important things which are needed to be described for
understanding of the following pages of the document.
In chapter 3 how to start with the project has been written in a brief.
Chapter 4 gives the fundamentals that to keep in mind for building a new software to
move in right way of approach for reaching the required goal.
Chapter 5 shows the detailed view of installation of libraries that are required to be used
to prevent the errors.
Chapter 6 describes all the details about parsing cim file and basics and precautions to
be taken for parsing the cim file which is given.
Chapter 7 describes the approach in an outline for automatic generation of power
system network.
Chapter 8 describes the ways in which we can generate the power system network in a
theoretical way.
Chapter 9 explains about the line routing techniques for the routing the power system
components after positioning of the components is successful.
Chapter 10 describes the some of the future enhancements which can be done to the
presented work in this document.
Chapter 11 References
11. 10
Chapter 2
Technical Descriptions
2.1 Description of XML
In computing Extensible Markup Language (XML) is a much like HTML but not
same as it, it is markup language that defines a set of rules for encoding documents in a
format that is both human-readable and machine-readable.
XML was designed to store and transport data. XML was designed to be self-
descriptive. For getting started in XML can go through Reference guide for XML .
2.2 Description of CIM
CIM file is a XML file which contains the Power system network data, status and
connection details provided by the power system operators. From which we can get the
complete information about the network. But for the educational usage details about
these things are kept private. So we can’t get the sample CIM files. You may ask why
xml is chosen to write CIM file, cause CIM file need to transported to many pc’s It must
be platform dependent so that everyone able to access the file, hence it is written in CIM
file.
CIM file follows particular IEC Standards [27], [2] for representing the power system
network else everyone could represent their own way of representation which makes
difficult to the end user who want to use it for analysis. Hence the standard convention
is followed for representing the network. Complete information about the standard
convention is also kept private. But the basic required info about the CIM and IEC
standards are available in net for understanding.
Over the years IEC conventions are updating, in this document we used IEC 61850 for
writing CIM even though IEC 61970 is latest one. Reason for that is described in further
proceedings.
12. 11
2.3 Types of Substation Configurations
Actually in a substation number of incoming and outgoing transmission lines will not be
connected by a single they use proper substation configurations like double bus double
breaker, rings bus, main bus and transfer bus, one and half breaker, double bus single
breaker etc., for reliability during maintenance these configuration usage will be helpful
so that there will be no power shut down in such type of conditions. Each of them has a
specific advantage and disadvantages, based on the conditions and location the
substation configuration is selected appropriately and economically.
For all the bus bar schemes details refer bus bar schemes
2.4 Front End vs Backend
The objective of designing an application or website is to ensure that when the users
open up the application they see the information in a format that is easy to read and
relevant. This is further complicated by the fact that users now use a large variety of
devices with varying screen sizes and resolutions thus forcing the designer to take into
consideration these aspects when designing the site. They need to ensure that their site
comes up correctly in different browsers (cross-browser), different operating systems
(cross-platform) and different devices (cross-device), which requires careful planning on
the side of the developer. This type of development can be called as Front end
development
Ex: HTML, CSS, JAVASCRIPT
Code written by back end developers is what communicates the information to the
browser or application. Anything you can't see easily with the eye such as databases and
servers is the work of a back end developer. In more formal, Information or input
given by the user is processed by the backend code and gives the result to display. This
type of development for an application can be called as backend development.
Ex: Ruby, SQL etc.
2.5 Description of GUI development
UI means the user interface or human–machine interface is the part of the machine that
handles the human–machine interaction.
The Graphical User Interface , is a type of user interface that allows users to interact
with electronic devices through graphical icons and visual indicators such as secondary
notation, instead of text-based user interfaces, typed command labels or text navigation.
As far as concerning about the software the GUI is the most important thing, since If UI
is not much attractive user will not prefer to the use it.
13. 12
So for developing the software, building the GUI is known as GUI development, recent
years vast development in GUI’s have been done, such that predefined packages are
available in all programming languages mostly. Just we have to choose the appropriate
one such that it can fulfills our goal.
2.6 Differentiation between Framework and Library
Of course, there are a lot of definitions of frameworks and libraries. Rather than getting
into it, I’d like to illustrate my view on the differences by means of this picture.
Fig 2.6.1 framework vs library
When building an application using a particular framework, the application lives inside
the framework. This is most noticeable when the application is required to inherit from
some framework class, although this is not always the case. From the viewpoint of the
application, the framework is the whole world. The framework is the all-powerful
environment which can do everything the application would ever want (for some
particular domain, at least).
Framework Eg: Java script framework, Ajax framework, Web framework
Alternatively, an application can be writing using libraries (and it’s always libraries,
plural, it’s never just the one). In that design, a library is just tacked on to the side of the
application. The application stands on its own, it has an identity outside of a particular
framework, and it just uses libraries to do some part of the work.
Library Eg: os.system, java.swing, java.awt etc.,
Concluding it, costs of a framework are bigger than the benefits it has. Especially now
that more and more libraries begin using lazy evaluation and higher-order functions.
But, the future of software components is libraries only.
For more reference why libraries are preferred over framework
14. 13
2.7 Description of Open source package
Open source packages are the packages (set of programs) which can be used for free and
available in net. Source code of the package will also be available in net, so that the
developers can update it modify any bugs are there. Hence these packages continuously
changes their version with time.
Eg: all python packages like pypi, pyqt, tkinter etc.
Open source software is also as similar as that software source code will be available and
can be modified for easier user experience by any developer. Doesn’t require any license
for installation also.
15. 14
Chapter 3
Project Initiation
There are 2 ways to start the project,
1. Since already the existence of open source Power System simulation software’s
like Inter PSS, OPENCIM, PSAT lead to a doubt that whether to modify the
source codes of the source software’s and add required plugins (add-ons) to the
existing software such that it makes the work what we required. We will proceed
to the brief view of what each software can do in further proceedings.
2. Another way to start is to develop the software from the scratch, build step by
step fulfilling each objective given above which is big process although but can be
guarantee that if we go through right path which is very important so that we can
meet our goal.
3.1 Cons of Updating the Open source software
The open sources simulation software like Interpss contains graphic editor where we
can construct the one-line network diagram of bus/branch model without breakers and
can perform load flow analysis if some xml code related to the simulation is provided to
it. This software doesn’t follow any rules of CIM standards. Entire source codes of
software was also written in JAVA, for reference guide to start see Reference Guide -
Inter PSS Community
OpenCIM contains xml viewer/ editor where we can view the CIM XML file and can also
edited if needed. It doesn’t generate the network diagram but performs the load flow
analysis etc., from the input CIM XML file.
The updating of these open source software requires good knowledge in Java
programming and also must be an amateur in software developing since the files created
after installation contains many .info, .dll and meta data files which can’t be opened and
viewed directly as even though java programs are modified, it may not compatible
because other files like .info, .dll files require high programming knowledge, more
explanation is given in Problems in modifying .dll files . Even understanding the pre-
rewritten codes is also a difficult task.
16. 15
Fig 3.1 High level architecture view of Inter PSS
3.2 Pros of developing the new software
If the software is developed from everything will be on our control, whatever is needed
accordingly we can build based on it and could be edited if any changes is also required.
But the problem is to justifying the each and every step that we make for approaching
the final goal. If we struck in midway such that if it isn’t possible feasible with the
approach, it may lead to go back and change the process. But a controllable one. Hence
it is suggested for beginners in programming to develop the software from scratch.
17. 16
Chapter 4
Fundamentals for developing the new software
4.1 Selection of programming Language
Choosing programming language for the desired work is the first step to start, mostly
c++, java, python could do this. In the language which you have chosen, ensure that are
there any packages for parsing the xml, able to draw diagrams, building GUI
animations, 3D diagrams, mapping coordinates with the canvas. Even if packages aren’t
there ensure that is it possible to make these things or not. Best thing to do is search for
open source existing packages or libraries as the project itself is a big task, building an
own package could kill lot of time.
4.2 Selection of appropriate packages
After thorough search I got to know cpp and Python could make this since there are
plenty of packages in both of them like PugiXml, c++ library for directed graphs, Qt5,
OpenGL etc., in Cpp and ElementTree, Lxml, networkx, matplotlib, wxpython, Tkinter,
PyQt, Pygame ,PyGraphViz ,Pydot etc., in python. I found python would be better one
to choose because it decreases the length of code for the same work in cpp.
There are enough number of libraries in python such that it becomes difficult to choose
the best one among them such that it capable of doing our required work.
ElementTree, Lxml are the best packages for parsing (extracting) XML (I used
ElementTree). Although lxml has even more features like complete Xpath support which
is not in ElementTree, but it is sufficient for parsing the CIM XML.
Networkx, Graphviz are packages which helps in drawing directed graphs with any
images as nodes and also has additional features. But, networkx has rich library than
Graphviz and also gives some identicalness in view to the circuit diagrams like bus,
breakers as node and transmission lines as edges of graph etc., hence chosen the
networkx package for the required work. More details about Networkx can be seen in
further proceedings.
Matplotlib is a Python 2D plotting library which produces publication quality figures in
a variety of hardcopy formats and interactive environments across platforms. Matplotlib
can be used in Python scripts, the Python IDE and IPython shell, the jupyter notebook,
web application servers, and for graphical user interface toolkits.
18. 17
For GUI development, Matplotlib plot itself displays the output on a tkinter canvas, so
we can perform Event handling directly on it like mouse click, mouse drag etc., even
additional toolbars, combo box things can also be added directly on the matplotlib plot
using widgets. Way For rich GUI development what we require will be shown in further
proceedings.
19. 18
Chapter 5
Instructions for Libraries installation
5.1 Installing Python
Python is available in two latest versions namely 2.7.13 and 3.6.1 and both in 32-bit,
64-bit. Mostly the 2 versions are not much differed in terms of capability. I choose
python 2.7 32-bit which can be handled by a 64-bit CPU. 32-bit version is chosen by me
because some of the packages which I have seen were not available in 64 bit version like
wxpython demo etc., to prevent re installing I chose 32-bit.
For download go to python 2.7.13.
With the installation of python of particular version, 32 bit processor all the packages
which we are going to be installed must be also of compatible version for python
installed and appropriate 32/64 bit as chosen for python.
5.2 Installing PIP
PIP used to install all .whl or wheel files (compressed files), since most of the packages
are available in .whl files it can’t be installed with normal unzipping the compressed
files, it must be installed using pip in command prompt so that pip creates the
distribution files (distribution.info files) while installing the software.
Command to for installing packages change the directory to location where the package
is downloaded and then in cmd type
pip install package name
Eg: pip install networkx
So networkx, Matplotlib , pygame, elementTree, lxml, wxpython, Tkinter can be
installed by using pip.
5.3 Installing Numpy and Scipy
Numpy can also be installed using pip install Numpy but, the problem occurs while
installing Scipy, it requires mathematical kernel library associated with Numpy, so we
have to install numpy+mkl.whl for corresponding python version installed. Hence it is
recommended to install this package from the given link numpy+mkl.whl.
20. 19
Scipy would be useful because it has rich mathematical library associated with Numpy
helps in many ways for applying the electrical algorithms etc., in code.
Scipy can’t be installed through pip. For easy installing download miniconda installer.
After installing miniconda, use command i.e. conda install scipy
It automatically gets the required version numpy and mkl and next scipy will be
installed, if this isn’t happening install numpy+mkl first and next install scipy for proper
installation of scipy.
21. 20
Chapter 6
Parsing CIM XML
6.1 Prerequisite Concepts for the parsing of CIM XML code
After successful installation of elementTree can be verified by checking your installation
directory whether in lib/site-packages/elementTree exists or not.
Assuming that you have basic XML understanding of how to write else refer xml
tutorial, [4].
Concepts required for understanding the following code are
XML [4]
Tree diagram representation of XML code [4]
CIM understanding [3]
Feeder section, substation section part in the CIM file.
Namespaces usage in Xml
Concepts used from python programming
File Handling
Exception Handling
Object programming
Methods
Loops
Command line arguments
Lists and List Comprehensions
elementTree package
Dictionary usage
Tuple usage
Objects creation during Run-time.
Character addition to a string
String slicing
Command line arguments
Error prone areas in the program on wrong usage
Self keyword
Syntax for checking attribute of any tag or attribute consisting of namespace.
22. 21
In appropriate usage of append keyword
Case sensitivity while searching for attributes.
findall ,find keywords of elementTree mismatch usage
In appropriate usage of return keyword while using exception handling.
6.2 Some information regarding the prerequisites
Tree diagram representation of any xml, can be represented or named by the below way
is explained because this representation is used in the parsing CIM XML code.
Child1 can also be called Root[0], subchild1 can also be called as Root[0][0] and so on..
Example xml file1:
<Root>
<child1>
<subchild1>.....</subchild1>
</child1>
<child2>
<subchild2>.....</subchild2>
<subchild3>.....</subchild3>
</child2>
</root>
Fig 6.2.1: Tree diagram representation of XML File
Child2
Root[1]
Parent
Root
Child1
Root[0]
Subchild1
Root[0][0]
Root[0][0]
Subchild2
Root[1][0]
Child2[0]
Subchild3
Root[1][1]
Child2[1]
23. 22
Like as above the each element in the tree could be called in terms of their parent
elements. Which will be useful in parsing the xml.
For mastering the usage of elementTree package refer ElementTree tutorial made by 3rd
party, xml.elementtree.etree tutorial can also be referred and used. But just use the
import statement as i.e.
from elementtree import ElementTree as x.
6.3 Sample codes for parsing simple XML’s
Let a sample xml file be,
Fig 6.3.1 sample xml code
Python code for parsing
Explanation
Given the details how to extract the tags, attributes of the root, child, sub child from the
etc., from the xml file.
Output for the above code
24. 23
Precautions:
Just replace the file location according to your location of the xml and then run
the above python code it works!
File location in the parse, must shouldn’t have backward slashes because /f, /n
have other meaning in the usage.
Hence, it is recommended to use forward slashes () or double backward slashes
(//) so that it doesn’t pop out any error.
ElementTree package named xml.etree.ElementTree is also inbuilt provided in
the python version but it leads errors, hence it is suggested to use the
elementTree package downloaded from net.
If any of the tag or attribute is not existing it prints {}
In finding the attribute part use [ ] not ( ) for preventing the error.
6.4 Sample codes for parsing XML file with namespaces
Let us take a sample another xml file containing namespaces,
25. 24
Fig 6.4.1 sample xml code with namespaces
Python code for parsing,
Explanation
Parse the cim file and applied loop for getting the child of the root.
1. (for child in root) represents it loops across the child’s of root in xml.
2. Child.tag or attrib gives the details regarding the child’s.
3. We can also loop over child in other way like using tree diagram representation of xml
4. Root[0] corresponds to the first child , root[1] corresponds to second child, root[i]
ranging i over 10 covers all the first 10 child’s of the xml.
5. Checking of attributes can be done using if condition and if it is true you can do the
actions like get the child’s attributes or tags etc.,
Output of the above code
26. 25
Precautions:
Since the cim namespace contains (“: “ ) character, we can’t use directly the
attribute or tag name as it is, we need to represent it as ‘{0}ID’.format(rdf) or
(‘{http://www.w3.org/1999/02/22-rdf-syntax-ns#}ID’) both ways it can
be written to prevent from error.
If any keyError is popped up interchange the ways of writing the above line it
may solve some times.
6.5 Possibility of mislead in parsing the CIM XML file
The CIM convention is highly important in writing a generic code for parsing any CIM
file, because the CIM can follow IEC standards like IEC 61970 which is the latest one,
IEC 61850 bit older than the previous one also refer this [2] for IEC 61850 details
But as of newbie to start writing a CIM file, we think the newer convention of IEC would
be the best one, following the newer convention we observed that IEC 61970 has some
drawbacks in the xml updatability. As, when there is any changes in any substation
configuration at any bus CIM xml code has to update which has to be done by a code,
such that while generating the network will also generate the updated one.
Drawbacks of writing CIM in IEC 61970 is given even more clear in the XML model for
the CIM exchange [30]
6.6 Key-points in parsing any CIM file
For parsing an xml first thing we need to know is that, what are the details we have to
parse for the required work.
For generating a network from a code, we need to know all the connection details for
generating the network.
The components in the network represented by cim are
1. Connectivity Nodes
2. Breakers
3. Generators
4. Transformers
5. Transmission lines
6. Terminals
27. 26
Fig 6.6.1 Sample node/breaker model diagram
Feeder section and substation part in the node/breaker model of any circuit look like
above figure.
For more pictorial representation refer the document [30].
Since the cim is written for node/breaker model we also have nodes, terminals
details in the cim file. So to get the complete details of the connections,
We need to know the terminals connected to a node, terminals to which breakers are
connected, terminals to which bus is connected, terminals to which transformer is
connected, terminals to which transmission line connected, terminals to which the
generator is connected.
If we able to find the above one’s we can get the complete connection details of the
network.
To do this, we need to know that, we don’t know how many nodes, breakers,
terminals, buses are there in each feeder section and each substations. So we
have to find all of them.
In the main code certain functions, classes have been used to get the details.
We will get into the details of the each function used.
6.7 The logic behind the parsing the generic cim xml
1) After finding the number of feeder sections and substations, create classes for the
finding number of nodes or breakers which has a function which performs an action and
returns the number of nodes or breakers based on the object received, here the number
28. 27
of objects are decided by the number of feeder sections in one class, number of
substations in another case.
2) For finding the terminals connected to the components, create classes for finding the
terminals which has a function performs an action and returns the terminals connected
to each node or breaker as an element of the list. Here the number of objects is decided
by the number of nodes in each feeder section or the substation. For breaker terminals,
Number of objects is decided by the number of breakers in each feeder section or
number of breakers in each substation. Similarly for transformers, generators also.
3) Logic written in the all of the functions is bit similar,
Example: function for finding terminals search for name of the first node of the first
feeder section and check its sub child which has terminals details and pick the value of
it. This process has to continue for each node in feeder section, after completing the all
nodes in one feeder section then loop such that it continues to search for next feeder
section nodes. Next this process has to repeat for the substation nodes also, to get the
complete details of terminals connected to each node.
Significance of functions used outside the class
Significance of functions inside the classes
29. 28
Fig 6.7.1: Pictorial view of classes used in the code
Class findnodesall class nodebreaker_terminals class
findbreakersall
class terminals class substationecheck
6.8 Demonstration of code for parsing the
CIM XML file
Understand the terminology used here for each variable used for finding nodes,
terminals connected to nodes etc., else could be difficult to understand. Refer read me
file to check any output of the variable used.
Fore understanding significance of variables are commented in code too.
Findnodesfun() Stackfun() Findbreakers()
Temtonode
fun()
Ringbuscheckfun()
Transferbuscheckfun()
So on for all configs…….
30. 29
Code Part1
Cim, RDF are stored initially as they are namespaces.
Empty lists are created for the storing the objects created during runtime. Significance
of each list is commented beside.
Code part 2
Since for searching attribute value or tag value, we need names of the attribute and as
CIM follows standard convention (Here it is IEC 61850) we can use the names for
searching in the iteration. For the sample CIM file see [30]. Hence these names are
stored as elements of the lists. Such that we can iterate through each element of list by L
[1], L [2] so on. Significance of each list is commented beside.
31. 30
Code part 3
Names of the breakers in all the feeder sections, substations are stored in the list. But to
preserve the speed of program I have stored the names of the 3 feeder sections based on
the requirement it could be extended else unnecessarily the program may run slow. The
number of breakers to be stored for a particular feeder section or substation is also a
user dependent it can be extended to any number based on the size of the network.
Code part 4
Names of the nodes in all feeder sections and substation are stored in the lists similar as
the breakers stored in the above for iteration purpose during the search of attribute
value.
32. 31
Code part 5
Nodeblocks, breakerblocks are the lists which contain the names of the each lists used
above for the nodes, breaker to store the names respectively. These should also be
extended if the network is large one. As I was testing with 9 bus system I defined for few
of them to prevent unnecessary increment of run time.
Code part 6
Above 2 functions are the one’s which returns the number of feeder sections,
substations. Logic behind finding the number of feeder sections is the iterate through
the 1st bus name of feeder section like G1_BB1, G2_BB1 etc., the last name which
found will decide the number of feeder sections in the network.
Logic behind finding the number of substations is that, in CIM file for every substation
corresponding name will be given at the start of substation block in xml file. Hence the
number of substations can be found by iterating the names of S1, S2, S3 etc. last name
which found gives the number of substations in the network .
33. 32
Code part 8
Since the substation contains the buses of more than one depending on the bus bar
scheme used at substation, we need to know that so the above function is created to get
it. Just iterate the names of the buses like S1_BB1, S1_BB2, so on.
Code part 9
As of now, no of feeder sections, substations are found we need to know number of
nodes in each feeder substation class findnodesall is created. Logic behind the finding
the number of nodes is that, based on the number of feeder sections, number of
substations that many objects are created to pass for the operating the function with
each object storing a variable i.e. name of the feeder section or name of the substation.
Logic in function is that, findall keyword of the elementTree can be used to find all the
tags with certain name (i.e. here the connectivityNode) and it returns the objects of
34. 33
all those, in those objects check how many of them belong from G1, G2, S1, so on. Create
account variable using a temporary list m, length of the list is what it returns as the
number of nodes in the each feeder section or substation.
Blocksg, blocksu are list objects which describe the number of feeder sections,
number of substations.
Code part 10
Number of nodes in each feeder section and substations are also found, so we proceed to
getting the terminals connected to each node by creating the above class.
Important thing here is terminal connected to a node can be arbitrary, so we use
append keyword for adding terminal in list as soon as it found.
Pass the instance with variables, with names of the nodes that are in feeder sections,
substations and perform the function with that for getting the terminals of each node.
35. 34
Code part 11
Terminals of the nodes have been found, now we need to know the number of breakers
in each feeder section and substation so that we can create that many objects for this
class and process for function to get the terminals.
tempg, temps are the empty lists created for storing the number of breakers in each
feeder section or substation as each elements of the list.
Code part 12
Number of breakers in the each feeder section, substation are found. Now we need to
find the terminals to which these are connected.
Running a for loop based on the range of breakers in each feeder section, instance with
name of breaker is passed to function to get the terminals of it. Similarly for substation
breakers too.
36. 35
Code part 13
Class nodebreaker_terminals can be used for finding the terminals connected to
the bus, generator, transmission line and transformers also.
Since the logic behind finding the terminals is same for all, we can use that.
Repeat the same process done before for finding the terminals of the node, breaker.
Code part 14
37. 36
Code part 15
Explanation
Just use the relationship between the no of nodes and no of breakers in a substation
configuration for finding the substation configuration. Each have a specific relation so
we can distinguish just by count of breakers, nodes itself. Refer the substation
configuration diagrams for more understanding.
Note:
Warnings will be there after run of CIM parsing file, but it can be prevented by
adding import warnings and using catch statement for specific warning it can be
ignored like exception handling.
For more clarification use a sample CIM file and run the code, doubts could be cleared.
38. 37
Chapter 7
Generation of the one line diagrams of
power system network
7.1 Initiation
Not only generating 1 line diagrams, Research has been done in various areas for
analyzing the results of power system analysis like [9] shows generation of the power
flow diagrams. But our main intention is not to visualize the power flow diagrams
generate the complete network diagram
As we have seen above how to extract the connection details by parsing the CIM XML
file, we need to use the relation between the components and generate the network
diagram is what we need to do.
But, where to generate how to generate are the questions left?
First we need to know how to generate the network using those conditions and
requirements we need to decide where we generate the diagram.
Since in a power system network, each component in it is connected to any of the other
component and as current flows in certain direction in the lines, we can assume that it is
like some nodes which are interconnected in some relation and lines or edges are
directed between any 2 nodes i.e. directed graph.
‘’’For the above analogy to power system network, the nodes are the buses, breakers,
generators, transformers etc., and edges of the graph as transmission lines, feeder lines
of the network. ‘’’
So we need to find a package in python which helps in drawing graph views,
Some of the existing graph drawing packages in python are Networkx, Pygrahviz and
Pydot etc.
These are just graph drawing packages but can’t be viewed, to view the graph we need a
canvas to display it.
Matplotlib is the python package which has the power of plotting similar to the Matlab.
It displays the plots, graphs etc., made on a tkinter canvas and is also used for graphical
user interface toolkits.
Importing the graph drawing packages and Matplotlib has to be done in python script
and so that graph generated by using specific package could be displayed on the
Matplotlib plots. Since it can be used as tool kit after generating the network in plot,
discussion about GUI development will be seen in further proceedings.
39. 38
7.2 Selection of structured graph drawing package
Among the networkx, pygraphviz, Pydot one is to selected,
In my understanding pygraphviz, Pydot generated graphs generated by them are less
likely to be as of power system network.
Whereas networkx graphs have some resemblance towards the power system network if
the nodes and edges are treated as images of generators, breakers etc., and edges as line
joining between them I.e. Transmission lines. Networkx library has also rich library in
the generating networks or graphs.
Pygraphviz can generate the graph in the .dot file. It is used in such cases where we need
to process the file in MS word.
As there are many advantages in choosing the networkx, I preferred to use networkx,
even the graph generated by networkx can also be stored in .dot file if pygraphviz is also
used as additional library.
Details about networkx library can be seen in further proceedings.
7.3 Selection of GUI packages
As our goal was actually to generate the network diagram on a own built software,
So to generate the diagram on a software we need GUI package which helps in building
a software, as we finalized the programming the language as python, we need to search
for GUI packages available in python only.
GUI packages available in python are wxpython, Tkinter, PyQt etc.,
Each of the packages has its own advantages and disadvantages choosing the best one
could be a user opinion.
Some parts of the Wxpython generated GUI doesn’t give look and good feel, whereas
tkinter gives. But still preferring the best one is user dependent in my understanding.
Tip: Don’t try to generate the plot of matplotlib (i.e network that is displayed) on the
canvas of the any software like the program in (graph on wxpython.py) , because if we
do like that we will lose the control over the network which is displayed it can be only
moved entirely but not individual components. Event handling can’t be done in
individual components It can be done on whole plot only. Hence it is recommended not
to do that way.
40. 39
7.4 Key points in the networkx usage
As Networkx package is decided to use for generating the one line diagram, we need to
understand some important things in networkx required to master it so that it could be
easy to understand the code of generating the network diagram without confusion.
For good understanding read the networkx tutorial
Generating a sample graph with nodes and edges
using image as nodes
Adding/removing nodes and edges
Applying attributes to the nodes
Positioning of nodes
Size, shape, color etc., properties of a node
Different ways of writing code to draw graphs
Making union of 2 graphs.
Generating a sample graph using networkx
Output
Fig 7.4.1 Sample networkx graph
Import matplotlib.pyplot is needed for displaying the plot else it would just runs the
program without displaying the graph
41. 40
To gives images as a node, we need some important concepts from matplotlib hence will
describe later in Matplotlib.
7.5 key points the Matplotlib usage
As Matplotlib is huge library, we don’t need to know entire library of it. Just we need to
know which helps for reaching our goal. In our project it is used to display the graph
generated by the networkx. Here also we need to understand certain things like
Basic plotting in matplotlib
Displaying image on the plot or image manipulation
Generating subplots
Types of co-ordinate system in matplotlib
Figure and Axes objects
setting axes limits
Animation and interactive plotting
transforms tutorial
Plotting lines using only Matplotlib
Navigation panel of Matplotlib plot
Event handling in the Matplotlib plot
As Generating nodes with edges have been seen above section, now let’s see how the
images can set as nodes and generate a sample graph.
Python code:
Code Part 1
Explanation
New steps used are (G.node[0][‘image’] = img) it can also be represented as
G.node(0,image=img) , which means node with name 0 is given with image
corresponding to the img.
Positions are needed to be given for displaying the graph according to our
requirement.
Position must be given in form of a Dictionary like for example
42. 41
pos = {0: (1,2) , 1: (3,3)} . If position isn’t mattered many layouts in networkx
documentation are available.
Code part 2
Explanation:
First line in the part 2 of code represents the creation of figure object or canvas (output
window which will pop out after run)
Figsize has to be set appropriately for window to be as of full screen type.
Fig.setsize_inches can be used to set the random size for the figure.
24, 12.2 has to be set for getting full screen window.
Transforms are used to shift the coordinate from one system to other system, like
we given position in user defined co-ordinate system it has to convey to the code
by converting it to the pixels and then it can be converted to any of the other
forms like axes, figure coordinate system. For more pictorial understanding refer
Types of co-ordinate system in matplotlib .
Any system can be converted from one to another but must be done by first
converting it to pixel system and then transformed to one which we want.
Code part3
Explanation
As the size of image can be larger than what we want, we have to set the size of
the image manually by allotting it a variable here 0.1 is given as size.
P2 is set to size/2 because we need to move the axes for image to corner to center.
For more understanding refer imagecoordinates.py program
For displaying the nodes with images we need to run the (for loop) such that it
covers all nodes and in each node is assigned to their respective image.
43. 42
Initially user given co-ordinates are converted to pixel coordinates, and again
they are converted to figure coordinates so that axes object (i.e. plt.axes( a,b)
points the image’s right most top corner at that point to make it center of the
image , Plt.axes has to point to the (a-p2,b-p2) point and give the size as what we
defined above.
Output:
Fig 7.5.1 sample graph with images as nodes
For more information regarding calculating or getting the size or coordinates of borders
of the node( image ) refer the program imagecordinates.py .
44. 43
Chapter 8
Types of Methods to generate the power system network
With the understanding of till now it is sufficient to apply concept for generating one
line diagram.
Basically generating the one line diagram of the power system network can be done in 2
ways using
1. Artificial Intelligence
2. Algorithmic Deterministic approach.
8.1. Artificial Intelligence (AI)
Al refers to the trend to let computers perform activities which require intelligence as
ascribed to human beings. It is an approach to problem solving, learning, or discovery
that employs a practical method not guaranteed to be optimal or perfect, but sufficient
for the immediate goals.
Ex: thumb rule is a fact which can be stored, check whether it is true or not.
Domains
Person, activity = symbol
Predicates
likes(person,activity)
Clauses
Likes(tom, tennis).
Likes(bill, cricket).
Likes(bill,X) if Likes(tom,X).
If we run Likes(bill,tennis)
It returns True after running the program since tom like tennis bill also likes it.
It’s like a reasoning type approach, we need to stores the facts and we check whether the
case is true or not and also can solve a problem based on forward chaining, backward
chaining, fuzzy logic etc., as shown in [29].
45. 44
We could use artificial intelligence concepts in generating the one line diagram, research
has been done in generating the one line substation arrangement diagrams [8] using
turbo prolog software[28],[29] which is OS dependent runs only in dos systems but it
has shown correct results in china sub-transmission network.
Now recently visual Prolog has been developed for windows but we are not intended to
use the other software we need build the AI techniques in python.
We need like storing the relations between the components, all arrangement rules in
form of predicates as shown above for generating the 1 line diagram. Then we can apply
the test cases and check whether is it feasible or not.
There are many packages written in python intending to use the artificial intelligence
like pyke, yield prolog etc., In these package there are pre written programs which
contains the reasoning relationships. Which we can be extended to our requirement.
Generally experts use the artificial intelligence techniques cause we need to know the all
the facts regarding the problem else the problem couldn’t be solved.
So, for researchers it would be difficult to implement the AI techniques in generating the
power system network as we don’t know the entire facts in designing the power system
network. Hence I preferred to go with algorithmic approach.
Hence it is recommended for beginners to use algorithmic approach.
8.2. Algorithmic Approach and its types
There has been research undergoing over for generating the one line diagram of the
power system network. [7] Showed the results of generating 1 line diagrams in
bus/branch model using 3 different algorithms where 2 algorithms have slight
disadvantages, stated that 3rd algorithm will be useful.
Initially we will try to design the bus/branch model such a way that keeping in mind
that it can made interconvertible for any substation configuration.
As we need to generate the network diagram we can’t directly write an algorithm such a
way that it get the positons of the components and route the components.
It’s possible to connect them but not with intersections, overlapping of components.
Hence, algorithmic approach can be split into 3 separate tasks
1. Components positioning algorithm [13],[15]
2. Line routing algorithm [10],[11],[12]
3. Algorithm for Optimization of 1 line diagram generated [14]
46. 45
8.3 Components positioning algorithm
Positioning of Components is the first task to be done and once the places are set we
need to route the path accordingly with certain algorithm to prevent overlapping and
intersection of lines.
Let’s have a look at the algorithms proposed by [7] whether it will be helpful or not at
least by modifying it.
1. The Spring Embedder algorithm
2. The Rooted Tree Node Positioning algorithm
3. The Controlled Spring Embedder algorithm with Grid Aligning.
8.3.1 The Spring Embedder algorithm
Spring embedder algorithm is one of the few layout algorithms of undirected graphs. A
graph doesn’t contain no directed edges, no specific direction of flow relationships
between components. It is proposed to model a graph as set of components connected
by springs. The component are placed in some initial state and springs move the
components toward minimum energy state. Repulsive forces are calculated between
every pair of components but attractive forces are only taken for neighbors. By
minimizing the components would be most nearly at their ideal distances from one
another.
But the problem with this algorithm is, it doesn’t take any relationships between
components if we try to positioning all the components there may be possibility of like
bus connected with particular breaker may be at far position for forming a stable
system.
47. 46
Fig: 8.3.1.1 Output showing drawbacks of spring embedded algorithm
As components in a network will not be of same size let us assume that, bus is number 4,
1 is the breaker and apply the algorithm of spring layout, we find that these two are far
away from each other. If in the network that bus is connected to breaker then those
positons will also be far away from each other which is not required.
Hence this algorithm shouldn’t be applied for positioning all the components.
‘’Even if we try to position the only buses first by applying this algorithm, even though
these buses are of same size there is possibility of buses which must be nearby will
appear farther. It also generates the different locations each time as in algorithm
positions are randomly checked for attaining stable system’’.
Hence, this algorithms creates several reasons for deselecting it.
8.3.2 Rooted Tree Node Positioning algorithm
The Rooted tree algorithm is usually used for generating directed graphs i.e. the graph
has a specific direction flow relationship between components. The Rooted Tree
algorithm begins by analyzing the connectivity and direction flow relationship among
the components based on this information an initial tree layout is drawn. Here user
have some intervention in selecting the orientation of the network but the disadvantage
is that root component is always at the highest level, with all child components always in
lie at top-down or left-right Fashion, which may be rejected by some control center
dispatchers .
Sample network generated by it will be like
48. 47
Fig 8.3.2.1 View of Output using
rooted tree node algorithm
8.3.3 The Controlled Spring Embedder algorithm with Grid Aligning
The speed of the Controlled Spring Embedder algorithm is determined by the user’s
interaction. This is because the user makes all the decisions on
(i) Which components are fixed, (ii) how many components are fixed and
(iii) How much component dragging is done, the user chooses to end the generation
when the layout finally suits the user’s requirements. All these decisions contribute to
the time it takes to generate each diagram.
Grid Aligning further helps in enhancing the readability of the diagram layout by
aligning the components. This algorithm exhibits a high level of user friendliness. The
process of generating the one-line diagram layout via the Controlled Spring Embedder
algorithm is very much under the control of the user, thus requiring a high level of user
intervention. This, however, can sometimes turn into a disadvantage, as too much user
intervention may be required when generating each diagram.
Even using springlayout of networkx has also capability by fixing the particular
components, optimal distance between the components attribute values can be set , but
still the components nearby will not appear as required since we are not giving any
relational status between the components.
So, concluding first two algorithms anyhow discarded due to their problems. In case of
3rd algorithm in paper states that controlled spring embedded algorithm could be used
to generate the network, but I couldn’t justified it yet.
So we need to find an approach for positioning nodes or all the components at once and
then routing has to be done such that it generates the required network.
***so the new idea is to generate the graph following the relational status of the power
system network using networkx & Matplotlib . Even the generated graph will be of
clumsy type but, components which must be nearby will be nearby, it is a plus point of it
since the positions are determined by the code itself. So, next then remove all the edges
in it which lefts with the components only but with required acceptable positions, then
49. 48
on it routing algorithm can be applied and further process for optimization of the
spaces. ***
8.4 Need for generation of all the substation
configurations diagrams individually
After reading this section you will be able to answer the question of the need for
generating the substation configurations or bus branch schemes individually.
It has be generated to satisfy the aims listed below,
Ability to convert the bus/branch model of the network to the node/breaker
model of the network
Ability to split the any of the bus in bus/branch model and convert to any of
substation configuration.
Approach for making above aim possible is,
1. First aim can be achieved by after generating the bus/branch model, we need to
write a code such that upon the right click on the canvas network has to be
converted to node/breaker model.
2. Second aim can be accomplished by giving an option to user for splitting any of
bus to any of the bus bar scheme or substation configuration
Key points in making the above tasks,
For splitting a bus to any of the substation configuration, we need to update the
CIM file accordingly such that required network could be generated.
To update the CIM file, we need to write a code such that new cim file generated
should correspond to the new network.
As CIM written follows the IEC 61850 convention, we just need to write the code
to replace the particular substation part in cim xml file with new substation
configuration cim file and edit the parameters which are connected to the
transmission lines. Then the Cim file will correspond to the required network.
Hence, here we are just changing the certain bus part of the network with the certain
substation configuration we need to generate the individual substation configuration
diagrams so that we can replace the part easily in the original network .So let’s see how
to generate the particular substation configuration,
8.5 Generation of the Double bus double breaker
substation configuration diagram
For the specific substation configuration diagram generations, network diagram could
be generated without any algorithms also as the substation configuration diagram is
50. 49
fixed, diagram only changes with the additional branches it has in iSo I tried to generate
double bus double breaker network with 2 branches, if 3rd branch is there in the
substation then it can be added to right side if the diagram which is shown in figure
below and similarly if there are more branches connected to the bus then the additional
branches to the bus can be added at right side.
8.5.1 Demonstration of the python code for generation of double
bus double breaker substation configuration diagram
As the main theme of generation of the network was given above,
Logic behind the code is that,
Assign the images that we need for representing the substation configuration
network.
Create the separate graphs or networks for nodes of buses, breakers, terminals,
and connectivity nodes etc., components which are in the network.
Then create the number of nodes in each graph as per the range of total number
of buses or breakers or connectivity nodes in the substation network with names
assigned to it following CIM standard convention.
Since the diagram is specific one and minimum number of branches in the
substation would be greater than or equal to 2. Generate the diagram for 2
branches and write the code such that if there are more than 2 branches add the
branch at the right side of it.
Assign the co-ordinates of the components relatively so that diagram positions
can be tentative. Relative coordinates also have advantages that even if position
of the certain component is changed the whole diagram disturbs to prevent that
whole substation is treated as layout as described in [31]
Code part 1
51. 50
Explanation
1. Imported the program which extracted the details of the double bus double breaker
CIM file and also imported the needed packages
2. Created the individual graphs for individual components in the network.
Tip: rotated images can also be set to the node using Scipy, but I haven’t successful in
installing the scipy. So I have tried in other way, since the image is stored as RBG values
in a matrix. I applied the numpy library which transposes the matrix, thus indicates the
image is also rotated.
Code part 2
Explanation
1. To decide the number of nodes to be created for each individual graph, we need to
calculate the number of each components in the substation based on it number of nodes
will be decided for each graph.
2. Names are also set to the nodes such that, with the iteration the string name is also
changes and set to the each node of corresponding iteration.
3. So there is a loop in a loop which iterates over the each of the feeder sections
components. Anyhow for the substation cim file there will be one 1 substation and 0
feeder sections loop in a loop will be act as single loop only.
52. 51
4. Node images, color, shape are also set during the addition of nodes into the graphs.
Code part 3
Explanation
1. Connectivity nodes are added in nod.Graph (), based on the number of connectivity
nodes in substation that many nodes are added with names as per convention.
2. For terminals as nodes, we need to append the terminals of each node in a list and
measure the length of the list and it would give the number of terminals in the
substation configuration network.
3. Above Code is written generically, so it checks for feeder sections also and creates the
nodes for it. But those aren’t needed since we are drawing the substation configuration
diagram.
Code part 4
53. 52
Explanation
1. Positions of the each components are set by creating a python dict for each of it and
assign the relative co-ordinates to it for generating the diagram. Co-ordinates which I
have used isn’t fixed just tested how does the figure look.
2. Substation configuration positions are set for 4 nodes then code checks whether it has
more than 4 nodes indicates than it has more than 2 branches.
3. Next additional nodes, breakers positions are set right behind their previous ones.
Code part 5
Explanation
1. Figure is created first in this code and sets the resolution of it to fit to the screen and
next subplot size is set. As describe above in the matplotlib understanding section
transforms, size of images are set.
2. Positon of terminals set by 3 sides of the each node like top, left, right. Similarly all
terminals positions are set with respect to the each nodes.
54. 53
Code part 6
Explanation
1. Checks the number of terminals in the substation if there are greater than 14 , it
indicates that there are more than 2 branches in it.
2. Based on the number of additional branches number of additional terminals are
decided and plotted at the left, top, right based on requirement.
3. Next the horizontal and vertical lines are created using matplotlib which are needed
to form the whole network.
55. 54
Output:
Fig 8.5.1.1: Double bus double breaker substation configuration
Lines coming out from the nodes are transmission lines these have to connect to the
terminals where the previous substation configuration is connected. We can create like
substation configuration diagram as matlab block model and say that these
transmission lines are connected to specific terminals in the network.
Drawback:
Zooming the diagram may lead to dis-connectivity in it. This has to overcome by scaling
the co-ordinates with zoom so that even after zoom the diagram shouldn’t get dis-
connected between any 2 components.
8.6 Updatation of CIM file for inter conversion in
the substation configurations
1. For interconversion in substation configuration, first identify that which
substation configuration has to be changed it actually depends on user.
2. Remove the part of cim file corresponding to that substation, and parse the cim
file or required new substation configuration to replace the one and get the
child’s of it.
3. After removing the corresponding one, append the new substation configuration
details as the child of the rdf in cim file of the network.
4. Anyhow position of xml part isn’t mattered, appending at last doesn’t has any
problem.
5. Replace the terminals to which the old substation configuration is connected to
transmission line, with the new terminals of which the new substation
configuration transmission lines are connected.
6. Then the new cim file will correspond to the new network exactly.
56. 55
Demonstration of the code
Explanation:
1. Parse the cim file of the whole network and parse the cim file of the substation
configuration which we want to replace with any of other substations.
2. Create a class such that whose instance variables give the names of substations such
that which substation has to be replaced.
3. Search for the blocks with attribute S1 if S1 is undergoing the change, and delete all of
them from the cim file.
57. 56
Code part 2
Explanation:
1. Get the child’s from the new substation configuration cim xml and append all those in
the cim file of the whole network.
2. Still, there are some details need to be edited, for removing the old substation
configuration details i.e. transmission line connected terminals.
3. Search for the terminals to which the new substation transmission lines are connected
and replace with the old terminals of the substation transmission lines.
4. Then the cim file will corresponds to the new network exactly.
58. 57
Chapter 9
Line routing the components of the
power system network
Line routing of the components should be done only after positioning of the components
perfectly, else if we route without placing the components network looks very clumsy.
Take example like a bus and breaker and connected side by side in the network, but
during the positioning if those are far away from each other even the line is used to
connect them, it doesn’t meet our needs.
Hence without positioning of components satisfactorily it isn’t recommended to do the
routing of the components.
Plenty of research has been undergone in routing the components, book in [10] has
given tips for routing the components used in VLSI chip designing in single layer and
multilayers. We can use idea made for single layer line routing to our requirement.
To join 2 points between the obstacles, paper in [11] described an algorithm named high
tower which finds the obstacles by line searching method. But, this method doesn’t
guarantee the solution of the path between the points. Also doesn’t give shortest path
between the 2 points like maze runner algorithm.
Anyhow shortest path isn’t concerned point, there is a modified version of high tower
algorithm named as line expansion algorithm given in [12].
It guarantees the solution for finding path for joining 2 points between obstacles
Between the 2 points. So it is preferred to use the line expansion algorithm for line
routing of the network.
Even though the line routing is done to the network it may not look pleasing due to
unequal spacing between the components, so the optimization of the diagram is need for
look and feel. Algorithm [14] describes the process for optimizing it.
59. 58
Chapter 10
Future enhancements
Scaling the co-ordinates with zooming
Getting the breaker status from the CIM dynamic file.
Size of component has to be measured with perfection
Applying event handling like mouse click, drag operation on the canvas of the
software where the network is generated.
Have to make the link between the transmission lines of substation configuration
as shown in fig … with the actual network.
Building the GUI using packages like wxpython, tkinter etc., Slice the screen
such that subplot of it must be under matplotlib canvas and rest of the subplot for
performing the software actions like schematic opening, closing etc., build
through tkinter or wxpython or any GUI building package.
Developing the software such that it can apply the algorithms for power system
analysis and display the results through animations, 3d graphs etc.,
60. 59
Chapter 11
References
[1]. Q. Binh Dam, Member, IEEE, A. P. Sakis Meliopoulos, Fellow, Ieee, Gerald Thomas
Heydt, Fellow, Ieee, And Anjan Bose, Fellow, Ieee. A Breaker-Oriented, Three-Phase
Ieee 24-Substation Test System.
[2]. Yemula Pradeep, Student Member, Ieee, P. Seshuraju, S. A. Khaparde, Senior
Member, Ieee, Vinoo S.Warrier, And Sushil Cherian, Member, Ieee Cim And Iec 61850
Integration Issues: Application To Power Systems
[3]. A. Devos, Member Ieee S.E. Widergren, Sr. Member, Ieee J. Zhu, Member Ieee, Xml
For Cim Model Exchange
[4]. E.Z Zhou, Xml and Data Exchange
[5]. Michael Zhou And Shizhao Zhou, Internet, Open-Source And Power System
Simulation
[6]. T. Overbye and J. Weber, “Visualization Of Power System Data,” In Proc.
2000 IEEE 33rd Annual Hawaii Int. Conf. Syst. Sciences, Jan. 2000.
[7]. Y. Ong, H. Gooi, and C. Chan, “Algorithms for automatic generation
of one-line diagrams,” IEE Proc. Gener., Transm., Distrib.,, vol. 147,
no. 5, pp. 292–298, Sep. 2000.
[8]. Z. Yongli And O. Malik, “Intelligent Automatic Generation Of Graphical
One-Line Substation Arrangement Diagrams,” Ieee Trans. Power Del.,
Vol. 18, No. 3, Pp. 729–735, Jul. 2003.
[9].Sonng Shiyu , He Guangyu, Member,IEEE, and Xu Pengliang , Automatic
Generation Of Power Flow Diagrams For Transimission Networks
[10]. Schwarz . A.F ‘Handbook of VLSI Chip Design and Expert Systems
[11]. David W. Hightower, A Solution To Line-Routing Problems On The Continuous
Plane
61. 60
[12]. W.Heyns, W.Sansen , H.Bake, A Line Expansion Algorithm For The General
Routing With a Guaranteed Solution.
[13]. Alper KaraCelik August, 2012 , An Improved Spring Embedder Layout Algorithm
for Compound Graphs.
[14]. R. Canales-Ruiz, Fmrber Ieee D.Toral Garibay A. Alonso-Concheiro, Merber Ieee
Optimal Automatic Drawing Of One-Line Diagrams
[15]. John Q. Walker II, A Node-Positioning Algorithm for General Trees TR89-034
September, 1989
[16] Imre Lendák*, Attila Vidács**, Aleksandar Erdeljan* Electric Power System One
Line Diagram Generation With Branch and Bound Algorithm
[17]. Karel Máslo #1, Jonas Eickmann*2 Simplification of Breaker Oriented Network
Model into Extended Bus Oriented Model
[18]. Daniel Nack, Iowa State University, 2005, Reliability Of Substation Configurations
[19]. Yemula Pradeep, Student Member, Ieee, P. Seshuraju, Shrikrishna A. Khaparde,
Senior Member, Ieee, and Rushikesh K. Joshi , Cim-Based Connectivity Model For Bus-
Branch Topology Extraction And Exchange
[20] Qiuhua Huang, Mike Zhou, Yao Zhang, Zhigang Wu , Exploiting Cloud Computing
for Power System Analysis
[21] Dr. Jung-Uk Lim, Arkansas Tech University, An Enhanced Approach for the Power
System Course Using a Computer-Based Visualization Tool for Steady-State Power
System Simulation
[22] Thomas J. Overbye , Jamie D. Weber , New Methods for the Visualization of
Electric Power System Information
[23] Li Bo, Liu Wenying, Xing Jing North China Electric Power University, Zheng Wei
Gansu Electric Power Research Institute, Lanzhou,730050,China The Opengl-Based
Visualization Of Power Systemflow And Alarm .
[24] Thomas J. Overbye Yan Sun , Raymond P. Klump , Jamie D. Weber , Interactive 3d
Visualization Of Power System Information
[25] Christine Mikkelsen_ Y, Jimmy Johanssony, Matthew Cooper , Visualization Of
Power System Data On Situation Overview Displays
[26] Yan Sun, Student Member, Ieee Thomas J. Overbye, Senior Member, Ieee ,
62. 61
Visualizations for Power System Contingency Analysis Data
[27] Mathias Uslar, Michael Specht, Sebastian Rohjans, Jörn Trefke,
And José Manuel Vasquez González, The Common Information Model CIM
[28] Tutorial for Turbo Prolog
[29] Turbo prolog the natural language of artificial intelligence.
[30] kousik( co-intern), xml model for CIM exchange
[31] Gelli Ravikumar, Student Member, IEEE, Yemula Pradeep, Student Member, IEEE,
S. A. Khaparde, Senior Member, IEEE. Graphics Model for Power Systems using
Layouts and Relative Coordinates in CIM Framework.
Nikhil Valiveti
Github link: Git
Mobile: 890811225