code: def _get_pgen_var(self, generators, base_mva):
          
          Pg = array([g.p / base_mva for g in generators])
  
          Pmin = array([g.p_min / base_mva for g in generators])
          Pmax = array([g.p_max / base_mva for g in generators])
  
          return Variable("Pg", len(generators), Pg, Pmin, Pmax)
docs: Returns the generator active power set-point variable.