GridAPPS-D’s Documentation¶

Overview¶
Through a series of industry centric meetings and workshops, the U.S. Department of Energy Office of Electricity Delivery and Energy Reliability (DOE-OE) gathered input from utilities throughout the United States on their experiences in implementing, or planning to implement, ADMS. The results of these meetings are documented in a February 2015 report titled Voices of Experience: Insights into Advanced Distribution Management Systems.
The report documents the potential benefits to utilities in implementing ADMS applications, and underscores the need for more affordability, a timely path for deploying ADMS, and the development and deployment of ADMS applications. The high cost and amount of time required for ADMS deployment and application development was highlighted.
In response to these needs, DOE-OE has established an ADMS program with this project specifically tasked with developing an open-source, standards based ADMS application development platform - GridAPPS-D.
Conceptual Design Summary¶
A conceptual design for GridAPPS-D was created at the beginning of the project. The conceptual design is summarized below. The full design document may be downloaded from this link - GridAPPS-D Conceptual Design
This document provides a high level, conceptual view of the platform and provides related background and contextual information. This document is intended to both educate readers about the technical work of the project and to serve as a point of reference for the project team. The document will be updated as the project progresses.
Architecture¶
A conceptual architecture for the system has five key functional elements as shown in Figure 1:
- Tools help developers enhance the functionality of their applications. Examples might include off-line power flow, optimization tool boxes, state estimators, statistical processing, etc.
- I/O allows convenient access to the power system model and data through standards-based queries and messages. Conversely, applications can send control signals to the simulator using standard message schemas.
- Development utilities include loggers, debuggers, access control, test managers, user interface toolkits, and other application support functions.
- Data bus is based on industry standards like IEC 61968 and 61970 (i.e. the Common Information Model), plus more to be identified.
- Distribution simulator represents the power system operating in real time. Initially, this will be GridLAB-D, but future versions may include EPRI’s OpenDSS, ns-3 for communications, and other federated co-simulators.
Figure 1 also shows the relationships between GridAPPS-D, the ADMS application developer and commercial tools. Two different classes of data flow are shown:
- Control and configuration data are shown with dashed lines; this allows the application developer to manage the platform.
- Data flowing as a part of an application are shown with solid lines.
For more detailed information about the architecture and design, see UML from the Functional Specification
Figure 1: GridAPPS-D provides a method for developers (top) to run their new applications on a real-time simulator with extensive modeling and tool support (heavy box). GridAPPS-D is built around standard data models like the CIM (center). It readily interfaces to existing software products (right), which may also 1) use components of GridAPPS-D and 2) supplement or replace the built-in distribution simulator (bottom), facilitating the deployment of new ADMS applications to existing software products.
Definition of Terms¶
Process Manager - Process Manager keeps track of all the processes running on the platform. These processes may include simulators, requests, applications and other managers. It is also the starting point for a request received by the platform.
Configuration Manager - It receives simulation configuration request from Process Manager and parses it to build the necessary configuration files.
Data Manager - The data manager accesses the database to build the model files used by the simulator.
Simulation Manager - The simulation manager launches the simulator and other required applications such as the FNCS bridge, FNCS, and the VoltVar application. It is in charge of managing the timing of the simulation and reporting output from the simulation out to the simulation status topic.
FNCS-GOSS Bridge - Serves as a bridge between FNCS and Simulation Manager.
FNCS - FNCS is a network co-simulator used to communicate between simulator and FNCS-GOSS bridge
Platform - Refers to GridAPPS-D platform.
RC1 - Release Cycle 1.
Simulation - A real world distribution system currently done by GridLAB-D
Simulator - In current release GridLAB-D serves as the simulator.
VoltVar Application -
Vizualization - A web-based visualization application is developed in RC1 to view power system model with real time values from simulation result.
GOSS - Grid Optics Software System is a middleware architecture designed as a prototype future data analytics and integration platform
GridLAB-D - GridLAB-D is a distribution level powerflow simulator. It acts as the real world distribution system in GridAPPS-D.
Power System Model - IEEE 8500 model is used in RC1.
Model - See Power System Model
CIM - Common Information Model is a standard for representing electrical network and exchange information.
References¶
[CIT1] | W. H. Kersting, “Radial distribution test feeders,” in 2001 IEEE Power Engineering Society Winter Meeting. Conference Proceedings (Cat. No.01CH37194), 2001, pp. 908-912 vol.2. |
[CIT2] | R. F. Arritt and R. C. Dugan, “The IEEE 8500-node test feeder,” in IEEE PES T&D 2010, 2010, pp. 1-6. |
[CIT3] | M. E. Baran and H. Ming-Yung, “Volt/VAr control at distribution substations,” in IEEE Transactions on Power Systems, vol. 14, pp. 312-318, 1999. |
[CIT4] | V. Borozan, M. E. Baran, and D. Novosel, “Integrated volt/VAr control in distribution systems,” in 2001 IEEE Power Engineering Society Winter Meeting. Conference Proceedings (Cat. No.01CH37194), 2001, pp. 1485-1490 vol.3. |
[CIT5] | K. P. Schneider and J. C. Fuller, “Voltage control devices on the IEEE 8500 node test feeder,” in IEEE PES T&D 2010, 2010, pp. 1-6. |
[CIT6] | I. Gorton et al., “GridOPTICS(TM) A Novel Software Framework for Integrating Power Grid Data Storage, Management and Analysis,” in System Sciences (HICSS), 2013 46th Hawaii International Conference on, 2013, pp. 2167-2176. |
[CIT7] | S. Ciraci, J. Daily, J. Fuller, A. Fisher, L. Marinovici, and K. Agarwal, “FNCS: a framework for power system and communication networks co-simulation,” in Proceedings of the Symposium on Theory of Modeling & Simulation - DEVS Integrative, Tampa, Florida, 2014, pp. 1-8. |
[CIT8] | D. P. Chassin, J. C. Fuller, and N. Djilali, “GridLAB-D: An agent-based simulation framework for smart grids,” in Journal of Applied Mathematics, vol. 2014, no. 492320, pp. 1-12, 2014. |
Version History¶
Version Name: Release Cycle 1 (RC1)
Release Date: May 2017
Version description: This is the first version for internal release of GridAPPS-D platform. This is not ready for public use yet.
Functional requirements covered in this release:
- 102/202 Command Interface
- 301 Real-time Simulation Data
- 310 Hosted Application, but short-cutting the registration process (partial)
- 401 Distribution Co-Simulator (partial)
- 402 Process Manager (partial)
- 404 Data Manager (partial)
- 405 Simulation Manager (partial)
- 406 Power System Model Manager (partial)
- 413 Platform Manager (encapsulating 401 and 403-406)
Contact Us¶
GridAPPS-D team can be reached at gridappsd@pnnl.gov
Installing GridAPPS-D¶
GridAPPS-D is available using docker containers
Requirements¶
- git
- docker version 17.12 or higher
- docker-compose version 1.16.1 or higher
Clone or download the repository¶
git clone https://github.com/GRIDAPPSD/gridappsd-docker
cd gridappsd-docker
Install Docker on Ubuntu¶
- run the docker-ce installation script
./docker_install_ubuntu.sh
- log out of your Ubuntu session and log back in to make the docker groups change active
Start the docker container services¶
./run.sh
- The run.sh does the following
- download the mysql dump file
- download the blazegraph data
- start the docker containers
- ingest the blazegraph data
- connect to the gridappsd container
Start gridappsd¶
Now we are inside the executing container
root@737c30c82df7:/gridappsd# ./run-docker.sh
Open your browser to http://localhost:8080/
Exiting the container and stopping the containers¶
Use Ctrl+C to stop gridappsd from running
exit
./stop.sh
Restarting the containers¶
./run.sh
Reconnecting to the running gridappsd container
user@foo>docker exec -it gridappsddocker_gridappsd_1 bash
Using GridAPPS-D¶
Start GridAPPS-D platform¶
Connect to the running GridAPPS-D container
user@foo>docker exec -it gridappsddocker_gridappsd_1 bash
Now we are inside the executing container. Start the platform.
root@737c30c82df7:/gridappsd# ./run-docker.sh
Open your browser to http://localhost:8080/ and click the menu button.

Start a Simulation¶
Choose Simulations from the menu.

To run a demo simulation keep the selected and entered values as it is. Otherwise select/enter Powergrid, Simulation and Application configuration values. Click the check mark to save the configuration.

Click the triangle (1) to start the simulation. Simulation Status (2) at the bottom of the screen will display the simulation log messages.

The demo simulation runs 2 minutes of load variations with the sample-app controlling capacitor banks on the IEEE 8500-node test system [CIT2]. Most of Figure 1 is devoted to a map layout view of the test circuit, with updated labels for capacitor banks and voltage regulators. On the right-hand side, strip chart plots of the phase ABC voltages at capacitors and regulators, phase ABC substation power levels, and phase ABC regulator taps are continually updated. Capacitor bank labels on the circuit map view change between OPEN and CLOSED to show the bank status as load varies and the VVO application issues control commands. While GridAPPS-D runs the demo, GridLAB-D [CIT8] simulates power system operation and exchanges information with the sample-app using GOSS [CIT6] and FNCS [CIT7].
Following image shows the demo simulation output of the sample-app running on the IEEE 8500-node test system.
Stop GridAPPS-D platform¶
For an orderly shutdown of the platform:
Use Ctrl+C to stop gridappsd from running
Using Platform API¶
Applications and services can use either publish/subscribe mechanism or Python API to interact with GridAPPS-D platform.
Publish/Subscribe mechanism can be implemented using any of the language bindings for ActiveMQ messaging framework.
Python API wraps the publish/subscribe messaging and makes the interaction easier for Python apps/services. For more information on Python API and how to use it, look at https://github.com/GRIDAPPSD/gridappsd-python and https://github.com/GRIDAPPSD/gridappsd-sample-app.
Following sections describe the messaging APIs and the corresponding Python API function to interact with platform. Where no Python API function is mentioned, following generic functions can be used.
send(self, topic, message)
get_response(self, topic, message, timeout=5)
subscribe(self, topic, callback, id=None)
Powergrid Model API¶
The Powergrid Model Data Manager API allows you to query the powergrid model data store. Six actions are available: Query_Model_names, Query, Query_Object, Query_Object_Types, Query_Model, and Put_Model
Query Model Info¶
Returns list of names/ids for models, substations, subregions, and regions for all available feeders.
Allowed parameter is:
- Result Format – XML/JSON/CSV, Will return results as a list in the format selected.
Example Request:
{
"requestType": "QUERY_MODEL_INFO",
"resultFormat": "JSON"
}
Example Response for result format JSON:
{
"models": [{
"modelName": "ieee123",
"modelId": "_C1C3E687-6FFD-C753-582B-632A27E28507",
"stationName": "ieee123_Substation",
"stationId": "_FE44B314-385E-C2BF-3983-3A10C6060022",
"subRegionName": "large",
"subRegionId": "_1CD7D2EE-3C91-3248-5662-A43EFEFAC224",
"regionName": "ieee",
"regionId": "_24809814-4EC6-29D2-B509-7F8BFB646437"
}, .......
Query Model Names¶
Returns list of names for all available models.
Allowed parameter is:
- Result Format – XML/JSON/CSV, Will return results as a list in the format selected.
Example Request: goss.gridappsd.process.request.data.powergridmodel
{
"requestType": "QUERY_MODEL_NAMES",
"resultFormat": "JSON"
}
Example Response for result format JSON:
{
"modelNames": ["_49AD8E07-3BF9-A4E2-CB8F-C3722F837B62",
"_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3",
"_5B816B93-7A5F-B64C-8460-47C17D6E4B0F",
"_67AB291F-DCCD-31B7-B499-338206B9828F",
"_9CE150A8-8CC5-A0F9-B67E-BBD8C79D3095",
"_C1C3E687-6FFD-C753-582B-632A27E28507"]
}
Python API function:
query_model_names(self, model_id=None)
Query¶
Returns results from a generic SPARQL query against one or all models.
Allowed parameters are:
- modelId (optional) - when specified it searches against that model, if empty it will search against all models
- queryString - SPARQL query, for more information see https://www.w3.org/TR/rdf-sparql-query/ See below for example.
- resultFormat – XML/JSON , The format you wish the result to be returned in. Can be either JSON or XML. Will return result bindings based on the select part of the query string. See below for example.
Example Request: goss.gridappsd.process.request.data.powergridmodel
{
"requestType": "QUERY",
"resultFormat": "JSON",
"queryString": "select ?line_name ?subregion_name ?region_name WHERE {?line rdf:type cim:Line.?line cim:IdentifiedObject.name ?line_name.?line cim:Line.Region ?subregion.?subregion cim:IdentifiedObject.name ?subregion_name.?subregion cim:SubGeographicalRegion.Region ?region.?region cim:IdentifiedObject.name ?region_name}"
}
Example Response:
{
"head": {
"vars": [ "line_name" , "subregion_name" , "region_name" ]
} ,
"results": {
"bindings": [
{
"line_name": { "type": "literal" , "value": "ieee8500" } ,
"subregion_name": { "type": "literal" , "value": "ieee8500_SubRegion" },
"region_name": { "type": "literal" , "value": "ieee8500_Region" }
}
]
}
}
Python API function:
query_data(self, query, database_type=POWERGRID_MODEL, timeout=30)
Query Object¶
Returns details for a particular object based on the object Id.
Allowed parameters are:
- modelId (optional) - when specified it searches against that model, if empty it will search against all models
- objectID – mrid of the object you wish to return details for.
- resultFormat – XML/JSON , Will return result bindings based on the select part of the query string.
Example Request: goss.gridappsd.process.request.data.powergridmodel
{
"requestType": "QUERY_OBJECT",
"resultFormat": "JSON",
"objectId": "_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3"
}
Example Response:
{
"head": {
"vars": [ "property" , "value" ]
} ,
"results": {
"bindings": [
{
"property": { "type": "uri" , "value": "http://iec.ch/TC57/2012/CIM-schema-cim17#Feeder.NormalEnergizingSubstation" } ,
"value": { "type": "uri" , "value": "http://localhost:9999/blazegraph/namespace/kb/sparql#_F1E8E479-5FA0-4BFF-8173-B375D25B0AA2" }
} ,
{
"property": { "type": "uri" , "value": "http://iec.ch/TC57/2012/CIM-schema-cim17#IdentifiedObject.mRID" } ,
"value": { "type": "literal" , "value": "_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3" }
} ,
{
"property": { "type": "uri" , "value": "http://iec.ch/TC57/2012/CIM-schema-cim17#IdentifiedObject.name" } ,
"value": { "type": "literal" , "value": "ieee8500" }
} ,
{
"property": { "type": "uri" , "value": "http://iec.ch/TC57/2012/CIM-schema-cim17#PowerSystemResource.Location" } ,
"value": { "type": "uri" , "value": "http://localhost:9999/blazegraph/namespace/kb/sparql#_AD650B25-8A04-EA09-95D4-4F78DD0A05E7" }
} ,
{
"property": { "type": "uri" , "value": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" } ,
"value": { "type": "uri" , "value": "http://iec.ch/TC57/2012/CIM-schema-cim17#Feeder" }
}
]
}
}
Python API function:
query_object(self, object_id, model_id=None):
Query Object Types¶
Returns the available object types in the model
Allowed parameters are:
- modelId (optional) - when specified it searches against that model, if empty it will search against all models
- resultFormat – XML/JSON /CSV, Will return results as a list in the format selected.
Example Request: goss.gridappsd.process.request.data.powergridmodel
{
"requestType": "QUERY_OBJECT_TYPES",
"modelId": "_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3",
"resultFormat": "JSON"
}
Example Response:
{
"objectTypes": ["http://iec.ch/TC57/2012/CIM-schema-cim17#ConnectivityNode",
"http://iec.ch/TC57/2012/CIM-schema-cim17#TransformerTank",
"http://iec.ch/TC57/2012/CIM-schema-cim17#PowerTransformer",
"http://iec.ch/TC57/2012/CIM-schema-cim17#LinearShuntCompensator",
"http://iec.ch/TC57/2012/CIM-schema-cim17#EnergySource",
"http://iec.ch/TC57/2012/CIM-schema-cim17#ACLineSegment",
"http://iec.ch/TC57/2012/CIM-schema-cim17#LoadBreakSwitch",
"http://iec.ch/TC57/2012/CIM-schema-cim17#EnergyConsumer"]
}
Python API function:
query_object_types(self, model_id=None)
Query Model¶
Returns all or part of the specified model. Can be filtered by object type
Allowed parameters are:
- modelId - when specified it searches against that model, if empty it will search against all models
- objectType (optional) – type of objects you wish to return details for.
- filter – SPARQL formatted filter string
- resultFormat – XML/JSON, Will return result in the format selected.
Example Request: goss.gridappsd.process.request.data.powergridmodel
{
"requestType": "QUERY_MODEL",
"modelId": "_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3",
"resultFormat": "JSON",
"filter": "?s cim:IdentifiedObject.name 'q14733'",
"objectType": "http://iec.ch/TC57/2012/CIM-schema-cim17#ConnectivityNode"
}
Example Response:
[{
"id": "_0F9BF9EE-B900-71C2-B892-0287A875A158",
"http://iec.ch/TC57/2012/CIM-schema-cim17#ConnectivityNode.ConnectivityNodeContainer": "_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3",
"http://iec.ch/TC57/2012/CIM-schema-cim17#ConnectivityNode.TopologicalNode": "_AE5EDB3A-9177-AEA6-78EF-3DDBA4557D94",
"http://iec.ch/TC57/2012/CIM-schema-cim17#IdentifiedObject.mRID": "_0F9BF9EE-B900-71C2-B892-0287A875A158",
"http://iec.ch/TC57/2012/CIM-schema-cim17#IdentifiedObject.name": "q14733",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http://iec.ch/TC57/2012/CIM-schema-cim17#ConnectivityNode"
}]
Query Object Ids¶
Not yet available Returns details for a particular object based on the object Id.
Allowed parameters are:
- modelId (optional) - when specified it searches against that model, if empty it will search against all models
- objectType (optional) – type of objects you wish to return details for.
- resultFormat – XML/JSON/CSV , Will return result bindings based on the select part of the query string.
Example Request: goss.gridappsd.process.request.data.powergridmodel
{
"requestType": "QUERY_OBJECT_IDS",
"resultFormat": "JSON",
"objectType": "......."
}
Example Response:
{
"objectIDs": ["_49AD8E07-3BF9-A4E2-CB8F-C3722F837B62",
"_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3",
"_5B816B93-7A5F-B64C-8460-47C17D6E4B0F",
"_67AB291F-DCCD-31B7-B499-338206B9828F",
"_9CE150A8-8CC5-A0F9-B67E-BBD8C79D3095",
"_C1C3E687-6FFD-C753-582B-632A27E28507"]
}
Query Object Dictionary By Type¶
Not yet available Returns details for either all objects of a particular type or a particular object based on the object Id in the same format as the model dictionary file.
Allowed parameters are:
- objectType – type of objects you wish to return details for.
- modelId (optional) - when specified it searches against that model, if empty it will search against all models
- objectID (optional) - mrid of the object you wish to return details for.
- resultFormat – XML/JSON , Will return result bindings based on the select part of the query string.
Example Request: goss.gridappsd.process.request.data.powergridmodel
{
"requestType": "QUERY_OBJECT_IDS",
"resultFormat": "JSON",
"objectType": "Capacitor. TODO what is cim type name......"
}
Example Response:
{
"name": "c83",
"mRID": "_8B8DB36D-CF7F-8C11-6C9C-E24B59C02366",
"CN1": "83",
"phases": "ABC",
"kvar_A": 200.0,
"kvar_B": 200.0,
"kvar_C": 200.0,
"nominalVoltage": 4160.0,
"nomU": 4160.0,
"phaseConnection": "Y",
"grounded": true,
"enabled": false,
"mode": null,
"targetValue": 0.0,
"targetDeadband": 0.0,
"aVRDelay": 0.0,
"monitoredName": null,
"monitoredClass": null,
"monitoredBus": null,
"monitoredPhase": null
},....
Put Model¶
Note
Future Capability. Not yet available.
Inserts a new model into the model repository. This could validate model format during insertion **Keep cim/model version in mind
Allowed parameters are:
- modelId – id to store the new model under, or update existing model
- modelContent – expects either RDF/XML or JSON formatted powergrid model
- inputFormat – XML/JSON
Configuration File API¶
Request all GridLAB-D configuration files¶
Generates all configuration files necessary to run a sumulation using the GridLAB-D simulator. Returns the diretory where all of the configuration files are stored.
- Required: configurationType, parameters[model_id,directory,simulationname,simulation_start_time,simulation_duration,simulation_id,simulation_broker_host,simulation_broker_port]
- Optional: parameters[i_fraction, p_fraction, z_fraction, load_scaling_factor, schedule_name,solver_method]
Request: goss.gridappsd.process.request.config
{
"configurationType": "GridLAB-D All",
"parameters": {
"load_scaling_factor": "1.0",
"i_fraction": "1.0",
"model_id": "_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3",
"p_fraction": "0.0",
"simulation_id": "12345",
"z_fraction": "0.0",
"simulation_broker_host": "localhost",
"simulation_name": "ieee8500",
"simulation_duration": "60",
"simulation_start_time": "2018-02-18 00:00:00",
"solver_method": "NR",
"schedule_name": "ieeezipload",
"simulation_broker_port": "61616",
"directory": "/tmp/gridlabdsimulation/"
}
}
Response: <directory where files have been stored>
Request GridLAB-D Base File¶
Generates the main GLM file required by the GridLAB-D simulator
- Required: configurationType, parameters[model_id]
- Optional: parameters[simulation_id, i_fraction, p_fraction, z_fraction, load_scaling_factor, schedule_name]
Request: goss.gridappsd.process.request.config
{
"configurationType": "GridLAB-D Base GLM",
"parameters": {
"i_fraction": "1.0",
"z_fraction": "0.0",
"model_id": "_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3",
"load_scaling_factor": "1.0",
"schedule_name": "ieeezipload",
"p_fraction": "0.0"
}
}
Response:
object regulator_configuration {
name "rcon_VREG4";
connect_type WYE_WYE;
Control MANUAL; // OUTPUT_VOLTAGE;
.......
Request GridLAB-D Symbols File¶
Generates the symbols file with XY coordinates used by the GridLAB-D simulator
- Required: configurationType, parameters[model_id]
- Optional: parameters[simulation_id]
Request: goss.gridappsd.process.request.config
{
"configurationType": "GridLAB-D Symbols",
"parameters": {
"model_id": "_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3"
}
}
Response:
{"feeder":[
{"swing_nodes":[
{"name":"source","bus":"sourcebus","phases":"ABC",
"nominal_voltage":66395.3,"x1":1693780.0,"y1":1.22775777570982E7}
]},
{"capacitors":[
.......
Request CIM Dictionary file¶
Generates a dictionary file which maps between the mrid identifiers used by the CIM model and the other names of model objects used by simulators.
- Required: configurationType, parameters[model_id]
- Optional: parameters[simulation_id]
Request: goss.gridappsd.process.request.config
{
"configurationType":"CIM Dictionary",
"parameters":{"model_id":"_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3"}
}
Response:
{"feeders":[
{"name":"ieee8500",
"mRID":"_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3",
"substation":"ieee8500_Substation",
"substationID":"_F1E8E479-5FA0-4BFF-8173-B375D25B0AA2",
"subregion":"large",
"subregionID":"_A1170111-942A-6ABD-D325-C64886DC4D7D",
"region":"ieee",
"regionID":"_6F10E278-12DC-9CBB-D2D9-D09582538F8A",
"capacitors":[
{"name":"capbank0a","mRID":"_A5866105-A527-F682-C982-69807C0E088B","CN1":"r42246","phases":"A","kvar_A":400.0,"kvar_B":0.0,"kvar_C":0.0,"nominalVoltage":12470.0,"nomU":7200.0,"phaseConnection":"Y","grounded":true,"enabled":true,"mode":"reactivePower","targetValue":-50000.0,"targetDeadband":-500000.0,"aVRDelay":100.0,"monitoredName":"cap_3a","monitoredClass":"ACLineSegment","monitoredBus":"q16642","monitoredPhase":"A"},
.......
],
"regulators":[
{"bankName":"FEEDER_REG","size":"3","bankPhases":"ABC","tankName":["feeder_rega","feeder_regb","feeder_regc"],"endNumber":[2,2,2],"endPhase":["A","B","C"],"rtcName":["feeder_rega","feeder_regb","feeder_regc"],"mRID":["_330E7EDE-2C70-8F72-B183-AA4BA3C5E221","_0EBF840D-7BE9-0D81-03A0-315D617ECA27","_BBB3984D-2A67-7E15-0763-635C5B06A348"],"monitoredPhase":["A","B","C"],"TapChanger.tculControlMode":["volt","volt","volt"],"highStep":[32,32,32],"lowStep":[0,0,0],"neutralStep":[16,16,16],"normalStep":[16,16,16],"TapChanger.controlEnabled":[true,true,true],"lineDropCompensation":[false,false,false],"ltcFlag":[true,true,true],"RegulatingControl.enabled":[true,true,true],"RegulatingControl.discrete":[true,true,true],"RegulatingControl.mode":["voltage","voltage","voltage"],"step":[1.0125,1.0125,1.0063],"targetValue":[126.5000,126.5000,126.5000],"targetDeadband":[2.0000,2.0000,2.0000],"limitVoltage":[0.0000,0.0000,0.0000],"stepVoltageIncrement":[0.6250,0.6250,0.6250],"neutralU":[7200.0000,7200.0000,7200.0000],"initialDelay":[15.0000,15.0000,15.0000],"subsequentDelay":[2.0000,2.0000,2.0000],"lineDropR":[0.0000,0.0000,0.0000],"lineDropX":[0.0000,0.0000,0.0000],"reverseLineDropR":[0.0000,0.0000,0.0000],"reverseLineDropX":[0.0000,0.0000,0.0000],"ctRating":[300.0000,300.0000,300.0000],"ctRatio":[1500.0000,1500.0000,1500.0000],"ptRatio":[60.0000,60.0000,60.0000]},
.......
],
"solarpanels":[
],
"batteries":[
],
"switches":[
{"name":"2002200004641085_sw","mRID":"_F5E6D212-C700-C94A-ED54-E00E8230C19C","CN1":"q14734","CN2":"d5587291-3_int","phases":"ABC","nominalVoltage":12470.0,"normalOpen":false},
.......
],
"measurements":[
{"name":"RatioTapChanger_VREG2","mRID":"02b818b7-fab3-4529-b3b3-fa7cb026eab9","ConductingEquipment_mRID":"_39BD981D-C57D-49E9-1209-9DF79B93A9EA","Terminal_mRID":"_4082AE8B-FAF3-34A9-26A6-6769C16CF78D","measurementType":"Pos","phases":"A","MeasurementClass":"Discrete","ConductingEquipment_type":"PowerTransformer","ConductingEquipment_name":"VREG2","ConnectivityNode":"190-8593"},
{"name":"PowerTransformer_hvmv_sub_Power","mRID":"034241b0-c4f9-4f83-9b65-5dcbeab6b029","ConductingEquipment_mRID":"_B32F64E3-AAD3-FA3F-254B-CF74D12DA290","Terminal_mRID":"_ECDEEB50-1B94-9B13-A797-DED1326D80A5","measurementType":"VA","phases":"B","MeasurementClass":"Analog","ConductingEquipment_type":"PowerTransformer","ConductingEquipment_name":"hvmv_sub","ConnectivityNode":"hvmv_sub_hsb"},
.......
]
}]}
Request CIM Feeder Index file¶
Generates a list of the feeders available powergrid model data store
- Required: configurationType, parameters[model_id]
- Optional: parameters[simulation_id]
Request: goss.gridappsd.process.request.config
{
"configurationType":"CIM Feeder Index",
"parameters":{"model_id":"_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3"}
}
Response:
{"feeders":[
{"name":"ieee123","mRID":"_C1C3E687-6FFD-C753-582B-632A27E28507","substationName":"ieee123_Substation","substationID":"_FE44B314-385E-C2BF-3983-3A10C6060022","subregionName":"large","subregionID":"_1CD7D2EE-3C91-3248-5662-A43EFEFAC224","regionName":"ieee","regionID":"_24809814-4EC6-29D2-B509-7F8BFB646437"},
{"name":"ieee13nodecktassets","mRID":"_5B816B93-7A5F-B64C-8460-47C17D6E4B0F","substationName":"ieee13nodecktassets_Substation","substationID":"_D5B23536-54A7-984E-78F2-B136E9B6380E","subregionName":"test","subregionID":"_C43D4535-5786-01CD-C3C4-69AAC7945AD2","regionName":"ieee","regionID":"_85D8A951-64F2-4787-C922-4AE0AA99A874"},
.......
]}
Request Simulation Output Configuration file¶
Generates file containing objects and properties with measurements avilable in the selected model
- Required: configurationType, parameters[model_id]
- Optional: parameters[simulation_id]
Request: goss.gridappsd.process.request.config
{
"configurationType":"CIM Feeder Index",
"parameters":{"model_id":"_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3"}
}
Response:
{
"cap_capbank0a": [
"switchA",
"shunt_A",
"voltage_A"
],
"cap_capbank1b": [
"switchB",
"voltage_B",
"shunt_B"
],
"cap_capbank2c": [
"voltage_C",
"switchC",
"shunt_C"
],
"cap_capbank0b": [
"voltage_B",
"switchB",
"shunt_B"
],.......
Request YBus Export Configuration file¶
Generates file containing ybus configuration for the selected simulation. Simulation must be running.
- Required: configurationType, parameters[simulation_id]
Request: goss.gridappsd.process.request.config
{
"configurationType":"YBus Export",
"parameters":{"simulation_id":"12345"}
}
Response:
{
yParseFilePath":"/tmp/gridappsd_tmp/1129698954/base_ysparse.csv",
"nodeListFilePath":"/tmp/gridappsd_tmp/1129698954/base_nodelist.csv",
"summaryFilePath":"/tmp/gridappsd_tmp/1129698954/base_summary.csv"
}
Logging API¶
All processes should publish their log messages with process status to Process Manager. These processes include applications, simulations, services, and test runs.
Topic:¶
Log message with process status should be published on the following topic. Process id should be attached to the topic name at the end.
goss.gridappsd.simulation.log.[simulation_id]
goss.gridappsd.service.log.[service_id]
goss.gridappsd.application.log.[app_id]
goss.gridappsd.test.log.[test_id]
Message structure:¶
{
"source": "",
"processId": "",
"timestamp": "",
"processStatus": "[STARTED|STOPPED|RUNNING|ERROR|PASSED|FAILED]",
"logMessage": "",
"logLevel": "[INFO|DEBUG|ERROR]",
"storeToDb": [true|false]
}
Receiving multiple logs:¶
User can either subscribe to individual process’s log by subscribing to topics mentioned above or receive all logs of a type by subscribing to following topics.
goss.gridappsd.simulation.log.*
goss.gridappsd.service.log.*
goss.gridappsd.application.log.*
goss.gridappsd.test.log.*
Similarly, to receive to all logs subscribe to following topic:
goss.gridappsd.*.log.*
Simulation API¶
Start a Simulation¶
Returns simulation id.
Queue:
goss.gridappsd.process.request.simulation
Example Request:
{
power_system_config: the CIM model to be used in the simulation
"power_system_config": {
"GeographicalRegion_name": "ieee8500nodecktassets_Region",
"SubGeographicalRegion_name": "ieee8500nodecktassets_SubRegion",
"Line_name": "ieee8500"
},
simulation_config: the paramaters used by the simulation
"simulation_config": {
"start_time": "1248134400",
"duration": "120",
"simulator": "GridLAB-D",
"timestep_frequency": "1000",
"timestep_increment": "1000",
"simulation_name": "ieee8500",
"power_flow_solver_method": "NR",
simulation_output: the objects and fields to be returned by the simulation
"simulation_output": {
"output_objects": [{
"name": "rcon_FEEDER_REG",
"properties": ["connect_type",
"Control",
"control_level",
"PT_phase",
"band_center",
"band_width",
"dwell_time",
"raise_taps",
"lower_taps",
"regulation"]
},
.....]
},
model creation config: the paramaters used to generate the input file for the simulation
"model_creation_config": {
"load_scaling_factor": "1",
"schedule_name": "ieeezipload",
"z_fraction": "0",
"i_fraction": "1",
"p_fraction": "0"
}
},
application config: inputs to any other applications that should run as part of the simluation, in this case the voltvar application
"application_config": {
"applications": [{
"name": "vvo",
"config_string": "{\"static_inputs\": {\"ieee8500\" : {\"control_method\": \"ACTIVE\", \"capacitor_delay\": 60, \"regulator_delay\": 60, \"desired_pf\": 0.99, \"d_max\": 0.9, \"d_min\": 0.1,\"substation_link\": \"xf_hvmv_sub\",\"regulator_list\": [\"reg_FEEDER_REG\", \"reg_VREG2\", \"reg_VREG3\", \"reg_VREG4\"],\"regulator_configuration_list\": [\"rcon_FEEDER_REG\", \"rcon_VREG2\", \"rcon_VREG3\", \"rcon_VREG4\"],\"capacitor_list\": [\"cap_capbank0a\",\"cap_capbank0b\", \"cap_capbank0c\", \"cap_capbank1a\", \"cap_capbank1b\", \"cap_capbank1c\", \"cap_capbank2a\", \"cap_capbank2b\", \"cap_capbank2c\", \"cap_capbank3\"], \"voltage_measurements\": [\"nd_l2955047,1\", \"nd_l3160107,1\", \"nd_l2673313,2\", \"nd_l2876814,2\", \"nd_m1047574,3\", \"nd_l3254238,4\"], \"maximum_voltages\": 7500, \"minimum_voltages\": 6500,\"max_vdrop\": 5200,\"high_load_deadband\": 100,\"desired_voltages\": 7000, \"low_load_deadband\": 100,\"pf_phase\": \"ABC\"}}}"
}]
}
}
Subscribe to Simulation Output¶
Topic:
/topic/goss.gridappsd.simulation.output.[simulation_id]
Where simulation_id is response from start simulation API.
Example Message:
{
"simulation_id" : "12ae2345",
"message" : {
"timestamp" : "YYYY-MM-DDThh:mm:ss.sssZ",
"measurement" : {
"measurement_mrid" : "123a456b-789c-012d-345e-678f901a234b"
"magnitude" : 3410.456,
"angle" : -123.456
}
}
}
Subscribe to Simulation Logs¶
Topic:
/topic/goss.gridappsd.simulation.log.[simulation_id]
Where simulation_id is response from start simulation API.
Example Message:
{
"source": "",
"processId": "",
"timestamp": "",
"processStatus": "[STARTED|STOPPED|RUNNING|ERROR|PASSED|FAILED]",
"logMessage": "",
"logLevel": "[INFO|DEBUG|ERROR]",
"storeToDb": [true|false]
}
Send Input to Simulation¶
Topic:
/topic/goss.gridappsd.fncs.input
Example Message:
{
"simulation_id" : "12ae2345",
"message" : {
"timestamp" : "2018-01-08T13:27:00.000Z",
"difference_mrid" : "123a456b-789c-012d-345e-678f901a235c"
"reverse_differences" : [
{
"object" : "61A547FB-9F68-5635-BB4C-F7F537FD824E",
"attribute" : "ShuntCompensator.sections",
"value" : "1"
},
{
"object" : "E3CA4CD4-B0D4-9A83-3E2F-18AC5F1B55BA",
"attribute" : "ShuntCompensator.sections",
"value" : "0"
}
]
"forward_differences" : [
{
"object" : "61A547FB-9F68-5635-BB4C-F7F537FD824E",
"attribute" : "ShuntCompensator.sections",
"value" : "0"
},
{
"object" : "E3CA4CD4-B0D4-9A83-3E2F-18AC5F1B55BA",
"attribute" : "ShuntCompensator.sections",
"value" : "1"
}
]
}
}
}
Hosting Application or Service¶
Supported Application or Service Types¶
- Python
- EXE
Hosting Application or Service¶
Developers can create application and services using GridAPPS-D API and use following instruction to host it with the platform. For example of application and service working with GridAPPS-D, please see: https://github.com/GRIDAPPSD/gridappsd-sample-app and https://github.com/GRIDAPPSD/gridappsd-state-estimator
- Create proper folder structure for the application or service.
Following is the recommended structure for applications or services working with gridappsd using sample-app as an example:
For application:
.
├── README.md
└── my_app
├── app
│ ├── [application exe or pythod code]
├── requirements.txt
├── my_app.config
└── setup.py
For service:
.
├── README.md
└── my_service
├── service
│ ├── [service exe or pythod code]
├── requirements.txt
├── my_service.config
└── setup.py
Where config file is used by GridAPPS-D to launch the application or service from inside the gridappsd container.
Example config for application:
{
"id":"sample_app",
"description":"GridAPPS-D Sample Application app",
"creator":"PNNL",
"inputs":[],
"outputs":[],
"options": ["(simulationId)"],
"type":"PYTHON",
"execution_path": "sample_app/runsample.py",
"launch_on_startup":false,
"prereqs":["fncs","fncsgossbridge"],
"multiple_instances":true
}
Example config for service:
{
"id":"state-estimator",
"description":"State Estimator",
"creator":"PNNL",
"inputs":["/topic/goss.gridappsd.fncs.output","/topic/goss.gridappsd.se.input"],
"outputs":["/topic/goss.gridappsd.se.requests","/topic/goss.gridappsd.se.system_state"],
"static_args":["(simulationId)"],
"execution_path":"service/bin/state-estimator.out",
"type":"EXE",
"launch_on_startup":false,
"prereqs":[],
"multiple_instances":true,
"environmentVariables":[]
}
- Clone the repository https://github.com/GRIDAPPSD/gridappsd-docker (refered to as gridappsd-docker repository) next to this repository (they should both have the same parent folder)
.
├── gridappsd-docker
└── gridappsd-sample-app
- Add application or service to platform
In order to add your application/service to the container you will need to modify the docker-compose.yml file included in the gridappsd-docker repository. Under the gridappsd service there is an example volumes leaf that is commented out. Uncomment and modify these lines to add the path for your application and config file. Adding these lines will mount the application/service on the container’s filesystem when the container is started.
For application:
# volumes:
# - ~/git/gridappsd-sample-app/sample_app:/gridappsd/applications/sample_app
# - ~/git/gridappsd-sample-app/sample_app/sample_app.config:/gridappsd/applications/sample_app.config
volumes:
- ~/git/[my_app_directory]/[my_app]:/gridappsd/applications/[my_app]
- ~/git/[my_app_directory]/[my_app]/[my_app.config]:/gridappsd/applications/[my_app.config]
For service:
# volumes:
# - ~/git/gridappsd-sample-app/sample_app:/gridappsd/applications/sample_app
# - ~/git/gridappsd-sample-app/sample_app/sample_app.config:/gridappsd/applications/sample_app.config
volumes:
- ~/git/[my_service_directory]/[my_service]:/gridappsd/services/[my_service]
- ~/git/[my_service_directory]/[my_service]/[my_service.config]:/gridappsd/services/[my_service.config]
GridAPPS-D Development Resources¶
This section is useful for developers for understanding or changing platform’s internal workings and for those wishing to develop their own applications for GridAPPS-D. For developing application for GridAPPS-D platform see Using GridAPPS-D .
Eclipse IDE Setup¶
- Download or clone the repository from github
- Install github desktop https://desktop.github.com/ or sourcetree https://www.atlassian.com/software/sourcetree/overview and Clone the GOSS-GridAPPS-D repository (https://github.com/GRIDAPPSD/GOSS-GridAPPS-D)
- Or download the source (https://github.com/GRIDAPPSD/GOSS-GridAPPS-D/archive/master.zip)
- Install java 1.8 SDK and set JAVA_HOME variable
- Install Eclipse http://www.eclipse.org/downloads/packages/release/Mars/1 (Mars 4.5.1 or earlier, 4.5.2 appears to have bugs related to bundle processing) TODO what about neon?
- Open eclipse with workspace set to GOSS-GridAPPS-D download location, eg. C:UsersusernameDocumentsGOSS-GridAPPS-D
- Install BNDTools plugin: Help->Install New Software->Work with: http://dl.bintray.com/bndtools/bndtools/3.0.0 and Install Bndtools 3.0.0 or earlier
- Import projects into workspace
- File->Import General->Existing Projects into workspace
- Select root directory, GOSS-GridAPPS-D download location
- Select cnf, pnnl.goss.gridappsd
- If errors are detected, Right click on the pnnl.goss.gridappsd project and select release, then release all bundles
- If you would like to you a local version of GOSS-Core (Optional)
- Update cnf/ext/repositories.bnd
- Select source view and add the following as the first line
- aQute.bnd.deployer.repository.LocalIndexedRepo;name=GOSS Local Release;local=/GOSS-Core2/cnf/releaserepo;pretty=true,
- verify by switching to bndtools and verify that there are packages under GOSS Local Relase
- Open pnnl.goss.gridappsd/bnd.bnd, Rebuild project, you should not have errors
- Open pnnl.goss.gridappsd/run.bnd.bndrun and click Run OSGI
Execution Workflow¶

Process Manager - The workflow begins when a simulation request is sent to the request topic monitored by the Process Manager, the process manager gathers the necessary configurations from the Configuration Manager. Then sends the configuration to the simulation manager to run the simulation.
Configuration Manager - The configuration manager parses the request and builds the necessary configuration files. It also uses the data manager to pull the model data from the CIM database.
Data Manager - The data manager accesses the CIM database to build the model files used by the simulator.
Simulation Manager - The simulation manager launches the simulator and other required applications such as the FNCS bridge, FNCS, and the VoltVar application. It is in charge of managing the timing of the simulation and reporting output from the simulation out to the simulation status topic.
FNCS Bridge - Serves as input and output from the simulator to the rest of GridAPPS-D, receives initialization, timestep, update, and finalize requests from the simulation manager and other applications, such as voltvar. It also publishes output from the simulator on a pre-defined topic for the simulation manager and other applications to subscribe to.
Simulator - In this case GridLAB-D serves as the simulator.
Hosted Application - Applications can be developed to use the data generated by the simulation and submit feedback and updates to the simulator. Two examples of this have been developed in RC1, the VoltVar application and a vizualization application
Log Manager - Process Manager recieves a log message. It retrieves the username associated with the message and forwards the message and username to Log Manager. Log Manager writes the message on a file and if store_to_db key is true in log message then log manager calls the data manager to store the log message in the database.
Messaging¶
Please see Start a Simulation for more details.
CIM Documentation¶
This section summarizes the use of a reduced-order CIM [1] to support feeder modeling for the volt-var application in Release Cycle 1 (RC1). The full CIM includes over 1100 tables in SQL, each one corresponding to a UML class, enumeration or datatype. In RC1, we’re using approximately 100 such entities, mapped onto 100+ tables in SQL. Later versions of GridAPPS-D will use a triple-store or graph database, both of which appear to be better suited for CIM.
The CIM subset described here is based on the profile adopted for the most recent distribution CIM interoperability test, which was held in 2011 at EDF. For GridAPPS-D, we have updated that profile for compatibility with the most recent CIM base standard.
Class Diagrams for the Profile¶
Figure 1 through Figure 11 present the UML class diagrams generated from Enterprise Architect [2]. These diagrams provide an essential roadmap for understanding:
- How to ingest CIM XML from various sources into the database
- How to generate native GridLAB-D input files from the database
For those unfamiliar with UML class diagrams:
- Lines with an arrowhead indicate class inheritance. For example, in Figure 1, ACLineSegment inherits from Conductor, ConductingEquipment, Equipment and then PowerSystemResource. ACLineSegment inherits all attributes and associations from its ancestors (e.g. length), in addition to its own attributes and ancestors.
- Lines with a diamond indicate composition. For example, in Figure 1, ConnectivityNodes make up a TopologicalNode, and then TopologicalNodes make up a TopologicalIsland.
- Lines without a terminating symbol are associations. For example, in Figure 1, ACLineSegment has (through inheritance) a BaseVoltage, Location and EquipmentContainer.
- Italicized names at the top of each class indicate the ancestor (aka superclass), in cases where the ancestor does not appear on the diagram. For example, in Figure 1, PowerSystemResource inherits from IdentifiedObject.
Please see OSPRREYS_RC1.eap [3] in the repository [4] on GitHub for the latest updates. The EnterpriseArchitect file includes a description of each class, attribute and association. It can also generate HTML documentation of the CIM, with more detail than provided here.
The diagrammed UML associations have a role and cardinality at each end, source and target. In practice, only one end of each association is profiled and implemented in SQL. In some cases, the figure captions indicate which end, but see the CIM profile for specific definitions, as described in the object diagram section.
Nearly every CIM class inherits from IdentifiedObject, from which we use two attributes:
- mRID is the “master identifier” that must be unique and persistent among all instances. It’s often used as the RDF resource identifier, and is often a GUID.
- Name is a human-readable identifier that need not be unique.
Figure 1: Placement of ACLineSegment into a Line (aka Feeder). In GridAPPS-D, the Line is the EquipmentContainer for all power system components and the ConnectivityNodeContainer for all nodes. It also corresponds to one TopologicalIsland. It’s part of a SubGeographicalRegion and GeographicalRegion for proper context with other CIM models. For visualization, ACLineSegment can be drawn from a sequence of PositionPoints associated via Location. The Terminals are free-standing; two of them will “reverse-associate” to the ACLineSegment as ConductingEquipment, and each terminal also has one ConnectivityNode. In RC1, we have a one-to-one association between ConnectityNode and TopologicalNode. The AngleRefTopologicalNode association can be used to identify the swing bus for GridLAB-D. Otherwise, we’re only using the topology classes to facilitate state variables, as described in Figure 11. The Terminal:phases attribute is not used; instead, phases will be defined in the ConductingEquipment instances. The associated BaseVoltage:nominalVoltage attribute is important for many of the classes that don’t have their own rated voltage attributes, for example, EnergyConsumer.
Figure 2: There are four different ways to specify ACLineSegment impedances. In all cases, Conductor:length is required. The first way is to specify the individual ACLineSegment attributes, which are sequence impedances and admittances, leaving PerLengthImpedance null. The second way is to specify the same attributes on an associated PerLengthSequenceImpedance, in which case the ACLineSegment attributes should be null. The third way is to associate a PerLengthPhaseImpedance, leaving the ACLineSegment attributes null. Only conductorCount from 1 to 3 is supported, and there will be 1, 3 or 6 reverse-associated PhaseImpedanceData instances that define the lower triangle of the Z and Y matrices per unit length. The sequenceNumber goes from 1 to N+N*(N-1)/2 in column order. The fourth way to specify impedance is by wire/cable and spacing data, as described with Figure 10. If there are ACLineSegmentPhase instances reverse-associated to the ACLineSegment, then per-phase modeling applies. There are several use cases for ACLineSegmentPhase: 1) single-phase or two-phase primary, 2) low-voltage secondary using phases s1 and s2, 3) associated wire data where the neutral exists, 4) associated wire data where the phase wires are different. It is the application’s responsibility to propagate phasing through terminals to other components, and to identify any miswiring.
Figure 3: The EnergySource is balanced three-phase, representing a transmission system source (this is probably not the way we’ll model distributed generation in future versions). The EnergyConsumer is a ZIP load, possibly unbalanced, with an associated LoadResponse instance defining the ZIP coefficients. For three-phase delta loads, the phaseConnection is D and the three reverse-associated EnergyConsumerPhase instances will have phase=A for the AB load, phase=B for the BC load and phase=C for the AC load. A three-phase wye load may have either Y or Yn for the phaseConnection. Single-phase and two-phase loads, including secondary loads, should have phaseConnection=I (for individual).
Figure 4: There are seven different kinds of Switch supported in the CIM, and all of them have zero impedance. They would all behave the same in power flow analysis, and all would require many more attributes than are defined in CIM to support protection analysis. The use cases for SwitchPhase include 1) single-phase, two-phase and secondary switches, 2) one or two conductors open in a three-phase switch or 3) transpositions, in which case phaseSide1 and phaseSide2 would be different.
Figure 5: On the left, LinearShuntCompensator and LinearShuntCompensatorPhase define capacitor banks, in a way very similar to EnergyConsumer in Figure 3. The kVAR ratings must be converted to susceptance based on the nominal voltage, nomU. Note that aVRDelay is really a capacitor control parameter, to be used in conjunction with RegulatingControl on the right-hand side. The RegulatingControl associates to the controlled capacitor bank via RegulatingCondEq, and to the monitored location via Terminal. There is no support for a PT or CT ratio, so targetDeadband and targetValue have to be in primary volts, amps, vars, etc.
Figure 6: PowerTransformers may be modeled with or without tanks, and in both cases vectorGroup should be specified according to IEC transformer standards (e.g. Dy1 for many substation transformers). The case without tanks is most suitable for balanced three-phase transformers that won’t reference catalog data; any other case should use tank-level modeling. In the tankless case, each winding will have a PowerTransformerEnd that associates to both a Terminal and a BaseVoltage, and the parent PowerTransformer. The impedance and admittance parameters are defined by reverse-associated TransformerMeshImpedance between each pair of windings, and a reverse-associated TransformerCoreAdmittance for one winding. The units for these are ohms and siemens based on the winding voltage, rather than per-unit. WindingConnection is similar to PhaseShuntConnectionKind, adding Z and Zn for zig-zag connections and A for autotranformers. If the transformer is unbalanced in any way, then TransformerTankEnd is used instead of PowerTransformerEnd, and then one or more TransformerTanks may be used in the parent PowerTransformer. Some of the use cases are 1) center-tapped secondary, 2) open-delta and 3) EHV transformer banks. Tank-level modeling is also required is using catalog data, as described with Figure 9.
Figure 7: A RatioTapChanger can represent a transformer tap changer on the associated TransformerEnd. The RatioTapChanger has some parameters defined in a direct-associated TapChangerControl, which inherits from RegulatingControl some of the same attributes used in capacitor controls (Figure 5). Therefore, a line voltage regulator in CIM includes a PowerTransformer, a RatioTapChanger, and a TapChangerControl. The CT and PT parameters of a voltage regulator can only be described via the AssetInfo mechanism, described with Figure 8.
Figure 8: Many distribution software packages use the concept of catalog data, aka library data, especially for lines and transformers. We use the Asset and AssetInfo packages to implement this in CIM. Here, the TapChangerInfo class includes the CT rating, CT ratio and PT ratio parameters needed for line drop compensator settings in voltage regulators. Catalog data is a one-to-many, and sometimes a many-to-many, relationship. For these lookups, we create an Asset instance that has one association to AssetInfo, and one-to-many associations to PowerSystemResources. In this case, many TapChangers can share the same TapChangerInfo data, which saves space and provides consistency.
Figure 9: The catalog mechanism for transformers will associate a TransformerTank (Figure 6) with TransformerTankInfo (here), via the one-to-many mechanism described in Figure 8. The PowerTransformerInfo collects TransformerTankInfo by reverse association, but it does not link with PowerTransformer. In other words, the physical tanks are cataloged because transformer testing is done on tanks. One possible use for PowerTransformerInfo is to help organize the catalog. It’s important that TransformerEndInfo:endNumber (here) properly match the TransformerEnd:endNumber (Figure 6). The shunt admittances are defined by NoLoadTest on a winding / end, usually just one such test. The impedances are defined by a set of ShortCircuitTests; one winding / end will be energized, and one or more of the others will be grounded in these tests.
Figure 10: The catalog / library mechanism for ACLineSegment will have a WireSpacingInfo associated as in Figure 9. This will indicate whether the line is overhead or underground. phaseWireCount and phaseWireSpacing define optional bundling, so these will be 1 and 0 for distribution. The number of phase and neutral conductors is actually defined by the number of reverse-associated WirePosition instances. For example, a three-phase line with neutral would have four of them, with phase = A, B, C and N. On the right-hand side, concrete classes OverheadWireInfo, TapeShieldCableInfo and ConcentricNeutralCableInfo may be associated (as in Figure 9) to either ACLineSegment or ACLineSegmentPhase. The association to ACLineSegment only applies for three-conductor, three-phase lines all using the same wire data, or to supply just the ratedCurrent attribute. All other use cases would associate to ACLineSegmentPhase. It’s the application’s responsibility to calculate impedances from this data. In particular, soil resistivity and dielectric constants are not included in the CIM. Typical dielectric constant values might be defined for each WireInsulationKind.
Figure 11: The CIM state variables package might be used to mimic sensor locations and values on the distribution system. Voltages are measured on TopologicalNodes, power flows are measured at Terminals, step positions are measured on TapChangers, status is measured on ConductingEquipment, and on/off state is measured on ShuntCompensators. The “injections” have been included here, but there may not be a use case for them in distribution. On the other hand, we would need an SvCurrent, which was probably not included in the CIM because of its transmission system heritage. Attributes for sensor characteristics would also have to be added in future versions of GridAPPS-D.
Typical Queries¶
These queries focus on requirements of the first volt-var application.
- Capacitors (Figure 5, Figure 12, Figure 13, Figure 14)
- Create a list of capacitors with bus name (Connectivity Node in Figure 1), kVAR per phase, control mode, target value and target deadband
- For a selected capacitor, update the control mode, target value, and target deadband
- Regulators (Figure 7, Figure 8, Figure 12, Figure 29)
- List all transformers that have a tap changer attached, along with their bus names and kVA sizes
- Given a transformer that has a tap changer attached, list or update initialDelay, step, subsequentDelay, mode, targetDeadband, targetValue, limitVoltage, lineDropCompensation, lineDropR, lineDropX, reverseLineDropR and reverseLineDropX
- Transformers (Figure 6, Figure 9)
- Given a bus name or load (Figure 3), find the transformer serving it (Figure 16, Figure 19)
- Find the substation transformer, defined as the largest transformer (by kVA size and or highest voltage rating)
- List the transformer catalog (Figure 9, Figure 20) with name, highest ratedS, list of winding ratedU in descending order, vector group (https://en.wikipedia.org/wiki/Vector_group used with connectionKind and phaseAngleClock), and percent impedance
- List the same information as in item c, but for transformers
(Figure 6) and also retrieving their bus names. Note that a
transformer can be defined in three ways
- Without tanks, for three-phase, multi-winding, balanced transformers (Figure 16 and Figure 17).
- With tanks along with TransformerTankInfo (Figure 9) from a catalog of “transformer codes”, which may describe balanced or unbalanced transformers. See Figure 19 and Figure 20.
- With tanks for unbalanced transformers, and TransformerTankInfo created on-the-fly. See Figure 19 and Figure 20.
- Given a transformer (Figure 6), update it to use a different catalog entry (TransformerTankInfo in Figure 9)
- Lines (Figure 2, Figure 10, Figure 12)
- List the line and cable catalog entries that meet a minimum ratedCurrent and specific WireUsageKind. For cables, be able to specify tape shield vs. concentric neutral, the WireInsulationKind, and a minimum insulationThickness. (Figure 27)
- Given a line segment (Figure 2) update to use a different linecode (Figure 10, Figure 26)
- Given a bus name, list the ACLineSegments connected to the bus, along with the length, total r, total x, and phases used. There are four cases as noted in the caption of Figure 2, and see Figure 23 through Figure 26.
- Given a bus name, list the set of ACLineSegments (or PowerTransformers and Switches) completing a path from it back to the EnergySource (Figure 3). Normally, the applications have to build a graph structure in memory to do this, so it would be very helpful if a graph/semantic database can do this.
- Voltage and other measurements (Figure 1, Figure 11)
- Given a bus, attach a voltage measurement point (SvVoltage, Figure 30)
- List all voltage measurement points and their buses, and for each bus, list the phases actually present
- For tap changer position (SvTapStep, Figure 31), attach and list measurements as in items a and b
- For capacitor switch status (SvShuntCompensatorSections, Figure 32), attach and list measurements as in items a and b
- Loads (Figure 3, Figure 28)
- Given a bus name, list and total all of the loads connected by phase, showing the total p and q, and the composite ZIP coefficients
- Switching (Figure 4, Figure 22)
- Given a bus name, trace back to the EnergySource and list the switches encountered, grouped by type (i.e. the leaf class in Figure 4). Also include the ratedCurrent, breakingCapacity if applicable, and open/close status. If SwitchPhase is used, show the phasing on each side and the open/close status of each phase.
- Given switch, toggle its open/close status.
Object Diagrams for Queries¶
This section contains UML object diagrams for the purpose of illustrating how to perform typical queries and updates. For those unfamiliar with UML object diagrams:
- Each object will be an instance of a class, and more than one instance of a class can appear on the diagram. For example, Figure 12 shows two ConnectivityNode instances, one for each end of a ConductingEquipment.
- The object name (if specified and important) appears before the colon (:) above the line, while the UML class appears after the colon. Every object in CIM will have a unique ID, and a name (not necessarily unique), even if not shown here.
- Some objects may be shown with run-time state below the line. These are attribute value assignments, drawn from those available in the UML class or one of the class ancestors. The object may have more attribute assignments, but only those directly relevant to the figure captions are shown in the diagrams of this section.
- Object associations are shown with solid lines, role names, and multiplicities similar to the UML class diagrams. One important difference is that only one way of navigating a particular association will be defined in the profile. For example, the lower left corner of Figure 1 shows a two-way link between TopologicalNode and ConnectivityNode in the UML class diagram. However, Figure 12 shows that only one direction has been defined in the profile. Each ConnectivityNode has a direct reference to its corresponding TopologicalNode. In order to navigate the reverse direction from TopologicalNode to ConnectivityNode, some type of conditional query would be required. In other words, the object diagrams in this section indicate which associations can actually be used in GridAPPS-D.
- In some cases, the multiplicities on the object diagrams are more restrictive than on the class diagrams, due to profiling. For example, Figure 12 reflects a one-to-one correspondence between ConnectivityNode and TopologicalNode in this profile.
The object diagrams are intended to help you break down the CIM queries into common sub-tasks. For example, query #1 works with capacitors. It’s always possible to select a capacitor (aka LinearShuntCompensator) by name. In order to find the capacitor at a bus, say “bus1” in Figure 12, one would retrieve all Terminals having a ConnectivityNode reference to “bus1”. Each of those Terminals will have a ConductingEquipment reference, and you want the Terminal(s) for which that reference is actually a LinearShuntCompensator. In this CIM profile, only leaf classes (e.g. LinearShuntCompensator) will be instantiated, never base classes like ConductingEquipment. There can be more than one capacitor at a bus, more than one load, more than one line, etc.
Figure 12: In order to traverse buses and components, begin with a ConnectivityNode (left). Collect all terminals referencing that ConnectivityNode; each Terminal will have one-to-one association with ConductingEquipment, of which there are many subclasses. In this example, the ConductingEquipment has a second terminal referencing the ConnectivityNode called bus2. There are applications for both Depth-First Search (DFS) and Bread-First Search (BFS) traversals. Note 1: the Terminals have names, but these are not useful. Some Terminal names have been shown above, just to illustrate there is no useful implication of sequencing or ordering. Note 2: in this version of GridAPPS-D, we have one-to-one association of TopologicalNode and ConnectivityNode, but all searches should visit ConnectivityNodes. Note 3: transformers are subclasses of ConductingEquipment, but we traverse connectivity via transformer ends (aka windings). This is illustrated later.
In order to find capacitors (or anything else) associated with a particular “feeder”, Figure 13 shows that you would query for objects having EquipmentContainer reference to the feeder’s Line object. In GridAPPS-D RC1, we only use Line for equipment container in CIM, and this would correspond to one entire GridLAB-D model. There is also a BaseVoltage reference that will have the system nominal voltage for the capacitor’s location. However, in order to work with equipment ratings you should use ratedS and ratedU attributes where they exist, particularly for capacitors and transformers. These attributes are often slightly different than the “system voltage”. Most of the attribute units in CIM are SI, with a few exceptions like percent and kW values on transformer test sheets (i.e. CIM represents the test sheet, not the equipment).
Figure 13: All conducting equipment lies within an EquipmentContainer, which in GridAPPS-D, will be a Line object named after the feeder. It also has reference to a BaseVoltage, which is typically one of the ANSI preferred system voltages. Power transformers are a little different, in that each winding (called “end” in CIM) has reference to a BaseVoltage. Note that equipment ratings come from the vendor, and in this case ratedU is slightly different from nominalVoltage. All conducting equipment has a Location, which contains XY coordinates (see Figure 1). The Location is useful for visualization, but is not essential for a power flow model.
Completing the discussion of capacitors, Figure 14 provides two examples for single-phase, and three-phase with local voltage control. As shunt elements, capacitors have only one Terminal instance. Loads and sources have one terminal, lines and switches have two terminals, and transformers have two or more terminals. Examples of all those are shown later. In Figure 14, the capacitor’s kVAR rating will be based on its nameplate ratedU, not the system’s nominalVoltage.
Often, the question will arise “what phases exist at this bus?”. There is no phasing explicitly associated with a ConnectivityNode or Terminal in CIM. To answer this question, we’d have to query for all ConductingEquipment instances having Terminals connected to that bus, as in Figure 12. The types of ConductingEquipment that may have individual phases include LinearShuntCompensators (Figure 14), ACLineSegments, PowerTransformers (via TransformerEnds), EnergyConsumers, and descendants of Switch. If the ConductingEquipment has such individual phases, then add those phases to list of phases existing at the bus. If there are no individual phases, then ABC all exist at the bus. Note this doesn’t guarantee that all wiring to the bus is correct; for example, you could still have a three-phase load served by only a two-phase line, which would be a modeling error. In Figure 14, we’d find phase C at Bus611 and phases ABC at Bus675. Elsewhere in the model, there should be ACLineSegments, PowerTransformers or Switch descendants delivering phase C to Bus611, all three phases ABC to Bus675.
Figure 14: Capacitors are called LinearShuntCompensator in CIM. On the left, a 100 kVAR, 2400 V single-phase bank is shown on phase C at bus 611. bPerSection = 100e3 / 2400^2 [S], and the bPerSection on LinearShuntCompensatorPhase predominates; these values can differ among phases if there is more than one phase present. On the right, a balanced three-phase capacitor is shown at bus 675, rated 300 kVAR and 4160 V line-to-line. We know it’s balanced three phase from the absence of associated LinearShuntCompensatorPhase objects. bPerSection = 300e4 / 4160^2 [S]. This three-phase bank has a voltage controller attached with 2400 V setpoint and 240 V deadband, meaning the capacitor switches ON if the voltage drops below 2280 V and OFF if the voltage rises above 2520 V. These voltages have to be monitored line-to-neutral in CIM, with no VT ratio. In this case, the control monitors the same Terminal that the capacitor is connected to, but a different conducting equipment’s Terminal could be used. The control delay is called aVRDelay in CIM, and it’s an attribute of the LinearShuntCompensator instead of the RegulatingControl. It corresponds to “dwell time” in GridLAB-D.
Figure 15 through Figure 20 illustrate the transformer query tasks, plus Figure 29 for attached voltage regulators. The autotransformer example is rated 500/345/13.8 kV and 500/500/50 MVA, for a transmission system. The short circuit test values are ZHL=10%, ZHT=25% and ZLT=30%. The no-load test values are 0.05% exciting current and 0.025% no-load losses. These convert to r, x, g and b in SI units, from and , where Srated and Urated are based on the “from” winding (aka end). The same base quantities would be used to convert r, x, g and b back to per-unit or percent. The open wye – open delta impedances are already represented in percent or kW, from the test reports.
Figure 15: Autotransformer with delta tertiary winding acts like a wye-wye transformer with smaller delta tertiary. The vector group would be Yynd1 or Yyd1. For analyses other than power flow, it can be represented more accurately as the physical series (n1) – common (n2) connection, with a vector group Yand1. In either case, it’s a three-winding transformer.
Figure 16: A three-winding autotransformer is represented in CIM as a PowerTransformer with three PowerTransformerEnds, because it’s balanced and three-phase. The three Terminals have direct ConductingEquipment references to the PowerTransformer, so you can find it from bus1, busX or busY. However, each PowerTransformerEnd has a back-reference to the same Terminal, and it’s own reference to BaseVoltage (Figure 13); that’s how you link the matching buses and windings, which must have compatible voltages. Terminals have no sequence number, so the endNumber is important for correct linkage to catalog data as discussed later. By convention, ends with highest ratedU have the lowest endNumber, and endNumber establishes that end’s place in the vectorGroup.
Figure 17: Power transformer impedances correspond to the three-winding autotransformer example of Figure 15 and Figure 16. There are three instances of TransformerMeshImpedance connected pair-wise between the three windings / ends. The x and r values are in Ohms referred to the end with highest ratedU in that pair. There is just one TransformerCoreAdmittance, usually attached to the end with lowest ratedU, and the attribute values are Siemens referred to that end’s ratedU.
Figure 18: Open wye - open delta transformer banks are used to provide inexpensive three-phase service to loads, by using only two single-phase transformers. This is an unbalanced transformer, and as such it requires tank modeling in CIM. Physically, the two transformers would be in separate tanks. Note that Tank A is similar to the residential center-tapped secondary transformer, except the CIM phases would include s1 and s2 instead of A and B.
Figure 19: Unbalanced PowerTransformer instances comprise one or more TransformerTanks, which own the TransformerTankEnds. Through the ends, busHi collects phases ABN and busLo collects phases ABCN. Typically, phase C will also exist at busHi, but this transformer doesn’t require it. We still assign vectorGroup Yd1 to the supervising PowerTransformer, as this is the typical case. The modeler should determine that. By comparison to Figure 19, there is a possible ambiguity in how endA3 represents the polarity dot at the neutral end of Wdg A3. An earlier CIM proposal would have assigned phaseAngleClock = 6 on endA3, but the attribute was removed from TransformerTankEnd. It may not be possible to infer the correct winding polarities from the vectorGroup in all cases. There is a phaseAngleClock attribute on TransformerTankEndInfo, but that represents a shelf state of the tank, not necessarily connections in the field. Therefore, it may be necessary to propose the phaseAngleClock attribute for TransformerTankEnd.
Figure 20: This Asset catalog example defines the impedances for Tank B of the open wye – open delta bank. This is a 50 kVA, 7200 / 240 V single-phase transformer. It has 1% exciting current and 0.4 kW loss in the no-load test, plus 2.1% reactance and 0.5 kW loss in the short-circuit test. A multi-winding transformer could have more than one grounded end in a short-circuit test, but this is not common. The catalog data is linked with one or more TransformerTanks via the Asset instance, shown to the left. This Asset instance won’t exist without such links (i.e. the catalog data is actually used), so cardinalities are 1 for AssetInfo and 1..* for PowerSystemResources. Furthermore, endNumber on the TransformerEndInfo has to match endNumber on the TransformerTankEnd instances associated to Tank B. Instead of catalog information, we could have used mesh impedance and core admittance as in Figure 17, but we’d have to convert the test sheets to SI units and we could not share data with other TransformerTank instances, both of which are inconvenient.
Figure 21 through Figure 27 illustrate the query tasks for ACLineSegments and Switches, which will define most of the circuit’s connectivity. The example sequence impedances were based on Z1 = 0.1 + j0.8 Ω/mile and Z0 = 0.5 + j2.0 Ω /mile. For distribution systems, use of the shared catalog data is more common, either pre-calculated matrix (Figure 25) or spacing and conductor (Figure 26 and Figure 27). In both cases, impedance calculation is outside the scope of CIM (e.g. GridLAB-D internally calculates line impedance from spacing and conductor data).
Figure 21: An ACLineSegment with two phases, A and C. If there are no ACLineSegmentPhase instances that associate to it, assume it’s a three-phase ACLineSegment. This adds phases AC to bus671 and bus684.
Figure 22: This 50-Amp load break switch connects phases AC between busLeft and busRight. Without associated SwitchPhase instances, it would be a three-phase switch. This switch also transposes the phases; A on side 1 connects with C on side 2, while C on side 1 connects with A on side 2. This is the only way of transposing phases in CIM. Note the ambiguity in side 1 and side 2, because Terminal.sequenceNumber was subsequently removed from the CIM. This needs to be addressed in a future version of the CIM. Also note that LoadBreakSwitch has the open attribute inherited from Switch, while SwitchPhase has the converse closed attribute. In order to open and close the switch, these attributes would be toggled appropriately. See Figure 4 for other types of switch.
Figure 23: This is a balanced three-phase ACLineSegment between bus632 and bus671, 2000 feet or 609.6 m long. Sequence impedances are specified in ohms, as attributes on the ACLineSegment. This is a typical pattern for transmission lines, but not distribution lines.
Figure 24: The impedances from Figure 23 were divided by 609.6 m, to obtain ohms per meter for seqCat1. Utilities often call this a “line code”, and other ACLineSegment instances can share the same PerLengthImpedance. A model imported into the CIM could have many line codes, not all of them used in that particular model. However, those line codes should be available for updates by reassigning PerLengthImpedance.
Figure 25: This is a two-phase line segment from bus671 to bus684 using a line code, which has been specified using a 2x2 symmetric matrix of phase impedances per meter, instead of sequence impedances per meter. This is more common for distribution than either Figure 23 or Figure 24. It’s distinguished from Figure 24 by the fact that PerLengthImpedance references an instance of PerLengthPhaseImpedance, not PerLengthSequenceImpedance. The conductorCount attribute tells us it’s a 2x2 matrix, which will have two unique diagonal elements and one distinct off-diagonal element. The elements are provided in three PhaseImpedanceData instances, which are named here for clarity as Z11, Z12 and Z22. However, the sequenceNumber is most significant, as the elements must be numbered in lower triangular form. Finally, note that Z11 and Z22 are slightly different. The matrix row numbers must correspond to the phases present in ABC order. CIM doesn’t provide a way of transposing matrix row assignments, so in order to swap phases A and C, we’d have to create a second instance of PerLengthPhaseImpedance, with Z11 and Z22 swapped. The GridAPPS-D CIM importer will create these automatically, which expands the set of line codes. As presented here, mtx604 can apply to phasing AB, BC or AC.
Figure 26: The two-phase ACLineSegment impedance defined by sharing wire and spacing data from a catalog. Each ACLineSegmentPhase links to an OverheadWireInfo instance via the Asset instance. If the neutral (N) is present, we have to specify its wire information for a correct impedance calculation. In this case, ACN all use the same wire type, but they can be different, especially for the neutral. Similarly, the WireSpacingInfo associates to the ACLineSegment itself via a separate Asset instance. These Asset instances only exist when the catalog data is used, so cardinalities are 1 for AssetInfo and 1..* for PowerSystemResources.
Figure 27: The upper five instances define catalog attributes for Figure 26. The WirePosition xCoord and yCoord units are meters, not feet, and they include explicit phase assignments to match ACLineSegmentPhase. This removes any ambiguity, but it’s still necessary to create copies for phase transposition. The phaseWireSpacing and phaseWireCount attributes are for sub-conductor bundling on EHV and UHV transmission lines; bundling is not used on distribution. The number of WirePositions that reference spc505acn determine how many wires need to be assigned, and the phase attributes in those WirePosition instances determine how many phases and neutrals there are. Eliminating the neutral, this would produce a 2x2 phase impedance matrix. Although the pattern appears general enough to support multiple neutrals and transmission overbuild, the CIM doesn’t actually have the required phasing codes. When isCable is true, the WirePosition yCoord values would be negative for underground depth. To find overhead wires of a certain size or ampacity, we can put query conditions on the ratedCurrent attribute. To find underground conductors, we query the ConcentricNeutralCableInfo or TapeShieldCableInfo instead of OverheadWireInfo. All three inherit the ratedCurrent attribute from WireInfo. Cables don’t have a voltage rating in CIM, but you can use insulationThickness as a proxy for voltage rating in queries. Here, 5.588 mm corresponds to 220 mils, which is a common size for distribution.
Figure 28 illustrates the loads, which are called EnergyConsumer in CIM. The houses and appliances from GridLAB-D are not supported in CIM. Only ZIP loads can be represented. Further, any load schedules would have to be defined outside of CIM. Assume that the CIM loads are peak values.
Figure 29 illustrates the voltage regulator function. Note that GridLAB-D combines the regulator and transformer functions, while CIM separates them. Also, the CIM provides voltage and current transducer ratios for tap changer controls, but not for capacitor controls.
Figure 30 through Figure 32 illustrate how measurements required for RC1 can be attached to buses or other components. Individual phase measurements for voltage and capacitor status have to be added.
Figure 28: The three-phase load (aka EnergyConsumer) on bus671 is balanced and connected in delta. It has no ratedU attribute, so use the referenced BaseVoltage (Figure 13) if a voltage level is required. On the right, a three-phase wye-connected unbalanced load on bus675 is indicated by the presence of three EnergyConsumerPhase instances referencing UnbalancedLoad. For consistency in searches and visualization, UnbalancedLoad.pfixed should be the sum of the three phase values, and likewise for UnbalancedLoad.qfixed. In power flow solutions, the individual phase values would be used. Both loads share the same LoadResponse instance, which defines a constant power characteristic for both P and Q, because the percentages for constant impedance and constant current are all zero. The two other most commonly used LoadResponseCharacteristics have 100% constant current, and 100% constant impedance. Any combination can be used, and the units don’t have to be percent (i.e. use a summation to determine the denominator for normalization).
Figure 29: In CIM, the voltage regulator function is separated from the tap-changing transformer. The IEEE 13-bus system has a bank of three independent single-phase regulators at busRG60, and this example shows a RatioTapChanger attached to the regulator on phase A, represented by the TransformerTankEnd having phases=A or phases=AN. See Figure 19 for a more complete picture of TransformerTankEnds, or Figure 16 for a more complete picture of PowerTransformerEnds. Either one can be the TransformerEnd in this figure, but with a PowerTransformerEnd, all three phase taps would change in unison (i.e. they are “ganged”). Most regulator attributes of interest are found in RatioTapChanger or TapChangerControl instances. However, we need the Asset mechanism to specify ctRatio, ptRatio and ctRating values. These are inherent to the equipment, whereas the attributes of RatioTapChanger and TapChangerControl are all settings per instance. For the IEEE 13-bus example, there would be separate RatioTapChanger and TapChangerControl instances for phases B and C.
Figure 30: In CIM, the voltage measurement attaches to TopologicalNode, which we can find from the ConnectivityNode in GridAPPS-D. Positive sequence or phase A measurement is implied, so we must add a phase attribute on SvVoltage for GridAPPS-D. Physically, a voltage sensor is more closely associated with a Terminal or ConnectivityNode.
Figure 31: SvTapStep links to a TransformerEnd indirectly, through the RatioTapChanger. There is no phasing ambiguity because TransformerTankEnd has its phases attribute, while PowerTransformerEnd always includes ABC. Units for SvTapStep.position are per-unit.
Figure 32: The on/off measurement for a capacitor bank attaches directly to LinearShuntCompensator, but there is no phasing support. That needs to be proposed as a CIM extension.
Metering Relationship to Loads in the CIM¶
These UML class relationships in Figure 33 through Figure 35 have not been planned for implementation in RC1, but in a future version of GridAPPS-D, they can be used to link automated meter readings with loads in the distribution system model.
Figure 33: Energy Consumers are associated to Metering Usage Points
Figure 34: Metering Usage Points have one or more EndDevices (i.e. Meters)
Figure 35: EndDevices associate to meter readings, functions and channels.
CIM Enhancements for RC2¶
Possible CIM enhancements to support volt-var feeder modeling:
- Different on and off delay parameters for RegulatingControl (Figure 5)
- Phase modeling for EnergySource (Figure 3)
- Current ratings for PerLengthImpedance (Figure 2). At present, some users rely on associated WireInfo, ignoring all attributes except currentRating.
- Transducers for RegulatingControl (Figure 5)
- Dielectric constant and soil resistivity (Figure 10)
- Current flow and switch open/closed measurements (Figure 11)
- Individual phase measurements for voltage and capacitor state (Figure 11)
- Clock angles for TransformerTankEnd (i.e. move phaseAngleClock from PowerTransformerEnd to TransformerEnd (Figure 6)
- Clarify side1 and side2 for switch phase modeling (Figure 4)
CIM Profile in CIMTool¶
CIMTool was used to develop and test the profile for RC1, because it:
- Generates SQL for the MySQL database definition
- Validates instance files against the profile
The CIMTool developer will not be able to support the tool in future, so eventually we will use the new Schema Composer feature in Enterprise Architect.
In order to view the profile, import the archived Eclipse project OSPRREYS_CIMTOOL.zip into CIMTool. Please see the CIM tutorial slides provided by Margaret Goodrich for user instructions.
Four instance files were validated against the profile in CIMTool. In order to generate them, we use a current version of OpenDSS with the Export CDPSMcombined command on four IEEE test feeders that come with OpenDSS:
- ~/src/opendss/Test/IEEE13_CDPSM.dss is the IEEE 13-bus test feeder with per-length phase impedance matrices and a delta tertiary added to the substation transformer.
- ~/src/opendss/Test/IEEE13_Assets.dss is the IEEE 13-bus test feeder with catalog data for overhead lines, cables and transformers. Capacitor controls have also been added.
- ~/src/opendss/Distrib/IEEETestCases/8500-Node/Master.dss is the IEEE 8500-node test feeder with balanced secondary loads.
- ~/src/opendss/Distrib/IEEETestCases/8500-Node/Master-unbal.dss is the IEEE 8500-node test feeder with unbalanced secondary loads.
Either the 3rd or 4th feeder will be used for the volt-var application. The 1st and 2nd feeders are used to validate more parts of the CIM profile used in RC1. In all four cases, CIMTool reports only two kinds of validation error:
- Isolated connectivity node: CIMTool expects two or more Terminals per ConnectivityNode, but dead ended feeder segments will have only one on the last node. This is not really an error, at least for distribution systems.
- Minimum cardinality: For TapChangerControl instances, the inherited RegulatingControl.RegulatingCondEq association is not specified. This is not really an error, as the association is only needed for shunt capacitor controls. Figure 36 shows that RegulatingCondEq was not selected for TapChangerControl in the profile, so this may reflect a defect in the validation code. Efforts to circumvent it were not successful.
With these caveats, the profile and instances validate against each other, for feeder models that solve in OpenDSS.
Figure 36: Profiling TapChangerControl in CIMTool; the inherited RegulatingCondEq is not included.
Creating Data Definition Language (DDL) for MySQL¶
As shown at the top of Figure 36, CIMTool builds RC1.sql to create tables in a relational database, but the syntax doesn’t match that required for MySQL. The following manual edits were made:
Globally change CHAR VARYING(30) to varchar(50) with a blank space pre-pended before the varchar
Globally change “ to `
In foreign keys to enumerations, change the referenced attribute from mRID to name
In foreign keys to EquipmentContainer or ConnectivityNodeContainer, change the referenced table to Line
In foreign keys to ShuntCompensator, change the referenced table to LinearShuntCompensator
In foreign keys to TapChanger, change the referenced table to RatioTapChanger.
The CIM UML incorporates several polymorphic associations, which can’t be implemented directly in SQL. Base parent class tables were added for:
- AssetInfo, which can be referenced via the Parent attribute from ConcentricNeutralCableInfo, TapeShieldCableInfo, OverheadWireInfo, WireSpacingInfo, TapChangerInfo and TransformerTankInfo
- TransformerEnd, which can be referenced via the Parent attribute from PowerTransformerEnd and TransformerTankEnd
- PerLengthImpedance, which can be referenced via the Parent attribute from PerLengthSequenceImpedance and PerLengthPhaseImpedance
- Switch, which can be referenced via the SwtParent attribute from Breaker, Fuse, Sectionaliser, Recloser, Disconnector, Jumper and LoadBreakSwitch.
- ConductingEquipment, which can be referenced via the Parent attribute from ACLineSegment, EnergySource, EnergyConsumer, LinearShuntCompensator, PowerTransformer, and all of the Switch types.
The catalog data mechanism in Figure 8 required two new tables, one for polymorphic associations and another for many-to-many joins:
- PowerSystemResource, which can be referenced via the PSR attribute from ACLineSegment, ACLineSegmentPhase, RatioTapChanger and TransformerTank.
- AssetInfoJoin, which references AssetInfo and PowerSystemResource. This table actually supplants the Asset class in Figure 8.
The ShortCircuitTest in Figure 9 has a one-to-many association to TransformerEndEnfo, and we need to implement the many side by adding:
- GroundedEndJoin, which references TransformerEndInfo and ShortCircuitTest.
The ToTransformerEnd association in Figure 6 is one-to-many, so CIMTool did not export it to SQL. Rather than create a join table, a ToTransformerEnd attribute was added to TransformerMeshImpedance. This supports only one-to-one association, which is justified because the one-to-many case is very rare, and GridLAB-D cannot model transformers having the one-to-many association. This restriction may be removed in future versions having a semantic or graph database.
Except for the first two items, all of these adjustments arose from the absence of inheritance or polymorphism in SQL. These adjustments will make the updates, queries and views more complicated. However, they allow referential integrity to be enforced, which is one of the most important reasons to use SQL and relational databases. Other types of data store could be a more natural fit to the CIM UML, but they may not have the performance of a relational database.
In GitHub:
- RC1.sql is the manually adjusted SQL export from CIMTool
- LoadRC1.sql will re-create the GridAPPS-D database in MySQL, incorporate RC1.sql, and finally document the foreign keys. It should run without error.
[1] | See http://cimug.ucaiug.org/default.aspx and the EPRI CIM Primer at: http://www.epri.com/abstracts/Pages/ProductAbstract.aspx?ProductId=000000003002006001 |
[2] | Suggest “Corporate Edition” from http://www.sparxsystems.com/ for working with CIM UML. The free CIMTool is still available at http://wiki.cimtool.org/index.h tml, but support is being phased out. |
[3] | OSPRREYS is an older name for GridAPPS-D |
[4] | https://github.com/GRIDAPPSD/Powergrid-Models/CIM |
Platform UML Diagrams¶
UML from the Functional Specification¶
This section presents a selection of GridAPPS-D domain (class) diagrams to supplement the OSPRREYS Functional Specification document. The purpose is to enhance understanding of the functional specification, by providing graphical walkthroughs of some important use cases. The reader should be familiar with definitions in the functional specification, and with Universal Modeling Language (UML) diagrams.
GridAPPS-D is organized as a suite of internal function managers, twelve of them composing the Platform Manager as shown in Figure 1. All GridAPPS-D functions and interactions are mediated by one (or more) of these function managers. When running, the GridAPPS-D 413 Platform Manager will be composed of one (and only one) of each internal manager numbered 401 – 412. These internal managers work together to accomplish various GridAPPS-D functions.
Figure 1: Composition of the GridAPPS-D Platform Manager
Within each class block, some top-level attributes are listed with (-) signs in the middle division, and some top-level methods are listed with (+) signs in the lower division. For example, we already know that 401 Distribution Co-Simulator will need component simulators (i.e. attributes) for buildings (open-source EnergyPlus), communications (open-source ns-3), and the electric power distribution grid (open-source GridLAB-D running in a real-time mode). It will also need at least one method that runs the suite of simulators in a mode emulating continuous real-time operation. Taking another example, 407 Service Manager also contains an attribute for GridLAB-D to provide power flow calculations, but run as a service to applications.
As the design evolves, classes in Figure 1 will acquire many more attributes and methods. The attributes themselves may reference complicated classes and data structures. Therefore, the UML model will expand each class into layer and sub-layer diagrams to more clearly show these evolving details. We can still use the top-level diagrams to make sure that the major components are in place for the important use cases.
Figure 2 illustrates the case of a user executing an application, in the role of EF7 from the functional specification. We initially focused on volt-var optimization (VVO), and then added a more complicated demand response (DR) application that fits the same basic pattern. As a prerequisite, some entity has provided both applications to GridAPPS-D for registration and hosting, in a process detailed later. For now, we assume the application(s) have been installed and will focus first on running VVO.
Figure 2: Executing an application
All user interaction with GridAPPS-D occurs through a command interface, numbered 202 when the user writes commands to GridAPPS-D, and numbered 102 when the user gets data from GridAPPS-D. To run VVO, the user will issue 203 Model Configuration Setup and 204 Simulation Configuration Setup to GridAPPS-D, which then delegates the commands to various internal function managers (see Figure 1). The 203 Setup will probably extract the feeder model of interest, set load and weather data, etc. The 204 Setup will probably tell 401 to run GridLAB-D for a certain time period, but not to run ns-3 or EnergyPlus. The exact composition of 203 and 204 Setups will be determined later in the design process. In a process described later, internal functions 405 (Simulation Control Manager) and 406 (Power System Model Manager) will transform 201, 203 and 204 into 305 and 306, which 401 can then read and run from directly.
When it runs, 401 will generate streams of data that mimic real-time operation of the system, and these streams pass to the other parts of GridAPPS-D as 301 Real-time Simulation Data. Some of the data streams may also output to the user as 101 Real-time Simulation Data. The 310 VVO Application can act on this data to make decisions (e.g. switch capacitor banks, change regulator taps, change solar inverter settings). In this process, 310 VVO could invoke power flow calculations in GridLAB-D via 407 Service Manager, but this is different from the way 401 Co-Simulator runs. The application may use 407 services to explore alternatives or run contingency analysis, which could change the power system model, but the 401 real-time simulations always take priority and always use the “real” model.
When we considered adding the second and more complicated application, 310 DR, the structure of Figure 2 didn’t change very much. The open-headed diamond symbols indicate that GridAPPS-D can host several applications, which is UML aggregation. These applications may interact via the GridAPPS-D command interface, if the applications and their command sets have been designed for it. For example, the DR application may use VVO to check and mitigate voltage limits.
A DR application is more likely than VVO to need EnergyPlus and ns-3 in the co-simulation. In response, we added those attributes to 401, and will add supporting attributes to 201, 203 and 204 as the design evolves. It should also be recognized that more sophisticated VVO applications might incorporate communications (ns-3) if available.
Figure 3 depicts the process of managing power system models, including the schema and repository within 201 Distribution System Model. Because it’s based on standards (e.g. IEC 61968) and open-source tools (e.g. MySQL), the model can be created and maintained from outside GridAPPS-D, directly by EF 21, the Model Manager. This is shown at the top of Figure 3. This process is out of GridAPPS-D scope but within project scope, and it can leverage existing tools like Cimphony, Cimdesk, EA, etc.
For use by and within GridAPPS-D, all model configuration commands will pass from EF21 through the command interface to function 406, the Power System Model Manager. This function reads the base power system model data from 201, and configures it into a three-phase load flow model for solution in 106/306. The Distribution Co-Simulator uses 306, but the user might want 106 for off-line use. Working with 404 Data Manager, the 406 Power System Model Manager may also write additional data (i.e. not used in the load flow calculation) to 104/304. In this case, the 102 Model Output function will collect that data from both 104 and 106 for reporting to the user, EF7, via the command interface. Note that the base data, in 201, is not modified through this process. Instead, the base data is treated as input to GridAPPS-D.
Figure 3: Internal model management
Figure 4 shows the internal Platform Manager flow when running application tests. Compared to the case of normal usage in Figure 2, this example shows additional control and output for testing. The test commands include 203 and 204, as in Figure 2, but they also include:
- 205 Test Scripts, for the sequence of steps to perform
- 206 Test Configuration Setup, including initial conditions, etc.
- 207 Expected Results, for comparison to the actual output
- 210 Application Metadata, for information to run and instrument the application
The 403 Test Manager orchestrates the steps to run the application and collect results. As part of 103 Test Results, it will compare the real-time data (101/301) to the expected results in 207. If the testing user, EF8, requested logging, then the 409 Log Manager will create 109/309 System Logs for collection by 403 Test Manager. Logging is optional, and should have been requested as part of the 206 Test Config Setup or 204 Model Config Setup (this is not spelled out in the functional specification).
Figure 4: Testing an application or the platform
Figure 5 shows some of the internal 413 Platform Manager detail when a user, EF7, runs an application in debugging mode. Compared to Figure 2, there is much more internal output. The 212 Debug Configuration will include such things as breakpoints, watch variables, and logging requests. When run in debug mode, the 408 Debug Manager will collect the internal inputs and intermediate results from a variety of GridAPPS-D modules, including the simulator, services in use, model data, and access violations. The 404 Data Manager mediates most of this data collection (and with a change to the specification it could also mediate 101/301). The 408 Debug Manager combines this into 108 Intermediate Results, with 109 System Logs, for output to the user via the command interface. Depending on the implementation of GridAPPS-D, interactive debugging may also be supported, but is not shown in Figure 5.
Figure 5: Debugging an application
Figure 6 shows the process of registering or updating an application to use with GridAPPS-D. The developer, in the role of EF13, must provide the application itself (211) along with the application data schema (208) and metadata (210). The data schema includes input and output parameters. The metadata includes a user-friendly name, description, calling parameters, command syntax, API functions used, etc. Using this information, 410 Application Hosting Manager will install and register the application, and its data, with 407 Service Manager and 404 Data Manager. After completing these steps, 412 Version Manager will output the current version information via the command interface; the current version includes information about which applications are installed along with the application versions.
In order to perform application management, EF13 also needs to provide user credentials to be checked against the 209 Access Control List. If these credentials are valid, the 411 SAC Manager will create 311 Access Permission Verification for all of the internal Platform Manager components. In Figure 6, the 410 Application Hosting Manager can pass 311 to 404, 407 and 412 as needed. Although not shown earlier, SAC is actually incorporated into all GridAPPS-D processes this way.
Figure 6: Hosting an application
UML for Release Cycle 1¶
Our objective is to demonstrate useful functionality, which is standards-compliant, by the end of March 2017. A simple heuristic VVO application will be running in GridAPPS-D. In terms of the Functional Requirements, we will be implementing:
- 102/202 Command Interface
- 301 Real-time Simulation Data
- 310 Hosted Application, but short-cutting the registration process
- 401 Distribution Co-Simulator (partial)
- 402 Process Manager (partial)
- 404 Data Manager (partial)
- 405 Simulation Manager (partial)
- 406 Power System Model Manager (partial)
- 413 Platform Manager (encapsulating 401 and 403-406)
This represents five out of twelve Internal Functions from the Functional Requirements, in partial form. The deadline leaves four months for detailed design and implementation, plus two months for documentation and testing. Therefore, we have chosen a minimal set of functions that can show end-to-end use of GridAPPS-D at the first milestone.
In developing the work breakdown structure (WBS), we noted that real-time simulation data is published with no time lags or errors in Release 1. However, data flow in a real DMS is affected by sensor and communication system performance, and also by the action of other subsystems. In Release 2, this might be addressed through some combination of:
- Communication and sensor models in the Distribution Co-Simulator
- Adding MDM and SCADA service attributes to the 407 Service Manager
- Filters on 301 Real-time Simulation Data
These decisions, and many others affecting Release 2 and Release 3, can be deferred until we gain experience developing Release 1.
Figure 1 shows the software components planned for Release 1. Most of these correspond to internal functions from the Functional Requirements, with some relatively minor re-factoring. The Power System Model Manager functionality has been split. The data store management and the creation of a complete GridLAB-D model appear at the bottom. Once the simulator is running, incremental changes are posted to the messaging bus.
Most of the “pink” components in Figure 1 are assigned to one task, except:
- The 310 VVO is a sub-task of the Command Interface, due to the close coupling of those efforts. The team on this task needs both power system and software skills.
- A separate task has been added for some project-level items.
Figure 1: Component Diagram for GridAPPS-D Release 1
Initial Work Breakdown for Release Cycle 1¶
The Release 1 work breaks down into seven tasks, listed below. Three critical items must be completed first; these are highlighted in red. There are other inter-task dependencies that have not yet been called out. We plan to sequence the work over eight two-week “sprints” within the four months allocated for detailed design and development, using an agile process (Kanban).
- Project-level Elements
- Identify a power system model (note: IEEE-13 is already in CIM/CDPSM)
- Design data store schema
- Manually ingest power system models
- Command Interface
- Design APIs
- For all configurations in Task 4
- For power system control actions (e.g. open/close switch)
- Select one language binding (e.g. Python, Java, C++, MATLAB) and implement
- Develop a heuristic volt-var application (VVO) in the bound language
- Integrate VVO into GridAPPS-D
- Design APIs
- Messaging and Data Manager
- Select a messaging framework (eg. ZeroMQ)
- Create communication APIs
- Receives real-time data from simulator
- Receives power system control actions
- Handle communication between GridAPPS-D managers
- Log messages to file
- Configuration Manager (both Power System Config & Simulation Config)
- Receive configurations from command interface over message bus
- Translate configurations to native GridLAB-D
- Translate and publish incremental update messages
- Send configurations to Process Manager for simulation start
- Process Manager
- Receives configurations from the Configuration Manager
- Send configuration to the Distribution Co-Simulator
- Start Co-Simulation Process
- Create simulation data channels and inform application
- Stop simulation process
- Distribution Co-Simulator (wraps GridLAB-D)
- Accepts configurations from Process Manager
- Start simulation
- Produce and publish data in real time
- Accept changes in real time (e.g. capacitor switching) via message bus
- Power System Model Manager
- Access the power system model in data store
- Create native GridLAB-D file for initial loading into the simulator
Data Model¶
IEEE 8500-Node Test Feeder¶
An IEEE Working Group specified a set of distribution test circuits [CIT1] and we have chosen the largest one of these as a sample circuit for GridAPPS-D [CIT2]. The 8500-Node test feeder operates at 12.47 kV and has a peak load of about 11 MW, including approximately 1100 single-phase, center-tapped transformers with triplex service drops. Loads are balanced between the two center-tapped windings.
The circuit includes 4 shunt capacitor banks and 4 voltage regulator banks, making it a reasonable test for solving voltage problems and for applying volt-var optimization (VVO). The circuit is also relatively lossy at peak load.
The model in GridAPPS-D came from the IEEE 8500-Node input files distributed with OpenDSS, exported to CIM from OpenDSS, and then imported to the GridAPPS-D data manager. In this automated process, four changes were implemented:
- Use constant-current load models, rather than constant-power load models. This is necessary for the solution to converge at peak load. Voltages at peak load are low, and a constant-power load will draw more current under those conditions. Holding the current magnitude constant allows GridLAB-D to achieve convergence under a variety of operating conditions. This is an appropriate compromise in accuracy for real-time applications, which need to be robust through wide variations in voltage and load. In contrast, planning applications usually need more accurate load models, even at the possible expense of re-running some non-converged simulations.
- Disable automatic regulator and capacitor controls. The volt-var application, described below, will supersede these settings. If a developer or user is testing the GridLAB-D model outside of GridAPPS-D, these control settings should be re-enabled in order to solve the circuit at peak load. That requires manual un-commenting edits to the GridLAB-D input file.
- Substitute a variable called VSOURCE for the SWING bus nominal voltage. This needs to be set at 1.05 per-unit of nominal on the 115-kV system (i.e. 69715.065) in order to solve at peak load. Other conditions may require different source voltage values.
- Use a schedule for the loads so they can vary with time during GridAPPS-D simulation. The file should be named zipload_schedule.player.
Integrated Applications¶
Volt-var Optimization (VVO)¶
The sample VVO application is a Python implementation of a heuristic method that PNNL has investigated before [CIT3], [CIT4], [CIT5]. There are more advanced VVO methods that could be implemented in future applications.
Visualization¶
We have created a web-based visualization of the sample VVO application. The visualization displays the topology of the IEEE 8500-Node system as an interactive graph. Capacitors and regulators are highlighted in the graph and displayed alongside tables with current values for capacitor status (OPEN or CLOSED), regulator voltage, and feeder power.
PNNL Applications (Release Cycle 2)¶
State Estimator¶
Objectives¶
State estimation is widely used in transmission system operations but is less common in distribution system operations due to a relatively limited value in traditional distribution systems, additional computational complexity, and a lack of sensors. Advanced distribution management platforms like GridAPPS-D provide access to model and sensor data that can be leveraged to overcome barriers to adoption and open the door to distribution system state estimators that are fast and accurate enough to be useful in utility operations.
A distribution system state estimator computes the most likely state given a set of present and/or past measurements. The full state of a distribution system consists of either the full set of complex bus voltages or the full set of complex branch currents; given the system model (admittance matrix), the remaining system parameters can be computed given the full system state.
Use Cases¶
- Assist power factor optimization: Utility objective is unity power-factor at the substation.
- Assist voltage optimization (planning): Utility objective is 1 p.u. voltage at last house primary.
- Real-time state estimation for advanced applications: applications can access the state estimate at a sufficient resolution to capture e.g. insolation variation caused by clouds.
Distribution System State Estimation Algorithms¶
State estimation uses system model information to produce an estimate of the state vector x given a measurement vector z. The measurement vector is related to the state vector and an error vector by the measurement function, which may be non-linear.
Multiple formulations of the distribution system state estimation problem are possible:
- Node Voltage State Estimation (NVSE): The state vector consists of node voltage magnitudes and angles for each node in the system (one reference angle can be eliminated from the state vector). This formulation of the state estimation problem is general to any topology and it is the standard for transmission system state estimation.
- Branch Current State Estimation (BCSE): Radial topology and assumptions about shunt losses create a linear formulation of the state estimation problem. The state vector contains branch currents and, for a fully-constrained problem, requires one state per load, which can be less than the number of branches in the system.
Different algorithms provide different advantages for distribution system state estimation. A subset of the state estimation algorithms below will be used to achieve these goals.
- Weighted Least Squares Estimation (WLSE): a concurrent set of measurements are used to find a state vector that minimizes the weighted least squares objective function. The algorithm is memoryless with respect to previous solutions and measurements should be synchronized.
- Kalman Filter Estimation (KFE) and Extended Kalman Filter Estimation (EKFE): The Kalman filter provides a mechanism to consider past state estimates alongside present measurements. This provides additional noise rejection and allows asynchronous measurements can be considered individually. KFE is appropriate for linear BCSE and EKFE is compatible with nonlinear NVSE.
- Unscented Kalman Filter Estimation (UKFE): The unscented transform estimates the expected value and variance of the system state by observing the system outputs for inputs spanning the full dimensionality of the measurement space. Again, the Kalman filter provides a mechanism to consider past estimates.
TRL¶
The state estimator application will provide the capability to estimate the full system state using asynchronous measurement data. In addition a model order reduction technique will be implemented to greatly speed up the state estimation computation and to reduce the dependence on forecast-based pseudo-measurements. A paper (Reduced-Order State Estimation for Power Distribution Systems with Sparse Sensing) is targeted for IEEE Transactions on Power Systems.
Design¶
The state estimation service is being developed in c++. A modern c++ implementation allows the application to adapt to an evolving interface. The program architecture is shown below.
Topology Processor: initializes the measurement function and its Jacobian and determines the size of the measurement vector, the measurement covariance matrix, and the state vector.
Meter Interface: updates the measurement vector and the measurement covariance matrix as new measurement data comes available.
State Estimator: performs the state estimation operation according to the specified algorithm.
Output Interface: formats the state vector and any implicit states as an output stream.
Inputs:¶
Upon initialization, the topology processor will receive the Y-bus from the GridLAB-D service and will query contextual information and sensor locations from the CIM database.
Periodic measurement data, including any forecasts to be used a pseudo-measurements will be required as inputs.
A “terminate” command from the platform will end the state estimation process.
Outputs:¶
The output will include the full system state (node voltages and/or branch currents TBD).
Testing and Validation¶
Evaluation metrics¶
- State Error: compare state estimation output to “true” system state.
- Accuracy over baseline: compare state error of state estimator to state error of a QSTS load-flow model.
- Execution Time
- Bad Sensor Detection (binary)
Scenarios¶
- Full sensor deployment: verify that the true system state can be reproduced.
- Sparse sensor deployment: verify that the state estimator performs better than a QSTS load-flow model.
- Breaker trip: verify that switch state can be detected even when it is reported incorrectly.
- Bad sensor detection: verify that a sensor that is producing bad data can be identified.
- Dependent application support: verify that the state estimator can support e.g. the VVO application.
- Fault: for a radial system, determine the nearest common bus from multiple emulated customer calls.
Operating/Running¶
The state estimator will execute the topology processor at initialization and will enter a stat estimation loop. The state estimation loop will exit and the process will end upon receiving a ‘terminate’ command from the platform.
At initialization, a configuration file will be read for:
- State estimation mode (state vector and algorithm) selection
- Normalized residual threshold for bad measurement / sensor detection
References¶
[1] Abur and A. G. Exposito, Power System State Estimation, New York, NY: Marcel Dekker, Inc., 2004.
[2] M. E. Baran and A. W. Kelley, “A branch-current-based state estimation method for distribution systems,” in IEEE Transactions on Power Systems, vol. 10, no. 1, pp. 483-491, Feb 1995.
[3] Z. Jia, J. Chen and Y. Liao, “State estimation in distribution system considering effects of AMI data,” 2013 Proceedings of IEEE Southeastcon, Jacksonville, FL, 2013, pp. 1-6.
[4] S. C. Huang, C. N. Lu and Y. L. Lo, “Evaluation of AMI and SCADA Data Synergy for Distribution Feeder Modeling,” in IEEE Transactions on Smart Grid, vol. 6, no. 4, pp. 1639-1647, July 2015.
[5] M. Kettner; M. Paolone, “Sequential Discrete Kalman Filter for Real-Time State Estimation in Power Distribution Systems: Theory and Implementation,” in IEEE Transactions on Instrumentation and Measurement, vol.PP, no.99, pp. 1-13, Jun. 2017.
[6] G. Valverde and V. Terzija, “Unscented kalman filter for power system dynamic state estimation,” in IET Generation, Transmission & Distribution, vol. 5, no. 1, pp. 29-37, Jan.
Model Validator¶
Objectives¶
The model validator will detect and attempt to correct unreasonable component interconnections and network parameters.
Use Cases¶
- Valid transformer size and orientation (Utility): orientation is not captured explicitly in their GIS system.
- Discover secondary line impedance parameters (Utility) conductor type and line length are currently based on generic assumptions.
- Sanity check or estimate transformer size and impedance.
- Verify that the nominal voltage of nodes matches the base voltage of the segment: generally the winding voltage of the upstream transformer or swing bus voltage.
- Sanity check conductor sizes and line current ratings.
- Validate and fill in regulator and capacitor control settings.
- Check phase continuity (GridLAB-D may not model phase discontinuities)
Design¶
The model validation application will be implemented in Python.
Inputs:¶
The model validator will have access to the CIM database and archived data from the state estimator.
Outputs:¶
The model validator will one or both of the following outputs:
- Model status: log file or GUI pipe for identified issues.
- Model correction: CIM updates to correct identified issues.
Testing and Validation¶
Evaluation metrics¶
- Ability to detect known issues.
Scenarios¶
- Utility merger: models with different format may be interpreted differently, creating issues a CIM model.
- Data entry issue: model update does not match upgrade performed in the field
Operating/Running¶
The model validator script will execute once when called by the platform.
At initialization, a configuration file will be read for:
- Mode (status, quiet, verbose; see outputs section)
- Selectable validation items (use cases)
Given a perfect and complete set of voltage magnitude and angle measurements, along with a detailed and accurate power system model, one could calculate the real power, or any other electrical variable of interest, anywhere in the system. In practice, measurements have errors, time delays, and may even be missing. State estimation refers to the process of minimizing the errors and filling in gaps [1]. One state estimation method is called “weighted least squares”, and it’s analogous to drawing the best-fit line through a set of scattered points. Other methods may perform better [2]. Also, on distribution systems, it may be better to estimate branch currents instead of node voltages, but the principle is the same. In GridAPPS-D, the visualizations and applications ought to use the best available state estimator outputs, instead of raw SCADA values, for both accuracy and consistency. Therefore, the state estimator is not an application but a service in GridAPPS-D, sitting between emulated SCADA and the GOSS bus.
Figure 1: The state estimator processes noisy and incomplete measurements, then posting estimated voltage (V), current (I), real power (P), reactive power (Q) and switch status (S) values onto the GridAPPS-D message / data bus.
In Figure 1, the power system model (upper left) will include a limited number of sensors, corresponding to actual voltage and current transformers, line post sensors, wireless sensors, etc. In some scenarios, smart meters can also be sensors. Each such sensor will have different performance characteristics (e.g. precision, accuracy, sampling rate). Distribution systems typically do not have enough sensors to make the system observable, so there will be measurement gaps in the topology. The state estimator might fill these gaps with interpolation and graph-tracing methods on the power system model.
The supervisory control and data acquisition (SCADA) system in Figure 1 introduces more errors and failure points. Eventually, GridAPPS-D may simulate these impacts by federating ns-3 as a co-simulator. Until then, a placeholder module could be used to insert variable errors, time delays and dropouts in each measurement, whether due to sensor characteristics or the communication system. The output represents data as it would come into an operations center, and feeds the state estimator. Internally, the data flows between simulator, SCADA and state estimator might be implemented with FNCS, but this is an implementation detail. The state estimator will provide two outputs to the GOSS bus used by all GridAPPS-D applications:
- At a time step configured by the platform, publish the best-estimate VIPQS values wherever sensors actually exist in the model, with quality attributes that still have to be established. Sensor locations delineate circuit segments, and note that all VIPQS values will be estimated at the boundaries, even if the sensor measures only V or I, for example.
- Upon request by another application or service, publish the estimated VIPQS values for all nodes and components in the model, even at locations where no sensors exist. A variant is to publish the estimates only for selected nodes and components.
As indicated in Figure 1, other applications need to obtain estimated VIPQS values from the GOSS bus. Switch open/close states are a special case; they might be considered known values, but in practice the switch state is a measurement, which could lead to topology errors in the model. For GridAPPS-D, switch state estimates need to be a point of emphasis. Given that most distribution systems lack redundant measurements, It would be possible for an application to query these VIPQS values directly from the simulator or SCADA, bypassing the state estimator, but this is “cheating” in most situations. However, in the application development process, idealized VIPQS values could be obtained through a combination of two methods:
- Add more sensors to the power system model
- Set the sensor and channel errors to zero
Because the sensor outputs in GridAPPS-D come from a power flow solution that enforces Kirchhoff’s Laws, the state estimator will produce ideally accurate values whenever the sensor and channel errors have been specified to be zero. The state estimator may still exhibit interpolation errors between sensor locations, but that is readily mitigated for testing purposes by adding more sensors.
With reference to RC1, the visualization and VVO applications should now subscribe to VIPQS values from the state estimator, not from the distribution simulator. They may also use or display quality metrics on the estimated values.
The state estimator basically attempts to fit measured data to a power flow model, usually assuming that the model is correct. However, a model attribute (e.g. line impedance) could also be estimated by minimizing its error residual in the state estimator’s power flow solution. This process works best when applied to just one or a few suspect attributes, and/or when an archive is available to provide enough redundant measurements. The Model Validation Application will use these state estimator features off-line to help identify and correct the following types of model errors:
- Unknown or incorrect service transformer sizes
- Unknown or incorrect secondary circuit lengths
- Incorrect phase identification of single-phase components
- Phase wiring errors in line segments and switches
- Transformer connection errors, especially reversed primary and secondary
- Primary conductor sizes that don’t decrease monotonically with distance from the source
- Missing regulator and capacitor control settings (i.e. supply defaults from heuristic rules)
- More than one of these on the same pole: recloser, line regulator, capacitor
- Substation transformer impedance and turns ratio
These types of errors often appear upon the initial model import from a geographic information system (GIS), or in periodic model updates from GIS. Other error types may be added later. Many utilities do not have their secondary circuits modeled at all, but this has an important impact on AMI data. The service transformers and secondary circuits insert significant impedance between AMI meters and the primary circuit, where most of the other sensors are installed. Therefore, the first two items will require AMI data, and also enable its more effective use.
As shown in Figure 2, the Model Validator integrates with GridAPPS-D as a hosted application on the GOSS bus. Internally, it will use some of the same algorithms as the State Estimator and may share some code or binary files, but this is an implementation detail. It will need to access an archive of state-estimated VIPQS data, which may include AMI data. It will also use or incorporate an off-line power flow model, not the same one running in the GridAPPS-D distribution simulator. This may be EPRI’s OpenDSS simulator [3]; compared to GridLAB-D, it’s more tolerant of model errors and provides more diagnostic information about model errors.
Figure 2: The Model Validator works with an archive from the state estimator, and an off-line power flow model.
Transactive energy is a method of controlling loads and resources on the distribution system, combining both market and electrical principles [4]. One reason for including this application in DOE-funded GridAPPS-D is that PNNL has made several technical contributions and led several demonstration projects in transactive systems, also funded by DOE [5].
Application structure
This transactive systems application is to be implemented as a modularized 2-layer 3-level structure, as seen from Figure 3. The layer decomposition helps the control of various groups, with limited information flow between different layers. With the predefined functions in each agent type (Agent A, B, and C) in each level, the existing transactive system related work can be conveniently integrated into the application, and the new control features can be added into specific control function in each type of the agent easily.
Figure 3: The structure of the modularized 2-layer 3-level transactive system application
The modularized agents opens the door for integrating different control mechanisms into the application. Users need to consider which level their control algorithm fits into, and fill in the control function of the Agent class in that level, without worrying about communications between the agents. In each level, the same type of the agent may have various control functions, which help combining benefits of different control schemes together.
Agent A, B and C will be implemented as VOLTTRON applications. VOLTTRON is an application platform for distributed sensing and control applications [6]. With the capability of hardware-in-the-loop (HIL) testing through VOLTTRON, the transactive systems application will be tested using the actual devices. A GOSS-VOLTTRON Bridge is to be implemented, for the communication between GridAPPS-D and the VOLTTRON agents in the transactive systems application.
Application test cases
The hierarchical control framework introduced in [7] for integrated coordination between distributed energy resources and demand response will be implemented into the application. In addition, [7] has not considered the power losses or power constrains, which will be taken into consideration in this test case. The two-layer control mechanism, including the coordination layer and device layer, fits the proposed structure of the application well. The control in each level will be implemented into corresponding function in each type of the agent. The IEEE 123-node test feeder built in GridLAB-D will be used for testing the application.
CIM extension for the Application
The latest versions of GridAPPS-D has used a reduced-order CIM to support feeder modeling. With transactive system application included into GridAPPS-D platform, more objects, such as house air conditioner and water heater, need to be defined in CIM. Before the definition in CIM, a simplified version of the house object and water heater object are to be implemented in GridLAB-D.
[1] |
|
[2] |
|
[3] |
|
[4] | Gridwise Architecture Council. (2017). Transactive Energy. Available: http://www.gridwiseac.org/about/transactive_energy.aspx |
[5] | Pacific Northwest National Laboratory. (2017). Transactive Energy Simulation Platform (TESP). Available: http://tesp.readthedocs.io/en/latest/ |
[6] |
|
[7] | Di Wu, Jianming Lian, Yannan Sun, Tao Yang, Jacob Hansen, “Hierarchical control framework for integrated coordination between distributed energy resources and demand response,” Electric Power Systems Research, pp. 45-54, May 2017. |
NREL Applications (Release Cycle 2)¶
Distribution Optimal Power Flow for Real-Time Setpoint Dispatch¶
Objectives¶
This application is designed to address the problem of optimizing the operation of aggregations of heterogeneous energy resources connected to a distribution system. We will focus on real-time optimization method and the power setting points of the distributed energy resources (DERs) will be updated on a second or subsecond timescale to maximize the operational objectives while coping with the variability of ambient conditions and noncontrollable energy assets [1]. In order to avoid massive measurements and overcome the limitation caused by model inaccuracy, this application will be implemented in a distributed manner, and only local measurements and a feedback signal from the substation aggregator are needed to determine the optimal setpoints for each controlled DER unit.
Figure 1 The conceptual framework of distribution OPF for real-time setpoint dispatch.
Figure 1 shows the conceptual framework of this application, and this application is targeting at TRL 3.
Design¶
Figure 2 describes the overall work flow of the application. Distribution OPF algorithm requires real-time measurements, distribution system model and power flow results, which will be obtained from GridAPPS-D platform through GOSS/FNCS message bus. The optimization problem formulation can be constructed using user-defined cost functions for different controllable devices. Finally the optimal setpoints for controllable devices will be solved based on the feedback information from system measurements. These setpoints will be sent back to GridLab-D grid model to update DER operations. Such a closed-loop control forms the control iteration for the studied time point, and new setpoints for the following time points will be determined in the same manner using the updated model and measurements.
Figure 2 The workflow of real-time setpoint dispatch application and its interaction with GridApps-D.
Data requirements
Message schemas (UML) (Enterprise Architect software) Jeff will help draw the UML diagram.
Testing and Validation¶
Evaluation metrics of this application:
- Real/reactive power at the substation
- System loss
- Voltages across the entire distribution grid: voltage magnitude, voltage fluctuation, voltage unbalance.
- Legacy control device operations: total control actions of all capacitors and regulators
Scenarios:
- Optimal Dispatch for Distributed PV Systems
- Optimal Dispatch for Distributed PV + Energy Storage
- Etc. (will be added when implementing the application)
Operating/Running¶
This application will be developed using Python.
References¶
[1] E. Dall’Anese, A. Bernstein, and A. Simonetto, “Feedback-based Projected-gradient Method for Real-time Optimization of Aggregations of Energy Resources,” IEEE Global Conference on Signal and Information Processing (GlobalSIP), Montreal, Canada, Nov. 2017.
API Documentation¶
GridAPPS-D¶
GOSS¶
The GridOPTICS Software System (GOSS) manages the platform data and message bus; its overall design is described in [CIT6].
FNCS¶
The Framework for Network Co-simulation (FNCS) manages the time clock and message traffic between platform simulators; its overall design is described in [CIT7]. For API documentation see https://github.com/FNCS/fncs/wiki .
VVO¶
GridLAB-D¶
GridLAB-D is the distribution grid simulator within the platform; its overall design is described in [CIT8].
gov.pnnl.gridlabd.cim¶
This Java package converts CIM RDF to GridLAB-D format.
CDPSM_to_GLM¶
-
public class
CDPSM_to_GLM
¶ This class converts CIM (IEC 61968) RDF to GridLAB-D format
The general pattern is to retrieve iterators on the different types of objects (e.g. ACLineSegment) through simple SPARQL queries. Usually these iterators include just the mrID, or the mrID and name. Then Jena RDF model and resource functions are used to pull other properties from iterated objects, writing GridLAB-D input along the way. A future version will rely more heavily on SPARQL queries to do the selection and filtering, as the preferred pattern for developers working with CIM. In existing code, the EnergySource most closely follows this new preferred pattern.
Invoke as a console-mode program
Author: Tom McDermott See also:
CDPSM_to_GLM.main
, CIM User Group, CIM Profile and Queries for Feeder Modeling in GridLAB-D, GridLAB-D
Fields¶
mapSpacings¶
-
static HashMap<String, SpacingCount>
mapSpacings
¶ to look up line spacings by name
nsCIM¶
Methods¶
AccumulateLoads¶
-
static boolean
AccumulateLoads
(GldNode nd, String phs, double pL, double qL, double Pv, double Qv, double Pz, double Pi, double Pp, double Qz, double Qi, double Qp)¶ Distributes a total load (pL+jqL) among the phases (phs) present on GridLAB-D node (nd)
Parameters: - nd – GridLAB-D node to receive the total load
- phs – phases actually present at the node
- pL – total real power
- qL – total reactive power
- Pv – real power voltage exponent from a CIM LoadResponseCharacteristic
- Qv – reactive power voltage exponent from a CIM LoadResponseCharacteristic
- Pz – real power constant-impedance percentage from a CIM LoadResponseCharacteristic
- Qz – reactive power constant-impedance percentage from a CIM LoadResponseCharacteristic
- Pi – real power constant-current percentage from a CIM LoadResponseCharacteristic
- Qi – reactive power constant-current percentage from a CIM LoadResponseCharacteristic
- Pp – real power constant-power percentage from a CIM LoadResponseCharacteristic
- Qp – reactive power constant-power percentage from a CIM LoadResponseCharacteristic
Returns: always true
Bus_ShuntPhases¶
CFormat¶
Count_Phases¶
FindBaseVoltage¶
-
static double
FindBaseVoltage
(Resource res, Property ptEquip, Property ptEqBaseV, Property ptLevBaseV, Property ptBaseNomV)¶ Returns the nominal voltage for conduction equipment, from either its own or container’s base voltage. For example, capacitors and transformer ends have their own base voltage, but line segments don’t.
Parameters: - res – an RDF resource corresponding to a ConductingEquipment instance; we need to find its base voltage
- ptEquip – an RDF property corresponding to the EquipmentContainer association
- ptEqBaseV – an RDF property corresponding to a possible BaseVoltage association on the equipment itself
- ptLevBaseV – an RDF property corresponding to the EquipmentContainer’s BaseVoltage association
- ptBaseNomV – an RDF property corresponding to the nominalVoltage attribute of a CIM BaseVoltage
Returns: the nominal voltage as found from the equipment or its container, or 1.0 if not found
FindConductorAmps¶
-
static String
FindConductorAmps
(Model mdl, Resource res, Property ptDataSheet, Property ptAmps)¶ needs to return the current rating for a line segment ‘res’ that has associated WireInfo at ‘ptDataSheet’, which in turn has the current rating at ptAmps
TODO - this is not implemented; emitted syntax is for OpenDSS and the function call (below, in main) needs review
Parameters: - mdl – an RDF model (set of statements) read from the CIM imput file
- res – an RDF resource corresponding to a CIM ACLineSegment
- ptDataSheet – an RDF property corresponding to CIM AssetDatasheet attribute
- ptAmps – an RDF property corresponding to CIM ratedCurrent attribute
Returns: unusable OpenDSS input
FirstPhase¶
GLDCapMode¶
GLD_ID¶
GLD_Name¶
GetACLineParameters¶
-
static String
GetACLineParameters
(Model mdl, String name, Resource r, double len, double freq, String phs, PrintWriter out)¶ for a standalone ACLineSegment with sequence parameters, find GridLAB-D formatted and normalized phase impedance matrix
TODO - this is always three-phase, so we don’t need all 7 variations from GetSequenceLineConfigurations
Parameters: - mdl – an RDF model (set of statements) read from the CIM imput file
- name – the root name of the line segment and its line_configuration
- r – an RDF resource corresponding to a CIM ACLineSegment
- len – the length of the ACLineSegment in feet
- freq – frequency in Hz for converting susceptance to capacitance
- phs – phasing for the written line_configuration (one of 7 variations) that needs to be referenced
- out – the PrintWriter instance opened from the main program, passed here so that we can share code in GetSequenceLineConfigurations
Returns: the name of the written line_configuration
GetBusName¶
-
static String
GetBusName
(Model mdl, String eq_id, int seq)¶ finds the bus (ConnectivityNode) name for conducting equipment
Parameters: - mdl – an RDF model (set of statements) read from the CIM imput file*
- eq_id – the CIM mrID of the conducting equipment
- seq – equals 1 to use the first terminal found, or 2 to use the second terminal found
Returns: the GridLAB-D compatible bus name, or x if not found. As Terminals no longer have sequence numbers, the ordering of seq is unpredictable, so if there are two we can get bus 1 - bus 2 or bus 2 - bus 1
GetBusPositionString¶
-
static String
GetBusPositionString
(Model mdl, String id)¶ for a bus (ConnectivityNode), search for X,Y geo coordinates based on connected Terminals and equipment
Parameters: - mdl – an RDF model (set of statements) read from the CIM imput file
- id – name of the bus to search from
Returns: X,Y coordinates in comma-separated value (CSV) format
GetCableData¶
-
static String
GetCableData
(Model mdl, Resource res)¶ needs to return underground_line_conductor data in GridLAB-D format
TODO - this is not implemented; the emitted syntax is actually for OpenDSS
Parameters: - mdl – an RDF model (set of statements) read from the CIM imput file
- res – an RDF resource corresponding to a CIM CableInfo (not a leaf/concrete class)
Returns: unusable OpenDSS input
GetCapControlData¶
-
static String
GetCapControlData
(Model mdl, Resource rCap, Resource ctl)¶ Parameters: - mdl – an RDF model (set of statements) read from the CIM imput file
- rCap – an RDF resource corresponding to a CIM LinearShuntCompensator (aka capacitor)
- ctl – an RDF resource corresponding to the CIM RegulatingControl that was found attached to the LinearShuntCompensator
Returns: the embedded capacitor control data for a GridLAB-D capacitor object
GetEquipmentType¶
-
static String
GetEquipmentType
(Resource r)¶ find the type of monitored equipment for controlled capacitors, usually a line or the capacitor itself
Parameters: - r – an RDF resource, will have a CIM mrID, should be a LinearShuntCompensator, ACLineSegment, EnergyConsumer or PowerTransformer
Returns: cap, line, xf if supported in GridLAB-D; NULL or ##UNKNOWN## if unsupported
GetGldTransformerConnection¶
-
static String
GetGldTransformerConnection
(String[] wye, int nwdg)¶ Map CIM connectionKind to GridLAB-D winding connections. TODO: some of the returnable types aren’t actually supported in GridLAB-D
Parameters: - wye – array of CIM connectionKind attributes per winding
- nwdg – number of transformer windings, also the size of wye
Returns: the GridLAB-D winding connection. This may be something not supported in GridLAB-D, which should be treated as a feature request
GetImpedanceMatrix¶
-
static String
GetImpedanceMatrix
(Model mdl, String name, Property ptCount, Resource r, boolean bWantSec)¶ Convert CIM PerLengthPhaseImpedance to GridLAB-D line_configuration
Parameters: - mdl – an RDF model (set of statements) read from the CIM imput file
- name – root name of the line_configuration(s), should be the CIM name
- r – an RDF resource, will have a CIM mrID, should be PerLengthPhaseImpedance
- ptCount – an RDF property for the PerLengthPhaseImpedance.conductorCount
- bWantSec – flags the inclusion of triplex, true except for debugging
Returns: the GridLAB-D formatted impedance matrix for a line configuration. We have to write 3 of these in the case of 1-phase or 2-phase matrices. If (by name) it appears to be triplex and bWantSec is false, nothing will be returned.
GetLineSpacing¶
-
static String
GetLineSpacing
(Model mdl, Resource rLine)¶ needs to return the line_spacing and wire/cncable/tscable assignments for this rLine in GridLAB-D format
TODO - this is not implemented, the emitted syntax is actually for OpenDSS
Parameters: - mdl – an RDF model (set of statements) read from the CIM imput file
- rLine – an RDF resource corresponding to a CIM ACLineSegment that should have an associated AssetInfo
Returns: unusable OpenDSS input
GetMatIdx¶
-
static int
GetMatIdx
(int n, int row, int col)¶ converts the [row,col] of nxn matrix into the sequence number for CIM PerLengthPhaseImpedanceData (only valid for the lower triangle) *
Parameters: - n – 2x2 matrix order
- row – first index of the element
- col – second index
Returns: sequence number
GetPowerTransformerData¶
-
static String
GetPowerTransformerData
(Model mdl, Resource rXf)¶ Parameters: - mdl – an RDF model (set of statements) read from the CIM imput file
- rXf – an RDF resource corresponding to CIM PowerTransformer; it should have mesh impedance data
Returns: transformer and transformer_configuration objects in GridLAB-D format
GetPowerTransformerTanks¶
-
static String
GetPowerTransformerTanks
(Model mdl, Resource rXf, ResIterator itTank, boolean bWantSec)¶ writes a PowerTransformer in GridLAB-D format, in the case where individual tranformer tanks that are connected together in a bank. GridLAB-D supports only 2-winding banks with same phasing on both sides, or single-phase, center-tapped secondary transformers.
Parameters: - mdl – an RDF model (set of statements) read from the CIM imput file
- rXf – an RDF resource corresponding to a CIM PowerTransformer that uses tank modeling
- itTank – a Jena iterator on the tanks associated with rXf, known to be non-empty before this function is called
- bWantSec – usually true, in order to include single-phase, center-tapped secondary transformers, which would come to this function
Returns: transformer object in GridLAB-D format; the transformer_configuration comes from calling GetXfmrCode
GetPropValue¶
-
static String
GetPropValue
(Model mdl, String uri, String prop)¶ unprotected lookup of uri.prop value, to be deprecated in favor of SafeProperty
Parameters: - mdl – an RDF model (set of statements) read from the CIM imput file
- uri – an RDF resource, currently only an EquipmentContainer is used, and it should always exist
- prop – currently only IdentifiedObject.name is used, and it should always exist
Returns: the name of the CIM object
GetRegulatorData¶
-
static String
GetRegulatorData
(Model mdl, Resource rXf, String name, String xfGroup, String bus1, String bus2, String phs)¶ Connects a regulator in GridLAB-D format between bus1 and bus2; should be called from GetPowerTransformerTanks. In CIM, a regulator consists of a transformer plus the ratio tap changer, so if such is found, should call GetRegulatorData instead of just writing the transformer data in GetPowerTransformerTanks. Any impedance in the regulating transformer will be lost in the GridLAB-D model. Should be called from PowerTransformers that have RatioTapChangers attached, so we know that lookup will succeed
TODO: implement regulators for tank transformers
Parameters: - mdl – an RDF model (set of statements) read from the CIM imput file
- rXf – an RDF resource corresponding to a CIM PowerTransformer that has a RatioTapChanger associated
- name – the name of the PowerTransformer (already looked up before calling this function)
- xfGroup – the PowerTransformer’s IEC vector group (already looked up before calling this function)
- bus1 – first bus (ConnectivityNode) on the regulator (already looked up before calling this function)
- bus2 – second bus (ConnectivityNode) on the regulator (already looked up before calling this function)
- phs – phases that contain A, B and/or C (already looked up before calling this function)
Returns: regulator and regulator_configuration objects in GridLAB-D format
GetSequenceLineConfigurations¶
-
static String
GetSequenceLineConfigurations
(String name, double sqR1, double sqX1, double sqC1, double sqR0, double sqX0, double sqC0)¶ For balanced sequence impedance, return a symmetric phase impedance matrix for GridLAB-D. We have to write 7 variations to support all combinations of 3, 2 or 1 phases used.
Parameters: - name – is the root name for these 7 variations
- sqR1 – positive sequence resistance in ohms/mile
- sqX1 – positive sequence reactance in ohms/mile
- sqC1 – positive sequence capacitance in nF/mile
- sqR0 – zero sequence resistance in ohms/mile
- sqX0 – zero sequence reactance in ohms/mile
- sqC0 – zero sequence capacitance in nF/mile
Returns: text for 7 line_configuration objects
GetWdgConnection¶
-
static String
GetWdgConnection
(Resource r, Property p, String def)¶ parse the CIM WindingConnection enumeration
Parameters: - r – an RDF resource, will have a CIM mrID, should be a transformerEnd
- p – an RDF property, will be a CIM attribute, should be connectionKind
- def – default value if property is not found, such as Y
Returns: D, Y, Z, Yn, Zn, A or I
GetWireData¶
-
static String
GetWireData
(Model mdl, Resource res)¶ needs to return overhead_line_conductor data in GridLAB-D format; res is the CIM OverheadWireInfo instance
TODO - this is not implemented; the emitted syntax is actually for OpenDSS
Parameters: - mdl – an RDF model (set of statements) read from the CIM imput file
- res – an RDF resource corresponding to CIM OverheadWireInfo
Returns: unusable OpenDSS input
GetXfmrCode¶
-
static String
GetXfmrCode
(Model mdl, String id, double smult, double vmult, boolean bWantSec)¶ Translates a single TransformerTankInfo into GridLAB-D format. These transformers are described with short-circuit and open-circuit tests, which sometimes use non-SI units like percent and kW, as they appear on transformer test reports.
TODO: smult and vmult may be removed, as they should always be 1 for valid CIM XML
Parameters: - mdl – an RDF model (set of statements) read from the CIM imput file
- id – CIM mRID corresponding to a CIM TransformerTankInfo
- smult – scaling factor for converting winding ratings to volt-amperes (should be 1)
- vmult – scaling factor for converting winding ratings to volts (should be 1)
- bWantSec – usually true to include single-phase, center-tapped secondary tranformers, which come to this function
Returns: transformer_configuration object in GridLAB-D format
GldPrefixedNodeName¶
MergePhases¶
Phase_Kind_String¶
Phase_String¶
SafeBoolean¶
-
static boolean
SafeBoolean
(Resource r, Property p, boolean def)¶ look up Jena boolean value
Parameters: - r – an RDF resource, will have a CIM mrID
- p – an RDF property, will be a CIM attribute
- def – default value if property is not found
Returns: boolean value, or default if not found
SafeDouble¶
-
static double
SafeDouble
(Resource r, Property p, double def)¶ look up Jena double value
Parameters: - r – an RDF resource, will have a CIM mrID
- p – an RDF property, will be a CIM attribute
- def – default value if property is not found
Returns: double value, or default if not found
SafeInt¶
-
static int
SafeInt
(Resource r, Property p, int def)¶ look up Jena integer value
Parameters: - r – an RDF resource, will have a CIM mrID
- p – an RDF property, will be a CIM attribute
- def – default value if property is not found
Returns: integer value, or default if not found
SafePhasesX¶
SafeProperty¶
SafeRegulatingMode¶
-
static String
SafeRegulatingMode
(Resource r, Property p, String def)¶ parse the CIM regulating control mode enum
Parameters: - r – an RDF resource, will have a CIM mrID
- p – an RDF property, will be a CIM attribute
- def – default value if property is not found
Returns: voltage, timeScheduled, reactivePower, temperature, powerFactor, currentFlow, userDefined
SafeResName¶
-
static String
SafeResName
(Resource r, Property p)¶ for components (not buses) returns the CIM name from r.p attribute if it exists, or the r.mrID if not, in GridLAB-D format
Parameters: - r – an RDF resource, will have a CIM mrID
- p – an RDF property, will be a CIM attribute
Returns: a name compatible with GridLAB-D
SafeResourceLookup¶
-
static String
SafeResourceLookup
(Model mdl, Property ptName, Resource r, Property p, String def)¶ Parameters: - mdl – an RDF model (set of statements) read from the CIM imput file
- ptName – should be the IdentifiedObject.Name property of the resource we are looking for
- r – an RDF resource, will have a CIM mrID
- p – an RDF property, will be a CIM attribute
- def – default value if property is not found
Returns: the GridLAB-D formatted name of a resource referenced by r.p
Shunt_Delta¶
-
static boolean
Shunt_Delta
(Resource r, Property p)¶ for loads and capacitors, returns true only if CIM PhaseShuntConnectionKind indicates delta
Parameters: - r – an RDF resource, will have a CIM mrID, should be LinearShuntCompensator or EnergyConsumer
- p – an RDF property, will be a CIM attribute for phaseConnection
Returns: true if delta connection
WirePhases¶
-
static String
WirePhases
(Model mdl, Resource r, Property p1, Property p2)¶ Returns GridLAB-D formatted phase string by accumulating CIM single phases, if such are found, or assuming ABC if not found. Note that in CIM, secondaries have their own phases s1 and s2. *
Parameters: - mdl – an RDF model (set of statements) read from the CIM imput file
- r – an RDF resource, will have a CIM mrID, should be something that can have single phases attached
- p1 – an RDF property, will be a CIM attribute, should associate from a single phase back to r
- p2 – an RDF property, will be a CIM attribute, should be the single phase instance’s phase attribute
Returns: concatenation of A, B, C, s1 and/or s2 based on the found individual phases
main¶
-
public static void
main
(String[] args)¶ Reads command-line input for the converter
Parameters: - args – will be CDPSM_to_GLM [options] input.xml output_root
Throws: - java.io.FileNotFoundException – if the CIM RDF input file is not found
Options:
-l={0..1} load scaling factor, defaults to 1
-t={y|n} triplex; y/n to include or ignore secondaries. Defaults to yes. Use no for debugging only, as all secondary load will be ignored.
-e={u|i} encoding; UTF-8 or ISO-8859-1. No default, so this should be specified. Choose ‘u’ if the CIM file came frome OpenDSS.
-f={50|60} system frequency; defaults to 60
-v={1|0.001} multiplier that converts CIM voltage to V for GridLAB-D; defaults to 1
-s={1000|1|0.001} multiplier that converts CIM p,q,s to VA for GridLAB-D; defaults to 1
-q={y|n} are unique names used? If yes, they are used as unique GridLAB-D names. If no, the CIM mrID is de-mangled to create a unique GridLAB-D name, but this option is only implemented for ACLineSegments as written to some earlier GIS profiles.
-n={schedule_name} root filename for scheduled ZIPloads (defaults to none)
-z={0..1} constant Z portion (defaults to 0 for CIM-defined LoadResponseCharacteristic)
-i={0..1} constant I portion (defaults to 0 for CIM-defined LoadResponseCharacteristic)
-p={0..1} constant P portion (defaults to 0 for CIM-defined LoadResponseCharacteristic)
Example: java CDPSM_to_GLM -l=1 -e=u -i=1 ieee8500.xml ieee8500
Assuming Jena and Commons-Math are in Java’s classpath, this will produce two output files:
ieee8500_base.glm with GridLAB-D components for a constant-current model at peak load. This file includes an adjustable source voltage and manual capacitor/tap changer states. It should be invoked from a separate GridLAB-D file that sets up the clock, solver, recorders, etc. For example, these two GridLAB-D input lines set up 1.05 per-unit source voltage on a 115-kV system:
- #define VSOURCE=69715.065 // 66395.3 * 1.05
- #include “ieee8500_base.glm”
If there were capacitor/tap changer controls in the CIM input file, that data was written to ieee8500_base.glm as comments, which can be recovered through manual edits.
ieee8500_busxy.glm with bus geographic coordinates, used in GridAPPS-D but not GridLAB-D
Cautions: this converter does not yet implement all variations in the CIM for unbalanced power flow.
- AssetInfo links to WireSpacing, OverheadWireInfo, ConcentricNeutralCableInfo and TapeShieldCableInfo
- PerLengthSequenceImpedance has not been tested
- Capacitor power factor control mode - not in GridLAB-D
- Capacitor user-defined control mode - not in GridLAB-D
- Capacitor controlled by load (EnergyConsumer) - need to name loads
- Line ratings for PerLengthImpedance
- Dielectric constant (epsR) for cables - not in CIM
- Soil resistivity (rho) for line impedance - not in CIM
- Multi-winding transformers other than centertap secondary-not in GridLAB-D
- Unbalanced transformer banks - not in GridLAB-D
- Autotransformers have not been tested
- schedule_name implemented for secondary loads only, primary loads to be done
- Fuse not implemented
- Breaker not implemented
- Jumper not implemented
- Disconnector not implemented
Throws: - java.io.UnsupportedEncodingException – if the UTF encoding flag is wrong
See also:
CDPSM_to_GLM
CDPSM_to_GLM.GldNode¶
-
static class
GldNode
¶ Helper class to accumulate nodes and loads.
All EnergyConsumer data will be attached to node objects, then written as load objects. This preserves the input ConnectivityNode names
TODO - another option is to leave all nodes un-loaded, and attach all loads to parent nodes, closer to what OpenDSS does
Fields¶
Constructors¶
Methods¶
AddPhases¶
ApplyZIP¶
-
public void
ApplyZIP
(double Z, double I, double P)¶ reapportion loads according to constant power (Z/sum), constant current (I/sum) and constant power (P/sum)
Parameters: - Z – portion of constant-impedance load
- I – portion of constant-current load
- P – portion of constant-power load
GetPhases¶
CDPSM_to_GLM.SpacingCount¶
-
static class
SpacingCount
¶ helper class to keep track of the conductor counts for WireSpacingInfo instances
Number of Conductors is the number of phases (1..3) plus neutrals (0..1)
Constructors¶
SPARQLcimTest¶
-
public class
SPARQLcimTest
extends Object¶ This class runs an example SQARQL query against CIM XML
Future versions of GridAPPS-D will rely more heavily on SPARQL queries to do the selection and filtering, as the preferred pattern for developers working with CIM. This example uses several triples to execute a query on LinearShuntCompensators (aka capacitors).
Invoke as a console-mode program
Author: Tom McDermott See also:
SPARQLcimTest.main
License¶
- Battelle Memorial Institute (hereinafter Battelle) hereby grants permission to any person or entity lawfully obtaining a copy of this software and associated documentation files (hereinafter the Software) to redistribute and use the Software in source and binary forms, with or without modification. Such person or entity may use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and may permit others to do so, subject to the following conditions:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Other than as used herein, neither the name Battelle Memorial Institute or Battelle may be used in any form whatsoever without the express written consent of Battelle.
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BATTELLE OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
General disclaimer for use with OSS licenses
This material was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the United States Department of Energy, nor Battelle, nor any of their employees, nor any jurisdiction or organization that has cooperated in the development of these materials, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness or any information, apparatus, product, software, or process disclosed, or represents that its use would not infringe privately owned rights.
Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or any agency thereof, or Battelle Memorial Institute. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof.
PACIFIC NORTHWEST NATIONAL LABORATORY
operated by
BATTELLE
for the
UNITED STATES DEPARTMENT OF ENERGY
under Contract DE-AC05-76RL01830