0

loop only through EXISTING buses

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.

Ascegan's avatar
11
Ascegan
asked 2020-04-11 18:20:04 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

0

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
perolofl's avatar
3.8k
perolofl
answered 2020-04-15 04:51:17 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

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
jconto's avatar
2.9k
jconto
answered 2020-04-12 09:43:41 -0500
edit flag offensive 0 remove flag delete 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's avatar Ascegan (2020-04-17 19:39:04 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer