Fuzzy logic in the decision-making tasks of connecting renewable energy sources into the electricity supply system

The Third and Fourth EU Energy Packages, as well as the Energy Strategy of Ukraine “Safety, Energy Efficiency, Competitiveness” until 2035, define the development of electricity production using renewable energy sources among the priorities of the energy sector. In this situation, the decision-making process on the integration of renewable energy sources into the electricity supply system is of particular importance. The article develops a fuzzy model for assessing the risks of connecting (integration) renewable energy sources to the power supply system. The toolkit, based on logical rules, allows modeling various connection options. The data obtained can then be used to set requirements for the parameters of the electrical installation at the stage of issuing technical specifications to the customer. The modeling results demonstrate the adequacy of the developed knowledge base and the possibility of using it to develop a methodology for the controlled and efficient connection of renewable energy sources to the power grid.


Introduction
In the past, national energy planning involved the development of a centralized infrastructure investment program for a certain period of time.However, in the current geopolitical context, environmental damage, depletion of fossil fuels and territorial imbalances are factors that require a change in the energy mix, and the introduction of measures to invest in energy diversification and the integration of renewable energy sources (RES).
At present, the construction of clean energy generation facilities is carried out solely from the standpoint of commercial attractiveness, but not from the standpoint of the country's economic development, environmental friendliness and consumer interests.The rapid development of green energy is taking part without consideration of the real needs of Ukraine's energy system for additional generating capacity.This can lead to destabilization of its functioning and the possibility of emergencies.
Decision-making on the integration of RES into the electricity supply system should be based on an analysis of the modes and processes that arise under different options for connecting RES.However, decision-making will almost always take place in conditions of incomplete information, which will cause some uncertainty about the results of these connections.In such circumstances, the use of fuzzy logic elements in the process of assessing risk factors is justified.

Purpose and objectives
The purpose of the article is to develop a methodology that allows for a controlled and efficient connection of RES to power grids based on a risk profile.The objective of the article is a study of the use of fuzzy logic for risk assessment in the connection of RES to the electricity supply system, namely, a comprehensive consideration of the influence of factors.

Research material and results
According to a report by the International Renewable Energy Agency (IRENA), 3064 GW of renewable generation capacity was in operation worldwide at the end of 2021 [1].Of this volume, 40% is accounted for by hydroelectric power plants, 28% by solar power plants and 27% by wind power plants.However, solar and wind power have dominated the expansion of renewable energy capacities lately (figure 1).[2].

Figure 1. Growth of RES capacities
The studies [3,4] has shown that further development towards increasing the share of solar and wind power plants in the generation of the power system poses significant challenges to ensuring reliable electricity supply and efficient management of the distribution system.In view of this, as well as the growing technical capabilities of RES and related equipment, there is a need to set requirements for the main equipment or to install additional equipment for flexible and dynamic regulation of RES operation.
Unfortunately, there is currently no effective, comprehensive system for assessing and managing risks in the integration of RES into the electricity supply system.The practical aspects of risk management in this segment have not been sufficiently researched and covered, considering the experience of the world's leading countries and the grid specifics of the electricity supply system.There is an urgent need to create a comprehensive risk management system for the integration of RES, which will be adapted to the current realities of the Ukrainian power system.
In the energy sector, decision-making often takes place with significant incomplete information, lack of statistical estimates, and in poorly formalized conditions.In these circumstances, many researchers suggest using fuzzy logic for decision-making.
Courtecuisse et al [5] use this method because it facilitates the analysis and definition of fuzzy control algorithms adapted for complex hybrid systems.In addition, the fuzzy logic method is adapted to solve the problems of forecasting energy production from RES and changes in grid IOP Publishing doi:10.1088/1755-1315/1254/1/0120433 frequency with load changes.This allows them to avoid accurate and detailed models of different sources and system topology.
Dimitroulis and Alamaniotis [6] presents a fuzzy logic-based energy management system for residential prosumers, who produce electricity for their own consumption and sell it to the grid.The use of a mathematical model based on fuzzy logic allows reducing energy consumption costs and increasing profits from the sale of excess energy to the grid.This was confirmed by the results of practical implementation.
The article [7] addresses the problem of optimal control of energy storage systems to maintain voltage/frequency in distribution power grids, considering the degradation of batteries.Liu et al propose an optimal fuzzy control method that maximizes the useful effect, reduces power losses, and minimizes battery degradation.
Yahyaoui et al [8] proposes and evaluates a methodology based on fuzzy logic for energy management in autonomous installations with photovoltaic panels and limited battery capacity.The decision-making process includes consideration of the system's autonomy, battery protection against deep discharge and overcharge, and power supply stability.
Ziemba [9] also use a fuzzy logic model, and more exactly, a modified fuzzy TOPSIS method for multi-criteria assessment of investments in onshore wind farms in Poland.This method is also used to determine the most cost-effective investment.The fuzzy TOPSIS method allows capturing the uncertainty of input data as well as conflicting criteria.
Pankovits et al [10] uses fuzzy logic algorithms to integrate renewable energy generation and storage units, using the example of a railway substation.This made it possible to contribute to limiting the excess of the estimated capacity from the grid and to promote local consumption of renewable energy through empirical supervision parameters.The multi-criteria approach, including energy, environmental and economic constraints, was implemented at different time levels.
De Carvalho et al [11] presented a methodology using fuzzy logic to optimize the control of an embedded power system.The system under consideration was equipped with a supercapacitor energy storage device that performs the function of power smoothing and peak reduction.The optimization goals were to minimize the voltage fluctuations of the DC circuit and to improve the system efficiency by reducing power dissipation.
In turn, Baqui [12] formulated an automated decision-making model for the allocation of power grid resources using fuzzy logic algorithms.The rule base was created on the knowledge of the subject area and analysis of the operator's decision-making activities.
The article of Ibrahim et al [13] is devoted to the development of a fuzzy logic-based energy management system for hybrid energy sources.The proposed system uses fuzzy logic to make decisions on load distribution between different energy sources depending on external conditions and consumer requirements.In addition, the system can adapt to changing operating conditions and ensures optimal energy utilization.Studies have shown that the proposed fuzzy logic-based electricity consumption management system is effective and can reduce electricity costs.
Castillo-Calzadilla et al [14] describes a methodology for assessing positive energy districts (PEDs) based on fuzzy logic.A PED is an area where most of the energy consumed is provided by renewable sources and excess energy is transferred to the grid.The use of this methodology can help determine the degree of sustainable development and energy security in different PEDs.The results of the study demonstrate the effectiveness of the proposed methodology and the possibility of its use to assess positive energy districts in different regions and cities.
Fuzzy logic has also been used to evaluate crops that can be grown profitably for bioenergy production.Lewis et al [15] used a fuzzy spatial suitability model with physical and economic variables to identify non-agricultural areas that could be profitably cultivated with bioenergy crops that are more resilient to environmental conditions.
Alekhya et al [16] consider risk assessment using fuzzy logic.This study proposes a risk assessment methodology that uses fuzzy logic to model and analyze uncertainty.This methodology involves creating a mathematical model that includes a set of factors and fuzzy rules to assess the degree of influence of each factor on the project cost.The use of fuzzy logic allows modeling uncertainty and ambiguity in risk assessment.The results of the study demonstrate the effectiveness of the proposed methodology and its ability to more accurately assess the risks of project cost overruns.
In the tasks of risk assessment when connecting RES and decision-making under uncertainty, problems arise that are difficult to solve using traditional methods.In a real-world model, there is always a technological scatter of parameters due to the complexity of the system.To solve this problem, it is necessary to use fuzzy concepts and knowledge that describe the control process using productive if-then rules.The most important advantages of this method of evaluation include the ability to use the expert's experience without drawing up differential equations.The use of fuzzy logic for decision-making is most useful for systems with poorly formalized processes [17].
The advantages of using a fuzzy logic model in decision-making are as follows: • fuzzy logic methods make it possible to describe risk factors in a qualitative, verbal way by introducing the concepts of linguistic variables, the meaning of which is understandable to the expert; • the use of fuzzy sets allows formalizing more flexible relationships between the factors of each of the risks under study.This is more in accordance with the nature of the real interactions studied in the electric power industry; • fuzzy methods make it possible to make decisions under conditions of incomplete information by synthesizing and analyzing qualitative values.This is important for decisionmaking in connecting RES to the power supply system.
In general, the mechanism of logical inference includes four stages [18]: introduction of fuzziness (fuzzification), fuzzy conclusion, composition and reduction to clarity, or defuzzification (figure 2).Fuzzy inference algorithms mainly differ in the type of rules used, logical operations, and the type of defuzzification method.Despite the complexity of the mathematical apparatus embedded in the algorithms, this approach allows for a fairly flexible model that will operate with numerous input arguments and provide a resultant value.The resulting value can be considered objective with a certain degree of approximation.Because there are a variety of subjective things, such as the assessment of specific threats by experts [19].
The Mamdani algorithm was used to create a risk profile for the integration of RES into the power supply system.The application of this algorithm allows us to qualitatively describe the possible causes (processes or phenomena) that contribute to the connection problem.Subsequently, with this information about the factors, it is possible to build a functional correspondence.
In Mamdani's model, each rule has a degree of execution ω i , which is calculated as follows: where ∧ -a fuzzy conjunction operation that corresponds to the "AND" operator in the rules; n x -number of inputs; µ j,i (x j ) -the membership function on the j-th input in the antecedent of the i-th rule; n r -number of rules.
After the degrees of rule fulfillment are calculated, the fuzzy values of the rule constituents are calculated using implication (in Mamdani systems, the minimum operation is usually used).
Then, using the aggregation operation (in Mamdani systems, the maximum operation is usually used), the fuzzy output value with the membership function µ Y out (y) is calculated according to the expression: where ∨ is an aggregation operation that corresponds to the union of fuzzy rules by ELSE, which is equivalent to a disjunction in the Mamdani system; ∧ -implication operation (equivalent to a conjunction in the Mamdani system); µ Y i (y) -is the membership function of the concatenation of the i-th rule.
After the rule inputs have been processed by the algorithm described above and the fuzzy output µ Y out (y) is obtained, it is necessary to find the corresponding crisp value using defuzzification y * .The main methods of defuzzification are the center of gravity, center of sums, and average maximum methods.

Practical application
The Matlab environment used in the study is a specialized package Fuzzy Logic Toolbox [20].It is used to create and further use a fuzzy logic system in an interactive mode.
To assess the risks of integrating RES into the power supply system, indicators reflecting the impact of these sources on the system are used.These elements include such factors as: the occurrence of higher harmonics (Ku), voltage deviation from Un (∆U ) and reactive power flow (cos ϕ).The occurrence of higher harmonics was defined by an ordered term set of values consisting of three terms: "low", "medium" and "high".The terms are listed in order from the most negative to the most positive.According to the tasks set, it is enough to select 3 linguistic variables to describe the aspects of the factor for further application of the fuzzy logic method.This scale is also used for other indicators (table 1).A distinctive principle of the Mamdani method is that its rules of logical inference contain fuzzy values (membership functions) in their concretions (on the right side).The Matlab module includes 11 built-in membership types.However, in practice, it is convenient to use those membership functions that allow an analytical representation in the form of some simple mathematical function.This simplifies not only the corresponding numerical calculations, but also reduces the computational resources required to store individual values of these membership functions [21].Therefore, in our study, we considered the triangular, trapezoidal, and simple Gaussian membership functions.
The triangular membership function (figure 3) is formed using a piecewise linear approximation.
A triangular function (for example, for the "medium" term of ∆U ) can be given analytically by the following expression: .
The parameters a and c characterize the base of the triangle, and the parameter b characterizes its vertex.As you can see, this membership function generates a normal convex unimodal fuzzy set with a carrier -the interval (a,c), the boundaries (a, c) \ {b}, the kernel b and the mode b.
The following is a trapezoidal membership function (figure 4).
In turn, the trapezoidal (also for the term "medium" of ∆U ) can be given analytically by the following expression: .
The parameters a and d characterize the lower base of the trapezoid, and the parameters b and c characterize the upper base of the trapezoid.In this case, this membership function generates a normal convex fuzzy set with a carrier -the interval (a, d), the boundaries (a, b) ∪ (c, d)) and the kernel [b,c].
A commonly used method of generating a membership function is to apply a Gaussian curve.Based on the Gaussian distribution function, two types of membership functions can be constructed: a simple Gaussian membership function (figure 5) and a bilateral one formed using different Gaussian distribution functions.
The symmetric Gaussian function for the "medium" term of ∆U is given analytically by the following expression: In this expression, c is the coordinate of the maximum of the membership function; and σ is the concentration coefficient of the membership function.
The accuracy of risk assessment in the integration of RES depends on the completeness of the knowledge base.The flexibility of the analysis process is achieved by setting key decision-making rules.The course of logical inference is formed at the stage of defuzzification, in our case, using expert data obtained in the study [3].For each rule, the membership functions of the input variables and the output variable are displayed (figure 6).Considering the respective possibility of occurrence and the level of consequence of the realization of factors, the results of building fuzzy logic are obtained.In this case, they are based on the identified 27 rules.To analyze the results of the model, a graphical interpretation of the rules was made.This made it possible to see how the model works for the three output parameters Ku, ∆U , cos ϕ (figure 7).
The level of integration of RES into the electricity supply system reflects how efficiently and reliably the grid is provided with energy from RES.The integration of RES into the electricity supply system can have different levels, depending on the type and capacity of the installed equipment of these sources, as well as on the size and characteristics of the electricity grid.According to the results, the level of integration at the same values of the system parameters for the three selected membership functions is in a small range of deviations.For the triangular membership function with relative values Ku=0.94, ∆U =0.95, cos ϕ=0.92, the level of integration is 0.763, for the trapezoidal function -0.757, and for the simple Gaussian function it is 0.725.The small range of deviations indicates the adequacy of the developed model.
It should be noted that the method used allows us to track the level of RES integration at different values of system parameters.For example, for a triangular membership function with other parameter values (Ku=0.91,∆U =0.92, cos ϕ=0.91), the integration rate decreases to 0.537.That is, a mechanism for making a generalized decision when integrating renewable  energy sources into the power supply system appears.In the future, this will be used to develop a methodology for the controlled and efficient development of renewable energy.
The Matlab functionality makes it possible to view the input-output surface corresponding to the synthesized fuzzy system.However, when we go beyond the three dimensions, we begin to face problems with the full display of the results.Since our system has three inputs and one output, the program can only generate a three-dimensional output surface where any two inputs change, but one of the inputs must remain constant (figures 8-10).
The fuzzy inference surface makes it possible to visually assess the probabilities of a situation that may result from the connection of a particular RES installation.In order to obtain the highest efficiency of RES, it is necessary to adhere to the parameters that form the yellow and green zones of the profile.The blue zone, on the contrary, is characterized by the greatest risks to the normal functioning of the system and shows a categorically unacceptable integration of the system and RES under these parameters.Getting into the blue zone is also not recommended, as it shows low efficiency from RES and a higher probability of risk consequences.The graphs have a local decrease in the level of integration, which is explained by the number of logical variables and rules.With their increase, the model will more accurately reflect the level of integration for making decisions on RES connection, which will be done in further research.
The developed system makes it possible to quickly carry out the evaluation procedure based on fuzzy logic tools and quantify the level of integration.It can also be supplemented or modified by an expert by introducing other rules, adjusting membership functions for variables,  and adding new parameters.Therefore, using this toolkit based on logical rules, it is possible to model various connection options, and then use the data obtained to set requirements for the parameters of the electrical installation at the stage of issuing technical specifications to the customer.
The results of the fuzzy logic system in the Matlab environment show that the program tools allow tracking the level of RES integration at different values of system parameters.The modeling results demonstrate the adequacy of the developed knowledge base and the possibility of its use for the controlled and efficient connection of renewable energy sources to power grids.

Conclusions
The growing role of intermittent generation from RES, the need to reduce the use of fossil fuels, and the different profile of consumer demand create a number of risks for the system.They relate to the impact of RES sources on the planning, organization of operation, and  management of power grids.At present, the construction of clean energy generation facilities is carried out solely from the standpoint of commercial attractiveness, not from the standpoint of the country's economic development, environmental friendliness and consumer interests.The rapid development of "green" energy is taking place without considering the real needs of Ukraine's energy sector for additional generating capacity, which may lead to destabilization of the country's energy system and the possibility of emergencies.
In the tasks of risk assessment in connection of RES and decision-making under uncertainty, problems arise that are difficult to solve using traditional methods.In a real-world model, there is always a technological scatter of parameters due to the complexity of the system.To solve this problem, it is necessary to apply the mathematical apparatus of fuzzy logic theory.One of the most important advantages of this method is the ability to use the experience of an expert without drawing up differential equations.
We have developed a fuzzy model for risk assessment in the integration of RES into the electricity supply system based on expert data.To formalize the initial data, we used triangular, trapezoidal, and simple Gaussian membership functions for the input variables.According to the results, the level of integration at the same values of the system parameters for the three selected membership functions is in a small range of deviations, which indicates the adequacy of the developed model.In the future, it can be supplemented or modified by an expert by introducing other rules, adjusting the membership functions for the variables, and adding new parameters.
The use of fuzzy logic allows tracking the level of RES integration at different values of system parameters.The toolkit, based on logical rules, allows modeling various connection options.The data obtained can then be used to set requirements for the parameters of the electrical installation at the stage of issuing technical specifications to the customer.The modeling results demonstrate the adequacy of the developed knowledge base and the possibility of its use for the controlled and efficient connection of renewable energy sources to power grids.

Figure 2 .
Figure 2. System of the fuzzy logic model.

Figure 10 .
Figure 10.The fuzzy inference surface of the trapezoidal membership function with input parameters Ku, cos ϕ at ∆U = 0.92 (a) and ∆U = 0.97 (b).

Table 1 .
Scale for assessing linguistic variables.