Simulation of a Cogeneration System in Developing the Concept of Smart Energy Networks