Device models#
- class Bus(*, rawtag=None, ibus, name='', baskv=0.0, ide=1, area=1, zone=1, owner=1, vm=1.0, va=0.0, nvhi=1.1, nvlo=0.9, evhi=1.1, evlo=0.9)#
Represent one bus and its voltage and ownership data.
- in_service()#
Return whether the bus is electrically available.
- class Load(*, rawtag=None, ibus, id='1', status=1, area=0, zone=0, pl=0.0, ql=0.0, ip=0.0, iq=0.0, yp=0.0, yq=0.0, owner=0, scale=1.0, intrpt=0, dgenp=0.0, dgenq=0.0, dgenm=0, loadtype='', name='')#
Represent one load with constant-power, current, and admittance parts.
- gross_p()#
Return gross active load in MW at 1.0 per-unit voltage.
- p_demand()#
Return net active demand in MW at 1.0 per-unit voltage.
Enabled distributed generation reduces the gross load.
- gross_q()#
Return gross reactive load in Mvar at 1.0 per-unit voltage.
Positive capacitive admittance reduces reactive demand.
- scale_p(alpha)#
Multiply all active-load components by
alpha.
- scale_q(beta)#
Multiply all reactive-load components by
beta.
- in_service()#
Return true when the load is in service.
- class Generator(*, rawtag=None, ibus, id='1', pg=0.0, qg=0.0, qt=9999.0, qb=-9999.0, vs=1.0, ireg=0, mbase=100.0, zr=0.0, zx=1.0, rt=0.0, xt=0.0, gtap=1.0, status=1, rmpct=100.0, pt=9999.0, pb=-9999.0, baslod=0, o1=0, f1=0.0, o2=0, f2=0.0, o3=0, f3=0.0, o4=0, f4=0.0, wmod=0, wpf=1.0, nreg=0, droopname='', name='')#
Represent one generator and its operating and capability limits.
- reactive_capability(*, wind=True)#
Return the available reactive-power range as
(minimum, maximum).- Parameters:
wind -- Apply wind-machine power-factor modes when true.
- in_service()#
Return true when the generator is in service.
- clamp_pg(pg_mw)#
Clamp active power in MW to the generator's minimum and maximum.
- machine_base(sbase)#
Return the machine MVA base.
Use the case base when
mbaseis not positive.- Parameters:
sbase -- Case MVA base.
- class GenCost(*, ibus, id='1', model, startup=0.0, shutdown=0.0, cost=<factory>, ramp=0.0, ramp_agc=0.0, ramp_10=0.0, ramp_30=0.0)#
Represent the operating cost curve for one generator.
Cost data is an optimization input and is separate from the generator's power-flow data.
modeldefines the layout ofcost:model == 2(polynomial):costare coefficients highest-order first,f(pg) = c[0]*pg**n + ... + c[n].model == 1(piecewise linear):costare interleaved(pg, f)breakpoints with strictly increasingpg.
- evaluate(pg)#
Return the hourly operating cost at active output
pgin MW.
- class Branch(*, rawtag=None, ibus, jbus, ckt='1', rpu=0.0, xpu=0.0, bpu=0.0, name='', rate1=0.0, rate2=0.0, rate3=0.0, rate4=0.0, rate5=0.0, rate6=0.0, rate7=0.0, rate8=0.0, rate9=0.0, rate10=0.0, rate11=0.0, rate12=0.0, gi=0.0, bi=0.0, gj=0.0, bj=0.0, st=1, bp=0, met=1, length=0.0, o1=0, f1=0.0, o2=0, f2=0.0, o3=0, f3=0.0, o4=0, f4=0.0)#
Represent one non-transformer AC branch or transmission line.
- in_service()#
Return true when the branch is in service.
- class Transformer(*, rawtag=None, ibus, jbus, kbus=0, ckt='1', cw=1, cz=1, cm=1, mag1=0.0, mag2=0.0, line_b=0.0, nmetr=2, name='', status=1, o1=0, f1=1.0, o2=0, f2=0.0, o3=0, f3=0.0, o4=0, f4=0.0, vecgrp='', zcod=0, r1_2=0.0, x1_2=0.0, sbase1_2=100.0, r2_3=0.0, x2_3=0.0, sbase2_3=100.0, r3_1=0.0, x3_1=0.0, sbase3_1=100.0, vmstar=1.0, anstar=0.0, windv1=1.0, nomv1=0.0, ang1=0.0, wdg1rate1=0.0, wdg1rate2=0.0, wdg1rate3=0.0, cod1=0, cont1=0, rma1=1.1, rmi1=0.9, vma1=1.1, vmi1=0.9, ntp1=33, tab1=0, cr1=0.0, cx1=0.0, cnxa1=0.0, nod1=0, rate1_4=0.0, rate1_5=0.0, rate1_6=0.0, rate1_7=0.0, rate1_8=0.0, rate1_9=0.0, rate1_10=0.0, rate1_11=0.0, rate1_12=0.0, windv2=1.0, nomv2=0.0, ang2=0.0, wdg2rate1=0.0, wdg2rate2=0.0, wdg2rate3=0.0, cod2=0, cont2=0, rma2=1.1, rmi2=0.9, vma2=1.1, vmi2=0.9, ntp2=33, tab2=0, cr2=0.0, cx2=0.0, cnxa2=0.0, nod2=0, rate2_4=0.0, rate2_5=0.0, rate2_6=0.0, rate2_7=0.0, rate2_8=0.0, rate2_9=0.0, rate2_10=0.0, rate2_11=0.0, rate2_12=0.0, windv3=1.0, nomv3=0.0, ang3=0.0, wdg3rate1=0.0, wdg3rate2=0.0, wdg3rate3=0.0, cod3=0, cont3=0, rma3=1.1, rmi3=0.9, vma3=1.1, vmi3=0.9, ntp3=33, tab3=0, cr3=0.0, cx3=0.0, cnxa3=0.0, nod3=0, rate3_4=0.0, rate3_5=0.0, rate3_6=0.0, rate3_7=0.0, rate3_8=0.0, rate3_9=0.0, rate3_10=0.0, rate3_11=0.0, rate3_12=0.0)#
Represent one two-winding or three-winding transformer.
- property is_3winding#
Return true for a three-winding transformer.
- terminals()#
Return physical winding terminals with their individual service states.
- winding_in_service(winding)#
Return whether a numbered transformer winding conducts.
- in_service()#
Return whether any supported transformer winding conducts.
- is_switched_off()#
Return true when status places the transformer out of service.
- unsupported_status()#
Return true when a two-winding transformer uses a partial-outage status.
- nonpositive_winding_bases()#
Return nonpositive MVA-base fields used for impedance conversion.
- class FixedShunt(*, rawtag=None, ibus, id='1', status=1, gl=0.0, bl=0.0, name='')#
Represent one fixed bus shunt.
- in_service()#
Return true when the fixed shunt is in service.
- class Area(*, rawtag=None, iarea, isw=0, pdes=0.0, ptol=0.0, arname='')#
Represent one control area and its interchange target.
- class Zone(*, rawtag=None, izone, zoname='')#
Represent one named network zone.
- class Owner(*, rawtag=None, i, owname='')#
Represent one named equipment owner.
- class SwitchedShunt(*, rawtag=None, i, id='1', modsw=1, adjm=0, stat=1, vswhi=1.0, vswlo=1.0, swreg=0, nreg=0, rmpct=100.0, rmidnt='', binit=0.0, s1=1, n1=0, b1=0.0, s2=1, n2=0, b2=0.0, s3=1, n3=0, b3=0.0, s4=1, n4=0, b4=0.0, s5=1, n5=0, b5=0.0, s6=1, n6=0, b6=0.0, s7=1, n7=0, b7=0.0, s8=1, n8=0, b8=0.0, name='')#
Represent one switched shunt and its control steps.
- in_service()#
Return true when the switched shunt is in service.
- class SystemSwitchingDevice(*, rawtag=None, ibus, jbus, ckt='1', xpu=0.0, rate1=None, rate2=None, rate3=None, rate4=None, rate5=None, rate6=None, rate7=None, rate8=None, rate9=None, rate10=None, rate11=None, rate12=None, rsetnam='', status=1, nstat=1, metered=1, stype=2, name='')#
Represent a system-level breaker or disconnect.
The solver treats a closed device as an AC branch. Status 1 and 2 mean closed, and status 0 means open. The record carries reactance but no resistance.
Ratings are either inline or referenced by
rating_set_name. A record cannot use both forms.- in_service()#
Return true when the switching device conducts.
- class InterArea(*, rawtag=None, arfrom, arto, id='1', ptran=0.0)#
Represent one scheduled transfer between two areas.
- class TwoTerminalDC(*, rawtag=None, name='', mdc=0, rdc=0.0, setvl=0.0, vschd=0.0, vcmod=0.0, rcomp=0.0, delti=0.0, met='I', dcvmin=0.0, cccitmx=20, cccacc=1.0, ipr=0, nbr=1, anmxr=0.0, anmnr=0.0, rcr=0.0, xcr=0.0, ebasr=0.0, trr=1.0, tapr=1.0, tmxr=1.5, tmnr=0.51, stpr=0.00625, icr=0, ndr=0, ifr=0, itr=0, idr='1', xcapr=0.0, ipi=0, nbi=1, anmxi=0.0, anmni=0.0, rci=0.0, xci=0.0, ebasi=0.0, tri=1.0, tapi=1.0, tmxi=1.5, tmni=0.51, stpi=0.00625, ici=0, ndi=0, ifi=0, iti=0, idi='1', xcapi=0.0)#
Represent one two-terminal LCC HVDC link.
- in_service()#
Return true when the link uses power or current control.
- is_switched_off()#
Return true when the link is blocked.
- class VscDCLine(*, rawtag=None, name='', mdc=1, rdc=0.0, o1=None, f1=None, o2=None, f2=None, o3=None, f3=None, o4=None, f4=None, ibus1=0, type1=1, mode1=1, dcset1=0.0, acset1=1.0, aloss1=0.0, bloss1=0.0, minloss1=0.0, smax1=0.0, imax1=0.0, pwf1=1.0, maxq1=9999.0, minq1=-9999.0, vsreg1=0, nreg1=0, rmpct1=100.0, ibus2=0, type2=1, mode2=1, dcset2=0.0, acset2=1.0, aloss2=0.0, bloss2=0.0, minloss2=0.0, smax2=0.0, imax2=0.0, pwf2=1.0, maxq2=9999.0, minq2=-9999.0, vsreg2=0, nreg2=0, rmpct2=100.0)#
Represent one two-terminal VSC HVDC link.
- in_service()#
Return true when the link transfers power.
- is_switched_off()#
Return true when the link is explicitly out of service.
- unsupported_status()#
Return true when the link uses an unsupported control mode.
- class MTDCConverter(*, ib, nbrdg, angmx, angmn, rc, xc, ebas, tr=1.0, tap=1.0, tpmx=1.5, tpmn=0.51, tstp=0.00625, setvl, dcpf=1.0, marg=0.0, cnvcod=1)#
Represent one converter station in a multi-terminal DC system.
- class MTDCBus(*, idc, ib=0, area=1, zone=1, dcname='', idc2=0, rgrnd=0.0, owner=1)#
Represent one DC bus in a multi-terminal DC system.
- class MTDCLink(*, idc, jdc, dcckt='1', met=1, rdc, ldc=0.0)#
Represent one branch between multi-terminal DC buses.
- class MultiTerminalDC(*, rawtag=None, name='', mdc=0, vconv, vcmod=0.0, vconvn=0, converters=<factory>, dcbuses=<factory>, dclinks=<factory>)#
Represent one multi-terminal DC system and its nested records.
- property nconv#
Return the number of converters.
- property ndcbs#
Return the number of DC buses.
- property ndcln#
Return the number of DC links.
- in_service()#
Return whether the DC system is enabled.
- is_switched_off()#
Return true when the DC system is blocked.
- class Facts(*, rawtag=None, name='', i, j=0, mode=1, pdes=0.0, qdes=0.0, vset=1.0, shmx=9999.0, trmx=9999.0, vtmn=0.9, vtmx=1.1, vsmx=1.0, imx=0.0, linx=0.05, rmpct=100.0, owner=1, set1=0.0, set2=0.0, vsref=0, fcreg=0, nreg=0, mname='')#
Represent one FACTS device and its active control mode.
- in_service()#
Return true when the FACTS device uses normal control mode.
- is_switched_off()#
Return true when the FACTS device is explicitly out of service.
- unsupported_status()#
Return true when the FACTS device uses an unsupported mode.
- class MultiSectionLine(*, rawtag=None, i, j, id='&1', met=1, dum1=None, dum2=None, dum3=None, dum4=None, dum5=None, dum6=None, dum7=None, dum8=None, dum9=None)#
Group AC branches that form one multi-section line.
- class ImpedanceCorrection(*, rawtag=None, i, t1=0.0, f1=0.0, t2=None, f2=None, t3=None, f3=None, t4=None, f4=None, t5=None, f5=None, t6=None, f6=None, t7=None, f7=None, t8=None, f8=None, t9=None, f9=None, t10=None, f10=None, t11=None, f11=None, t12=None, f12=None, im_f1=0.0, im_f2=None, im_f3=None, im_f4=None, im_f5=None, im_f6=None, im_f7=None, im_f8=None, im_f9=None, im_f10=None, im_f11=None, im_f12=None)#
Represent one transformer impedance-correction table.
- class InductionMachine(*, rawtag=None, i, imid='1', stat=1, scode=1, dcode=2, area=0, zone=0, owner=0, tcode=1, bcode=1, mbase=100.0, ratekv=0.0, pcode=1, pset=0.0, h=1.0, a=1.0, b=1.0, d=1.0, e=1.0, ra=0.02494, xa=0.07482, xm=2.32786, r1=0.02078, x1=0.09145, r2=0.12471, x2=0.03326, x3=0.0, e1=1.0, se1=0.04, e2=1.2, se2=0.2, ia1=1.0, ia2=5.0, xamult=1.0, name='')#
Represent one induction motor or generator.
- in_service()#
Return true when the induction machine is in service.
- class Substation(*, rawtag=None, isub, name='', lati=0.0, long=0.0, srg=0.0, nodes=<factory>, switching_devices=<factory>, terminals=<factory>)#
Represent a substation and its node-breaker topology.
Power flow uses the bus-branch model until a topology operation applies the node and switching-device state.
- class SubstationNode(*, inode, name='', ibus, status=1, vm=None, va=None)#
Represent one node in a substation's node-breaker topology.
inodeis scoped to its substation;ibusmaps the node onto the bus-branch model.vmandvacontain optional node voltages.- in_service()#
Return true when the substation node is in service.
- class SubstationSwitchingDevice(*, inode, jnode, swdid='1', name='', type=2, status=1, nstat=1, xpu=0.0, rate1=None, rate2=None, rate3=None, rsetnam='')#
Represent one switching device between two substation nodes.
Status 1 and 2 mean closed, and status 0 means open.
A record can contain inline ratings or reference a
SwitchingDeviceRatingSetthroughrsetnam.- is_closed()#
Return true when the switching device conducts.
- class SubstationTerminal(*, ibus, inode, type='', jbus=None, kbus=None, eqid='1')#
Connect one equipment terminal to a substation node.
typeidentifies the equipment family. Branch and transformer terminals usejbusand optionalkbusvalues.eqididentifies the connected equipment.