I was coding the AC-OPF problem for the 9Bus network in Pyomo. Here is the main body of the code:
model.BusNO = 9 model.BusNumber = pyo.RangeSet(1,9) model.BusPQ