AC Loadflow PSSL Syntax
AC Loadflow PSSL Syntax
/**
* DSL (domain specific language) for AC Loadflow calculation
*
* 1) The method should be called in sequence following the sequence defined, for example
* Bus.genCode() should be called before bus.voltageSpec()
*
*
* Add a load bus to the network
*
addAclfBus(id, "Bus-"+id)
.areaNumber(noArea)
.zoneNumber(noZone)
.baseVoltage(baseV)
.loadCode(code)
.load(new Complex(p,q), pUnit);
* Add a non-load and non-gen bus
*
addAclfBus(id, "Bus-"+id)
.areaNumber(noArea)
.zoneNumber(noZone)
.baseVoltage(baseV, unit);
/**
* Add a PQ Gen bus to the network
*
addAclfBus(id, "Bus-"+id)
.areaNumber(noArea)
.zoneNumber(noZone)
.baseVoltage(baseV)
.genCode(AclfGenCode.GEN_PQ)
.gen(new Complex(p,q), pUnit);
/**
* Add a PV bus to the network object
*
addAclfBus(id, "Bus-"+id)
.areaNumber(noArea)
.zoneNumber(noZone)
.baseVoltage(baseV)
.genCode(AclfGenCode.GEN_PV)
.genP_vMag(p, pUnit, v, vUnit);
/**
* Add a swing bus into the network
*
addAclfBus(id, "Bus-"+id)
.areaNumber(noArea)
.zoneNumber(noZone)
.baseVoltage(baseV)
.genCode(AclfGenCode.SWING)
.voltageSpec(vMag, vUnit, vAng, angUnit);
/**
* Add a capacitor bus to the network
*
addAclfBus(id, "Bus-"+id)
.areaNumber(noArea)
.zoneNumber(noZone)
.baseVoltage(baseV)
.genCode(AclfGenCode.CAPACITOR)
.capacitorQ(q, qUnit);
/**
* Add a line branch to the network
*
addAclfBranch(fid, tid)
.branchCode(AclfBranchCode.LINE)
.z(new Complex(r,x), zUnit)
.shuntB(hB*2.0, bUnit);
/**
* Add a Xfr branch to the network
*
addAclfBranch(fid, tid)
.branchCode(AclfBranchCode.XFORMER)
.z(new Complex(r,x), zUnit)
.turnRatio(fTap, tTap, ratioUnit);
/**
* Add a PsXfr branch to the network
*
addAclfBranch(fid, tid)
.branchCode(AclfBranchCode.PS_XFORMER)
.z(new Complex(r,x), zUnit)
.turnRatio(fRatio, tRatio, ratioUnit)
.shiftAngle(fAng, tAng, angUnit);
/**
* Add a FunctionLoad control to the network
addFunctionLoad(busId)
.initLoad(new Complex(loadP0,loadQ0), unit)
.pCoefficient(p_a, p_b, unit)
.qCoefficient(q_a, q_b, unit);
/**
* add PQ bus control
*
addPQBusLimit(busId)
.qSpecified(qSpec, qUnit)
.vLimit(vMax, vMin, vUnit);
/**
* Add PV Bus control
*
addPVBusLimit(busId)
.vSpecified(vSpec, vUnit)
.qLimit(qMax, qMin, qUnit);
/**
* add PS Xfr control of p flow
addPSXfrPControl(fromId, toId, "1")
.pSpecified(pSpec, pUnit)
.angLimit(angMax, angMin, angUnit)
.flowFrom2To(flowFrom2To)
.controlOnFromSide(conOnFromSide);
/**
* add bus Q control of a remote bus voltage
*
addRemoteQBus(busId, adjNet)
.controlType(RemoteQControlType.BUS_VOLTAGE)
.adjBusBranchId(remoteBusId)
.qLimit(qMax, qMin, qUnit)
.vSpecified(vSpec, vUnit);
/**
* Add Bus Q control of a remote branch mvar flow
*
addRemoteQBus(busId)
.controlType(RemoteQControlType.BRANCH_Q)
.adjBusBranchId(remoteBranchId)
.qLimit(qMax, qMin, qUnit)
.vSpecified(vSpec, vUnit)
.mvarOnFromSide(onFromSide)
.flowFrom2To(flowFrom2To);
/**
* Add Xfr branch tap control for bus voltage
*
addTapControl(fromId, toId, "1")
.controlType(XfrTapControlType.BUS_VOLTAGE)
.adjBusBranchId(vcBusId)
.flowControlType(FlowControlType.POINT_CONTROL)
.vSpecified(vSpec, vUnit)
.turnRatioLimit(tapMax, tapMin)
.adjSteps(steps)
.vcBusOnFromSide(vcBusOnFromSide)
.tapOnFromSide(tapOnFromSide);
/**
* Add Xfr Tap Control for branch mvar flow
*
addTapControl(fromId, toId, "1")
.controlType(XfrTapControlType.MVAR_FLOW)
.flowControlType(FlowControlType.POINT_CONTROL)
.mvarSpecified(mvaSpec, mvaUnit)
.turnRatioLimit(tapMax, tapMin)
.adjSteps(steps)
.tapOnFromSide(tapOnFromSide)
.flowFrom2To(flowFrom2To)
.meteredOnFromSide(mvarSpecOnFromSide);
*/