Ask Your Question
1

Get buses numbers when calling tree function

asked 2012-12-14 03:40:15 -0500

zeeegis gravatar image

updated 2012-12-14 03:45:23 -0500

When i call psspy function tree it returns how many buses are in current islands. I also want those buses numbers. How can i do that?

Only solution i can find is to redirect progress output to file and parse those numbers from it.

So is there any more simple way to do this using psspy API.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
2

answered 2012-12-15 17:57:51 -0500

JervisW gravatar image

There isn't a simple way as far as I know with the PSSE API. But here is how I do that currently:

  1. create a set of all in service buses
  2. call island to switch islanded buses out of service
  3. create a set of all in service buses

The 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.

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: 2012-12-14 03:40:15 -0500

Seen: 2,240 times

Last updated: Dec 15 '12