ODM Reference Implementation

Introduction

As an important part of the ODM Model development, a reference implementation of the model using Java has been created. It serves the following two main purposes:

    • To prove that the model could be practically implemented. “We eat our own dog food”.
    • To serve as a concrete example for those who might new to XML and have difficult to understand how to use the model.

ODM Model Java API

One important benefit of using XML Schema to represent the model is that we can automatically create ODM Schema's programming API using open-source tools. For this reference implementation, XmlBeans, which is an Apache open-source project contributed by BEA Systems, is used to generate the model Java API. The API is packaged in a Java jar file ieee.odm_pss.schemas.jar, which could download from the InterPSS project download site.

ODM Model Parser

Since the model API is generated by XmlBeans, it follows certain special naming conversion and has certain syntax. A Model Parser with some utility helper classes have been created to hide some of the complexity and make programming simple. Currently, it has the following Java classes:

IEEEODMPSSModelParser.java

ODMXmlUtil.java

XML File to Model

One common task is to load a ODM Xml document into computer memory to process. The following are sample code to load a model Xml file by the parser and build the model in memory.

IEEEODMPSSModelParser parser = new IEEEODMPSSModelParser(new File("filename"));

PSSNetworkXmlType baseCaseNet = parser.getBaseCase();

// print out all bus info

for (BusRecordXmlType bus : baseCaseNet.getBusList().getBusArray()) {

System.out.println("Bus Id: " + bus.getId());

}

// print out all branch info

for (BranchRecordXmlType branch : baseCaseNet.getBranchList().getBranchArray()) {

System.out.println("Branch Id: " + branch.getId()

+ " connected from: " + branch.getFromBus().getIdRef()

+ " to: " + branch.getToBus().getIdRef());

}

Create Model Using Programming

When you build an adapter, for example to convert an IEEE CDF file into the ODM Model, you might want create the model by programming. The following are sample code to create the model using the programming approach.

IEEEODMPSSModelParser parser = new IEEEODMPSSModelParser();

baseCaseNet = parser.getBaseCase();

BusRecordListXmlType busList = baseCaseNet.addNewBusList();

BusRecordXmlType bus1 = busList.addNewBus();

bus1.setId("Bus-1");

BusRecordXmlType bus2 = busList.addNewBus();

bus2.setId("Bus-2");

BranchRecordListXmlType branchList = baseCaseNet.addNewBranchList();

BranchRecordXmlType branch = branchList.addNewBranch();

branch.setId("Bus-1_Bus-2");

branch.addNewFromBus().setIdRef("Bus-1");

branch.addNewFromBus().setIdRef("Bus-2");;

System.out.println(parser.toString());

Common Adapters

Using the model Java API, adapters could be built to import data stored in data files in a particular format, such as IEEE CDF, PEE/S or UCTE, to the ODM model or vs versa. The following is a list of adapters currently available or under development.

IEEE CDF Adapter

A IEEE CDF Adapter, which translates a data file in IEEE CDF format to an ODM Xml document has been developed.

Implementor

InterPSS

Source Code Location

The Java source code IeeeCDFAdapter.java has been posted into the repository. The IEEE-14Bus Sample file location has the two files:

BPA Adapter

A BPA Adapter, which translates a data file in BPA format to an ODM xml document has been developed. This implementation is based on the Chinese-version BPA published by the Chinese Electric Power Research Institute (CEPRI). Detailed information could be found here.

Implementor

InterPSS.

Source Code Location

The Java source code BPAAdapter.java has been posted into the repository.

For more information about the implementation, please visit here.

PSS/E Format Adapter

(todo ...)

GE-PSLF Format Adapter

(todo ...)

UCTE Format Adapter

A UCTE-DRF Adapter, which translates a data file in the UCTE format to an ODM Xml document has been developed. The UCTE data exchange format for load flow and three phase short circuit studies is defined by UCTE Network models and forecast tools subgroup. This implementation is based on the latest version 02 (2007.05.01).

Implementor

InterPSS

Expert Group

Mario Sedlak, Österreichische Elektrizitätswirtschafts-AG

VERBUND-Austrian Power Grid AG (APG) Marktmanagement (UMM)

Source Code Location

The Java source code UCTE_DEFAdapter.java has been posted into the repository.

InterPSS Adapter

InterPSS has an adapter to import ODM Xml document directly into InterPSS and perform Loadflow analysis.

Implementor

InterPSS

PSAT Adapter

PSAT allows to import and export data in the ODM format. The functions that do the import/export conversion are odm2psat and psat2odm.m, respectively. Both filters are modular and can be extended as the ODM schema grows.

Implementer

Prof Federico Milano

Adapter Runtime

An adapter runtime environment has been created to run the adapters to convert data files in a particular format into ODM model.

Download and Installation

Currently, the adapter runtime is maintained by InterPSS. You can download from InterPSS SourceForge Download Site. Unzip the distribution file and follow instructions in the readme.txt to install and configure the adapter runtime.

Run Adapter

java -classpath ... org.ieee.pes.odm.pss.Data2ODMXml

-in <input file>

-format IEEECDF|UCTE

-out <output xml file>

If you run on Windowns, you can use the sample batch files in the bin directory.