## 2 Materials and Methods  
Modeling energy consumption and production in a building is a major part or basis for developing possible future scenarios. Over the past decades, several modeling methods have been developed that assume certain simplifications. Top-down models enable the determination of energy consumption in the building, and bottom-up models enable more detailed calculations of energy flows in the building [26; 27]. Dynamic modeling is an important approach when it is possible to simulate the behavior of a building during the day or in selected time periods [28; 29]. In this study, part of Zilina City in Slovakia was selected as an example of the creation of an energy-self-sufficient community. For selected city districts, a survey was performed, where the actual condition of every house was examined [30] as the next step was to process the calculation of heat demand for selected houses. The standards valid in Slovakia are in accordance with [31] and define the calculation procedure and marginal conditions for calculating energy consumption in the building. The community includes 63 houses that form a separate neighborhood of the city. The time of construction of houses is roughly from the mid-1970s until today, while the construction of new houses, or the reconstruction of existing ones, is still ongoing. Some houses have undergone renovation; they have been insulated, and windows and doors have been replaced; some of the houses are in their original condition from the time of construction. The use of RES is on a small scale, and some houses use solar thermal collectors to heat water, a few buildings use photovoltaic panels to produce electricity. From the point of view of the future use of solar energy, the houses differ mainly in orientation and type of roof. The three-dimensional model of one reference house is shown in Figure 1, and the total summary of the parameters for the houses is shown in Table 1.  
The next step was determining the energy class for selected houses. The reference building method [28] with houses of average dimensions was used for the determination. For this study, 3 reference buildings were simulated. One of them, house no. 1, is shown in Figure 2, and the dimensions of these houses are in Table 2. House no. 3 belongs to energy class A, and house no. 2 belongs to class C. Other variations of houses were created by changing the structures of house no. 1. Different insolation thicknesses allowed the creation of a house from classes D and B. Natural gas was considered the main fuel for heating for all houses. \begin{table}
\begin{tabular}{l c} \hline \hline
**Houses** & **Count** \\ \hline Total amount & 63 \\ \hline Original condition or only partial reconstruction & 29 \\ \hline Overall renovated and new houses & 34 \\ \hline Using solar energy & 7 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Houses in the selected district. Figure 1: Model of the selected city district. With this assumption, the whole variety of houses from different energy classes was simulated. For the simulation of heat demand, a monthly calculation method was used as described in valid Slovak technical standard [31]. The calculation maintained methodology described in [32], which is based on the building thermal envelope method. The specific heat loss H is determined using the sum of the specific heat loss by heat transfer H\({}_{\text{T}}\) and the specific heat loss by ventilation H\({}_{\text{V}}\).