0% found this document useful (0 votes)
66 views5 pages

Guddanti 2020

Uploaded by

Anag Systems
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views5 pages

Guddanti 2020

Uploaded by

Anag Systems
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Better Data Structures for Co-simulation of

Distribution System with GridLAB-D and Python


Kishan Prudhvi Guddanti∗ , Yanzhu Ye† , Panitarn Chongfuangprinya† , Bo Yang† and Yang Weng∗
∗ School of Electrical and Computer Engineering, Arizona State University, USA; † Hitachi America Ltd., USA

Abstract—Due to the high penetration of distributed energy connecting them with advanced analytics languages are either
resources (DERs) in the distribution system, there is an increasing application-specific or lacking a clear data structure for inter-
need for advanced tools to thoroughly study the impacts of DERs operability and extensibility.
on distribution networks under various DER control/modeling
scenarios. This type of tools not only requires a powerful Therefore, this paper uses GridLAB-D, developed by the
network simulation engine in distribution grids, but also a U.S. Department of Energy, as an example to show how to
flexible and interactive environment for easy development of provide the needed flexibility to speed up the analysis for
advanced analysis/control algorithms, e.g., cutting-edge machine colleagues based on our codes and framework. The reason
learning packages. If the software can be open-sourced, the to choose GridLAB-D is due to its nice capabilities, such as
power industry can further enjoy transparency and faster-time-
to-market transition to expedite renewable integration. Past work (1) fine-grain modeling and simulation of distribution assets
does not give a fully independent data structure to separate the from substation to the household level, (2) modeling the effect
simulation layer and the application layer. Therefore, this work of climate variations on renewable such as PVs, household
aims at providing full independence while integrating the two equipment, and (3) time-series power flow simulations and
most powerful open-source tools in distribution grid simulation many other advanced study capabilities in distribution system.
and an extremely popular programming language: GridLAB-
D and Python. Specifically, we carefully create (1) an open However, similar to other distribution simulation tools, it has
and flexible design, (2) easy-to-develop analytical application a constrained network file format called GLM file, lacking a
scenarios, and (3) compatibility with a variety of third-party user-friendly graphical user interface (GUI). This limitation
tools. We demonstrate features (1) and (2) of this co-simulation prevents its user growth and its interoperability with third-
framework with a use case study on integration capacity analysis party tools. To solve this limitation, [1] proposes demand
(ICA) and we demonstrate feature (3) as an example to conduct
graphical analysis in Python for distribution system analysis response co-simulation and [2] provides a co-simulation for
with a near-zero effort. A highly accurate and fast system-wide residential energy control study in micro-grids. The drawbacks
ICA result demonstrates the supreme data structure and easy- of these works lie in a predefined and restricted use case (appli-
to-extend architecture for speeding renewable integration. The cations). Meanwhile, Matlab is proprietary software, limiting
code is available for download. its flexibility and compatibility with different simulation tools.
I. I NTRODUCTION Therefore, it is better to have an open-source programming
In recent years, energy regulations, environmental policies, language, such as Python to replace Matlab. For example,
and technology advances have driven a significant rise in the Python has access to intensive third-party libraries and is ca-
penetration level of distributed energy resources (DERs) in the pable of interacting with most other languages and platforms.
distribution system. Such DERs includes solar photovoltaic For this purpose, [3] proposes an Amazon cloud-based Python-
panels (PVs), energy storage system, electric vehicles (EVs), GridLAB-D framework that is dynamic for transmission-level
etc. Such transition brings various challenges to utilities, e.g., power analysis with MATPOWER. To be independent of
uncertain reverse power flow, outdated protection schemes, the cloud and use Python, GrridLAB-D also has its server
over-voltage violations, etc. These new problems in distribu- mode. But, it is not a modular design for Independence
tion systems can not be handled easily with transmission-grid [4]. Even worse, the server mode passes the modification of
approaches, due to the investment constraints per feeder, call- power system information, requiring the Python users to know
ing for advanced computational tools to counter the hardware network information beforehand. Such a one-way information
limitation. flow prevent Python users to get system information.
While some DER analysis is available in existing software, To resolve this problem, we propose to define an indepen-
e.g., CYME, Synergi, GridLAB-D, OPENDSS, these tools dent data structure layer for two-way graphical information
provide limited openness and flexibility for the expansion of flow between the GridLAB-D simulation environment and
the new system components and new applications. However, data. Additionally, such a new layer will also ensure Indepen-
a similar idea can be easily incorporated into other open- dence between the data management and the application layer,
sourced software, such as OPENDSS. For example, CYME greatly liberate the API design in Python, based on the network
and Synergi are proprietary, which provide limited openness information defined. Such a three-layer independent design not
for function additions. On the other hand, although GridLab- only let perform domain-specific simulations from GridLAB-
D and OPENDSS are open-sourced, the current practice of D but also extend the scenarios seamlessly and easily for all
power system domain problems.
This work is supported by the California Energy Commission (CEC)
grant EPC-17-043 and it will be applied into GLOW (GridLAB-D Open Therefore, the proposed co-simulation framework makes
Workspace). unique contributions: 1) Develop of an open and flexible

978-1-7281-5508-1/20/$31.00 ©2020 IEEE


Authorized licensed use limited to: Rutgers University. Downloaded on May 15,2021 at 00:03:20 UTC from IEEE Xplore. Restrictions apply.
GridLAB-D-Python co-simulation framework with layered
data architecture and modular design; 2) Integrate various
third-party tools and GridLAB-D through proposed common
data interfaces; 3) Demonstrate the flexible framework for
two-way graphical information flow for a use case, called
Integration Capacity Analysis (ICA).
The paper is organized as follows: Section II details the
layered data infrastructure and its advantages. Section III ex-
plain and validate this framework for ICA study in distribution
systems. Section IV demonstrates the integration capabilities
with third-party tools. Section V concludes the paper.
II. C O - SIMULATION F RAMEWORK FOR D ISTRIBUTION
S YSTEM A NALYSIS
For GridLAB-D, there is a server mode, which can let users
modify the network structure or inputs. Such an approach
is briefly displayed in a blue dashed line on top of Fig. 1.
However, the underline assumption is that the user knows
the network very well in advance. However, this assumption Fig. 1: The layered architecture of the proposed co-simulation
prevents data analytics expert to understand the information in framework.
Python due to one-way information flow. Therefore, we pro- such as data processing, conversion and storage functions,
pose a new approach in Fig. 1 with red dashed line. In this new integration with third-party data sources, e.g., AMI data,
approach, we not only solve 1) the one-way information flow etc. This layer not only provides a means to model
problem but also solve 2) the independence of application to the system data via application layer due to its layered
the data and 3) the flexible interaction between the application architecture but it also allows the proposed framework to
to any Python packages. A parallel computation is also more integrate with third-party applications due to its modular
attractive feature due to our standardized graph structure and design, shown in Fig. 1. This modularity is explained in
its modularity. a detailed manner in Subsection II-B.
A. System Architecture (c) Simulation Layer: After having the independent data
For the three goals above, we create a three-layer archi- structure (NDS), we can have two-way information flow
tecture, namely the application layer on the left, the data between the network data structure (NDS), and the
structure layer in the middle, and the simulation layer on GridLAB-D data structure (GLM data) to run GridLAB-
the right. For the application layer, we conduct independent D. For example, the Python user can retrieve the net-
application definition and algorithm development in Python. work structure in graph representation, independent of
In the data management layer, we focus on data modeling GridLAB-D to make network modifications. After mod-
and management. In the simulation layer, we focus on its ifications, network conversion will convert NDS back
interpolation with a standardized data structure. to GLM, so that distribution system simulation can be
(a) Application Layer: For GridLAB-D, it has a server mode. carried out in GridLAB-D. Another selling point of
So, one needs to manually understand the given system the proposed architecture is the data structure indepen-
topology/details to modify the GLM file. This is inflex- dence, which enables parallel computing of GridLAB-
ible and gives burdensome overhead to Python users to D simulations, e.g., parallel computation for reinforce-
understand GLM files in the power system backgrounds. ment learning. Finally, the simulation results generated
Therefore, we propose to define the application purely by GridLAB-D will be transmitted back to the data
based on Python knowledge and standardized data inter- management layer and application layer for display.
faces, e.g., NDS. For example, a variety of distribution B. Data Management Layer: Detailed Code Design
system analysis (DSA) applications can be developed The data structure is mainly extending the flexibility and
by leveraging the extensive analytical Python libraries. functionality of GridLAB-D file format, “.glm”, short name
These DSA applications can be developed as functional for GridLAB-D Model. Therefore, we detail the information
modules. These functional modules/applications can be in the data management layer in this section. To address
as simple as 1) power flow simulations 2) system-wide GridLAB-D’s incompatibility issue with different tools, we
integration capacity analysis, 3) graph theoretic studies, show four functions to standardize the data structure.
4) machine learning, etc. 1) Distribution Network Build (DNB): Python cannot under-
(b) Data Management Layer: This layer is the key contri- stand GLM file, so we first define a function, DNB, to
bution of the paper and this layer is extrapolated from let users convert GLM data into a standard data struc-
the last interaction between the application layer and the ture. Specifically, DNB extracts the distribution network
simulation layer in blue in Fig. 1. In this new layer, components and their properties from GLM data into
we define modules to provide system modeling tools a standard network data structure (NDS), which can

Authorized licensed use limited to: Rutgers University. Downloaded on May 15,2021 at 00:03:20 UTC from IEEE Xplore. Restrictions apply.
be read/modified (conceptualized) in Python easily, e.g., TABLE I: Different power system criteria while calculating
N DS = DN B(GLM ). ICA values at a candidate DG location.
2) Network Data Structure (NDS): Using the function of
Name Criteria Threshold
DNB, the output data format is defined as NDS, a
well-known Python dictionary that any Python program Steady state Voltage at all loads should be ≥ 0.95 p.u or
voltage (SSV) within acceptable range ≤ 1.05 p.u.
can understand. Such a NDS consists of power system
Voltage Percentage change in voltage at ≤ 3%
components, including but not limited to nodes, loads, fluctuation all loads when the DG is turned
lines, transformers (taps and tap controls), capacitors (size (VFL) ON from OFF condition
and controls), switches, regulators (settings) etc, which Thermal line Line currents cannot violate 800A-main
are stored in a structured format as shown in Table limits (TLL) thermal line limits of overhead and 400A-
to the left bottom of Fig. 1. From the NDS, different and underground lines service lines.
types of data formats can be further generated based on
application needs, e.g., JSON, graphic data, or exported
into databases. a structure, namely the ICA. Since it is computationally
3) Distribution Network Modification (DNM): After we expensive to calculate the ICA value for all 8, 756 hourly
enable two-way information exchange between GLM points, it is reduced to 24 hourly values as a demonstration
in GridLAB-D and standard data structure, NDS, in to account for HC variation during a typical day in the year.
Python, we program a function called DNM to perform ICA is a hosting capacity (HC) analysis. The most popular
the application design. Therefore, such a design is in- industrial approach to analyze it is via extensive simulations to
dependent of the GridLAB-D environment, leading to understand the maximum generation or load capacity, which
great generalization. For example, DNM can modify the can be installed independently at each point of distribution
physical and electrical properties of the nodes, loads, circuits without adversely impacting its reliability and power
lines, devices, etc by modifying the NDS to NDSmodel in quality.
python e.g., N DSmodel = DN M (N DS). Some exam- For simulating ICA, there are two calculation techniques
ples for DNM are, assigning the SCADA/AMI data to the one is the fast but inaccurate streamlined approach. The other
desired load locations, load allocation programs that can is the iterative simulation approach, which is relatively slow
identify houses downstream of a transformer and allocate but more accurate method. As CPUC prefers over iterative
AMI load data to these houses, network reconfiguration approach, we will use it to demonstrate our three-layer archi-
problems such as addition or removal of nodes for use tecture. Various IEEE test systems are validated and we use
cases e.g., GUI, power-rerouting algorithms, etc. 123 node test feeder to illustrate the concept and results. For
4) Network Graph Object (G): While the application layer this case study, which has a nominal voltage of 4.16 kV with
talks to the data structure layer in Fig. 1, it is important both three phases and single-phase connected loads. The loads
to notice that there is a graph object in the figure. This are modeled as constant power, constant current and constant
benefit is a natural result of a standardized data structure, impedance types based on the standard IEEE-123 test feeder
making any packages, compatible with graph definition to designed by the official DSAS authority.
be viable for the application designer. For example, one B. Deployed Algorithms based on the New Architecture
can implement state-of-the-art graph networks research. The following assumptions are made with respect to the
Specifically, we first developed NDS as a common data DER connecting phases and power factor e.g., 1) The added
interface between Python and GridLAB-D, but NDS is candidate DER has the same phase connections as that of the
not compatible with Networkx. Hence, similar to NDS, default load, and 2) the added candidate DER is modeled
we developed a new common data interface between as a constant power type load with a power factor of 0.98
Python and Networkx by converting NDS into a Net- in each of its connected phases. We study nodal ICA using
workx graph object (G), e.g., G = make G(N DS). two different iterative algorithms e.g., 1) linear search, and
The Networkx graph object (G) is built by separating its improved version 2) multiplicative binary search to not
the distribution network components present in NDS only allow simplicity in method but also achieve high accuracy
into nodes and edges with attributes. The attributes of with less computational time. We picked binary search as it is
these edges (overhead lines, transformers, regulators, etc) optimal for the search of n sorted list.
and nodes (node, load, capacitor, etc) are their electrical 1) Linear search
and physical properties from Fig. 1. Some use cases of In linear search, we allocate hourly load profiles (24 hourly
utilizing this graph object (G) for distribution system values) to all the loads in the IEEE-123 bus system. For each
analysis will be presented in Section IV. time instant (each hour), we increase the size of the integrating
III. U SE C ASE : I NTEGRATION C APACITY A NALYSIS OF DER value by a constant up-size step value (α) until any vio-
D ISTRIBUTION N ETWORK lation from Table. I is recorded. When a violation is recorded
A. Experiment Setup: Integration Capacity Analysis (ICA) then the algorithm returns the previous step integrating DER
After showing the design of the three-layer structure, we value with no violation as the hosting capacity value for the
will use one example on ICA to show the value of such DER location. Fig. 3 shows the calculated 24 hourly hosting

Authorized licensed use limited to: Rutgers University. Downloaded on May 15,2021 at 00:03:20 UTC from IEEE Xplore. Restrictions apply.
Fig. 3: Comparison of 24 hourly hosting capacity values at
bus n = 96 for linear and binary search algorithms.

Fig. 4: Comparison of the performance of linear and binary


search algorithms for the system-wide ICA study of IEEE-123
node test feeder.
Fig. 2: Flowchart of ICA study with binary search. Fig. 3 shows the comparison of 24 hourly ICA values at n =
capacity values (final ICA curve ICA∗n,h ∀h = 1, 2, · · · , 24) 96 using binary search and linear search approach, where the
for the DER located at bus n = 96 when the constant up-size binary search is significantly better than the linear search due
step value is α = 5KWs. The final ICA value (ICAn ) at bus to our algorithm design and framework implementation.
n = 96 is obtained by (1). Fig. 4 summarizes some key metrics for the system-wide
ICA study using both linear and binary search algorithms.
ICAn = min ICA∗n,h ∀h = 1, 2, · · · , 24 ,

(1) The system-wide study refers to the simulation of maximum
∗ ∗ ∗

= min ICAn,1 , ICAn,2 , · · · , ICAn,24 . (2) hosting capacity value for each node in the given IEEE-123
base case system. Because of the framework’s flexibility to
Even though the linear search is simple, it can only be either develop applications such as binary search, we can solve this
accurate or fast but not both. This is because the larger the problem in lesser time and fewer power flow simulations,
incremental size (α), the more inaccurate the ICA values are while having a better accuracy e.g., smaller optimality gap
and vice versa. There exists a compromise between accuracy as shown in Fig. 4. The optimality gap indicates the mean of
and computational speed. Hence this calls for a flexible all distances between the calculated ICA values at every node
framework that can develop applications that are both and their global ICA solution. This is because the theoretical
accurate and fast e.g., binary search. computational complexity of the binary search is O(log(n)),
2) Multiplicative binary search while that of linear search is O(n). Additionally, the pro-
The binary search is proposed in Fig. 2 for node-by- posed framework allows the usage of high-performance
node ICA simulation to improve computational efficiency clusters with multi-core systems (22 cores with 4 branches)
while maintaining search accuracy. The binary search mainly to conduct the system-wide ICA simulation, the computational
involves two major steps (red blocks) as shown in Fig. 2: 1) efficiency is significantly improved e.g., time reduction is
calculate upper and lower bound of the integrating DER value 1/16 of that of the binary search in Fig. 4. Generally, the
and 2) calculate final DER maximum integration capacity. communication delay is only several microseconds. However,

Authorized licensed use limited to: Rutgers University. Downloaded on May 15,2021 at 00:03:20 UTC from IEEE Xplore. Restrictions apply.
Fig. 6: Edge and vertex betweenness centrality based weighted
graph of a real-world 295-bus distribution feeder for vulnera-
bility analysis.
Specifically, Fig. 6 is a weighted graph in which the weights
of branch and node are based on edge and vertex betweenness
Fig. 5: Heat map of the the IEEE-123 bus system based on centrality graph metrics calculated using ‘G’ and Networkx
ICA simulation. library. This centrality measure indicates the nodes that share
in the case of applications with parallel running platforms, a most information e.g., real power flow. The outage of a node
latency setting can be used in python to deal with different that has a high centrality measure results in the splitting of
sampling rates of platforms. the given network into undesirable huge islands as shown in
IV. I NTEGRATION WITH T HIRD PARTY T OOLS Fig. 6. Such a fast one-line analysis can let system operator
Hence, the proposed framework is designed in a modular know the system state quantitatively.
manner to facilitate the integration with any other libraries V. C ONCLUSION
using a common data interface as shown in Fig. 1. In this sec- In this paper, a co-simulation framework is proposed, which
tion, we demonstrate one such application where we integrate is based on GridLAB-D and Python. The co-simulation frame-
the distribution system analysis with graph-theoretic analysis. work has multi-layer architecture and follows the modular
As mentioned in Section II, in the data management layer, the design principle. On the simulation layer, the GridLAB-D
network graph object (G) is a module in the common data operates as distribution system simulation tools. On the data
interface of the proposed framework in Fig. 1 that flexibly conversion/management layer and modular application layer,
integrates the third-party Python libraries, e.g., Networkx, for different application functions are built and interacted within
conducting advanced graph-theoretic analysis on distribution Python environment. The interaction between the simulation
systems. layer and upper system applications are bridged within Python
A. Interactive Hosting Capacity for GridLAB-D environment through well-defined APIs. The decoupling of the
GridLAB-D is a code-based tool that does not have any simulation and analytical environment enhances the flexibility
support to visualize and process its results. However, the flex- of this co-simulation framework. A demonstration of integra-
ible data structure can enable transparent heat map of hosting tion capacity analysis on distribution system was implemented
capacity (ICA) with dynamic visualization by one line of code based on this proposed framework as use case. Advanced
“Heat map(ICA values, G)” in package “Networkx”. The methodologies are investigated to improve the computational
system-wide hosting capacity of IEEE-123 feeder is shown in efficiency and accuracy of ICA study, e.g., binary search,
Fig. 5. In this heat map, the intensity of color at each node multi-core etc. The code for this project is available at [5].
corresponds to its hosting capacity value. Such an analysis is R EFERENCES
validated by observations such as the fact that nodes closer [1] D. Wang, B. de Wit, S. Parkinson, J. Fuller, D. Chassin, C. Crawford,
and N. Djilali, “A test bed for self-regulating distribution systems:
to the substation can host larger capacity DERs than ones Modeling integrated renewable energy and demand response in the
farther away. Such a one-line analysis can significantly boost GridLAB-d/MATLAB environment,” IEEE PES Innovative Smart Grid
the renewable integration. Technologies, pp. 1–7, 2012.
[2] M. A. Al Faruque and F. Ahourai, “Gridmat: Matlab toolbox for gridlab-
B. Vulnerability for Cascading Outages d to analyze grid impact and validate residential microgrid level energy
Hosting capacity shows the extra generation a net- management algorithms,” IEEE PES Innovative Smart Grid Technologies,
work can tolerate before negative impact. Similar con- pp. 1–5, 2014.
[3] K. Anderson, J. Du, A. Narayan, and A. E. Gamal, “Gridspice: A
cept lies in vulnerability, e.g., tolerance. Due to our distributed simulation platform for the smart grid,” IEEE Transactions
flexible data structure, such an analysis can also be on Industrial Informatics, vol. 10, no. 4, pp. 2354–2363, 2014.
done in one line. For example, Fig. 6 is created [4] T. M. Hansen, B. Palmintier, S. Suryanarayanan, A. A. Maciejewski, and
H. J. Siegel, “Bus.py: A GridLAB-D communication interface for smart
by functions “centrality measure = nx.centrality(G); distribution grid simulations,” pp. 1–5, 2015.
W eight graph(G, centrality measure)” over a real-world [5] Hitachi America Ltd., “GridLAB-D-python co-simulation framework,”
distribution systems in California. 2019. [Online]. Available: https://github.com/Hitachi-ESL/Hitachi-ASU

Authorized licensed use limited to: Rutgers University. Downloaded on May 15,2021 at 00:03:20 UTC from IEEE Xplore. Restrictions apply.

You might also like