Modeling of Energy Systems