## 2 Materials and Methods
### The Structure of the Fuzzy Model  
Due to the completeness of the survey questions, the role of the fuzzy modelling expert (Figure 1) was reduced to developing the model structure and introducing a formalized mathematical notation enabling the creation of a complete fuzzy model. Based on survey research, a fuzzy model with two inputs was proposed as follows: \(ZEP\) and \(ZREE\) characterized by three fuzzy sets. Three bases of rules were proposed for the fuzzy model, depending on the legal provisions (\(Pr\)) affecting energy security, i.e., on the quality parameter. The legal status was marked as favorable \(Pr=1\), neutral \(Pr=0\), or unfavorable \(Pr=-1\). The structure of the fuzzy model for determining Poland's energy security index is shown in Figure 2.  
As can be seen in Figure 2, if, for example, legal regulations change from neutral (\(Pr=0\)) to favorable (\(Pr=1\)), then for the purposes of determining the sharp value of the energy security factor \(SEM_{f}\) in the fuzzy model, there is a transition from one (middle) rule base to another (internal) one, corresponding to a given legal status. The fuzzy model consists of a series of blocks. The first one is Normalization. In this block, the input quantities \(ZEP\) and \(ZREE\) are converted into their normalized forms \(ZEP^{N}\) and \(ZREE^{N}\) in the range \([-1,1]\). In the model, the normalized modal values of the sets of fuzzy inputs, with the values given in Section 2.1 and qualitatively marked in the survey and Tables 1-3 as M, S, and D, define the location, i.e., the values \(uS^{N}\), \(uP^{N}\), and \(uL^{N}\)--Formula (1). They are necessary to determine the value of the function belonging to fuzzy sets of current values at the model input. The fuzzification block assigns the degree of membership to the fuzzy sets \(e_{i}\) and \(p_{j}\) (\(i\), \(j\) = 1, 2, 3). The input vector is then transformed into a fuzzy set characterized by the membership function [34]. Triangular functions were adopted as the function of membership in fuzzy sets of inputs, for which the value of the function of membership in fuzzy sets is determined using the following formulas:  
\[\mu_{ei}\big{(}ZREE^{N}\big{)} =\begin{cases}0&for\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  
\[\underbrace{IF\left(e^{N}=S_{j}\ AND\ p^{N}=S_{i}\right)}_{anteccalent\ (prenise)}TO \underbrace{\left(SEM^{N}=b_{ji}\right)}_{conclusion} \tag{3}\]  
The proposed model uses three rule bases, each taking into account experts' opinions on the development of Poland's energy security index in the legal situation understood as negative, neutral, or positive. In the inferential mechanism used in the model, the \(PROD\) operator was used to aggregate the premises, allowing the surface of the fuzzy model to be smoothed. This operator can be expressed as the following equation:  
\[m_{k}=PROD\left(\mu_{ei}(ZREE^{N}),\mu_{pij}(ZWEP^{N})\right)=\mu_{ei}(ZREE^{ N})\cdot\mu_{pij}(ZEP^{N}) \tag{4}\]  
where \(m_{k}\) is the degree of fulfilment of the premise of the \(k\)th rule. Inference was carried out using the MAX-MIN method:  
\[\mu_{ji*}(SEM^{N})=MIN\left(m_{k},\mu_{ji}(SEM^{N})\right) \tag{5}\]  
Defuzzification (Figure 2) is used to determine the sharp value of the output quantity, based on the determined resulting value of the membership function, obtained by introducing the sharp values \(ZEP\) and \(ZREE\) to the inputs. The Height method was used to implement this function. Due to the fact that the model-output fuzzy sets are singletons located in a specific modal value, the output value is calculated from the following formula:  
\[SEM^{N}=\frac{\sum_{i}^{r}b_{ji}\times\mu_{ji*}}{\sum_{i}^{r}\mu_{ji*}} \tag{6}\]  
where \(r\) is the number of rules. The last stage of the calculations is denormalization, i.e., the calculation of the absolute value of the \(SEM_{i}\) coefficient from the standardized range \([-1,1]\).