Scripting Bus/Branch Object

InterPSS, though its GUI, provides standard models for Bus and Branch for Loadflow and Short Circuit analysis. However, we realized that there would be always situations that these models may not be enough to solve a particular problem. Therefore, we added Bus/Branch object scripting feature, so that as an advanced user, one can quickly define custom models to plugin into InterPSS to perform Loadflow and/or Short Circuit analysis to extend InterPSS functionality.

Background Information

Debug

There may be cases where the simulation results are not as expected. You may want to debug your script function details by print out some of the internal information. At any place, you can use InterPSS Logger (JavaAPI) to send the internal results to the InterPSS logger file, as follows:

x = 1.0;

com.interpss.common.util.IpssLogger.getLogger().info( "X = " + x ));

Loadflow Bus Scripting

InterPSS Loadflow bus model is shown in the following diagram:

To implement a custom bus generation, the following methods needs to be implemented:

    • PQ Generation Bus

public boolean isGenPQ() { return true; }

public double getGenP();

public double getGenQ();

    • PV Generation Bus

public boolean isGenPV() { return true; }

public double getGenP();

public double getVoltageMag();

    • Swing/Slack Generation Bus

public boolean isSwing() { return true; }

public double getVoltageMag();

public double getVoltageAng();

All quantities are in PU.

Please Note: You can only define one type of bus generation, Swing/Slack, PV or PQ, not a combination.

To implement a custom bus load, the following methods need to be implemented:

public boolean isLoad() { return true; }

public double getLoadP();

public double getLoadQ();

To implement a custom bus shunt Y, the following methods need to be implemented:

public Complex getShuntY();

You can access the complete bus object information by calling the getParentAclfBus() method. For example, you can do the following:

AclfBus bus = getParentAclfBus();

Complex voltage = bus.getVoltage();

Scripting Functional Load Sample

The following is a sample implementation of a functional load bus.

Loadflow Branch Scripting

InterPSS Loadflow branch model is shown in the following diagram. You can describe a loadflow branch in two ways:

    • Use 2x2 complex matrix [yff, yft, ytf, ytt] to describe an impedance based branch, such as a transmission line, or a transformer.
    • Use two inject currents to describe an electronic device based branch, such as a DC transmission line.

To describe a custom branch using branch impedance, the following methods need to be implemented:

public Complex yff();

public Complex yft();

public Complex ytf();

public Complex ytt();

All y are in PU. InterPSS does not assume symmetric node Y matrix. You need to specify both yft() and ytf(). If the branch is going to participate in Fast-Decouple (PQ) loadflow solution, the following extra methods need to be implemented:

public double b11ft();

public double b11tf();

public double b1ft();

public double b1ft();

To describe a custom electronic branch, the following methods need to be implemented:

public Complex currentIntoNetFromSide();

public Complex currentIntoNetToSide();

You can also specify three branch MVA ratings for branch MVA violation checking:

public double getRatingMva1();

public double getRatingMva2();

public double getRatingMva3();

You can access the complete branch object and associated from/to bus object information by calling the getParentAclfBranch() method. For example, you can do the following:

AclfBranch branch = getParentAclfBranch();

Complex fromSideVoltage = branch.getFromAclfBus().getVoltage();

Complex toSideVoltage = branch.getToAclfBus().getVoltage();

The following is an example of defining a regular transmission line.

Short Circuit Bus Scripting

To define a custom bus object for short circuit analysis, the following methods need to be implemented:

/*

Define Z1 for symmetric fault, Z2,Z0 for non-symmetric fault, all in PU

*/

public Complex getZ1() { return new Complex(0.0, 0.0); }

public Complex getZ2() { return new Complex(0.0, 0.0); }

public Complex getZ0() { return new Complex(0.0, 0.0); }

/*

Define bus ground, GroundCode [BusGroundCode.UNGROUNDED, BusGroundCode.SOLID_GROUNDED, BusGroundCode.ZGROUNDED]

For ZGround, define getGroundZ() in PU

*/

public BusGroundCode getGroundCode() {

return BusGroundCode.SOLID_GROUNDED; }

public Complex getGroundZ() { return new Complex(0.0,0.0); }

All value are in pu.

The following is a sample of defining a contributing solid grounded bus.

Short Circuit Branch Scripting