*3.3. ANFIS Approach for PV Efficiency Estimation and Analysis*

The ANFIS model comprises ANNs and fuzzy logic to forecast the output data identified by input parameters. An ANFIS model is constituted by membership functions (MFs) [15]. Higher MFs numbers usually affect the outcomes optimality with lower accuracy [43], additional MFs cannot improve the effectiveness of a fuzzy model [44]. A fuzzy model's performance depends on efficiently selected system parameters, their complexity, and the type of training algorithm called the ANNs [45–48].

An ANFIS includes fuzzy implications presented in fuzzy 'If-Then' rules to represent the relations of fuzzy inputs-outputs parameters linguistically [15]. An efficient parameter control depends on the number of rules. In other words, an ANFIS is shaped by fuzzy rules and their term sets [46]. The rules are the backbone of an ANFIS system. When the parameters are nonlinear, Gaussian membership functions are used for identifying the fuzzy terms which will be used to forecast the PV generated. The aim of an ANFIS model is to forecast the performance of the solar PV module. The set of input–output data was split into three randomly selected parts: training data, testing, and validation data. Training data set includes 319 observations served for the ANFIS model building, and for testing and validation 100 data were employed, respectively. The designed ANFIS model consists of five nodes for input parameters with 25 Gauss membership function, five nodes in the hidden layer (H1~H5), and a node (*Pk*) to show the solar PV model outcome for the output layer. Hence, the ANFIS model has a total of sixty eight nodes arranged with thirty linear and fifty nonlinear parameters corresponding to the five input parameters.

The input parameters of ANNs are the radiation (W/m2; *x*1), module surface temperature (◦C; *x*2), outdoor temperature (◦C; *x*3), wind direction (*x*4), and wind speed (m/s; *x*5) and the outcome parameter of network is the PV generated (*Pk*). The input-hidden and hidden-output layers' coefficients called weights are presented by *wij* and *wjk*, correspondingly. The following equation was used to calculate the *k*-th neuron's outcomes in the hidden layer.

$$met\_k = \sum\_{i=1}^{25} w\_{ik} f\_i \tag{4}$$

The input variables' MFs is shown by *fi*, *wik*, depicts the weighting coefficient in the hidden layer. *pk* = *f*(*netk*) shows the output MFs in the hidden layer and is found according to the following equation.

$$p\_k = f(net\_k) = \frac{1}{(1 + \exp\left(-net\_k\right))}\tag{5}$$

where *f*(*net*) is the activation function in ANNs and the following equation was used to determine it.

$$met\_k = \sum\_{j=1}^{m} p\_k w\_{jk} \tag{6}$$

where m and *wjk* show the number of neurons in a hidden layer and the weights, respectively. For the training process, input data were used, the outcomes of ANFIS model were

determined and compared with the actual (*Ak*) outcomes presented in Equation (8). The learning constant value *η* was set up as 0.25, 0.50, and 0.70 as given in the following equation.

$$
\Delta w\_{ij} = -\eta \frac{\partial E}{\partial w\_{ij}}, \\
\Delta w\_{jk} = -\eta \frac{\partial E}{\partial w\_{jk}} \tag{7}
$$

The best outcome of learning constant was obtained when *η* is equal to 0.70. The error of the p'th observation can be calculated according to the following equation.

$$E = \frac{1}{2} \sum\_{p=1}^{N} E\_p = \frac{1}{2} \sum\_{p=1}^{N} \sum\_{k=1}^{l} \left( A\_k - P\_k \right)\_p^2 \tag{8}$$

<sup>−</sup>1/2( *<sup>x</sup>*−*<sup>c</sup> <sup>σ</sup>* ) 2

(9)

The number of training data N, actual outcomes (*Ak*) and the predicted outcomes (*Pk*) are presented in the equation given above. The (E) shows the error estimator, is a squared error minimization function and called the Least-Squares Estimator (LSE). For specifying Gaussian membership functions (MFs), two parameters (*c*, *σ*) are used; the center '*c*' of MFs and the width '*σ*' of MFs are used for identifying the MFs.

The Gaussian MFs are shown in Figure 10 for the input parameters 'wind direction' and the 'module surface temperature', respectively. Their fuzzy linguistic term set can be stated as {very low, low, average, high, and very high}. The MF can be presented with a mathematical relation conforming to the following equation for the fuzzy linguistic term 'average' for the wind direction.

Gaussian (*x*, *c*, *σ*) = *e*

**Figure 10.** Gaussian MFs for wind direction and module surface temperature.

The fuzzy membership function of the fuzzy term 'average' used to identify the factor 'wind direction (*x*4)'.

$$\mu(\mathbf{x}\_4) = f\_{(\mathbf{x})} = \begin{cases} 0, & \mathbf{x} < 15.75 \text{ and } \mathbf{x} > 343.292 \\ e^{-\frac{1}{2}\left(\frac{\mathbf{x} - 178.812}{70}\right)^2}, & 15.75 \le \mathbf{x} \le 343.292 \end{cases}$$

A neuro-fuzzy model is a set of fuzzy 'If-Then' rules [47]. Sugeno fuzzy modelling approach suggests an efficient way to produce fuzzy rules from the parameters data. In a Sugeno fuzzy model, fuzzy rules are usually constituted in the following form. In the following equation, B and C are the antecedent of the fuzzy term sets, whereas *yn* = *fn*(*x*1, *x*2, ... , *xm*) is the consequent part of the fuzzy rule. The input parameters (*x*1, *x*2, ... , *xm*) are depicted as polynomial functions *fn*(*x*1, *x*2, ... , *xm*), and *rn* is the constant, presented as follows:

*IF x*<sup>1</sup> *is B and x*<sup>2</sup> *is C* ... ... *THEN yn* = *fn(x*1, *x2,* ... *,xm)* = *bnx*<sup>1</sup> + c*nx*<sup>2</sup> + *dnx*<sup>3</sup> +... *knxm* + *rn* (10)

The fuzzy reasoning procedure produces crisp outputs, *'y'* shows the amount of PV generated under certain conditions by the modules. Thus, a fuzzy rule set of input–output parameters of a PV energy generation plant can be presented as follows.

**Rule 1.** *IF 'The radiation is 249 (W/m2) and the module surface temperature is 28* ◦*C AND the outdoor temperature is 31.2* ◦*C AND the wind direction is 180. AND the wind speed is 2.92 m/s THEN The amount of PV energy generated is (kWh) = 4.575x1* − *14.39x2 + 14.13x3* − *0.0469x4* − *6.22x5 + 339.4934 (1490 kWh)*.

**Rule 2.** *IF 'The radiation is 336 (W/m2) and the module surface temperature is 26.7* ◦*C AND the outdoor temperature is 15.6* ◦*C and the wind direction is 134. AND the wind speed is 3.22 m/s THEN The amount of PV energy generated is (kWh) = 6.785x1* − *65.26x2 + 25.35x3* − *0.574x4* − *67.35x5* − *275.995 (363 kWh)*.

The ANFIS model for the solar PV generation was developed using 319 data for training, 100 for testing, and 100 for the validation of the model. The training errors were determined for the observations by differencing the actual data (*At*) and the predicted data (*Pt*) obtained from the solar PV fuzzy inferencing model. The ANFIS model was optimized during the training process, and several factors were arranged to obtain the best outcomes. The optimization of ANFIS model and training process depend on certain factors such as the range of influence was set to 0.7, so the squash factor set to 1.25, the accept ratio set to 0.75 and the reject factor was set to 0.157 in this study. Additionally, the error tolerance limit was arranged as 0.001 and epochs as 3000. Consequently, the Root Mean Square Error (RMSE) achieved 66.98 for the training process of ANFIS model with nine rules, 113.5208 for ANFIS model with five rules, and 68.47 for the ANFIS model with eleven rules. On the other hand, the training error can be recorded as the mean squared error (*MSE*) for a trained ANFIS model. The *MSE* was calculated as follows:

$$MSE = \frac{1}{n} \sum\_{t=1}^{n} (A\_t - P\_t)^2 \tag{11}$$

To minimize the training process error, the gradient vector is obtained initially, calculated from the output layer by derivation of the findings and propagating backward until the input layer. In this work, three ANFIS models were developed including 5, 9 and 11 rules based on the sub clustering algorithm. Considering the training error and RMSE, the ANFIS model having 9 rules gave the best outcomes with minimum error for the solar PV generation model examined. The error (residual) was determined 0.5362% for the solar PV generation model of 9 rules ANFIS model, 1.26% for the ANFIS with 5 rules and 1.082% for the ANFIS model that has 11 rules. On the other hand, the performance of the ANFIS models was tested based on different rule-bases of the solar PV system. The findings are assessed and compared with the other models using the average prediction error approach. The following equation was employed for the calculation of the average prediction error.

$$Average\ prediction\ error = \frac{1}{n} \sum\_{k=1}^{n} \frac{|A\_k - P\_k|}{A\_k} \times 100\tag{12}$$

### **4. Results and Discussions for Solar PV System Findings**
