find branches associated with a bus psspy
Hi, I need to find a list of all the branches from and to a bus using Python. Is there a command to to that? Thanks ed
First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
Hi, I need to find a list of all the branches from and to a bus using Python. Is there a command to to that? Thanks ed
I don't know of any direct function to do this. Here's a little script that will do it for you though:
# Buses you want to get branches between
frmBus = 100086
toBus = 100087
# Initialise Branch fetching rutine.
ierr = psspy.inibrn(frmBus,2)
while ierr==0:
# Get next buses (including 3-wind transformers).
ierr, jbus, kbus, ickt = psspy.nxtbrn3(frmBus)
if jbus != toBus and kbus != toBus:
# The to bus(es) are not the buses we are looking for
continue
# Grab whatever data you want from branches here
# For example, grab branch status
ierr, ival = psspy.brnint(frmBus, toBus, ickt, 'STATUS')
print 'Branch from ' + str(frmBus) + ' to ' + str(toBus) + ', circuit ' + str(ickt) + ': ' + str(ival)
You can also abuse the subsystem data retrieval methods to collect branch, 2-winding and 3-winding using the `aflowint` and `aflowchar`. Those functions will give `TONUMBER`, `FROMNUMBER` and `ID` for any bus in the defined bus subsystem. There is no direct function that I know of either.
Asked: 2012-08-20 03:39:27 -0500
Seen: 2,352 times
Last updated: Aug 20 '12