Learning and Control for Energy Systems under Uncertainty