Simulation of cogeneration within the concept of smart energy networks