Ask Your Question

Revision history [back]

I'd use the Subsystem Data Retrieval and Subsystem Definition APIs. Use these to create a subsystem of buses based on a filter, and then retrieve attributes like Voltage and Angle.

# filter all area 3, 500kV buses and put into subsystem 1.
psspy.bsys(
  sid=1,
  usekv=1,             # filter based on Base kV
  basekv=[500,500],    # select buses with base voltage 500kV
  numarea=1,
  areas=[3],           # only buses in area 3
)

# now get the bus numbers for buses in subsystem 1.
ierr, target_buses = psspy.abusint(
  sid=1,
  flag=1,              # only in service buses.
  string=["NUMBER", "TYPE"]    # request bus numbers and types.
)

There is a lot more you can do with subsystem data retrieval functions (like abusint). Look at Chapter 8 of the PSSE Application Program Interface (API) manual.