Closed loop reactive power control for use in energy management systems