Optimization for Energy System