Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

They will never be the same. Line charging quantities are defined as per unit capacitance whereas the total charging from AREA total is reactive power (MVAR) resulting from line charge. I don't think there is any API that would return MVAR due to line charge, however you could work around it by:

ierr, buses = psspy.abrnint(sid=subsysid,ties=3,string=['FROMNUMBER','TONUMBER'])
fbuses = buses[0]
tbuses = buses[1]
ierr, (cktids,) = psspy.abrnchar(sid=subsysid,ties=3,string='ID')

total_charge=0

for fbus,tbus,ckt in zip(fbuses,tbuses,cktids):
    ierr, brch_loss = psspy.brndt2(ibus=fbus,jbus=tbus,ickt=ckt,string='LOSSES')
    ierr, flow_fbus = psspy.brnflo(ibus=fbus,jbus=tbus,ickt=ckt)
    ierr, flow_tbus = psspy.brnflo(ibus=tbus,jbus=fbus,ickt=ckt)
    charge_mvar = brch_loss.imag - (flow_fbus.imag + flow_tbus.imag)
    total_charge += charge_mvar

They will never be the same. Line charging quantities are defined as per unit capacitance whereas the total charging from AREA total is reactive power (MVAR) resulting from line charge. I don't think there is any API that would return MVAR due to line charge, however you charge as a variable. You could work around it by:probably parse the output of SUBS API. I couldn't remember the formula, but alternatively a simple workaround would be:

ierr, buses = psspy.abrnint(sid=subsysid,ties=3,string=['FROMNUMBER','TONUMBER'])
fbuses = buses[0]
tbuses = buses[1]
ierr, (cktids,) = psspy.abrnchar(sid=subsysid,ties=3,string='ID')

total_charge=0

for fbus,tbus,ckt in zip(fbuses,tbuses,cktids):
    ierr, brch_loss = psspy.brndt2(ibus=fbus,jbus=tbus,ickt=ckt,string='LOSSES')
    ierr, flow_fbus = psspy.brnflo(ibus=fbus,jbus=tbus,ickt=ckt)
    ierr, flow_tbus = psspy.brnflo(ibus=tbus,jbus=fbus,ickt=ckt)
    charge_mvar = brch_loss.imag - (flow_fbus.imag + flow_tbus.imag)
    total_charge += charge_mvar

Line charging quantities are defined as per unit capacitance whereas the total charging from AREA total is reactive power (MVAR) (MVAr) resulting from line charge. I don't think there is any API that would return MVAR MVAr due to line charge as a variable. You could probably either parse the output of SUBS API. I couldn't remember the formula, but alternatively a simple workaround would be:API or calculate and sum up MVArcharge per branch.

# get details of all branches in defined subsystem ID
ierr, buses = psspy.abrnint(sid=subsysid,ties=3,string=['FROMNUMBER','TONUMBER'])
fbuses = buses[0]
tbuses = buses[1]
ierr, (cktids,) = psspy.abrnchar(sid=subsysid,ties=3,string='ID')
ierr, (charging,) = psspy.abrnreal(sid=subsysid,ties=3,string='CHARGING')
mvabase = psspy.sysmva()
 # iterate every branch in defined subsystem and calculate charging vars
total_charge=0
 for fbus,tbus,ckt fbus,tbus,ckt,charge in zip(fbuses,tbuses,cktids):
zip(fbuses,tbuses,cktids,charging):
    ierr, brch_loss fbus_puvolt = psspy.brndt2(ibus=fbus,jbus=tbus,ickt=ckt,string='LOSSES')
psspy.busdat(ibus=fbus,string='PU')
    ierr, flow_fbus tbus_puvolt = psspy.brnflo(ibus=fbus,jbus=tbus,ickt=ckt)
psspy.busdat(ibus=tbus,string='PU')
 ierr, flow_tbus = psspy.brnflo(ibus=tbus,jbus=fbus,ickt=ckt)
if charge:
 charge_mvar = brch_loss.imag - (flow_fbus.imag + flow_tbus.imag)
    total_charge += charge_mvar
(charge*mvabase/2 * fbus_puvolt**2) + (charge*mvabase/2 * tbus_puvolt**2)

Line charging quantities are defined as per unit capacitance whereas the total charging from AREA total is reactive power (MVAr) (VAr) resulting from line charge. I don't think there is any API that would return MVAr VAr due to line charge as a variable. You could either parse the output of SUBS API or calculate and sum up MVArcharge VAr charge per branch.

# get details of all branches in defined subsystem ID
ierr, buses = psspy.abrnint(sid=subsysid,ties=3,string=['FROMNUMBER','TONUMBER'])
fbuses = buses[0]
tbuses = buses[1]
ierr, (cktids,) = psspy.abrnchar(sid=subsysid,ties=3,string='ID')
ierr, (charging,) = psspy.abrnreal(sid=subsysid,ties=3,string='CHARGING')
mvabase = psspy.sysmva()

# iterate every branch in defined subsystem and calculate charging vars
total_charge=0
for fbus,tbus,ckt,charge in zip(fbuses,tbuses,cktids,charging):
    ierr, fbus_puvolt = psspy.busdat(ibus=fbus,string='PU')
    ierr, tbus_puvolt = psspy.busdat(ibus=tbus,string='PU')
    if charge:
        total_charge += (charge*mvabase/2 * fbus_puvolt**2) + (charge*mvabase/2 * tbus_puvolt**2)

Line charging quantities are defined as per unit capacitance whereas the total charging from AREA total is reactive power (VAr) resulting from line charge. I don't think there is any API that would return VAr due to line charge as a variable. You could either parse the output of SUBS API or calculate and sum up VAr charge per branch.

# get details of all branches in defined subsystem ID
ierr, buses = psspy.abrnint(sid=subsysid,ties=3,string=['FROMNUMBER','TONUMBER'])
fbuses = buses[0]
tbuses = buses[1]
ierr, (cktids,) = psspy.abrnchar(sid=subsysid,ties=3,string='ID')
ierr, (charging,) = psspy.abrnreal(sid=subsysid,ties=3,string='CHARGING')
mvabase = psspy.sysmva()

# iterate every branch in defined subsystem and calculate charging vars
total_charge=0
for fbus,tbus,ckt,charge in zip(fbuses,tbuses,cktids,charging):
    ierr, fbus_puvolt = psspy.busdat(ibus=fbus,string='PU')
    ierr, tbus_puvolt = psspy.busdat(ibus=tbus,string='PU')
    if charge:
     total_charge += (charge*mvabase/2 * fbus_puvolt**2) + (charge*mvabase/2 * tbus_puvolt**2)

Line charging quantities are defined as per unit capacitance whereas the total charging from AREA total is reactive power (VAr) resulting from line charge. I don't think there is any API that would return VAr due to line charge as a variable. You could either parse the output of SUBS API or calculate and sum up VAr charge per branch.

# get details of all branches in defined subsystem ID
ierr, buses = psspy.abrnint(sid=subsysid,ties=3,string=['FROMNUMBER','TONUMBER'])
fbuses = buses[0]
tbuses = buses[1]
ierr, (cktids,) = psspy.abrnchar(sid=subsysid,ties=3,string='ID')
ierr, (charging,) = psspy.abrnreal(sid=subsysid,ties=3,string='CHARGING')
mvabase = psspy.sysmva()

# iterate every branch in defined subsystem and calculate charging vars
total_charge=0
for fbus,tbus,ckt,charge in zip(fbuses,tbuses,cktids,charging):
    ierr, fbus_puvolt = psspy.busdat(ibus=fbus,string='PU')
    ierr, tbus_puvolt = psspy.busdat(ibus=tbus,string='PU')
    if charge:
     total_charge += (charge*mvabase/2 * fbus_puvolt**2) + (charge*mvabase/2 * tbus_puvolt**2)

Line charging quantities are defined as per unit capacitance whereas the total charging from AREA total is reactive power (VAr) resulting from line charge. I don't think there is any API that would return VAr due to line charge as a variable. You could either parse the output of SUBS API or calculate and sum up VAr charge per branch.

# get details of all branches in defined subsystem ID
ierr, buses = psspy.abrnint(sid=subsysid,ties=3,string=['FROMNUMBER','TONUMBER'])
fbuses = buses[0]
tbuses = buses[1]
ierr, (cktids,) = psspy.abrnchar(sid=subsysid,ties=3,string='ID')
ierr, (charging,) = psspy.abrnreal(sid=subsysid,ties=3,string='CHARGING')
mvabase = psspy.sysmva()

# iterate every branch in defined subsystem and calculate charging vars
total_charge=0
for fbus,tbus,ckt,charge in zip(fbuses,tbuses,cktids,charging):
    ierr, fbus_puvolt = psspy.busdat(ibus=fbus,string='PU')
    ierr, tbus_puvolt = psspy.busdat(ibus=tbus,string='PU')
    if charge:
        total_charge += (charge*mvabase/2 * fbus_puvolt**2) + (charge*mvabase/2 * tbus_puvolt**2)

Line charging quantities are defined as per unit capacitance whereas the total charging from AREA total is reactive power (VAr) resulting from line charge. I don't think there is any API that would return VAr due to line charge as a variable. You could either parse the output of SUBS API or calculate and sum up VAr charge per branch.

# get details of all branches in defined subsystem ID
ierr, buses = psspy.abrnint(sid=subsysid,ties=3,string=['FROMNUMBER','TONUMBER'])
fbuses = buses[0]
tbuses = buses[1]
ierr, (cktids,) = psspy.abrnchar(sid=subsysid,ties=3,string='ID')
ierr, (charging,) = psspy.abrnreal(sid=subsysid,ties=3,string='CHARGING')
mvabase = psspy.sysmva()

# iterate every branch in defined subsystem and calculate charging vars
total_charge=0
for fbus,tbus,ckt,charge in zip(fbuses,tbuses,cktids,charging):
    ierr, fbus_puvolt = psspy.busdat(ibus=fbus,string='PU')
    ierr, tbus_puvolt = psspy.busdat(ibus=tbus,string='PU')
    total_charge += (charge*mvabase/2 charge*mvabase/2 * fbus_puvolt**2) (fbus_puvolt**2 + (charge*mvabase/2 * tbus_puvolt**2)