Closed-loop Energy Management