Optimising Energy Systems in Smart Urban Areas

In this chapter, the urban structure will be defined with zero or almost zero energy consumption, followed by pollution parameters. Energy systems are designed as networks of energy-intensive local hubs with multiple sources of hybrid energies, where different energy flows are collected on the same busbar and can be accumulated, delivered, or transformed as needed into the intelligent urban area. For analysis of the purpose function of our energy system, a micro-network of renewable energy sources (RES) is defined by penalization and limitations. By using fuzzy logic, a set of permissible solutions of this purpose function is accepted, and the type of daily electricity consumption diagrams is defined when applying cluster analysis. A self-organising neural network and then a Kohonen network were used. The experiment is to justify the application of new procedures of mathematical and informatics-oriented methods and optimisation procedures, with an outlined methodology for the design of smart areas and buildings with near zero to zero energy power consumption.


Introduction
Efforts to increase energy savings (electricity, heat, water, gas and fuels), reductions of greenhouse gases and the most environmentally friendly approaches lead to the need not only to deal with buildings and elements within the territory as separate entities in the future, but also to try with maximum effectiveness to design the whole area or city region in which these sub-elements, which will interact and communicate with each other. With this approach, it is possible to considerably improve the behaviour of the whole territory, which is also able to react flexibly to situations in the area, for example, current traffic or air conditions. The way to apply this approach is the concept of smart cities [25], which combines various principles of efficient object design, operations management, especially with significant energy savings and sharing of information into one functional unit. Given the current absence of any method of approach to the creation of smart cities on a global scale, our work aims to outline the basic approaches in individual parts of intelligent city design, that is, urban areas and descriptions of the possible variants of the solution of sub-elements of the area. The aim of the contents of this chapter will be to illustrate the methodology of this issue.
The principles of a smart city can be divided into several areas of human activity: • Political (city management level) • Social (city population level) • Technological (business level) Due to the comprehensiveness of the concept of smart cities, this chapter will focus on technological areas such as buildings, energy and media, individual and public transport, public space technologies and information, and from these areas, we will be more interested in saving electricity.
The exact and unambiguous definition of the smart area or smart cities has not yet been established on a global scale, but in general it can be said that in order to be considered as smart, all elements and objects contained in that territory must be designed as smart.
So, it does not concern just the building itself but also energy and media supply systems, water supply, waste management, management of all kinds of transport, public lighting and IOT. Instrumentation of the urban system means that the operation of this system can produce data based on key performance indicators, basically making the system a measurable tool and an intelligent metre.
Instrumentation appears to be appropriate to provide urban networks with efficient use of resources, transport and energy services and other public services. Intelligence refers to the ability to use the information gathered to model behavioural patterns and thus to develop predictive models of probable outcomes, allowing for better decision-making and erudite functions. Pilot testing on our experimental intelligent urban area "Rohansky ostrov" (Rohan Island, Prague 8 district) provides information on how to consume electricity more efficiently (we can also focus on water consumption, consumption of heat, natural gas and oil). In our imaginary intelligent area, Figure 1 shows intelligent instrumentation is widely observed. Intelligent/smart devices and wireless metres transmit information through broadband networks and provide intelligence that citizens and city organisations can put into practice, thus ensuring its optimisation [29].
For example, in our intelligent Rohan Island area, 250 users can test their energy management system and gain insight into the energy consumption of their appliances, allowing for energy consumption monitoring and remote switching on and switching off appliances. In the intelligent area of the Rohan Island, 500 houses will be equipped with smart energy metres displaying energy consumption. Other energy savings have been or are recommended to be discussed in brainstorming sessions. In our Rohan Island project, 500 households will be equipped with smart metres with displays, and personal energy-saving targets will be determined for each household. The goal is to save at least 14% of energy and reduce CO 2 emissions by the same amount. The tallest building in our fictitious smart office area is testing which smart building technology will be best suited to make office buildings more sustainable and more environmentally friendly. Information obtained through smart connections and understanding based on data analysis will be used to provide more effective solutions. In our Rohan Island area-a shopping precinct with many cafes and restaurants and 40 small businesses-solutions for a more sustainable environment will be tested, such as electric vehicle use logistics, energy-saving light bulbs for night light, garbage containers with solar power, smart metres and displays for energy consumption and incentives and benefits from energy savings. A Prague future smart city has recently experimented with crowdsourcing (mass idea exchange of members), that is, it is practically a collaboration since the very beginning of the project, with open innovations, in order to involve its citizens in finding better solutions for public spaces and mobility. Ambitious targets have been set: to reduce CO 2 emissions by 40% and energy consumption by 20% with the implementation of smart zero energy or near zero energy areas by 2025.
In this chapter, we will try to combine the structure of our city-the imaginary intelligent area of Rohan Island-with energy consumption and consequently the pollution parameters. For our experiment, the energy set was chosen as a network composed of energy centers (22/0.4 kV transformer station) with multiple hybrid energy sources where different energy flows are collected on the same busbar and can be accumulated, delivered or transformed as needed. Individual energy centres interact with each other. It is complicated to describe and define it in a comprehensible manner at the municipal level (since it would go beyond the scope of the problem that is dealt with in this chapter). Similarly, it also concerns a challenging generation of new operational models based on existing critical urban infrastructures. Critical infrastructure consists of elements or systems of elements (buildings, equipment, resources or public infrastructure) and their operators. Disruption of this function would have a serious impact on the state's security, ensuring the basic living needs of the population, the health of the people or the economy of the state. This is the reason why this issue will be discussed here in terms of assessing the impact on unexpected situations associated with the safety and quality of energy.
The transmission and distribution systems of electricity, natural gas, potable water supply, road and rail transport, communication and information systems and others play an important role in crisis management at the level of cities, urban areas, municipalities and municipalities with extended powers. Therefore, our solution is also focused on specific specifications of the technical and operational values of intelligent information transmission and intelligent networks at the level of the extent of the impact of disruption of their functions. The activities of thermal, electrical and portable infrastructures are considered as qualification characteristics of the energy centre, but they are not taken into account. The experimental part in our case shows that the analysis and optimised layout of the energy system serves one urban district-the urban area (Rohan Island). The associated optimised parametric layout of energy generation infrastructures is a feature of the property of the urban area. An extra vulnerability is due to domino and cascading effects, excessive system complexity and lack of backup. The aim is to protect the information systems (IS) for critical infrastructure (CI), including emergency communication preparedness and protection of materials and equipment which support the IS. For this purpose, a European Programme for Critical Infrastructure Protection (EPCIP) has been set up, and a Critical Infrastructure Warning Information Network (CIWIN) has been built. The European Union is currently planning to increase the protection of Critical Information Infrastructure (CII) in order to ensure the proper functioning of critical infrastructure. The term CII refers to telecommunications, computer systems (including software), the Internet, transmission networks and so on. Nowadays, an especially important component is the Internet, due to its considerable expansion. In our case, the optimisation of energy will be to find solutions for the technical equipment of buildings, such as the internal distribution of engineering and telecommunication networks, starting with the connection to the public distribution of these networks at the level of RES micro-networks. The basic types of energy used in the Czech Republic to produce electricity include thermal, nuclear, solar (sunlight), water and wind.
Many European countries are aiming for a significant reduction in CO 2 emissions by 2050 as well as a reduction in the demand for energy per capita. The European Commission is looking for cost-effective ways to direct Europe's economy towards more climate-friendly and cost-efficient methods. This low-carbon emission economy strategy gives the European Union an incentive to reduce emissions by up to 80% by 2050 compared to levels in 1990. To achieve this, 40% of emissions should be reduced by 2030 and 60% by 2040. All sectors must contribute, and the transition must be appropriate and acceptable; particularly generation and distribution of energy, as well as transport and buildings, are among the main sectors for implementing CO 2 reduction. There are also three main pillars on which the structure of urban energy systems is based [1,2,30]. The energy sector has the greatest potential to limit emissions. It can almost completely eliminate CO 2 emissions by 2050. Electricity could actually partially replace fossil fuels in transport and heating. In addition, electricity can be produced with zero emissions using wind, solar, water and biomass energy or other low-emission sources, such as nuclear power plants or fossil-fuelled power plants equipped with carbon capture and storage technologies. This will, however, require high investment in smart grids and micro-network technology [3,4]. In the short term, the greatest progress can be found for petrol and diesel engines that could be produced with highly improved fuel utilisation and thus more and more efficient. In the longer term, the engagement of hybrid and electric cars will result in a sharp reduction in emissions.
Regarding the European Union strategy planning, emissions from residential and commercial buildings can almost entirely be reduced by approximately 90% by 2050. Energy efficiency will be drastically increased by: Electricity begins to play a key role in the smart urban energy system. In all existing top examples, the concept of a smart city [6] (or urban area) is based on a recurring cyclical economy and shared resources. Urban energy systems can be seen as a set of energy centres [5], defined as "entities", which uptake energy at entrance ports connected to RES micro-network locations and electricity distribution, and natural gas infrastructures provide certain required energy services, such as electricity, heating, cooling, etc. on the output ports. Inside the centre, energy is transformed and conditioned using, for example, combined energy and heat technology (CHP/FC) transformers, information and communication technology (ICT), compressors, heat exchangers and other equipment. Realistic facilities that can be considered as energy centres include industrial enterprises, larger buildings (hospitals and shopping centres), urban areas and isolated energy systems (trains, trams, etc.). In many cases, other forms of energy to urban areas and vice versa are converted using electricity; thus other forms of energy are generated by electrical energy. From this point of view, the energy system will soon host most energy sources and can be considered a centre of interest for further consideration and in-depth studies.

Assessment of risks on equipment is expressed in two steps
A relationship (1) for the calculation of risk is defined. This relationship reflects the basic reference variables for the risk calculation, which are the likelihood and severity of the impact of an extraordinary event. In addition, a member taking into account the existing security measures is also included against the classic risk statement. These variables are a function of partial relationships for the calculation of vulnerability, hazards and implemented measures [7]: where R is the level of risk, P is the probability of occurrence of an extraordinary event, D is the severity of the impact of an emergency, Zp is the level of vulnerability of the rated equipment that affects the likelihood of an extraordinary event, Np represents the level of threat assessment affecting the probability of occurrence of an emergency, Z D is the level of vulnerability of the rated equipment that affects the severity of the impact of an emergency, N D is the level of threat assessment affecting the severity of the impact of an emergency and B is the level of security measures.
In the second step, partial relationships are established to calculate the vulnerability, hazards and workability. The resulting variables of these relationships are a function of the criteria defined in the previous paragraph. These are the following five relationships: • Rating of the vulnerability level of the equipment affecting the likelihood of an emergency occurrence: • Rating of the vulnerability of the equipment affecting the severity of the impact of an emergency: • Rating the level hazard of threat affecting the likelihood of an emergency occurrence: • Rating the hazard level of the threat affecting the severity of the impact of an emergency: • Level of security measures: A weighted arithmetic mean will be used to calculate the individual functions to ensure that all evaluated criteria are adequately represented. At the same time, it should be noted that the criteria related to the assessment of the security level measures include only the newly envisaged security measures. Measures that have already been implemented are reflected in the reduced vulnerability of the facility or reduced likelihood of damage.

Determining the level of risk
The final step of the critical risk analysis is to define the reference values for determining the resulting level of risk. According to the relationship (1), the level of risk is determined by three variables, namely, the probability of occurrence of an extraordinary event (P), the severity of the impact of an emergency (D) and the level of new security measures (B). Based on this, a 3D model based on the linear shift of the standard risk matrix (P Â D) depends on the level of anticipated safety measures (B5 = max., B1 = minimum measures). Using a five-step index scale, all variables reach maximum values of 5 (this ensures the use of arithmetic mean). The resulting risk levels using the five-step index scale are presented in the 3D risk matrix.

Criteria for assessing the level of vulnerability of the facility
Accessibility (KZ P )-the ease with which an asset may be affected, whether natural or anthropogenic. Criteria index value: 1-5.
Security (KZ FROM )-represents the level of current asset security. Criteria index value: 1-5.
Criticality (KZ TO )-the relevance to the system, subsystem or whole component. The objective is critical if its destruction or damage has a significant impact on the performance of the entire system, subsystem, entity or component. Criteria index value: 1-5.
Renewability (KZ O )-estimates the time needed to replace, repair or bridge the damaged or destroyed asset. Criteria index value: 1-5.
Recognisability (KZ R )-the time horizon from the origin and identification of the fault after finding its cause. Criteria index value: 1-5.

Criteria related to threat assessment
Terms of use (KN PP )-a set of external factors (such as daytime, climatic conditions and skills) that create favourable or unfavourable conditions for a natural or anthropogenic threat. Criteria index value: 1-5.
Activability (KN A )-the time horizon of activation of the threat; the longer this horizon is, the less dangerous threat becomes, because there is more time to prepare security measures. Criteria index value: 1-5.
Exposure (KN E )-the time horizon of exposure to an asset; the longer this horizon is, the more threatening the threat becomes. Criteria index value: 1-5.
Potential (KN P )-the magnitude of the threat's effect (strength, robustness and yield) is considered by the potential range of impact on the asset. Criteria index value: 1-5.

Criteria relating to the assessment of the level of security measures
Efficiency (KB U )-the ability of security measures to minimise the impact of the threat and its impact on the asset. Criteria index value: 1-5.
Feasibility (KB R )-the availability and usability of technological measures to minimise the threat. Criteria index value: 1-5.
Financial difficulty (KB F )-the availability of financial resources to implement security measures. Criteria index value: 1-5.
Duration (KB C )-the time required to implement security measures. Criteria index value: 1-5.

Municipal energy centres and micro-networks
Within this range, the urban energy centre microcosm is one of the most important infrastructures, which is defined as "A group of interconnected loads and distributed energy sources within clearly defined power limits that act as one controllable and manageable entity over the network. The microprocessor can be connected to and disconnected from the network to allow it to operate in both the network connection mode and the Isolated/Autonomous mode". In the CIGRE definition (French: Conseil International des Grands Réseaux Électriques), energy resources are a means of generating and storing resources (heat, etc.). The CIGRE is a leading worldwide community dedicated to the world's knowledge development programme for creating and sharing expertise in energy systems.
In our research, we focused on the goal of understanding the differences between micro-networks and intelligent networks. A microsystem is basically a local island network that can function as a stand-alone or network-connected system. It is powered by gas turbines or renewable energy sources and includes dedicated converters and interconnections to connect to an existing network. Specialpurpose filters overcome harmonic problems while increasing the quality and efficiency of electrical power. In short, we are thinking of building a micro-network as a local power provider with limited advanced management tools where the smart grid is a broadband provider with sophisticated capabilities to support automated decision-making. When implementing buildings with zero or almost zero energy consumption, the co-operation of the micro-network of RES with the intelligent network within the 22 kV distribution system takes place. An example of our microsystem that is subjected to our experiment is shown in Figure 2.
Micro-networks are the superior physical infrastructure unit that the city's energy centre operates on. If this serves the municipal energy centre [3,4], then the following issues need to be considered for micro-network activity: • Independence of urban infrastructures (mobile electricity infrastructure, gas infrastructure, water systems, waste recycling, wastewater treatment) • Restricted RES penetration, which cannot be considered significant in cities where micro-networks exist (as they are known and defined) It can be said that the first issues are that infrastructure and urban systems are viewed as individual [7], that is, transport, sewage and water supply, which are usually highly interactive and interdependent ( Figure 3).

Unit commitment renewable energy sources and distribution network
In order to ensure the security and reliability of the power supply from RES and the network, electrical resources must be planned and effectively controlled. The large distribution network consists of many elements including generators, transmission lines, transformers and circuit breakers. New RES green energy sources are co-opted or integrated into a distribution system or smart grid system including other DC/DC converters and DC/AC converters and must then be scheduled for microsystem operation. In addition, market structure and real-time energy pricing need to be assessed. For stable operation of the micro-network, it will be necessary to plan electricity generation and supply it to the system load for every second of the intelligent area operation-Rohan Island (Prague 8, Czech Republic) (see Figure 1). Energy sources for large energy systems consist of water, nuclear energy, fossil fuels, renewable energy sources such as solar energy (photovoltaic systems) as well as green energy such as fuel cells, biomass and combined heat and power (CHP  or also known as cogeneration). These resources must be managed and synchronised to meet the load demand of the microprocessor.
The load requirement of the RES and electricity grids is cyclical and has a peak daily demand for hours and minutes of the week, that is, weekly peak demand for each month and monthly peak demand for the year. Figures 4 and 5 show the course of electricity demand in our intelligent area on Mondays and Thursdays.
The energy resources must be optimised to meet the peak demand of each load cycle, so that the total cost of generating and distributing electricity is minimised. The power system operator must plan the power sources of the grid and equipment to meet the different load conditions. Systemic load has a general mathematical formulation. This load gradually increases during the day and then decreases during the night. The cost of the generated power of individual RES sources is not the same for all sources. Therefore, there is a higher effort to produce more energy at the least cost in units. In addition, several network lines connect one electrical network to another neighbouring power grid. These are called interconnections between networks. When exporting power from one power system to an adjacent power supply system through a connecting line, balanced power is considered a load; and conversely, when such power is imported, it is considered energy production. Flow control through these network distributions is  preprogrammed (software) based on safe operation and economic indicators. In order to control the energy flow through the connection lines within the transmission at a given frequency of the system, the concept of the control error is introduced (area control error, A CE ) and is defined as [10].
and P 2 is the planned power between two power nets; P 1 is the actual power output between two network nets; f Ref is the reference frequency, that is, the nominal frequency; f mer is the actual measured frequency of the system; and β is frequency distortion.
The AGC software (automatic generation control) is designed to achieve the following activities ( Figure 6): • Compensation of the surface energy load of the given area, that is, distribution of nodes, links and load schedule, thus controlling the system frequency Δf • Distribution of changing loads between generators minimising operating costs The above conditions are subject to additional limitations that may be introduced in network security considerations, such as loss of power in the line or in the generator.
The first objective is to solve the additional controller and the distortion concept. Parameter β is defined as frequency distortion and is the so-called debug factor that is set when implementing AGC. In the case of a small change in load on the microsystem in the intelligent area, it leads to proportional changes in the system frequency.
For this reason, a bug in a controlled area A CE ¼ ΔP n À βΔf provides each space with information on load changes and controls an additional smart zone controller to control the turbine control valves. In order to achieve reasonable regulation (i.e. A CE reduced to zero), system load requirements are sampled every few seconds.
The second objective is to fill energy consumption in the prescribed sample at each minute and to allocate the varying load between the different units to minimise operating costs. This assumes that the load demand remains constant over each period. Figure 7 shows the AGC block diagram. The AGC also manages the connected micro-networks in a large interconnected power grid. The microgrid concept assumes the grouping of loads in the area within various micro-projects, such as photovoltaics, biomass and combined CHP, acting as a single control network. For the local grid, this cluster becomes the only discernible burden. When the micro-network is connected to the grid, microprocessing voltage is controlled by the local grid. In addition, the frequency of the electrical network is controlled by the operator of the electrical network. The microgrid cannot change the voltage of the bus network and the frequency of the power supply. Therefore, if the microwave network is connected to the local grid, it becomes part of the network and is subject to network failures. The AGC control system is designed to monitor system load fluctuations.

Economic delivery
The economic supply is expressed in a mathematical process where the required electricity production from the grid including the RES within the micro-network of the intelligent region, Rohan Island, is divided between individual energy sources within the operating RES micro-networks, and thus by minimising defined cost criteria [4], it is subject to both load and operating constraints or penalties.
For each specified load over time (see Figures 4 and 5) the power of each RES power plant, including electricity from the distribution grid (i.e. each production unit within the power plant), is calculated to minimise the total cost of fuel required to operate the system load [3]. The problem of economic supply is traditionally formulated as an optimisation with quadratic cost objective functions [11,24]: where N g is the total output produced from all RES, N D is the total power consumed, P zt is the total power loss in the system, x i t ð Þ is the energy state of the IT sources over time t (see functions (10), P gi is the power output of the RES, P Di is the power consumed, P gi, min is the minimum power of the RES source, P gi, max is the maximum power of the RES source, P g is the rated power of the RES source, V is the voltage of the RES source, V min is the minimum voltage of the source of RES and V max is the maximum voltage of the RES source.
If independent variable P g (function argument) P gi , that is, power of the IT resources in time t and x i t ð Þ, is the energy state of the IT source over time t, we get the basic relationship of the cost function: Based on the above-defined variables, constants, mathematical approximations and mathematical structures (8) and (10), we construct two variations of the cost functions of our energy system-the physical model of the intelligent cities' energy system ( Figure 2). Support is also available [8].
For the sake of our experiment, we will be based on defined cost functions (12) over the entire integrated period (24 hours/day). We will separately allocate the operation and sorting of RES costs. Then we mark the cost function as F, the number of RES in the network is denoted as N G , the scheduled RES mode (24 hours) will be labelled as t ∈ 1; 2; …; T f g , the resource index is marked as i ∈ 1; 2; …; N g È É , the number of time moments in the given period when RES is depicted as T, the power of the IT source at time t, we denote P gi t ð Þ, the functional cost of the cost function f is expressed as an algebraic shape C i P gi þ B i P 2 gi x i t ð Þ, the cost of running one of the RES is algebraic γ i x i t ð Þ • 1 À x i t À 1 ð Þ ð Þ , the start-up cost (to commence the operation of RES) in relation (12), is also expressed by the relation D i 1 À e Àαt ð Þ• x i t ð Þ; α ¼ À ΔT i τ i t ð Þ, the cost coefficients in relation (11) and (12), are C i , B i , A i , D i , respectively. ΔT i t ð Þ and τ i the relevent cost coefficients, or the downtime and time constant of exponential increas in the start-up costs of the i-th source at time t.
the operating costs of RES producing the output will be expressed in an algebraic relationship ð Þ is the energy state of the IT source over time t and x 1 ; x 2 ; …; x n ð Þ , are vector components (independently variable cost functions). Where N g is the number of resources in the network and T the number of times or slices are considered during the day (24 hours).
We break down the cost (purpose) function (12) and express the operating costs of the RES-generating power P g ¼ C • P gi þ B • P 2 gi CZK ½ : This relationship is written without expressing the cost. This relationship simplifies the algorithm (12) because the generators (RES) are always in an on state x i t ð Þ ¼ 1: The individual variables (cost items) mean C is cost-dependent on the power output (e.g. the amount of fuel depending on the higher output), [CZK/MW], for example, C i • P i ¼ CZK ½ , and B are costs that are dependent on the second output of power (e.g. joule heating losses are greater with a larger current passing through the conductor). Joule heat is then Q ¼ RI 2 t [J]. Further, heat is lost in iron and friction CZK=MW 2 Â Ã a P G is the power output [MW].
Restrictive conditions include balances and imbalances according to energy algorithms, as well as generator, bus, voltage and current flow limitations. This is solved through analytical programming, such as nonlinear programming (NLP), quadratic programming (QP) and linear programming (LP), Newton's method, inner point method (IPM) and decision support such as the analytic hierarchy process (AHP). We use alternative methods such as evolutionary programming (EP) [12], genetic algorithms (GA) [13], taboo searching [14], neural networks [15], optimisation of particle flocks [16,17], the stochastic optimisation algorithm simulated annealing (SA) [18,29] and adaptive dynamic programming (ADP) which are passive learning methods to improve the performance of the economic delivery algorithm.

Resource assignment (unit commitment)
Resource deployment, or operational planning function, is sometimes referred to as "pre-delivery". In the overall RES resource management hierarchy [11], resource deployment is coordinated with the planning of economic supply and maintenance and production over time. Scheduling resource deployment covers the scope of the decision on the hourly operation of the power system with a horizon of 1 day-1 week.
Resource planning covers the hourly operation of the RES system with a horizon of 1 day-1 week. We take into account: While respecting constraints and unexpected stochastic variables, certain assumptions are made when compiling a mathematical statement of resource sorting. These may include, for example, rotary reserves of electricity currents, equipment for respective initial reserves under the conditions of a boiler (in the case of biomass) or partial formulation with the commencement of operation. The first constraint is that realistic electricity production must be greater than the sum of the total electricity consumption (power) of consumers in the intelligent Rohan Island area, including required power reserves, or the sum is equal to P cel is the total required power (net demand) [MW]. a P res is the total power reserve in [MW].
The RES micro-network should maintain a certain power reserve; then the cap of the power reserve must be modified in some way. Hence  (15) P pop is the production power demand in [MW], P zt is production power loss in [MW], P gi is the total real electricity production in [MW], and P res gi is the total reserve of electricity actually produced where A c is the cost of running an off-line resource (resource status in a given hour) in [CZK], a is the thermal time constant, t is the time in [sec], A L is the workforce costs in [CZK], A 0 is the cost of running the cold boiler in [CZK] and P max gi is the maximum production output power of the IT source [MW].
where A B is the costs to start a subdued resource in [CZK], t is the time in [sec] and A ban are the wage costs in [CZK].
Resource sorting belongs to the classic Lagrange relaxation technique, but the solution to the constraints is based on stochastic variables. That is why we have solved optimisation by simulated annealing as stochastic optimisation (we will not deal with this further; see [8]). Allowed cost functions are conditional when the output power produced by the local network (micro-networks) of RES in the given hour A t ð Þ is determined by the sum of resources turned on. We draw from a typical daily electricity consumption diagram at any given time. The optimisation algorithm works with acceptable solutions (see [8]) which can be evaluated through cost functions without the use of penalties. Then.

Optimisation of energy system special-purpose system
The design of special-purpose function f (x) is one of the most complex steps of optimisation. There is no guide or procedure of creating such a function. If we are to design such special-purpose function, we have to know what we are to achieve and what the starting point may be. When we consider our problem, we can see that, in order to achieve reliable and functional results, we have to solve it using constrained optimisation. The constrained optimisation may then be mathematically expressed as follows: f : D ! R, D ⊆ R d is defined above the definition field D, which is a continuous set of searched space, and R is a real value range. Furthermore, f , g i ah j has the functions, and I and J has the final sets of indices. The function F is a specialpurpose function; g i , i ∈ I has constraints using the inequality algorithm, and h j , j ∈ J has constraints using the algorithm. From a general point of view, the optimisation problem can be expressed as follows: The special-purpose function can be expressed as a sum of quadrates of the deviations between the current parameter values and the required values The value of the minimised special-purpose function or the value of the optimised system parameters depends on the status vector: where x 1 , x 2 , …, x n has the state variables of the optimised system expressed by the special-purpose function, y 1 , y 2 , …, y m has the parameters of the optimised system d 1 , d 2 , …, d m have the required values of these parameters. When we introduce the inequality constraint g i x ð Þ ≥ 0, the condition expresses that the state variable must be higher than or equal to zero. By multiplying both sides by À1, we get a condition corresponding to the function of state variables. The procedure of its optimisation is then as follows: where f : X ! R a X ⊂ R n : If our problem is formulated from the point of maximisation, then it is easy to make the adjustment to minimise. In that case, the situation would be the following: argmax f x ð Þ : x ∈ X f g¼ argmin Àf x ð Þ : x ∈ X f g (25) For the local minimum, the following applies: on X ⊂ R n , if δ > 0 so that for each y ∈ X, y À x j j j j< δ applies f x ð Þ ≤ f y ð Þ: For the global minimum, the following applies The special-purpose function design is a very complex problem, requiring considerable experience in the subject area, and the possibilities of defining optimisation must be considered. We need to build on what is to be achieved and what can be done.
We have based our experience and our research on optimisation solutions of energy systems from energy companies within the Czech Republic. Based on this we have described the physical model of the energy grid, RES microgrid (Figure 2), which corresponds to our experiment. By adjusting the algorithm (18), the relation for the restrictive condition of the cost function is gotten using relation (19) and the relation (27). The fact (reality) will be such that g x i t ð Þ ð Þ≥ 0: Then we can write a relationship Þ depends on the state of the source at a given hour, where ∑ N g i¼1 P i x i t ð Þ represents the state of the power generator at time t and γ t ð Þ represents the energy consumption forecast for a given hour. Parameters i ∈ 1; 2; …; N g È É stand for source indexes. N G represents the number of sources in our microgrid (which is 7). Variable t ∈ 1; 2; …; T f grepresents the time the connected sources spend in the defined mode, and P gi t ð Þ is the output of the source at time t.

Penalty function
The optimisation algorithm works with acceptable but inadmissible solutions. The penalising function is zero in terms of standard requirements. For one criterion, it has a non-zero value and is positive.
If we add a penalty function to the cost function, then we get an algorithm that is only optimally suitable for local searches in terms of effectiveness. We see this if we exit from [19,20]; then we can apply a suitable approach to penalising cost functions.
In the first instance Let us define meanings. Definition 1: Consider functions f, g, and suppose some values of the function g (x) belong to D (f). To every such ). This defines the function h (x) = f (g (x)), which we will call function f, g and mark it h = f Á g Note: G is the first function and the second is F. The penalising function is the function of unsolicited power supply: Þþa > 0: The individual parameters have the following meaning: a ensures load function f P g t ð Þ; x t ð Þ À Á take negative values. Parameter a is set to high. Constant s i is applied to the functional transformation, and b i is searching for duplicate hypersurfaces. Limited values g i X ð Þ will be lower than higher for values s i and b i . Very often with parameters like s = 1 and b = 1, the penalty works satisfactorily. This is an external penalty function that links penalties with condition violations. Penalties only apply outside of acceptable solutions. The external penalty is the one that uses exceeding quadrate measures as a penalty [21]. We have a limited minimisation function [22]; then We will replace When applying definition 1, limiting the conditions (27) and the relationship (28) to the target function fg X ð Þ or by applying definition 1 and conditions (27), (29) and (30), we get a modified algorithm [23] as follows: where ag 2 X ð Þ is the so-called penalty of the non-required electrical power supply. Because g 2 is a negative number, there is a power when γ t ð Þ > ∑ i P gi x i t ð Þ. The function value of the target function (31) must be artificially reduced or increased; then w (31) are the same in the algorithm (31).
We are looking for an x allowing us to minimise functions f X ð Þ þ ag 2 X ð Þ:In such case we solve Eq. (31) by minimising cost function f(X) and maximising the penalty defined as function ag 2 X ð Þ . The result of summing the two functions up is the following function, fg: We used the minus sign in algorithm (32) as we intend to maximise functional prescription μ g X ð Þ ð Þ: Function g x ð Þ defines the output stability of the system, which is why we may set it to zero. This function thus ranges from 0 to 1 and μ is fuzzy zero. Both constraining conditions (31) and (32) may be compared, and the most suitable definition of the constraining conditions may be selected.
When function fg X ð Þ approaches the minimum, which is our intent, we achieve a stable power output balance. Our objective is to minimise both the operation costs and the deviation of production from consumption.
Note: If the power consumption of a given area of "Rohanský ostrov" smart urban area is higher than the production, there will be a minus sign on the right side of Eq. (27) (it will be a negative number). Then we will focus on mathematical expression (28); if the value of expression (27) is very small, that is, close to zero, we have achieved a suitable solution.
Experimental solution: 1. We start from (32), focusing on penalising unsolicited power supply to the smart area from the local RES microgrid. Weight a (coefficient) defines the conditions of the cost function. In numerical ratio, it is set to such value that the ratio of costs and balances mutually approximately set off.
2. Next, we define the condition of extending the admissible solution.
a. We set a low permissible deviation between power generation and consumption.
b.We define the source organisation so that the required output at a given time was as near as possible to the required consumption.
c. We accept a small permissible deviation which we mark ΔP ( Figure 8) and accept expression (33), which is the function of the chart showing negative and positive slope.
Let us define the membership function as X ¼ 0, which is a classical set, and μA : X ! 0; 1 h i as the representation [21]. A fuzzy set will then be a coordinated pair A ¼ X; μA ð Þ: Set X will be the universe of fuzzy set A, and μA will be the membership function of fuzzy set A. For each x ∈ X, real number μA x ð Þ is the level or degree of the membership of element x in fuzzy set A; μA x ð Þ will be interpreted the following way: It is not possible to identify whether x is a member of A, while the value of μA x ð Þ expresses the level, degree of the membership of x in A.
In our case, g(X) expresses the deviation of the stable output balance which is why we seek to set it to zero. Number x ∈ X is selected arbitrarily from fuzzy set A, and μg is a function of fuzzy set A (where the admissible deviation is defined). It is obvious that for each x ∈ X, real number μ (g (X)) may be called the membership level or degree of element x in fuzzy set A.
We describe and compare the expressions x g X ð Þ and μA X ð Þ μ g X ð Þ ð Þ. Then, μ g X ð Þ ð Þcan be expressed as follows: Expressions (33) and (34) and Figure 8 allow us to assume that ΔP¼0, by which the constraining condition is fulfilled (see μ g X ð Þ ð Þ¼1 ð ). Eq. (32) is optimised by its subsequent minimisation or maximisation (μ¼0 až 1). Fuzzy number "μ" will always be small, and we may achieve that using number a (therefore we maximise function f(X)). At this moment, we may say that we have solved the optimisation of our task for the purposes of other applications, for example, in order to minimise the special-purpose function.

Experiment
Let us assume the fictitious smart city (intelligent area of Rohan Island) which consists of a complex of intelligent residential, administrative and public buildings with a wide range of civic amenities (Figure 1).
The energy concept of the area under consideration is clearly focused on local renewable energy sources (FV1, FV2, FV3, FV4 and FV5) assembled together with biomass and cogeneration systems (Figure 2), including TS-DS 22/0.4 kV power station, RMS, (Figure 2), located in the underground floor of KU02. This is a RES Figure 8.
Þby applying the function of triangular fuzzy number zero [8].
microgrid at a distance of up to 50 km from our fictitious urban area. Continuous and reliable power supply is provided by two high-voltage lines with various switchboards guided from both independent directions. Table 1 lists the costs, characteristics and technical constraints of individual sources. Electricity consumption estimates are based on the values of the total usable floor area of all the buildings in the area, and for the estimation of electricity type consumption, specific consumption and consumption values of electricity for months per year for individual types of buildings and the total electricity consumption per year are given in Table 2, including financial costs [26][27][28]. Table 3 Table 2.
Building types and their specific and total consumption. electricity generation per year per type of facility including total electricity generation per year.

Self-organising map
The aim of our experiment is to define a design solution for the system of sorting resources for randomly selected working days Monday and Thursday. Using mathematical analysis using the optimisation stochastic method-simulated annealing-we reached the design and evaluation of input parameters for the purpose of designing the software for the application of the programming language JAVA.
The input parameters for the optimisation programme are hourly load prediction (obtained from the history of experimental scientific observation)-what will be the power consumption at a given time? To evaluate this data, a neural network was used to transmit and process information (data). The neural network was also used to implement and optimise the parameters and structure of the fuzzy model. In addition, the clustering method-cloud analysis of data-was used through data analysis. Several types of daily diagrams were created, and then grouped into "clusters", so that two objects of the same cluster were like two objects from different clusters. The result of the individual clusters was the so-called prototype. Prototypes, cost factors and constraints were input into the neural network, the number of power generators (sources), the number of hours we are functioning on, the cost factors for each generator, the predicted consumption for each hour of the time period and the weight w. A cluster analysis method was applied, and the annual history of electricity consumption has been artificially modelled to compare identified daytime patterns with a standard. The baseline standard used hourly patterns of consumption of the working days on Monday and Thursday in January 2019, where each hourly consumption was randomly modified using a random number generator with a normal probability distribution. This modelling was performed 260 times (the total number of Monday working days) and 260 times (the total number of Thursday working days) through a JAVA programme. In Figure 9, two examples of randomly modelled Monday daytime charts are selected, and two examples of randomly modelled daily charts are selected on Thursday. These are hourly consumption forecasts, that is, its standards derived from historical data Figure 10. We also apply the self-organising neural network (SOM)-the Kohonen network. The Kohonen network works analogously as a cluster or factor analysis. The aim is to reduce the input file by mapping it to a smaller number of clusters. Thus, we can imagine finding the spatial representation of complex data structures so that classes of similar vectors are defined by close neurons in each topology. After the network adaptation, the Kohonen map ( Figure 11) is drawn out during active   dynamics, after resubmitting the training patterns, from which we can find a very well-defined massive cluster corresponding to Mondays and Thursdays.
Furthermore, by spreading propagation or active dynamics, we can extract the weight vectors from the configuration of the learned neural network, that is, searched day-type diagrams ( Figures 12 and 13), where they compare with the appropriate standard.
The individual daily charts in the annual history in Figures 12 and 13 show that consumption patterns are quite different. Typical daily consumption patterns are basically like the relevant standards (Figures 12 and 13), as illustrated by the fact that the cluster analysis method is very effective. Table 4 shows that the average and maximum tolerances range from approximately 0.1% to 0.5%. From this expression we can evaluate that the cluster analysis method is a very effective and high-quality method demonstrated by this experiment.
If we are to evaluate our experiment according to our specifications, we will assume a situation when we supply power to our smart area of "Rohanský ostrov" through the RES microgrid. The RES microgrid is equipped by eight power generators complemented with the low-voltage grid supplies and the installation of ACCUs. This is a combination of the following ways of power generation:  photovoltaics, cogeneration and biomass plus low-voltage supplies from the distribution grid (see Table 5).
Another task and therefore the aim of the experiment was to design a unit commitment for the weekdays, Monday and Thursday, in January 2019. The hourly consumption forecast has been processed for Thursday (for this chapter we do not specify the hourly consumption of Monday's working day in terms of content) ( Table 5).
Initial operation of the temperature setting is based on its initial estimate and its subsequent increase to a value at which almost every failure is accepted during the first 10%. The principle of tuning the number of iterations is based on its initial estimate and subsequent increase to a value that does not reduce the resulting production cost to the amount of energy that covers the consumption of that period. The reference cost of electricity generation that covered the estimated consumption of the period was defined as a simplified solution. A simplified solution for that period consisted in the fact that all resources work at medium strength (see relationship (35)). Table 4. Typical daily diagram (TDD) compared to standard. Table 5.
Organisation system for power energy sources of the RES microgrid for the working day Thursday.
During the course of optimisation, we perform random settings of the state and output of a randomly selected RES generator within the microgrid using a random number generator. This defined procedure is done for each hour and each set period as well as for every iteration. This is done using a programme in JAVA source code. // start hour cycle for (int j = 2; j <= nt +1; j ++) { // start iteration cycle for (iter = 1; iter <= n; iter ++) { // state random generation // random choice of source i = ran (seed) * (ng -1) +1; ij = (i-1) * (nt +1) + j; // random change of state if (x (ij) == 0) { if (ran (seed) <= Ponoff) x (ij) = 1; Else if (ran (seed) <= Ponoff) x (ij) = 0; // random choice of source i = ran (seed) * (ng -1) +1; ij = (i-1) * (nt +1) + j; // random set of power p (ij) = rand (seed) * (Pmax (i) -Pmin (i)) + Pmin (i); } } nt is the number of hours and ng is the number of sources. p(ij) the output of the ith generator and the jth hour. Further, x(ij) is the state of the ith source during the jth hour. P min and P max are power values with their limit in the ith generator. Here, nt is the number of hours, ng is the number of available sources, p (ij) is the power of the ith source and the jth hour, and x (ij) is the state of the ith source during the jth hour. Values Pmin and Pmax have their limit in the ith source. Ponoff is the parametrizable probability of a change of the source state. Function ran is set up by the random number generation within the interval of (0,1) with even probability distribution. The result of our experiment in terms of source organisation on the selected Thursday as defined by us is presented in Table 5. Worth mentioning is also the fact that the calculation time when using a laptop was 2 minutes and 30 seconds.

Conclusion
The total power load (consumption) of the intelligent urban area "Rohanské nábřeží" (Rohan Island) according to Table 2 is estimated at 21,000,757 kWh/year = 21 MWh/year. Total power generation from RES microgrid ( Table 3) is 7,801,559 kWh/year = 7.8 MWh/year. At present β ¼ 0:6 of the total power consumption of the smart area which is 12,600,454 kWh/year. The installed distributed micro-network of RES will cover the power consumption of the urban smart area with 62% of electricity. The projected planned concept (ideal idea) is to have by 2020 a factor of 0.2, thus existing distribution rates can be optimised. In our experiment, 4.2 MWh/year of surplus power would be 85%, which is 3.6 MWh/year. The intelligent urban area would be self-sufficient in terms of electricity consumption and would also generate 3.6 MWh of electricity per year into the 22-kV power grid. The smart area would be energy-efficient in this case, and 85% of the total volume of electricity produced would be commercial. With the transition to smart grids (Figure 2), it is assumed that the intelligent urban development of the Rohan embankment will behave like a power producer and be able to influence the energy market. Similarly to the today's use of automated exchange system to offset exchange rate differences, a decentralised network of autonomous buildings -power stations-can be created on the energy market.
When defining the unit commitment optimisation from RES by working day (Thursday) in 1-hour increments, we have achieved a further saving of approximately 20%.