1

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

edl763's avatar
21
edl763
asked 2012-08-20 03:39:27 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

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)
jsexauer's avatar
586
jsexauer
answered 2012-08-20 13:40:03 -0500
edit flag offensive 0 remove flag delete link

Comments

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.

JervisW's avatar JervisW (2012-08-20 15:22:19 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer