###### Abstract  
Buildings are known to be responsible for about a third of energy consumption in developed countries. This situation, together with the fact that the existing building stock is being renovated at a very slow pace, makes it crucial to focus on the energy retrofitting of buildings as the only way to reduce their contribution to these energy consumptions and the consequences derived from them in terms of pollution and climate change. The same level of insulation and the same type of windows is usually proposed for all dwellings in a building block. This article shows that since the improvements required by each dwelling in the same block are different, the proposed solution must also be different. The methodology is proposed for a practical case consisting of an apartment block in Cadiz, a demonstration building of the European RECO2 ST project. To achieve the optimum solution for each case, a multi-objective optimization problem is solved: to minimize the annual heating demand of the building and the standard deviation of the annual demand of the different dwellings. Thanks to the use of the proposed methodology, it is possible to bring the building to a Nearly Zero Energy Building (NZEB) level, while avoiding excessive insulation that causes overheating in summer. retrofitting; energy efficiency of buildings; thermal inertia +
Footnote †: journal: Applied Sciences  
article  
[color=gray!20, linecolor=gray! Energy Statistics (KWES) report produced by the International Energy Agency (IEA) [5]. According to the KWES, 27.1% of the total electricity consumption in 2016 was due to the residential sector and 22.2% to commercial and public services. Energy consumption in buildings mainly results from the need for lighting, heating and/or cooling, ventilation, and others. All of this, in turn, depends on the type of building, its use, the thermal quality of its exterior envelope, the state of conservation of the building and its facilities, not to mention the climate of the area in which it is located [6]. Many studies have analyzed the causes of the energy consumption of buildings, their findings included climatic reasons, building envelope, building facilities, user behavior, etc. [PERSON] and [PERSON] [7] presented a global vision of energy consumption in buildings in Europe that relates to the aforementioned data. In the case of residential buildings in particular, latitude and therefore the local climate are determining factors of heating and cooling consumption, and for this reason, special emphasis has been placed on the study of how the urban microclimate affects the energy consumption for the conditioning of buildings. With this objective, [PERSON] et al. [8,9] proposed a method based on the concept of climatic severity. The energy demand in residential buildings for lighting, on the other hand, represents only a small part of the total consumption; other uses, such as household appliances and especially the production of domestic hot water require more energy. According to the study of the energy consumption of households in Spain by the SECH-SPAHOUSEC Project [10], this consumption depends fundamentally on the climate (varying from 0.719 toe/year on the Mediterranean coast to 1087 toe/year inland) and on the type of housing: single-family or apartment blocks (varies from 0.649 toe/year for apartments to 1334 toe/year for single-family homes). According to the analysis performed by [PERSON] et al. [11] on the state of the art of Nearly Zero Energy Building (NZEB) technologies, they can be summarized in three categories: passive energy-saving technologies, energy-efficient building service systems, and renewable energy production technologies. To the first category belong the measures that entail a reduction in the need to consume energy in buildings, such as increasing the insulation of roofs and facade walls. The second category includes measures aimed at improving the efficiency of energy consuming equipment in buildings. And finally, renewable energy facilities belong to the third category.