Energy sustainability of a cluster of buildings with the application of smart grids and decentralization of renewable energy sources

: The article deals with the current state of energy consumption and CO2 emissions in the urban area of building clusters. There are many requirements, such as those set by the EU (FIT 55, decarbonisation in 2050, full electromobility in 2035, or mandatory annual reductions in energy consumption and CO2 production) or societal requirements, such as stable energy supply and its optimisation while significantly reducing CO2 emissions. This inspired us to design an energy model of a building (EMB) with smart grid implementation in a decentralized sustainable energy system. Simulation model studies were carried out to show the possibility of their application in the process of fully satisfying energy needs in terms of reducing their environmental impact. A decentralized photovoltaic system (microgrid) connected to a distribution grid. The main objective is to propose an original methodology for the design of smart "Nearly Zero Energy Buildings" (NZEB) and a subsequent solution for energy sustainability. This has led us to use HOMER, PV*SOL, Monte Carlo and DesignBuilder software which were chosen from the range of options that were and are available. Subsequently, a synthesis of the selected software solutions was carried out and a new model - the "Energy Model of a Building" (EMB) - was proposed in the process of integration with the energy performance of buildings, as an original optimization basis for designing smart buildings and smart areas, and even cities. The proposed EMB has been verified and evaluated within the experiment.


Introduction
The effort to achieve ever greater energy savings, reduction of greenhouse gas emissions and in general the most friendly approach to the environment leads to the need for the future not to solve individual buildings and elements of the area as separate units, but to try to design the whole area or urban district in which these sub-elements will cooperate and interact with each other with maximum efficiency. This systemic approach makes it possible to significantly improve the behaviour of the whole area, which is also able to react very flexibly to the situations that arise in it, e.g. the current traffic situation, the air condition, power load capacity, power production, etc.
The way to apply this approach is the concept of an energy urban area and the concept of a Smart City, which combines the principles of efficient economic design of buildings and building equipment, operation management of technical equipment, and information sharing into one functional unit.
The main objective of this work is to propose an original methodology of energy model of buildings (EMB) for the design of smart, "near-zero energy buildings" (NZEB), and then to define a smart city/smart building concept based on the acceptance of a sustainable energy system for a cluster of buildings through the decentralization of renewable energy sources (RES) and smart grids. Furthermore, the basic architecture of the Smart Grid is proposed using a block diagram in the EMB structure and then a methodology for optimizing Smart Grids is proposed. Achieving the stated objective of our work means: 1. Meeting the requirements of the "Energy Performance of Buildings Directive" (EPBD 3) for the year 2030 compared to 1990 in the following criteria: a) Reduction of CO2 greenhouse gases by 40%; Following the ER Summit in December 2020, the EU-27 leaders agreed (increased) the target of 55% CO2 reduction by 2030. b) A 27% reduction in energy consumption c) The share of renewable energy sources should increase by 27%. Note: With the application of the current energy performance of buildings (EPB) solution through the methodology, see Figure 1, and with the implementation of the set programs at the level of government regulations of the Czech Republic but also of the EU, the requirements of EPBD 3 cannot be easily met. Based on the experiment carried out in the application of the new methodology of the Energy Model for Buildings (EMB) Figure 2, our proposal to meet the requirements of EPBD 3 is suitable, and it brings these requirements to their realistic solution. 2. The fulfilment of point 1 affects the application of "Smart Grids" in the automated building management system process in a significant way. Therefore, an EMB with smart microgrid integration was verified in the experiment; see Figure 2.
From a broader perspective on sustainable energy development of individual countries and regions, it can be stated that it is an important part of the overall concept of sustainable development [1,2]. Approaches and solutions that are closely related to sustainable energy development focus mainly on the intensive use of alternative energy sources, including renewable energy sources in the energy mix [3]. When it comes to improving energy efficiency, it is well presented in [4,5], including the reduction of greenhouse gas emissions and air pollutants see. [6,7].
The European Union has adopted a common foreign energy policy. It is the Energy Performance of Buildings Directive (EPBD 3). Over the next decade, efforts will be made to further reduce greenhouse gas emissions -in 2030 we should produce 40% less greenhouse gases compared to 1990. Buildings are responsible for 36% of all emissions in the Union. The challenge is to create a sustainable, competitive, secure and decarbonised energy system in Europe by 2050. The relevant 2009 Directive of the European Parliament and of the Council (EU) set mandatory and binding targets for the European strategy by the end of 2020, also known as '20-20-20', as follows: to achieve a 20% reduction in energy consumption by 2020, a 20% reduction in greenhouse gas emissions and a 20% increase in the use of renewables in Europe's total energy production compared to 1990. In addition, the 20-20-20 programme will continue until 2030 as follows: a) reduction of greenhouse gas emissions by 20% b) Energy consumption should be reduced by 27% c) The share of renewable energy sources should be increased by 27%.
The assumptions of this strategy are much more ambitious than those presented at the 2018 climate summit in Poland (Katowice) [8]. On the other hand, at the European Council summit held from 10th to 11th December 2020, EU-27 leaders agreed (increased) the target of CO2 reduction by 55% by 2030 [9]. The Czech Republic should reduce CO2 emissions by 2030 by 55% compared to 1990, i.e. from 199 million tonnes to 89.5 million tonnes. Just for comparison: in 2017, the Czech Republic produced 129 million tonnes of emissions. Reducing emissions means a major restructuring of the Czech economy, and this cannot be achieved without massive investments. Investments to reduce CO2 emissions by companies in the Czech Republic will be directed mainly to the energy and heating sector (35% of CO2 production), industry (28%), transport (14%), buildings (10%) and agriculture (7%). These ambitious assumptions for new climate and energy commitments focus primarily on the sustainable development of the energy sector. The ideal state of this sector is that energy should only be produced and consumed from clean energy sources (mainly renewable energy) [10,11,12]. Sustainable energy development of countries is therefore essential for the continued existence of the energy sector and cru-cial for the development of RES, the economy, the environment and society [13]. As far as the increase in CO2 concentration is concerned, it is primarily due to the burning of fossil fuels in buildings, industry and the power engineering industry. There is no doubt about the impact of mankind on the global climate, but it is not certain to what extent man alone is contributing to warming; it is estimated that 60% of the warming since 1850 is due to the burning of fossil fuels. This fact has led to the decision taken by the Czech Government to focus on nuclear power plants, renewable energy sources that contribute to a significant energy reduction in buildings, as well as in industry and transport, and a significant reduction in CO2. CO2 is the most important greenhouse gas, but methane and nitrous oxide are also other greenhouse gases that are not yet included in the emission permit system, although they also contribute significantly.
Governments around the world are supporting the development of sustainable and climate-friendly energy systems powered by wind, sun and water. In times of economic downturn, governments in industrialised countries are sticking to their environmental goals -in part because they increasingly recognise the economic potential of sustainable energy policies. This will be reflected especially in low electricity generation and therefore low infrastructure costs, as well as independence from imports. Moreover, governments can act with confidence, knowing that they have the support of their populations. Sustainability becomes a critical competitive factor in markets. Unsustainable forms of production are perceived as unethical and they are being rejected. If we want to assess the Czech Republic's energy platform in terms of sustainable energy development, we need to take into account parameters and especially quantifiable values or functions that can be justified mathematically or physically. It is much more difficult to assess the impact of political conditions on the formation and implementation of a sustainable development economy. Their influence is undoubtedly significant, but difficult to assess unambiguously. In order to objectively assess and evaluate the sustainable energy potential of the Czech Republic in order to achieve its effective and optimal significance, it is first necessary to select a group of indicators describing the energy sector in its most important areas. These areas are: power engineering, economics, and ecology. We are talking about the so-called 3E model: "Economy-Energy-Environment" [14,15]. On the other hand, since the human factor is an integral part of the concept of sustainable development, it was necessary to describe this area in the social (S) dimension, which corresponds to the 3E&S (Energy, Environment, Economy and Society) model. The use of these four dimensions is fully justified in terms of the sustainable development economy, as it covers all the major elements (economy + people + environment).
Since individual countries have their own specifics, it was necessary to compare the indicators characterising sustainable energy development in the Czech Republic with their economic and demographic potential. If we look at socio-economic development, the value of GDP is its most important indicator. On the other hand, the population factor is also important from the perspective of considering the development of a country. As research [16,17] shows, the size of the population can also affect the emission of greenhouse gases, and it is from the energy sector that the largest amount of them comes. Another important indicator of the energy intensity of GDP shows how efficient a country's society is in transforming primary energy resources into economic output. It is a ratio-type indicator. An increase in the GDP energy intensity indicator usually reflects outdated technology, economic decline or secondary energy exports. On the contrary, a decline in this indicator points to new technologies, innovation, growth in savings or economic recovery of a country. The GDP energy intensity indicator is a springboard for the development of other energy intensity indicators such as: applications of RES decentralisation and resource sequencing, energy accumulations, applications of electromobility, applications of automation and optimisation of urban energy centres, ABMS and applications of artificial intelligence in solving complex energy contexts. In the context of integrity or integration of sustainable energy at the building, area, or city level, the application of the Smart Grids concept as an innovative distribution network is indispensable. A Smart Grid can efficiently integrate the activities of all connected users -large generation sources, local generation sources (especially renewable energy sources and combined heat and power units) and consumers with the possibility to utilise their active role. The project also counts with the integration of new distribution network functions such as charging stations for electromobiles.
Our research and subsequent experimentation is based on the concept and structure of a smart building, which consists of four interconnected and coordinated platforms.  Table 3, the Design Builder simulation software was selected for this purpose.  Table 1, based on the use of a design quality management methodology based on the Six Sigma tool. 3 rd area: It focuses on optimizing the microgrid's energy sources. A microgrid is a small network of electricity users with a local energy source that is usually connected to a national central grid but is able to operate independently. Application of the "Homer" (Hybrid Optimization of Multiple Energy Resources) software. 4 th area: It focuses on the design of a photovoltaic power plant (PV) using the PV*SOL simulation program. It involves the design of PV panels in a given area, design of inverters, determination of the annual electricity consumption distribution of the given buildings and assessment of the need to install battery storage in the given locality. 5 th area: Monte Carlo simulation. This is a stochastic heuristic class of algorithms for simulating systems using pseudo-random numbers. The simulation results were produced using the Palisade @Risk 7.6 simulation program, which is a Microsoft Excel add-in application. Results such as arithmetic mean, minimums, maximums, and percentage quantiles are presented. 6 th area: As part of our EMB, we will build the infrastructure for electromobility, install automation and monitoring elements of the distribution network, and efficiently connect it to the grid with local RES power generation. 7 th area: Conclusion and evaluation of the research and experiment.
Benefits of the proposed EMB for the practice and its further development: a) The first factor, which we consider to be original, is the building of the system structure (system solution) of the EMB Figure 2; its process was built based on the analysis and synthesis of simulation models. The specific selection of simulation models suited to the given issue is presented in Table 3 with a dynamic framework so that they interact with each other, work together, and form the structure of the so-called EMB or cluster of buildings in a given urban area. The EMB design methodology and the project and methodological quality management of the project are based on the Six Sigma application. An important factor of a Six Sigma project is a process clearly structured and defined in its basic parameters such as scope, volume, clearly defined objective, structure and project leadership, organization, and management. A fundamental element of the quality improvement effort is the pursuit of incremental process improvement (e.g., in the form of Kaizen -change for the better) that is easily documented and measurable. By applying the EMB in the format of the EPB platform at the project level and then implementing it, we will not only meet the 20-20-20 programme by 2030, but we will significantly exceed the set values of this programme in terms of CO2 reduction, reduction of energy consumption, and increase of the share of RES. The specific values will be expressed in the final evaluation of the implemented project of the building cluster of our experiment. Note: Design and implementation companies can continuously implement policy requirements into this energy model through directives, decrees or laws of the Czech Republic (and also EU), including implementing documentation. b) The second factor is the adoption of the Smart Grid application within the EMB, which makes this contribution even more original, significantly supporting the pursued objective, i.e. reducing energy consumption and thus CO2. This EMB will then be verified by an experiment in a given urban planning area (Prague), with subsequent evaluation of the energy sustainability aspects, energy demand reduction values and significant CO2 emission reductions.  Table 1 show the methodological approach of the current (existing) EPB solution, and in the context of NZEB buildings it is the only legally binding term. In this model, we respect the Directive No. 2010/31/EU of the European Parliament and of the Council on the energy performance of buildings (revised), the so-called EPBD II (Energy Performance of Building Directive), subsequently respecting the 3rd Energy Performance of Buildings Directive under the designation 2018/844/EU (EPBD III). The practical aspect and implementation of this requirement are reflected in the decree, which gradually tightens the required value of the energy performance indicatorsnon-renewable primary energy Δep and the average heat transfer coefficient through the building envelope Uem, Table 2. The basic purpose of the newly (originally) proposed methodology is to achieve the maximum possible energy savings of a smart building with the required indoor environmental quality and minimized environmental impact. The subject of the environmental impact assessment of the concept is the compliance with Act No. 93/2004 Sb.   From a physical point of view, a building is a very complex system consisting of many elements that have links and special interactions with each other. A simulation model is an abstraction of a real building that allows certain influences to be taken into account, emphasises a high level of detail and analyses key performance indicators without measuring costly building characteristics. The building performance simulation, referred to as BPS the Czech Republic referred to as Energy Performance of a Building (EPB), is a replication of BP (Building Performance) aspects using a computer mathematical model developed based on basic physical principles and real engineering practice. The EPB simulation has different sub-domains: thermal simulation, lighting simulation, acoustic simulation, airflow simulation, etc. Most EPB simulations are based on the use of customised simulation software. The EPB simulation itself is a platform of a wider field of scientific computations. The aim of the simulation is to quantify aspects that are relevant to the design, construction, operation, and management of buildings [18]. Based on an analysis of a wide range of possible simulation tools available, the simulation tools listed in Table 3 were selected through synthesis and evaluation of the results obtained from the research. From these, the Design Builder simulation software [19] was then selected and emerged as the most suitable for our application. DesignBuilder is software for complex dynamic modelling of buildings, analysis, and environmental assessment. DesignBuilder has a user-friendly interface and can be used for building certification. Buildings are complex thermodynamic objects that contain constantly changing energy flows between different thermal zones inside and outside the building. Due to the complexity of the building model, computer modelling can analyse the effects of different ECMs (Energy Conservation Measures) and their complex interactions more efficiently, comprehensively, and accurately than any other available method. The main purpose of this software is to calculate the energy consumption of a building. The building model can be imported from other BIM programs. The key features of the software are: • Calculation of accurate data describing the behaviour of the building and the indoor environment; • Visualisation of any phase of the project; • Improvement of the design process and evaluation of options (important decision-making data is available when you need it); • Enables modelling for small and large projects (from single rooms to houses, blocks of flats and large office centres); • Enables to design environmentally friendly buildings; • Can be used to evaluate certain criteria for building certification in accordance with BREEAM (Building Research Establishment Environmental Assessment Method), LEED (Leadership in Energy and Environmental Design), and GreenStar (building certification methodology).

Materials and Methods
BREEAM is the world's leading sustainability assessment method for masterplanning of projects, infrastructure, and buildings. It recognises and reflects the value of better performing assets throughout the life cycle of the built environment, from new construction to operation and renovation. LEED certification, or its offshoots such as LEED EB:OM, was developed by the U.S. Green Building Council, or USGBC. It provides independent verification that a building or building complex has been designed and constructed using practices and strategies aimed at achieving high standards in the core areas of a healthy environment. This includes sustainable construction of buildings, houses, or districts, water conservation, energy efficiency, selection of appropriate materials, and indoor environmental quality.

Input Data
To perform the simulation, two main components of the building energy model need to be created/modified: • Building materials and components (walls, floors, ceilings, occupants and equipment). • Equipment components (HVAC equipment and other environmental control systems).
Input data include: value of heat transfer coefficient of structures and openings, solar equipment conductivity ratio, building occupancy. After the simulation it is possible to obtain building and block output of zone data (average temperatures, comfort conditions), internal gains, latent loads.

Simulation
The DesignBuilder software is based on the EnergyPlus simulation algorithm [20] for evaluating building conditions and operational scenarios. The calculation of temperature, velocity, and pressure distributions is performed using the CFD (Computational Fluid Dynamics) module.

Output Data
After modelling and calculations, the output data such as: heat loss, solar energy, room temperature, amount of energy needed for heating, ventilation, air conditioning, and lighting will be obtained.
After adjusting the display of the results, a comprehensive analysis and comparison of the energy performance of the building can be made. In the settings, it is possible to select which variables are included in the display of graphs, fuel decay, and comfort, in-cluding CO2 values. All of this information can be displayed as a graph, table, grid, or summary.

Use
Some typical uses of the output data are: • evaluation of façade options in terms of overheating, energy consumption, and shading parameters; evaluation of the optimal use of daylight; modelling of lighting control systems and determination of the level of savings in the relevant electricity; • calculation of temperature, velocity, and pressure distribution in the building/environment using the CFD (Computational Fluid Dynamics) module; • visualization of the master plan and shading; • thermal simulation in buildings ventilated by means of natural ventilation; • determination of heating and cooling capacity to include issues that will help design air conditioning.

EPB Design Methodology and EMB Design for Sustainable Energy
In designing a new methodology for designing smart NZEB buildings in the framework of sustainable energy and smart city concepts, we will start from the current model -see Figure 1. Finally, the "Design Quality Management Methodology based on Six Sigma" [21] will support the design of the new methodology. A fundamental element of the quality improvement effort is the effort to incrementally improve the processes (e.g. in the form of Kaizen 4 -change for the better), which is easily documented and measurable. Selecting the right project that fits measurable criteria (e.g., we should produce 40% less greenhouse gases in 2030 compared to 1990, etc.) with easily definable units of measurement [22] is also an integral condition for future success. We proceed by setting the (EMB) project design priorities according to a strictly defined methodology, based on the Six Sigma tool. Let´s ask ourselves the following questions: • Does the potential project have the character of recurring phenomena? • Are there appropriate metrics? If not, can metrics be established within an appropriate time period? • Are you able to manage, i.e., control the process? • Will the potential project improve customer satisfaction? • Is the potential project linked to at least one business metric (indicator)? • Will the potential project generate savings? • Does the potential project have a high probability of completion when applying the DMAIC method within six months of its start? (DMAIC stands for Define, Measure, Analyse, Improve, and Control. At each stage there are a number of useful methods and tools.  Can "success" criteria be established for this project?
If the answer to the above questions is "YES", the potential project should be considered suitable for implementation. The specific activities in the Six Sigma methodology projects can be summarised in the following points: • data collection, • obtaining information from the data by analysing it, • proposing solutions, • ensuring that the desired results are achieved.
The Six Sigma principle is presented in Table 4. Measure the current performance of the process to be improved. E.g. We will prepare an EPBC.
What are the causes?
Analysing E.g. Analysing software tools for RES application. The electricity consumption of buildings, transport, and parking is affected. Impact on CO2. It is necessary to address the issue of energy consumption on the platform of its impact on the charging process.
Analyse the process in order to identify the root causes of poor performance. E.g. The RES will be designed, as set out in Decree No 78/2013 Sb., i.e. it is a RES design without further context and links to the actual design system with the objective for the year 2030. The most appropriate method for optimization and design of the charging system is the MONTE CARLO method.

What can be done for this?
Improving Design of a new building energy model on the NZEB platform in the context of sustainable energy within the Smart City concept.
Improve the process by exploring and studying possible solutions to achieve a robust improved process.
The entire NZEB design and engineering process can be improved by exploring and studying possible solutions to achieve a robust improved process. Design a new methodology for designing EPB in the sustainable energy process within the Smart City (area) concept. This is to meet the key objective for 2030; see the description under the " Analysing" section. How to maintain the achieved condition?
Standardize the improved process so that it can be managed and continuously improved to maintain its performance. This process is about standardising an improved EPB process so that it can be managed and continuously improved to maintain its performance in terms of sustainable energy. Building automation systems must be used to ensure this.

Final Evaluation of the Six Sigma Principle and EMB Design
An essential impact of projects based on the Six Sigma principle is the area of cost savings [23]. The more an organization (design company, etc.) invests in the quality preparation of project documentation and subsequent supervision of compliance with its design, in good planning and operational interdisciplinary controls, the greater the savings of excess costs it can achieve. Therefore, it is nonsense to assume that project quality and its implementation is expensive, because it is the redesigns, corrections, additions and waiting for additional required information that are expensive.
Based on the evaluation of the Six Sigma principle, the analysis of simulation tools for EPB, Table 4, the reference and normative values of EPB, Table 1,2, the analysis of simulation tools for the selection of software suitable for the application of the choice and optimized design of RES and electromobility charging stations, Table 3, 5 and the implementation of the European Energy Performance of Buildings Directive (EPBD 3), including the decision of the European Council held on 10th -11th December 2020 with the goal of reducing CO2 by 55% by 2030 [24] and by integrating these areas using the system theory and system analysis, we design the EMB, Figure 2. From the definition of system theory it is clear that a system is a group or combination of interconnected, interdependent, or integrating elements, among which we distinguish their relations and thus they form a system structure or a set of virtual doubles (agents) defining a collective whole, i.e. EMB. Since the EMB is primarily concerned with the application of variously defined simulation models (elements), the complex of elements of this model is in a certain defined interaction, i.e. it has defined inputs and outputs, which affects the behaviour of this system, i.e. the EMB. The consequence will then be the fulfilment of the given requirements and needs of the building(s) with their smart behaviour. A smart grid establishes a two-way exchange of information and energy between producers and consumers. This is defined as the disjunction of the telecommunication network and the electricity distribution system, which allows managing the electricity distribution network in a smart way, which tries to minimize operational disturbances and deviations of the voltage from its nominal value. A smart grid also focuses on increasing the integration of renewable energy generators and tries to overcome the problems associated with distributed generation, allowing users to play a more active role in the grid management.
We are implementing the smart grid in two steps. • The first step is local control and monitoring of distributed generators. These are equipped with a local interface that guarantees minimal service, such as disconnecting the generators in case of high or low voltage. For the power source unit commitment, time-related consumption must be taken into account. All currently produced energy must be used according to the power source unit commitment op-timisation plan in the given area.This is distribution control in the form of dispatch management of distributed generators. • The second step concerns voltage control issues. Traditional voltage control systems are based on measuring the output current at transformers. The assumed loads are passive. The voltage is maximum at the beginning of the line and minimum at the end. The larger the load, the larger the load current, and thus if the load current is high, the voltage is low.
In the second step of voltage control, this approach is no longer acceptable in our case because distributed generators (RES) react sensitively and distort the voltage profile, which requires developing a more sophisticated approach based on a Distribution Management System (DMS). A DMS is typically based on a dispatch management and data acquisition system that identifies optimal values required for voltage control equipment in order to maintain busbar voltages near nominal values. A DMS is used in large networks outside cities with high wind energy infiltration. On the contrary, in the first step of the so-called dispatch management, control systems ensure reliable power supply where it is needed at any given time. Power system control and energy management are based on the demand for better information, reliability, and efficiency. Accurate information and effective monitoring are increasingly important for distribution network operators in today's demanding market situation full of deregulation.
A fundamental characteristic of a smart grid is the communication capability of the devices within the network. The combination of the power system and the communication system Figure 2, creates an interconnected network. For the characteristic way of operation of the electricity system, a clear definition of the required communication capabilities, which is its main objective, is essential. Communication is often somewhat of a problem of new methods of power system operation because of its limited reliability, latency, bandwidth and security [27]. The design of communication parameters is often a compromise between these parameters. Much work has been done on optimizing protocol parameters, but in general, improving these parameters leads to increased maintenance costs. The communication includes parts of the communication, component, and information layers from SGAM (CEN-CENELEC-ETSI 2012). An Open Systems Interconnection (OSI) conceptual model (International Organization for Standardization/International Electrotechnical Commission 1994) was developed to classify the communication functions of telecommunication or computer systems. It can be adapted to communication in the context of a power system, which is addressed in EMB Figure 2. The three main classifiers for power system communication consist of information flows through an intelligent interface, a service layer, and a technological implementation secured by an intelligent SCADA/EMS network. In Figure 2 the individual modules (coloured in light green) forming the basic architecture of the Smart Grid are implemented through a basic block diagram. It shows the Smart Grid architecture used by the power company for smart measuring for homes and business premises. The Smart Grid application in the EMB structure ensures its relevance and functionality through: • electric smart grids -independent control of the electricity supply depending on a reduction or increase in consumption, • smart meters installation -transmission of consumption information, • smart interface -timely combination of the use of electrical appliances and distribution of electricity according to the need, which significantly reduces energy costs A microgrid as part of a Municipal Energy Centre (MEC) is "a group of interconnected loads and distributed energy resources within clearly defined electricity limits, which operates as a single controllable and manageable entity in relation to the grid. A microgrid can be connected to and disconnected from the grid to enable its operation, both in the grid connected mode and in the isolated/autonomous mode." When it comes to sustainable energy, it is derived from natural resources that replenish themselves over time. It is sometimes called green energy because it is considered environmentally friendly and socially acceptable, and includes solar energy, wind energy, hydro energy, biomass energy and geothermal energy.
The electric grid of the future [28,29] will be characterized by the rapid integration of alternative forms of energy generation. This will require new optimization for energy sources that are distributed according to interconnection standards and operational limitations. The original grid was designed to handle this change. Stability, reliability, and the accompanying cost phenomena for renewable energy resources are critical in the development of technical and economic software. Renewable energy variants are designed to provide a smart grid for: 1. Remote use and storage of renewable energy resources (RES) output. 2. Improving the functionality of grid-connected systems of renewable energy sources (RES) by: a) facilitating reciprocity of energy from the system, b) redistributing/reallocating unused energy from grid-connected RES, c) facilitating the accumulation in the RES network of the energy generated by technologies for back-up accumulation at the customer's end, d) tracking the interactions for billing and study. 3. Improving the functionality of electric vehicles and plug-in hybrids. 4. Using car batteries as energy storage devices.
The feasibility of the microgrid as a self-sufficient system Figure 2, (modules marked in green), which is implemented in a project built based on EMB, will improve if it can generate enough power for the load for which it was designed (Prague 6 area, see ex-periment). Microgrid development is a customer-oriented project designed to enable the implementation of smart grid technologies and features for buildings and facilities. An integrated system development involves the implementation of smart grid equipment, devices, and software, as well as the installation and improvement of smart meter technologies in a community of owners of residential or non-residential premises to influence the distribution system. In most implementations, microgrid development involves equipping the infrastructure and installing the DER means in the identified system.

Smart Grid Optimization
The backbone of future smart grids is the ability of distributed entities such as software modules, remote processing units and ubiquitous sensor networks to acquire, process, and share data according to fixed time constraints and specified application fields. We use the SCADA system [30] for this purpose. In Figure 2, the SCADA system is implemented in the EMB system to carry out the RES smart microgrid management process.
The ubiquitous storage and processing of massive datasets is a very complicated issues (number of sensors in the network, amount of data of several quantities, data flow, etc.), which should be immediately processed by the selected smart grid optimization method. Metaheuristic algorithms can play an important role in solving these complex issues, because they can enable smart grid operators to represent and reveal the true semantics of the measured data, achieve a complete understanding of the related information, and assess the degree of confidentiality and reliability of the relevant content.
In the context of our solution, it is important to focus on the target function, which is the voltage deviation in the load busbars, which can be described as follows [31]: where NL is the number of load busbars and are the voltage and nominal voltage of the i-th busbar, respectively.
The control variables for optimization of the issues are: where are the required values of the generator voltage, T the conversion ratio of transformers in the branches QC je is the output reactive power the shunt compensators VAR and the number of transformers controlled, respectively.
The dependent variables are: where is a small power on the busbar, the voltage value of the i-th load busbar, is the voltage angle of the i-th busbar, and is the reactive power of the i-th generator.
The compliance limitations of this optimization problem are described by the power flow equations: where is the conductivity of the i-j branch, is the conductivity (imaginary part of admittance) of the i-j branch, are the generated active and reactive power and are the active and reactive power required at the i-th busbar and NB is the number of busbars.
The control variables must be limited in their operational area: To ensure that the network operates properly, the ranges of voltage on the busbars and the active power on each line must be limited within the appropriate operating ranges: The penalization method is typically adopted to describe these inequality limitations, while the inequality by limitations of voltage and reactive power could be illustrated by adding to the objective function (objective function) J as follows: where are two penalty coefficients, chosen arbitrarily, and are limit values calculated as follows [32]: As mentioned above, to restrict functions means to restrict the values of the objective function in selected areas of the range so that some values of this function are explicitly prohibited or penalized. If we view the searched space of possible solutions to the objective function as the "environment" of individuals in the population, then penalization has the effect of "making it uncomfortable" for individuals to reside in the penalized regions of the solution area. Let´s take a look at one general example of the many approaches to penalization [33].
where a is a constant that ensures that the objective function f b will gain only non-negative values. The a parameter is often set to high values, so that the optimization process is not affected. The s constant is further used to transform the functional, to an appropriate scale, and the bi exponent shapes the searched "hyperplane". When we ex-pect the range of the limitation ( ) to be low, then we use higher values of s and b. If the parameters are s=1 and b=1, then the penalization works reliably.
The issue of penalization and constraints is very often addressed in optimization. In many technical applications, as shown in smart grid optimization, the number of different limitations is relatively high and generally non-trivial. A very interesting advantage of penalization is that the space of possible solutions is continuous. Based on many experiments performed [33], it can be concluded that optimization using evolutionary algorithms is much more natural and, more importantly, more advantageous.

Unit Commitment
Unit Commitment (UC) is a scheduling function that is sometimes referred to as "pre-dispatch". In the overall generation resource management hierarchy [34], the UC function coordinates the scheduling of economic dispatch and maintenance and production over time. The UC schedule covers the range of power system operations hour by hour in making decisions over a one-day to one-week horizon.
Economic dispatch is a computational process where the total electricity generation supplied from the distribution network, including that from RES, is distributed to a load, in our case a cluster of buildings in the Prague -Bubeneč urban area, while minimizing a cost criterion [35] conditioned by loads and operational limitations. For each specified load condition, the output from each device (and each generation unit in the device) is calculated, which will minimize the total energy cost required to serve the loads in the system [36]. This process is transparent and targeted in terms of our goal of reducing energy consumption while reducing CO2 emissions. Traditionally, the economic dispatch problem is formulated as the optimization of costs as a quadratic objective function [37]: where Ng is the total power generated by all RESs; ND is the total power consumed; and Pzt is the total power loss in the system; xi (t) is the energy state of the i-th source at time t; Pgi is the output of the RES; PDi is the consumed output; Pg je is the rated power of the RES; where the Pg variable (function argument) is expressed as Pgi, i.e. the output of the i-th resource at time t and xi (t) is the energy state of the i-th source at time t; the basic cost function relation (18) , ≤ ≤ , , P (gi, min) is the minimum power of the RES; P(gi, max) is the maximum power of the RES; V is the voltage of the RES; Umin is the minimum voltage of the RES; and Umax is the maximum voltage of the RES.
Constraints include equalities and inequalities that represent limits of power, as well as of the generator, busbar, voltage, and flow in the line. This can be solved using analytical mathematical programming such as nonlinear programming (NLP), quadratic programming (QP), linear programming (LP), Newton's method, interior-point methods (IPM), and decision-making support methods such as e.g. analytical hierarchical programming (AHP). Alternative solution methods, such as evolutionary programming (EP) [35], genetic algorithms (GA) [38], tabu search [39], neural networks [40], particle swarm optimization [41,42], and adaptive dynamic programming (ADP), are proposed to improve the performance of the economic dispatch algorithm.
To formulate UC, it is necessary to apply the first limitation that needs to be satisfied, i.e. that the net generation must be greater than or equal to the total system demand and the required system reserve [43]: Should the units maintain a given amount of reserve, the upper limits must be modified accordingly. Thus: where is the payroll cost [CZK], is the cost of starting the reduced boiler and t is time in seconds.
Other limitations include uncertainty and some of the security or vulnerability indicators and overload margins used in the UC system formulation for smart grids. Lagrangian relaxation is one of the classical techniques used for the UC problem where the limitations are based on stochastic variables and a predictive approach is considered. The stochastic optimization method is useful for solving our problem because its randomness is a good approach to solve it, but its predictability is not as good as ADP [44,45]. ADP can handle discrete systems that use computational techniques and IPM as features of more advanced techniques that were able to handle stochastic and dynamic features.

Microgrid of Renewable Energy Sources
For a building (renovation) project in the selected Prague 6 urban area, which addresses the EPB according to the requirements resulting from the NZEB definition, it was necessary to find a software that can optimize the composition of energy components in the given locality based on certain data, such as electrical load. For this purpose, an analysis of the simulation tools was developed; see Table 5. This work focuses on the Homer Pro program developed by Homer Energy, which is one of the main programs for this particular optimization. Homer Pro is one of the products of the American company Homer Energy. The name Homer stands for Hybrid Optimization of Multiple Energy Resources [46]. Thus, Homer Pro focuses on the optimization of microgrid energy resources. A microgrid is a small network of electricity users with a local energy source that is usually connected to a national central grid but is able to operate independently, see Figure 3.
A microgrid is essentially a local island network that can operate as a stand-alone or networked system. It is implemented in our RES case and it contains dedicated inverters and interconnections that allow its connection to the existing network. The special purpose filters overcome harmonic problems while improving power quality and efficiency [47].  [48] Homer Pro has a primarily economical and partially engineered solution for microgrids [48]. The core of the program is a simulation model developed by Homer Energy that incorporates all the components the user wishes to consider and it simulates microgrid operation throughout the year. The simulation time step can range from one minute to one hour. The program further optimizes the microgrid design to determine which components are appropriate and which are not appropriate for a given area, thereby finding the option that appears to be the least costly. For its calculations, the program uses a price per unit of energy, so it can evaluate an option where the initial cost will be higher but which will be more advantageous over time.

PV*SOL Simulation
The design of the photovoltaic power plant was solved in our experiment using the PV*SOL simulation program. The program was used to design PV panels, inverters, determine the distribution of annual electricity consumption of the buildings and assess the need to install battery storage and charging stations for electric vehicles in the area. The program offers the possibility to choose the local system with regard to the use of the PV plant (building consumption, battery system, electric vehicles, and island system).

Monte Carlo Simulation, Design of Charging Stations in the Car Park
Electric vehicles, hereafter referred to as EVs, are vehicles that use electrical energy stored in a built-in battery as fuel. The range of an EV depends mainly on the capacity of the battery. Since the automotive industry is intensively involved in the development of electric vehicles and limits the development and production of gasoline and diesel vehicles, we address the issue of charging these vehicles here.
The Monte Carlo simulation method [49] was used to determine the electricity requirement for EV charging. It is a stochastic heuristic class of algorithms used to simulate systems using pseudo-random numbers. The idea of this method is to try to determine the mean value of the quantity using a random sequence of events. Once the computer model has been built and a sufficient number of simulations have been run, it is possible to apply common statistical methods such as arithmetic mean, minimums, maximums, and percentage quantiles to the results obtained. Monte Carlo methods are numerical methods of solving mathematical problems by modelling random variables and statistically estimating their characteristics. The method is based on conducting random experiments with the system model and evaluating them. The result of performing a large number of experiments is usually the probability of a certain phenomenon. The advantage is its simple implementation; the disadvantage is its relatively low accuracy = , where N is the number of random experiments (simulations, simulation steps, histoy) and B is a constant, expressing the nature of a particular example. Therefore, to increase the accuracy of the result by one order of magnitude, the number of simulations must be increased by at least two orders of magnitude. In other words, the accuracy of the Monte Carlo method is directly proportional to the number of iterations performed. Assuming that the random process is repeated n times, the accuracy of the result will be equal to 1/√n. Therefore, if we want to obtain a result one decimal place more accurate, it is necessary to perform 100 times the number of iterations. The Monte Carlo simulation results presented in this study were generated using the Palisade @Risk 7.6 simulation program, a Microsoft Excel add-in application. The simulations were run with 1,000,000 iterations, so the results are accurate to 3 valid digits.

Methods
Achieving the desired energy savings and CO2 emission reduction values in our experiment is due to the project based on the application of the newly designed EMB including the implementation of Smart Grid in this model, Figure 2.
Another measure in achieving energy savings and reduced CO2 emissions is the solution of control of frequency and active powers within the framework of achieving power balance, which is an obvious and currently fully acceptable process. Furthermore, the achievement of power balance of the power system can be very positively influenced by the application of unit commitment especially of RESs as proposed in our experiment.

Frequency and Active Power Control within Power Balance
Maintaining the power balance, i.e. the balance between consumption and production of electricity, is always the responsibility of the company providing the energy transmission system. In order to achieve the balance, operational electricity backups are provided on the one hand, and regulatory instruments are used on the other. The transmission system operator (TSO) is committed to ensuring the quality and reliability of electricity supply in the transmission system (TS). This means maintaining the frequency and voltage in the TS at the values defined by the TS Code and guaranteeing continuity of the supply at the points of consumption. The basic prerequisite for the aforementioned conditions is to maintain a balance between production and consumption, i.e. to secure the missing power when consumption exceeds production or to reduce production or secure consumption when the opposite is the case. TSOs must therefore have a certain amount of standby control power available, which they must reserve on the basis of contracts with individual providers, i.e. electricity producers. Services reserved in this way are called ancillary services (AS). The individual ancillary services are: primary frequency control of the unit, secondary power control of the unit, operating reserve for t minutes (t=5, 15, 30 minutes), power reduction, secondary voltage and reactive power control, island operation capability, and black-start capability.
For power balancing services the flexibility of power plants, heating plants, and the consumption side are currently used, i. e. increasing or decreasing their production or consumption on instruction from the dispatching centre. The TSO has been testing for some time the possibility of extending the power services market by other actors such as smaller sources, battery systems or smaller consumers. The role of the TSO's dispatching centre is to compensate for momentary deviations between production and consumption. Every few seconds (4 seconds in the Czech Republic), the deviation of the active power transmitted to neighbouring systems from the planned value is measured and, after the correction for the deviation of the network frequency, this deviation enters the central f and P controller. The output of this controller is the desired power values of the units providing the auxiliary service of the secondary P control.
Maintaining the power balance in real time is a matter of physical and technical aspects with the responsibility of the TSO as a system service. In an interconnected ES, the power balance is given by the following equation (see e.g. [50]): ∑ the sum of active outputs supplied by the generators ∑ the sum of the ES active load, including the plants' own consumption and user consumption ∑ total losses in grids Every time this balance (27) is disturbed, the frequency and voltage of the network changes. This change will continue until the power balance is restored [51]. The power balance in the system is valid only for certain values of frequency and voltage in the system. When they change, the power produced (consumed) changes. This also applies vice versa, when the power supplied or the load in the system changes, the frequency and voltage change. It should be noted that equation (27) is valid at the level of the whole interconnected system. The two sums in equation (27) also change due to [51]: random load fluctuations Figure 4; trend changes related to the shape of the daily load diagram (Section 2.5.2); unit outages; unregulatable supply (e.g. from wind farms); changes in supply at trading hour breaks. The control of f and P has a hierarchical character. The basic level is the primary control implemented at the power unit level. This is followed by secondary control of f and P. For the primary frequency control the following applies ∑ the total active power supplied by the generators of the control area, ∑ the sum of the active load of the control area, including the plants' own consumption and user consumption ∑ total losses in the control area, the planned balance of transmitted power of the control area (positive ∆P_1 for exports and negative ∆ for import), dP balance deviation. If the power of the control area is small compared to the power of the whole interconnected ES, then dP≅∆P is approximately true. The power exchanges (import/export) must be maintained at the planned agreed value of [27] which is mainly the task of the secondary control of f and P.
When it comes to secondary frequency and power control, the secondary control of f and P is automatically provided by the secondary controller of frequency and transmitted powers, including ACE. The ACE (Area Control Error) is calculated as follows: ∆P -the deviation of transmitted power from the planned value -the difference between the instantaneous sum of the measured power flows at the border between the transmission and distribution systems and the planned balance of P (in this sense, they correspond to positive values for imports, in contrast to the PPLAN value in equation (28)).
K -set parameter of the controller (the so-called K-factor), which should theoretically be equal to the power number of the control area and which is determined similarly to the total primary control reserve in proportion to the amount of electricity produced annually).
The caused power imbalance, manifested by the frequency change and the deviation of the transmitted power, is compensated only by the control (where the power imbalance occurred) and at the same time the controller of the unaffected area does not regulate the power deviation caused by the primary frequency f control. We can see this by simple consideration. If we substitute the summary change in turbine power according to (28) for ∆P in equation (29), taking into account the sign convention -positive for imports (we neglect the load control effect for simplicity). Then we get: Or, when the power number = ∑ and the K-factor are equal, the Area Control Error (ACE) is zero. When restoring the power balance, the secondary control of f and P follows the primary frequency control so as to gradually replace the power that has been provided on the principle of solidarity in the interconnected system, and the operation of the secondary control of f and P should restore the specified values of frequency and transmitted power within 15 minutes from the time of power imbalance occurrence. The secondary control of f and P is followed by tertiary power control, which is used to replace the exhausted secondary control reserve, i.e. the power used in the secondary control activity. For tertiary control, the spinning reserve on the units providing the support service of tertiary control of P is used.

Application of Simulation Models in EPB Solutions
The given programs were applied for modelling and subsequent simulation of the urban area of M.J. Lermontova and Ve Struhách streets in Prague -Bubeneč. The modelling and simulation were carried out on six blocks of flats, marked A, B, C, D, E, F, see Figure 5. The given blocks were modelled in two variants before reconstruction (without insulation; heat source: gas boilers, conventional ventilation and insulated hot water pipes) and after the reconstruction (with insulation; heat source: gas boilers, photovoltaic plant, LED lighting and insulated hot water pipes).

Design Builder -Climatic Data
We will choose the locality and orientation of the building. Then, we will learn the outdoor temperature in that locality Figure 6, the wind speed Figure 7 and the direct and diffuse radiation Figure 8. All these inputs affect energy consumption.

. CO2 Production
Based on the simulation, the annual CO2 production was determined for the objects solved in the urban area. The reduction of CO2 production was achieved by insulating the buildings and adding a photovoltaic plant to the existing source (to the gas boilers) as part of the RES microgrid. Figures 9 and 10 and Table 6 and 7 show its behaviour and the reduction in CO2 production for the condition prior to the reconstruction and subsequently after the reconstruction. For the condition after the reconstruction, the table is divided into two parts, namely the CO2 production only with insulation and without a PV plant and the CO2 production with both insulation and a PV plant. Thanks to these parameters used, the buildings will be close to the group of buildings with nearly zero energy consumption. Figure 9. CO2 production of block A before reconstruction in winter for a week Figure 10. CO2 production of block A after reconstruction in winter (weekly section) Table 6. CO2 before reconstruction

Heat Demand for Heating
A big item that will affect energy performance is the heat demand for heating. Reducing the heat demand for the urban area in question is achieved by selecting building structures with the required heat transfer coefficient values, and it is the heat transfer coefficient that is one of the indicators that assesses whether a building is a NZEB. The values of the specified heat transfer coefficients are given in Table 8. The values of the required heat transfer coefficients according to the legislation are given in Table 2. The reduction is also affected by gains from people, lighting, technology and solar gains. Heat demand trends and values are recorded in Figure 11 and 12 and Table 9 and 10. Figure 11. Heat balance of block A before the reconstruction in winter (weekly section) 7 PV denotes a photovoltaic power plant

Energy Consumption
The DB software was used to simulate individual consumption for the whole year, which is another indicator of whether it is an NZEB. The simulated energy consumption included consumption of electricity, heating, and hot water. The values and sample behaviour are shown in Figure 13 and 14 and Table 11 and 12.

Primary Energy
The last indicator is primary energy consumption per year. The resulting values for each block are recorded in Table 14 and 15. They are then compared to the primary energy requirement. The comparison is made in Table 16 and 17. For the houses in question (all building blocks in the above mentioned urban area), natural gas (heating and hot water) and electricity are used as energy carriers. For these energy carriers, we have used the conversion factor values according to Table 13.  The following Tables 16, 17 and Table 1 show a comparison of primary energy consumption and coverage from renewable energy sources with the required values. * the values for the required primary energy per year and the values for the required coverage from RES per year are given in Table 1 3.2. Monte Carlo -Electromobility There are five parking zones in the given urban area marked P1, P2, P3, P4, P5, see Figure 5. In Table 18, it is indicated for how many parking spaces parking zones are designed. The design of charging stations is based on the fact that there are 1 charging station per 10 parking spaces. From this it is already clear how many charging stations fall on each zone, see Table 19.   As a prerequisite for the simulation of consumptions of the charging stations, we will determine how the charging stations will be used. In our case, each charging station will be occupied by 1 car during night hours (20:00-6:00), mainly by the inhabitants of the residential buildings, and during the day (6:00-20:00) at least 2 cars will take turns at each charging station. This will simulate the consumption of the charging stations. We will use the Monte Carlo simulation method. The theoretical consumption of the charging stations is determined by setting the demand equal to the total number of fully discharged batteries in the vehicles multiplied by the frequency of car visits during the day, see Table 20.  The graph in Figure 15 shows the electricity consumption that the electric vehicle (EV) parking lot will need for the entire day, i.e., day and night-time hours of operation. The graph shows that the in 90% of the cases, the car park will need between 164.2kWh and 193.5kWh of electricity in total to charge all the cars. The highest consumption in the simulation was 218.35kWh and the lowest was 147.138kWh. 10 EVs were generated for each individual simulation.

PV*SOL -Photovoltaics
In the given urban area, photovoltaic power plants FV1, FV2, FV3, FV4, FV5, and FV6 are installed on the roof structures of individual blocks A, B, C, D, E, and F. The electricity generated from the plants is used to cover part of the household consumption, charge electric vehicles, be stored in batteries (from which energy is drawn at times when it is not available from the sun) and, last but not least, the excess energy is sold to a distributor. Figure 16 shows the power generation for the day 21.9.2021. An overview of the energy flow from the power plants is also shown in Figure 17 and Table 21.  Figure 3. It optimises the microgrid design to determine which components are suitable and which are not suitable for the area from a financial point of view. Other elements include, for example, emissions measurement. We are also interested in the characteristics of the electrical load, the PV system on the rooftops of the cluster of buildings, the battery storage, and the connection to the 22/04 kV distribution network. The database contains model loads for different types of buildings in the given climate region. Subsequently, a window appears with a summary of the details of the load in kWh per day, see. Figure 18. We entered January as the month with the highest load. Homer assumes a variable electrical load. For our area, we selected the Residential profile. We first ran the simulation with the basic components and then modified the model. First we added a connection to the central national grid, see Figure 19. Next, we selected the renewable source we want to consider, i.e. solar panels. We adjusted the price to $/kW, which corresponds to the area of powerful solar panels that could supply most of the area. Then we included a 100kW Li-Ion battery, which is relatively more expensive but of higher quality. Again, the cost is in dollars per kW/hour.

Simulation Results
The results section has two parts. The first one contains analytical scenarios, the second one contains optimization results. The second section contains the optimized re-sults of the microgrid scheme. Next, it contains power generatione. The program has optimized the grid only for PV and central grid connection, so we can see only these two components in the graph. The columns show the data by months. We can see that the renewable energy produced is over 68% of the total energy supplied, Figure 20.  In the next section, we can see how much energy we bought from the central grid and when. We can see that the energy bought from the grid inversely replicates the electricity production of the solar panel. In the Table 22 embedded in the graph, we can see that the energy bought, the energy sold, the difference and the price in each of the months are shown here Figure 22. The last tab shows the emission measurements listed in Table 23. The reduction of CO2 emissions should be at least 40% by 2030 according to EPBD3, but the requirement has been increased according to the decision of the ER Summit in December 2020 to a reduction of 55% by 2030. Table 24 and 25 present the simulation output of the DesignBuilder (DB) software. From these tables, the values that express the compliance or non-compliance with the EPBD3 and the ER/2020 summit requirements are evident. That is also the result of our experiment, which confirms the correctness of the application of the new EMB methodology. Table 26 shows the evaluation of CO2 production before and after the urban area reconstruction with the installation of charging stations, based on the DB and Monte Carlo simulations.  Table 27., which also assesses the status of meeting these regulations. The results confirm the correctness of the new NZEB design methodology assuming the application of the new EMB.

. Synthesis of Simulation Model
Studies of simulation models were carried out to show the possibility of their application in the process of fully meeting energy needs in terms of reducing their environmental impacts and addressing energy sustainability. Table 3 presents an overview of the synthesis of the simulation models, used for the optimal design of EPB and subsequently for the design of NZEB. The most effective simulation tool, DesignBuilder, was selected.
Furthermore, the starting point for the optimized solution of the RES design at the building cluster level is presented in Table 5. The HOMER software was selected by synthesis based on the analysis of the available tools. Monte Carlo software was selected to solve the energy dependence of the charging stations on the total energy consumption of the area in order to optimize the energy consumption and control the charging system. This demonstrably proved that the average simulated consumption was reduced by 65.03% compared to the classic solution.

Share of Renewable Energy Sources
The requirement to increase the share of RES under EPBD3 by 2030 is set at 27%. The evaluation of our experiment is presented in Table 28. From this Table 28 it is clear that according to the EMB application, increasing the share of RES in the creation of NZEB is achievable.  Table 22 shows the simulated electricity consumption required for charging the electric cars owned by the inhabitants of the urban area marked in our experiemnt, Figure 5. Using the MC simulation, we define the average simulated electricity consumption for charging to be 160 848 kWh. Table 26 evaluates the CO2 production before and after the reconstruction of the urban area with the installation of charging stations, using the DB and Monte Carlo simulations. When we include the simulated consumption in the total electricity consumption of the urban area we address, the CO2 production does not meet the EPBD3 requirements. By applying a smart microgrid in EMB Figure 2 in the process of controlling the electricity consumption in the area, including the control of the charging stations by the KNX/FOXTROT control system, we achieve a consumption that meets the 55% requirement in the CO2 production evaluation process.
We can refer to the study of the "Central Association of the Electrical and Electronic Industry" (ZVEI -the main German trade association:Zentralverband Elektrotechnikund Elektronikindustrie e. V.) We can refer to: the study of the "Central Association of the Electrical and Electronic Industry" (ZVEI -the main German trade association: Zentralverband Elektrotechnik-und Elektronikindustrie e. V.) from 2018, which states the following research conclusion for the application of KNX: " The use of modern electrical installation systems and the application of KNX brings significant potential in reducing energy consumption." Overall, the average energy savings when implementing measures to optimise the control of technology in buildings range from 11 to 31 %. If the average CO2 reduction in a given area is 45.6%, then with the application of the KNX system (FOXTROT) we achieve a minimum CO2 reduction of 55.6%. Then the EPBD3 requirement is met. In this case, we present a simplified block diagram of the control of the charging stations using the FOXTROT/KNX system and a smart microgrid, Figure 23. Figure 24 shows the connection to the electricity meter outputs at the charging stations using the FOXTROT control unit, which receives information from SCADA, which again responds to the output from the HOMER simulation according to the planned charging control system.  Garlík] In addition to the application of the smart grid (RES microgrid) in the management process of the charging station system, as shown in Figure 24, smart grids also enable the consistent implementation of energy savings in households. By installing continuous metering electricity meters it will be possible to control the switching on and off times of appliances, but the control will be linked to new commercial products -which can maximise savings in relation to the current market price of electricity. As the share of decentralised sources grows, we can expect to see much greater price differentiation between the low and high tariffs we have seen to date. It is also expected that the fixed switching times of household HDO appliances will be abolished, thus making this control more efficient.

CO2 Reduction Using the HOMER Software
When designing a smart microgrid, the HOMER software evaluates the emission measurements shown in Table 23. From this, we conclude that by designing a microgrid integrated in the EMB application process, we achieve a reduction of CO2 emissions to 1.462 kg/yr.
If we start from an estimate of the amount of CO2 (in kg) emitted to the atmosphere due to electricity production, based on the energy mix at national level, the emission factor is assumed to be equal to 283.6 g CO2/kWh. In our case we save 51 kWh/year.

Application of Monte Carlo Simulations in the CO2 Estimation Process
Once the simulations of the different data input sets were performed, each of them was used. The simulations result in equations (e.g., total emissions=emission factor*activity data) to determine the final result. The Monte Carlo software used to run the simulations is able to automatically include these simulations in the equation.
The Monte Carlo simulation models the estimation of total emissions More precisely, in this step the software inserts each random value produced by the Monte Carlo simulations into the model of interest. For example, an estimate of total greenhouse gas emissions is calculated for each round of simulations, as shown in Table 29. The first simulation of the emission factor is multiplied by the first simulation of activity data to identify one simulation of total emissions; the second simulation of emissions (as a factor) is multiplied by the second simulation to identify another simulation of total emissions. These calculations continue for each round of simulation until the tens of thousands of simulations have been run. The final distribution of total emissions represents the calculation of all the different simulation runs.
In some cases, there may be correlations between different variables and therefore between the resulting distribution values. In these cases, software should be selected that integrates this correlation between variables into the analysis should be selected. XLSTAT provides this capability

PV*SOL Simulations
The program offers the possibility to select the local system with regard to the use of the PV plant (building consumption, battery system, electric vehicles, island system). The PV plant and battery storage system with own building consumption is best suited for the site, as the electricity demand for EV charging will be solved by a different simulation method.
Considering the nature of the use of all the buildings in the urban area, Figure 5, we consider that of the total annual electricity consumption without EV, Table 26, 80% will be used with a load profile of residential buildings, 10% will be office space, and 10% restaurants and shops. There are only three building types in the tables: mixed residential and office and commercial. The simulation results in a total annual electricity production by PV panels for Block A of 102,378 kWh per year. The Senkey diagram in Figure  15 shows that 22 331kWh of the energy produced will be used for own consumption of the buildings, i.e. 21.8%. Given the fact that the overflows to the grid will use 18 428 kWh which is only 17.9%, 29 521 kWh will be used for charging electric vehicles, which is 28.8%, and 32,099 kWh will be used for charging backup batteries, which is 31.3% of the energy produced. 36 999 kWh per year will then be received from the grid. The study includes blocks A, B, C, D, E, and F ....Due to the large amount of data, the report presents results only for block A. The evaluation of the optimization of the PV power generation was carried out using the PV*SOL simulation. The result meets the requirements and it is suitable for the EMB model, which will serve as a basis for the development of the NZEB project documentation. 4.1.9 Smart network in the EMB system Chapter 2.1.4 emphasizes the basic characteristics of the smart grid, which plays an important role in the EMB system. Figure 2 shows the basic structure of a smart grid, which was confirmed in the experiment as irreplaceable in the EMB system. The Smart Grid application in the EMB structure ensures its significance and functionality through:  Smart grids independently regulate electricity supply depending on reduced or increased consumption. The basic representative of this aspect is the implementtation of the unit commitment (UC) of the RES microgrid.  Installation of smart meters to transmit consumption information.
 Intelligent interface in a timely manner to combine the use of electrical appliances and distribute electricity as needed, which significantly reduces energy costs. The issue and solution of UC is proposed, and its verification was carried out in an experiment, which will be the content of another article in the journal ENERGIES subsequently. In this study, the goal was to implement a smart grid into the proposed EMB. In this way we have fulfilled the goal of our work. .