Ask Your Question
1

How to add a extra digit on the bus numbers

asked 2015-02-11 00:24:54 -0600

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.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2015-02-11 02:36:22 -0600

Transmission Impossible gravatar image

updated 2015-02-12 01:31:52 -0600

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!

edit flag offensive delete link more

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: 2015-02-11 00:24:54 -0600

Seen: 646 times

Last updated: Feb 12 '15