InterPSS Python Interface

Motivation

Currently there are two ways to use InterPSS:

    • InterPSS GUI : InterPSS GUI is mainly designed for the normal user. Although its functionality could be extended using Java/JavaScript or XML by the advanced user, the freedom for the extension is quite limited.
    • Programming using InterPSS API : Using InterPSS Java API, you have full access to InterPSS power. However, we have noticed that there is a deep learning curve. Java language and InterPSS object-oriented programming style are unlikely accepted and understood by those without formal computer science training.

Therefore there is a need to create something in between - a power system simulation domain specific language (PSSL), which is simple enough to be understood by typical power engineers and powerful enough for advanced user for research and development purpose.

We select Jyphon as our implementation language. Jython is an implementation of the Python language written in Java. It thus allows you to run Python on any Java platform. Python is a dynamic object-oriented programming language that can be used for many kinds of software development. It offers strong support for integration with other languages and tools, comes with extensive standard libraries, and can be learned in a few days. Many Python programmers report substantial productivity gains and feel the language encourages the development of higher quality, more maintainable code.

Sample PSSL Statement

The following are PSS_DSL for creating two-bus Aclf network and performing Loadflow calculation:

aclfNet = IpssAclf.createAclfNetwork("Sample AclfNetwork")

.setBaseKva(100000.0)

.getAclfNet();

IpssAclf.addAclfBus("Bus1", "name-Bus 1", aclfNet)

.setBaseVoltage(4000.0)

.setGenCode(AclfGenCode.SWING)

.setVoltageSpec(1.0, UnitType.PU, 0.0, UnitType.Deg);

IpssAclf.addAclfBranch("Bus1", "Bus2", aclfNet)

.setBranchCode(AclfBranchCode.LINE)

.setZ(Complex(0.05, 0.1), UnitType.PU);

IpssAclf.createLoadflowAlgorithm(aclfNet)

.setLfMethod(AclfMethod.NR)

.setTolerance(0.0001, UnitType.PU)

.runLoadflow();

print AclfOutFunc.loadFlowSummary(aclfNet);

PSSL Environment Setup