First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
There isn't a simple way as far as I know with the PSSE API. But here is how I do that currently:
set
of all in service busesisland
to switch islanded buses out of serviceset
of all in service busesThe difference between step 3 and step 1 is the islanded buses.
ierr, (buses,) = psspy.abusint(
-1, # all buses in the case
flag=1, # in service buses
string=["NUMBER"])
original = set(buses)
psspy.island()
ierr, (buses,) = psspy.abusint(-1, flag=1, string=["NUMBER"])
afterisland = set(buses)
print original - afterisland
you could put all of that into a function called islanded_buses
. Unfortunately this is a destructive action, in that it actually changes the state of your base case. Those islanded buses are no longer in service - which may not have been what you wanted.