Ask Your Question
0

How to i find all buses which are connected to a specific bus

asked 2019-07-01 09:52:01 -0500

NilleDaWize gravatar image

updated 2019-07-01 09:56:49 -0500

Hi,

I am new to PSSE and have been looking thorough the API documentation in search of a method that will take a bus number as argument and return all the buses which are connected to it. The closest I have got is using NXTBUS, but from what I can tell it will only give me one of the adjecent buses and then move on down the line. I'm wondering if maybe I have to get all the branches first and then check what buses are connected to given branches?

If anyone knows of a way to fetch all buses connected to a specific bus that would be amazing.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2019-07-01 17:58:47 -0500

perolofl gravatar image

You have to call nxtbrn in a loop until there are no more branches connected to ibus. See example below:

tobuses,ckts = [],[]
ierr = psspy.inibrn(ibus,2)
while ierr==0:
    ierr, jbus, ickt = psspy.nxtbrn(ibus)
    if ierr==0: 
        tobuses.append(jbus)
        ckts.append(ickt)

List tobuses will contain the to bus number of all branches and 2W connected to ibus. List ckts contains the id's.

edit flag offensive delete link more

Comments

Worked like a charm! Thank you so much!

NilleDaWize gravatar imageNilleDaWize ( 2019-07-02 01:40:03 -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

Stats

Asked: 2019-07-01 09:52:01 -0500

Seen: 73 times

Last updated: Jul 01