Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hey Jervis,

I'm not sure whether you can change the settings of these reports to produce higher resolution values, but you should be able to write a script to calculate each of the numbers and report on them at a higher resolution,

I recently wrote a little script that calculates the line charging value (with more decimal places), and reports on the 15 lines contributing most to that value. This might be a useful starting point if you decide to re-write the reporting function.

LIST_LENGTH = 15 # How many lines to show

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

# iterate every branch in defined subsystem and calculate charging vars
total_charge=0
lCharge = []
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')
    lCharge.append(charge*mvabase/2 * (fbus_puvolt**2 + tbus_puvolt**2))
    total_charge += charge*mvabase/2 * (fbus_puvolt**2 + tbus_puvolt**2)

print "Worst %i lines:" % (LIST_LENGTH)
for f,t,c,l in sorted(zip(fbuses,tbuses,cktids,lCharge),key=lambda x: -1.0*x[3])[0:LIST_LENGTH-1]:
    print "%i-%i (%s) %d MVAr" % (f,t,c.strip(),l)

print "Total Line Charging =", total_charge