The urbanization process is constantly increasing worldwide. Today over 50 % of the population resides in urban areas and this value is expected to grow up to 68 % by 2050. In this scenario, the development of district scale energy grids and management systems has become crucial to optimize energy use and to balance energy flows within the cities, encouraging the use of renewable sources and self-consumption. This study focusses on a district under development in the city of Milan, involving an urban area of about 920 000 m2, which, once completed, will count for about 4 500 apartments, a school and a few other commercial uses. The existing energy systems consist of an electric grid, including a small photovoltaic field, a district heating ...