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

Ask Your Question
0

loop only through EXISTING buses

asked Apr 11 '0

Ascegan gravatar image

I want to evaluate each bus in the case for mismatch. Instead of looping through 0 - 999999, is there a way to identify only bus numbers that are actually in use in the case? Otherwise I'm operating (getting error flag) on bus numbers that don't exist.

2 answers

Sort by » oldest newest most voted
0

answered Apr 12 '0

jconto gravatar image

Search the forum for 'buses' for similar comments or check "How can I find all 500kV buses in an area?" for a code example on selecting buses. Below is code that uses the caspy module to get a list of buses existing in a base case:

import psse33
import caspy

case = caspy.Savecase(r"""savnw.sav""")
for item in case.pssbus.num:
    print item
link

Comments

Thanks, I found the "500kV buses" solution, it creates a subsystem first then outputs the bus quantities into a list, I added the feature below or organize the bus quantities into tuples: sortlist = list(zip(*target_buses)) One flaw : even setting abusint flag =2 won't pick up bus types 4,5,6,7.

Ascegan gravatar imageAscegan (Apr 18 '0)
0

answered Apr 15 '0

perolofl gravatar image

As jconto wrote, there are several examples on how to loop all buses. Here is an example using psspy:

ierr, buses = psspy.abusint(-1, 2, ['NUMBER'])
for ibus in buses[0]:
    print ibus
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

1 follower

Stats

Asked: Apr 11 '0

Seen: 988 times

Last updated: Apr 15 '20