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

Ask Your Question
1

How to add a extra digit on the bus numbers

asked Feb 11 '15

anonymous user

Anonymous

How easy would it be to create a python script to simply add a sixth number to all bus bars in a given network? For example we have “bus 101” and I would like to have “Bus 100101” but ensuring we have all branches, Transformers, load generators being updated as well. What will the code be, and is there an existing script for it.

1 answer

Sort by » oldest newest most voted
1

answered Feb 11 '15

Transmission Impossible gravatar image

updated Feb 12 '15

You can use BUS_NUMBER. Check section 2.8 in the API-document. I'm pretty sure the following should do the trick:

ierr, iarray = abusint(-1, 2, 'NUMBER')  # Get bus numbers
                                         # -1 is to use a subsystem with all buses
                                         # 2 is to include all buses, not only in-service buses

for x in range(0,len(iarray)):
    ierr = psspy.bus_number(iarray[x],100000+iarray[x])  # Change bus numbers
                                         # iarray[x] is the current bus number
                                         # 100000+iarray[x] is the new bus number

PSS/E should automagically change the bus numbers for all other equipment.

Hope this helped!

link

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: Feb 11 '15

Seen: 660 times

Last updated: Feb 12 '15