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

Ask Your Question
0

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

asked Jul 1 '19

NilleDaWize gravatar image

updated Jul 1 '19

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.

1 answer

Sort by » oldest newest most voted
0

answered Jul 1 '19

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.

link

Comments

Worked like a charm! Thank you so much!

NilleDaWize gravatar imageNilleDaWize (Jul 2 '19)

This piece of code only includes the to-bus neighbourhood and not includes from-bus nerghbourhood. Are there any way to solve that?

zejia01 gravatar imagezejia01 (Aug 8 '3)

What do you mean with "from-bus neighborhood"?

perolofl gravatar imageperolofl (Aug 9 '3)

I mean this code cannot find all buses which are connected to a specific bus. According to the defination of NXTBRN, if the specific bus A and its neighbor bus B is connected by a branch where bus A is the to bus and bus B is the from bus. NXTBRN cannot find bus B by using command NXTBRN(A).

zejia01 gravatar imagezejia01 (Aug 9 '3)

Have you tested the code? It returns all branches connected to ibus. INIBRN is called with argument single=2, which will return all branches.

perolofl gravatar imageperolofl (Aug 16 '3)

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

Stats

Asked: Jul 1 '19

Seen: 1,624 times

Last updated: Jul 01 '19