bustypes

bustypes(bus, gen)

bustypes() - Builds index lists for each type of bus (REF, PV, PQ).

[REF, PV, PQ] = BUSTYPES(BUS, GEN)
Generators with "out-of-service" status are treated as PQ buses with
zero generation (regardless of Pg/Qg values in gen). Expects BUS and
GEN have been converted to use internal consecutive bus numbering.