Does EnergyPlus uses optimization to charge thermal storage during off-peak hours and discharge during peak? If not how can this be implemented for cost minimization? 1. I am using reference DOE commercial building with thermal storage to see the impact w.r.t building without storage. I also want to control the charging and discharging based on the peak and off-peak power price. Any suggestions how to implement this. 2. How do I get the total peak energy use and off-peak energy use for building conditioning from the simulation?