Ask Your Question
1

find branches associated with a bus psspy

asked 2012-08-20 03:39:27 -0500

edl763 gravatar image

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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2012-08-20 13:40:03 -0500

jsexauer gravatar image

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)
edit flag offensive delete link more

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 gravatar imageJervisW ( 2012-08-20 15:22:19 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2012-08-20 03:39:27 -0500

Seen: 2,352 times

Last updated: Aug 20 '12