InterPSS API Q&A

The page answers common questions about InterPSS API.

Development & Setup

Development

How to discover InterPSS API functionality?

InterPSS is 100% object-oriented. When you work with an InterPSS-based development project, you can easily discover InterPSS API functionality. For example, in the following figure, you type distNet.getDistNetwork() to get a DistNetwork object. Then you can type a dot "." to discover all methods associated with the DistNetwork object.

Core Simulation Engine

Distribution System Analysis

How to display particular transformer object details?

// assume you have a DistNetwork object
DistNetwork distNet = ....
// retrieve a xformer object from the net 
DistXformer xfr = distNet.getDistNetwork()
                     .getDistBranch("<fromBusId>", "<toBusId>")
                     .toXFormer();
// at this stage, you can access all methods of the xfr object,
// for example
String str = xfr.toString(distNet.getBaseKva());

Jacobian Matrix

How to access Jacobian Matrix diagonal elements of a AclfBus object?

AclfBus bus = net.getAclfBus("1");
Matrix_xy m = bus.getJii(JacobianMatrixType.FULL_POLAR_COORDINATE);
        // m:   [dP/dAng, dP/dVmag]
        //      [dQ/dAng, dQ/dVmag] 
or
        m = bus.getJii(JacobianMatrixType.FULL_XY_COORDINATE);
        // m:   [dP/dVx, dP/dVy]
        //      [dQ/dVx, dQ/dVy] 

How do I create AclfNetwork Jacobian Matrix?

AclfNetwork aclfNet = ...
SparseEqnMatrix2x2 m = aclfNet.formJMatrix(JacobianMatrixType.FULL_XY_COORDINATE, msg);
SparseEqnMatrix2x2 m = aclfNet.formJMatrix(JacobianMatrixType.FULL_POLAR_COORDINATE, msg);

In some cases, one might want to increase J-matrix dimension by 1, for example, for voltage stability CPF calculation. You can use the following function call:

m.increaseDimension();

After the case, the dimension increased by 1, and aii[n+1] = 1.0, aji[n+1], bi[n=1] = 0.0;

Loadflow Functions

How to calculate power mismatch?

- At AclfBus level, you can use the bus.mismatch() method to calculate bus mismatch, see InterPSS API doc for more details.

- At AclfNetwork level, you can use net.maxmismatch() method to calculate the max mismatch. The return is a Mismatch object, which also includes bus location info of where the max mismatch occurred, see InterPSS API doc more details.

How do I get bus voltage after Loadflow converged?

Assume you have an AclfNetwork object (aclfNet), you can do the following to get bus voltage:

AclfBus bus = aclfNet.getAclfBus(<busId>);
Complex v1 = bus.getVoltage();  // get bus voltage in PU
Complex v2 = bus.getVoltage(UnitType.KV); // get bus voltage in KV

Detailed AclfBus API info could be found Here.

How do I get system loss after Loadflow converged?

Using the AclfNetwork object, the following method can used to calculate the total system loss:

Complex loss = aclfNet.totalLoss(UnitType.kVA)
// if you are running Distribution System analysis
Complex loss = distNet.getAclfNetwork().totalLoss(UnitType.kVA)

How do I get bus P after Loadflow converged?

Using the AclfBus object, the following methods can used to calculate bus P:

GenBusAdapter genBus = aclfBus.toGenBus();
Complex pg = genBus.getGenReuslts(UnitType.PU);
Complex pl = genBus.getLoadReuslts(UnitType.PU);

The adapter software design pattern is heavily used in InterPSS.

Short Circuit Analysis

How to specify short circuit contribution bus voltage angle?

Original question : I need to add voltage angle in ContributeBus.

I'm currently investigating 5 Bus Test System (Here), but I do not have any InterPSS API. What do I need to do with this code line, to add angle:

AcscInputUtilFunc.addScContributeBusTo(net, null, null, baseVolt, noArea, noZone, r1, x1, r2, x2, r0, x0, zUnit, null, rg, xg, gzUnit)

Is there any possibility to add voltage angle in contribute bus during ACSC calculations?

Maybe I could just take a real part of a Complex voltage value, for instance, 13800*exp(i*fi)=13800*cos(fi)=double type, but I am not sure is this a right solution?

Answer : InterPSS has two choices when setting the contribution bus voltage: 1) 1.0(0 deg) and 2) use Loadflow results. You can enter Loadflow info and perform Loadflow calculation before running short circuit analysis. In InterPSS object model, an AcscNetwork is an AclfNetwork, through inheritance. See more description in the InterPSS Overview.

How to add a parallel line into InterPSS network model?

Original question: I need to add a parallel line in my network model.

What kind of corrections do I need to do to add several parallel lines in my acsc model?

Answer : InterPSS allows you to connect any number of parallel branches between two buses, as long as each branch has an unique CircuitId.

How to specify Line, Transformer sequence parameters?

Original question: For Lines and Transformers, do we assume that Z1==Z2?

Answer: Yes. For all non-rotating devices, InterPSS assumes Z1 == Z2.

Build & Testing

Performance

How to measure InterPSS performance?

InterPSS API could be used to measure a particular function/method performance. The following is an example to measure time length for a loadflow calculation:

PerformanceTimer timer = new PerformanceTimer();
timer.start();
LoadflowAlgorithm algoLF = CoreObjectFactory.createLoadflowAlgorithm(adjNet, msg);
algoLF.setLfMethod(AclfMethod.NR);
algoLF.loadflow();
timer.logStd("Time for running Loadflow:");

The ipss.sample project (Here) has an example LoadflowPerformance.java to demonstrate the performance measurement.

Please Note: Java virtual machine (JVM) performance tuning itself is an advanced subject itself. JMV could be run in two modes: client mode and server mode.