Extension by Programming

InterPSS was designed for extension from the very beginning. In fact, InterPSS is build through extension and reuse. This page and its sub-pages will fully document InterPSS extension approach, using Java programming language, so that any one can extend InterPSS to add custom features. At the conceptual level, almost all InterPSS simulation related components could be considered as an implementation the following bus I-V or branch I-V generic function, as shown in the following diagram.

where, I - bus injection or branch current, V - bus or branch terminal voltage, t - time for time-domain simulation, dt - time-domain simulation step.

There are two ways to extend an existing class: through composition or inheritance, as shown in the following figure. InterPSS classes already have an inheritance structure, for example, AcscBus is a sub-class of AclfBus. Therefore extension through composition is recommended.

InterPSS Bus and Branch class are sub-class of the ExtensionElement class, as shown in the following figure. The extensioObject field could be overridden to implement Bus/Branch extension.

The following is a simple example to implement a constant-P Load (p = 1.6 pu, q = 0.8 pu) through extension.

AclfBus bus = (AclfBus)net.getBus("1");
bus.setExtensionObject(new AbstractAclfBus(bus) {
   public boolean isLoad() { return true; }
   public double getLoadP() { return 1.6; }
   public double getLoadQ() { return 0.8; }
   public Complex mismatch() { 
         Complex pIn2Net = getParentBus().powerIntoNet();
         return new Complex(-getLoadP(),-getLoadQ()).subtract(pIn2Net); }

This example, of course, is overly simplified and only for illustrating the extension concept purpose. The AclfBus object (id = "1") behavior is overridden by the extension object.