First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
1

find branches associated with a bus psspy

asked Aug 20 '12

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

1 answer

Sort by » oldest newest most voted
1

answered Aug 20 '12

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)
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 gravatar imageJervisW (Aug 20 '12)

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: Aug 20 '12

Seen: 2,433 times

Last updated: Aug 20 '12