Cogeneration systems have potential limitations: Because the heat recycled in these systems is a function of mechanical load (electricity), mismatch between power and heat consumption can lead to energy loss and reduced efficiency. On the other hand, partial loading of the engine or turbine reduces its mechanical efficiency and exergy of the exhaust gas. Therefore, meeting a specific consumer demand, requires optimization of the system in order to maximize the efficiency of the entire energy system of the city as well as a system management model. The performance of the cogeneration system in cities is limited for several reasons. For example, restrictions on the release of air pollutants and noise pollution may allow equipment to be installed in the suburbs instead of city centers, or to use smaller, more limited-capacity equipment. Similarly, the lack of space (land for installation of equipment) creates constraints in areas where the population and building texture is dense. Such restrictions may lead to the use of smaller power plants and equipment, which are less efficient than large equipment and require more initial investment (cost relative to MW output). In this paper, the effect of such constraints on the urban energy system is quantitatively investigated and the optimal model for the sample city is presented.