PSSL for AC Loadflow Analysis

Sample Code

The following are sample code to create a simple 2-bus system and run AC Loadflow analysis.

AclfNetworkDSL netDsl = IpssAclfNet.createAclfNetwork("Sample DistNetwork");

netDsl.baseKva(100000.0);

netDsl.addAclfBus("Bus1", "name-Bus 1")

.baseVoltage(4000.0)

.genCode(AclfGenCode.SWING)

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

netDsl.addAclfBus("Bus2", "name-Bus 2")

.baseVoltage(4000.0)

.loadCode(AclfLoadCode.CONST_P)

.load(new Complex(1.0, 0.8), UnitType.PU);

netDsl.addAclfBranch("Bus1", "Bus2")

.branchCode(AclfBranchCode.LINE)

.z(new Complex(0.05, 0.1), UnitType.PU);

IpssAclf.createAlgo(netDsl.getAclfNet())

.lfMethod(AclfMethod.NR)

.tolerance(0.0001, UnitType.PU)

.runLoadflow();

System.out.println(AclfOutFunc.loadFlowSummary(net.getAclfNet()));

Please Note: You need the latest ipss_core.jar and ipss_pssl.jar to run the sample code.