Simulation Engine Overview

InterPSS is a development project aimed to develop an modern information technology based software package for design, analysis, and simulation of power systems. The project is based on the latest software development technology, including Java, Xml, the Eclipse platform and other open-source software systems. Its open and loosely coupled software architecture will allow components developed by others to be easily plugged into InterPSS system to augment its functionality, and equally important, allow its components to be integrated into other systems to provide certain power system simulation functionality or services. InterPSS currently has already implemented AC load flow, DC load flow, short circuit, transient stability, distribution system analysis and DC power supply system analysis, and will include relay coordination, harmonics, dynamic (small singnal) stability, reliability, and many other power system design, analysis, and simulation modules in the future. InterPSS grid computing solution provides a foundation for creating computational grids to perform computationally-intensive power system simulation using conventional, inexpensive computers in a local area network (LAN) with minimum administration overhead. InterPSS Cloud Edition is currently running in the Google Cloud Computing environment, which can be access 24x7 anywhere around the globe. The project is currently developed and maintained by a team of developers living in the United States and China, and with contributions from many countries in the world.

Introduction

Power system simulation software systems have been widely used for analysis, design, and operation of modern power systems. The large-scale blackouts in the United States, United Kingdom and Italy in 2004 accelerated the adoption of advanced computer and network technologies in power systems. Commercial power system simulation software systems currently available in the market were largely developed using procedure programming languages, such as Fortran and C. Software systems developed using such approaches are known to be hard to maintain, extend and integrate into other systems. We believe these obsolete technologies and systems will eventually be replaced with new systems based on modern, network friendly and object-oriented programming languages, such as Java or C#, using a component-based plugin development approach. InterPSS is such an attempt to create a totally new software system using the Java programming language. InterPSS could be running on multiple platforms, including Windows, Linux and Unix, as long as there is a Java Runtime Environment (JRE) available on the platform.

InterPSS System Architecture

InterPSS system architecture is shown in the following Figure.

Figure 1 InterPSS System Architecture

At the center of the architecture is the power system simulation framework, which is based on an object-oriented power system simulation model described in Ref(1). UML is used to model power systems for simulation purpose and Eclipse EMF to generate code for the simulation framework. The goal of InterPSS design is to be flexible and extensible. Since it is an open system, worked largely by volunteers, easy to maintain is also an important part of the design goal. InterPSS simulation algorithms, user GUI, I/O modules, and integration interface implementations are plugins, which can be easily customized and/or replaced. InterPSS components are configured and/or integrated based on the Spring Framework. InterPSS development team uses Eclipse IDE and NetBeans IDE to do the development.

InterPSS Power System Simulation Framework

InterPSS foundation is a power system simulation framework, which consists of a power system simulation object model and a set of interfaces with which the outside world can interact with InterPSS core simulation engine. The framework is designed in a loosely coupled way that the core simulation engine could be easily extended or integrated into other systems as a standalone component.

Traditionally, a power system simulation program has a fixed input data format. However, InterPSS does not have a fixed input data format. Instead, InterPSS provides a set of plugins, we call them input File Adapters, for inputting data in particular format into InterPSS. It is quite easy and straightforward to develop your own custom file adapter to load your data in your own format into InterPSS. The default InterPSS input data format currently is the ODM - Open Model for Exchange Power System Simulation Data format.

InterPSS Object Model

InterPSS simulation framework consists of a set of simulation objects, and interfaces with which the outside world could interact with these objects. The following is a discussion of key InterPSS simulation objects and the SimuContext interface.

    • Network Topology

Modern power system simulation algorithms are mostly built on top of the power network nodal admittance Y-matrix. From the simulation perspective, power system network topology could be described as a Network object containing a set of connected Bus objects and Branch objects. InterPSS use the following network topology object model to describe power system networks for the simulation purpose.

Figure 2 Network Topology UML Class Diagram

A Bus object is a "node" to which a set of Branch objects could be connected. A Branch object is an "edge" with two terminals (from side and to side) which can be connected between two Bus objects (fromBus and toBus). A Network object is a container where Bus objects can be defined, and Branch objects can be connected between these Bus objects to form a network topology for the simulation purpose. For more details, please see Ref(1).

      • Network Classes

InterPSS breaks the power simulation problem into multiple abstract concept layers, such as Network, AclfNetwork ..., as shown in the following diagram. InterPSS uses object-oriented programming techniques, inheritance and composition, to reuse functionality defined in other concept layers. Currently the following concept layers are defined. More concept layers for such concepts as hamonics, OPF-optimal power flow, will added into InterPSS object model in the future.

    • Network: Network topology information.
    • AclfNetwork : Positive sequence network Y-matrix information and standard loadflow calculation information.
    • AcscNetwork : Negative and zero sequence network Y-matrix information for short circuit calculation.
    • DistNetwork : Allows you to define distribution systems, where device nameplate values are used.
    • DStabilityNetwork : For large disturbance transient stability simulation.

Figure 3 Network UML Class Diagram

      • Bus Classes

InterPSS uses Bus object concept to describe logical power system bus for the simulation purpose. The Bus inheritance and composition relationship is shown in the following figure:

    • Bus : Base Bus class, contenting topology connection information.
    • AclfBus : Positive sequence bus information for loadflow calculation.
    • AcscBus : Negative and zero sequence bus information for short circuit calculation.
    • DistBus : Distribution system bus device information, where device nameplate values are used.
    • DStabBus : Machine, exciter, governor, stabilizer information for transient stability simulation.

Figure 4 Bus UML Class Diagram

      • Branch Classes

InterPSS uses Branch object concept to describe logical power system branch for the simulation purpose. The Branch inheritance and composition relationship is shown in the following figure:

    • Branch : Base Branch class, contenting topology connection information.
    • AclfBranch : Positive sequence branch information for loadflow calculation.
    • AcscBranch : Negative and zero sequence branch information for short circuit calculation.
    • DistBranch : Distribution system branch device information, where device nameplate values are used.
    • DStabBranch : Information for transient stability simulation.

Figure 5 Branch UML Class Diagram

    • Switch/Break Model

In power system control centers, power network structure change information are gathered in terms of actual switch/break control actions. InterPSS currently supports two way to model the switch/break control actions.

Dummy Bus on Branch

Figure 6 Dummy Bus on Branch

Multiple dummy buses could be defined to model branch sections. For example, section I->k might be used to model a switch, so that one can issue the following statement to open the branch:

OPEN LINE FROM BUS I TO BUS k CIRCUIT 1

Bus Section

Figure 7 Bus Section

Multiple bus sections could be defined to separate a bus into multiple sections. In this way open switch at section-2 and section-3 will break the bus into 3 independent buses.

Usually, switch/break are modeled as small impedance branch, which would cause at least two issues: 1) making the Y-matrix with much larger dimension; and 2) making Loadflow calculation difficult to converge sometimes. By using the Dummy Bus on Branch and the Bus Section, no extra logical bus or branch needs to be created when forming the Y-matrix in InterPSS.

    • SimuConext Facade

InterPSS simulation framework consists of many simulation classes. At runtime, instances of these classes are created, contained by other objects and cross referenced. Keeping track of all instances and their relationship at runtime becomes rather complex. If one wants to use the framework as a black-box component. InterPSS provides a SimuContext class to simplify the simulation object management. SimuContext is a Facade Pattern, which is used to wrap all simulation objects into a relative simple enclosing interface. The following diagram provides a concept view of the SimuContext interface.

Figure 8 SimuContext Concept

Object Adapter

InterPSS uses the Object Adapter Pattern extensively. The Adapter Design Pattern 'adapts' one interface for a class into one that that might be easy to use in other situations. An adapter allows classes to work together that normally could not because of incompatible interfaces by wrapping its own interface around that of an already existing class.

For example, the AclfBus class has all raw information in PU for representing a bus for load flow analysis. Object adapters, as shown in the following diagram, are defined so that one can deal load flow concepts, such as Swing bus, PV Generator bus, at higher abstract level. The following are some sample code to outline the benefit of using Object Adatper.

   AclfBus bus = …  // create a AclfBus object
   double voltMag = 1.0; // Assume it is a Swing Bus
   double voltAng = 0.0;
   // First the hard way, you need to remember voltMsg->gen.re and voltAng->gen.im
   bus.setGen(new complex(voltMag, voltAng));  

   // the recommended way  
   SwingBusAdapter swingBus = bus.toSwingBus();
   swingBus.setVoltMag(voltMag, UnitType.PU);
   swingBus.setVoltAng(voltAng, UnitType.Rad);
   double pGen = 0.5;  // Assume it is a PV Bus
   double voltMag = 1.0;
   PVBusAdapter pvBus = bus.toPVBus();
   pvBus.setPGen(pGen, UnitType.PU);
   pvBus.setVoltMsg(voltMsg, UnitType.Rad);

Figure 9 Object Adapter UML Class Diagram

Object Factory

Based on the Factory Method Pattern, InterPSS has a set of object factories for creating the simulation objects. The following are some sample code to create Loadflow analysis objects.

   // create a AclfBus object
   AclfBus myBus = CoreObjectFactory.createAclfBus("BusId");

   // create an AclfBranch object
   AclfBranch myBranch = CoreObjectFactory.createAclfBranch();
   // Create an AclfNetwork object 
   AclfNetwork myAclfNet = CoreObjectFactory.createAclfNetwork(); 
   // Create the default loadflow algorithm 
   LoadflowAlgorithm algo = CoreObjectFactory.createLoadflowAlgorithm(myAclfNet);

Analysis and Simulation Algorithm

InterPSS separates or decouples its analysis and simulation algorithms, which could be applied to relevant AclfNetwork classes to perform, for example, Loadflow analysis, from the Network object, as shown in the following diagram. The design is based on the Visitor software design pattern. However the analysis and simulation algorithms are designed to be replaceable. This is possible because of the decoupling of the AclfNetwork class and the algorithm class.

Figure 10 Algorithm UML Class Diagram

InterPSS Programming Style

InterPSS uses Java as its programming language. The development is based on pure object-oriented programming approach. The following are some sample code to show how to build a simplest Loadflow "program".

Create AclfNetwork

The following are sample code to create an AclfNetwork object to represent a simple 2-Bus, as shown in the figure.

Fig 11 Sample 2-Bus Loadflow Network

  public static void set2BusNetworkData(AclfNetwork net, IPSSMsgHub msg) {
 double baseKva = 100000.0;

 // set system basekva for loadflow calculation
 net.setBaseKva(baseKva);

 // create a AclfBus object
 AclfBus bus1 = CoreObjectFactory.createAclfBus("Bus1");
 // set bus name and description attributes
 bus1.setAttributes("Bus 1", "");
 // set bus base voltage 
 bus1.setBaseVoltage(4000.0);
 // set bus to be a swing bus
 bus1.setGenCode(AclfGenCode.SWING_LITERAL);
 // adapt the bus object to a swing bus object
 SwingBusAdapter swingBus = bus1.toSwingBus();
 // set swing bus attributes
 swingBus.setVoltMag(1.0, UnitType.PU);
 swingBus.setVoltAng(0.0, UnitType.Deg);
 // add the bus into the network
 net.addBus(bus1);

 AclfBus bus2 = CoreObjectFactory.createAclfBus("Bus2");
 bus2.setAttributes("Bus 2", "");
 bus2.setBaseVoltage(4000.0);
 // set the bus to a non-generator bus
 bus2.setGenCode(AclfGenCode.NON_GEN_LITERAL);
 // set the bus to a constant power load bus
 bus2.setLoadCode(AclfLoadCode.CONST_P_LITERAL);
 // adapt the bus object to a Load bus object
 LoadBusAdapter loadBus = bus2.toLoadBus();
 // set load to the bus
 loadBus.setLoad(new complex(1.0, 0.8), UnitType.PU, baseKva);
 net.addBus(bus2);

 // create an AclfBranch object
 AclfBranch branch = CoreObjectFactory.createAclfBranch();
 // set branch name, description and circuit number
 branch.setAttributes("Branch 1", "", 1);
 // set branch to a Line branch
 branch.setBranchCode(AclfBranchCode.LINE_LITERAL);
 // adapte the branch object to a line branch object
        LineAdapter lineBranch = branch.toLine();
 // set branch parameters
 lineBranch.setZ(new complex(0.05, 0.1), UnitType.PU, 4000.0, baseKva, msg);
 // add the branch from Bus1 to Bus2
 net.addBranch(branch, "Bus1", "Bus2");
   } 

Run Loadflow Analysis

InterPSS provides a default load flow algorithm implementation. The following are sample code to run load flow.

   public static void simpleLoadflow(IPSSMsgHub msg) {
      // Create an AclfNetwork object
      AclfNetwork net = CoreObjectFactory.createAclfNetwork();
      // set the network data
      set2BusNetworkData(net, msg);

      // create the default loadflow algorithm
      LoadflowAlgorithm algo = CoreObjectFactory.createLoadflowAlgorithm(net);
      // use the loadflow algorithm to perform loadflow calculation
      algo.loadflow(msg);

      // output loadflow calculation results
      System.out.println(AclfOut.loadFlowSummary(net));
  } 

The complete SampleLoadflow.java sample can be found in InterPSS Source repository.

References

[1] "Object-oriented Programming, C++ and Power System Simulation", IEEE Trans. on Power Systems, Vol.11, No.1, Feb. 1996 pp206-216.

[2] "Simulation of DC Power Distribution Systems", IEEE Industrial and Commercial Power Systems Technical Conference, 1994

[3] "Internet, Open-source and Power System Simulation", IEEE PES GM2007, Tempa, FL, 2007