Energy models and optimisation framework: phase 2

Summary
Energy models and optimisation framework phase 2