First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
Here's what I did:
To test it, I created a system with 4 InService buses, 4 out-of-service buses, and a branch between every bus pair.
I'm abusing the basekv filter below just to select all buses.
# Find all buses
sid = 1
ierr = psspy.bsys(sid=sid, usekv=1, basekv=[0,1000])
ierr, all_buses = psspy.abusint(sid=sid,
string=["NUMBER"], flag=2)
all_buses = all_buses[0]
# Find in-service buses
ierr, in_service_buses = psspy.abusint(sid=sid, string=["NUMBER"], flag=1)
in_service_buses = in_service_buses[0]
Steps 1-3 are just to find the out-of-service buses. It seems like a lot of work, but I couldn't find a better way.
# Find not in-service buses
out_service_buses = list(set(all_buses) - set(in_service_buses))
# Make a subsystem from out-of-service buses
sid = 2
ierr = psspy.bsys(sid=sid, numbus=len(out_service_buses),
buses=out_service_buses)
# Find in-service, non-transformer branches
ierr, branches = psspy.abrnint(sid=sid, string=["FROMNUMBER", "TONUMBER"],
flag=1, ties=3)
# Report
for i in range(len(branches[0])):
print "There's a problem with branch from %s to %s" % (branches[0][i],
branches[1][i])
And you should get something like:
There's a problem with branch from 1 to 10
There's a problem with branch from 1 to 11
There's a problem with branch from 1 to 12
There's a problem with branch from 2 to 10
<snip>