A Multi-Period Optimization Model for Energy Planning with CO2 Emission Consideration