Forecasting Models of Daily Energy Generation by PV Panels Using Fuzzy Logic

: This paper contains studies of daily energy production forecasting methods for photovoltaic solar panels (PV panel) by using mathematical methods and fuzzy logic models. Mathematical models are based on analytic equations that bind PV panel power with temperature and solar radiation. In models based on fuzzy logic, we use Adaptive-network-based Fuzzy Inference Systems (ANFIS) and the zero-order Takagi-Sugeno model (TS) with specially selected linear and non-linear membership functions. The use of mentioned membership functions causes that the TS system is equivalent to a polynomial and its properties can be compared to other analytical models of PV panels found in the literature. The developed models are based on data from a real system. The accuracy of developed prognostic models is compared, and a prototype software implementing the best-performing models is presented. The software is written for a generic programmable logic controller (PLC) compliant to the IEC 61131-3 standard.


Introduction
The basis for being on the electricity market is forecasting generation and demand for electricity.Power generators and distributors use short-term forecasting most often.The main problem of energy producers are external factors that affect the production level; in other words, weather conditions [1,2].In case of producers that sell energy on energy exchanges, the use of a forecast with a high error may result in financial losses.The reason for these losses is an inappropriate evaluation of energy supply and presenting an offer with a price significantly deviated from the market price.However, accurate forecasts reduce costs and increase profits, thanks to improving the efficiency of the procurement process and energy distribution [3,4].The choice of prognostic methods may depend on the scope of information.There are many forecasting methods, and some of them are used in power engineering.
Generally, the methods of power forecasting in solar systems can be divided into physical, statistical, artificial intelligence and others.Some statistical methods in prediction can be found in [2,5].The comparison of the physical model with the multilayer perceptron neural network (MLP NN) model for power predictions is presented in [6].Among others artificial intelligence methods, MLP neural networks [1,2,6,7], radial basis function neural networks (RBF NN) [8], physical hybrid artificial neural networks [9], recurrent neural networks [8] and deep neural networks [10] are used to predict the power and energy of photovoltaic sources.
A large part of the developed methods has some disadvantages, such as a relatively large average accuracy error and the dependence of a specific photovoltaic system design on the geographical location.In order to increase quality of forecasting power, some authors have developed hybrid models [11,12] and applied various methods of optimization of model parameters calculation [13] or used methods for input data imputation [14].Implementation of the mentioned methods requires devices with high computing power and the use of specialized software libraries.This may lead to the limitation of technology to the area of computing centers and a lack of possibility to deploy the technology on platforms commonly used in the industry, such as programmable logic controller (PLC) devices.
The goal of the paper is to evaluate fuzzy logic-based analytical models applied to forecast daily energy generation by an installation of PV panels and compare these models to an ANFIS system and to analytical models taken from the literature.The purpose of the research is the following.The market forces green energy producers to have models for energy production forecasting.In order to improve the accuracy of these models, local climate conditions should be taken into account.The existence of these conditions has impact on the precision of models.Having set up a PV panel site, it is recommended to conduct measurements in order to obtain data required for building a model of the site.Several examples of fuzzy logic applications in power engineering are control of a battery energy storage system [15], energy management in a DC microgrid [16], design of a voltage source inverter [17] and control of grid-connected inverters [18].Experience from these areas points to the fact that the quality of fuzzy logic-based models is better or comparable to systems designed by applying other methods.An advantage of fuzzy models is their rule-based form, which is easy to understand for a human.However, this implies that in order to examine properties of the system, oftentimes, simulations must be performed because of absence of analytical methods.Model-free and heuristic design methods, deficit in analytical tools, can be a reason that the fuzzy logic is not preferred solution in a given domain [19].Authors of this paper focused on models that are based on the zero-order Takagi-Sugeno fuzzy inference system with special kinds of fuzzy sets, as described in the thesis [20].This approach allows to express fuzzy rules as polynomials, compare models designed as a set of fuzzy rules with mathematical models and utilize analytical methods to examine features of the system.A practical application of the theory described previously [20] is presented in [21,22] for an attitude control system and a mechanical vibration limiting system.In one paper [23], it was shown that fuzzy models obtained by the use of methods from [20] can be efficiently implemented in hardware field-programmable gate array devices (FPGA).
The novelty of this work is an application of analytical methods in fuzzy modeling from [20] in the area of power engineering.The paper shows that using the presented techniques, we can obtain a high-quality fuzzy logic-based model for predicting daily energy production by a PV panel.Because the model is identical with a polynomial function, its characteristics can be studied with the use of formal methods.
We also show an exemplary implementation of our achievements.Commercial products utilizing fuzzy logic are considered to be innovative.The result of our research can be a base to develop a novel device that can be deployed as a data processing node at the layer 2 in the edge computing architecture of a Smart Energy System [24].The hardware platform for the device can be a standard general-purpose PLC unit.The program, which implements fuzzy logic systems, neither requires high computing power nor non-standard software components.

Description of the PV System
The research was carried out on the basis of a photovoltaic panel system.The PV system is composed of three modules (monocrystalline type), connected to the Soladin 600 solar inverter.Photovoltaic panels are positioned at 30 degrees to the horizon and are directed to the South.The total installation power is 330 [Wp].The PV system works in Rzeszów (geographical location 50 The photovoltaic measurement system included measurement of voltage and DC current in front of the inverter, voltage, AC current, power and frequency at the inverter output.At the same time, measurements of solar radiation in the plane of PV panels were made using a pyranometer.All parameters were measured on a current basis; however, their average values were recorded every minute in the database.The measurement data taken in the time interval from November to October of the next year were used for the research.
In our research, two measured factors were used in the PV system: the daily value of insolation and the total value of DC energy generated during the day, calculated per 1 [m 2 ] of the active area of photovoltaic panels.In addition, measurements of the daily maximum temperature in the analyzed period came from a meteorological station in the system's work place.Therefore, the forecasts of the daily energy produced in a PV system will be generated on the basis of two factors, i.e., air temperature and daily insolation.Developed forecasting models generate forecasts in the perspective of one day.
The total set of measurement data consisting of 347 samples (days) was divided into a training set (174 samples) and a test set (173 samples).This manner of division allowed to achieve even coverage of the measurement space with test and learning points.The algorithm for creating the learning set was as follows: Let M ST = (m ST1 , m ST2 , . . ., m STn ) be a sequence of measurements ordered by ascending temperature: m STi is a tuple <t, g>, where t is the value of temperature and g is the value of insolation; ∀i = 1, 2, . . ., n − 1: Let M SG = (m SG1 , m SG2 , m SGn ) be a sequence similar to the mentioned before, but ordered by ascending insolation: ∀i = 1, 2, . . ., n: m SGi •g ≤ m SGi + 1 •g.
The learning set is defined as M L = M LT ∪ M LG , where M LT and M LG are given by ( 1) and ( 2): The test set is defined as M T = M ST /M L .Based on the training set the parameters of the forecasting models were determined and the test set was used to verify these models.
Figure 1 presents the distribution of measure points in space of air temperature (T) and insolation (G). Figure 2 presents the distribution of measurements in the air temperature set (T) and Figure 3 shows the distribution of measurements in the set of daily insolation (G).

Mathematical Modes of the Power Production of Photovoltaic Panels
In the literature [25,26], several models of estimation of daily power production by a solar panel operating in Maximum power point tracking (MPPT) conditions are presented.One paper [25] proposes the equation: where: a , b , c and d are constants.Another model for determining the power of a PV panel is presented by the following formula [26]: Energies 2021, 14, 1676 where G is the insolation in the plane of the PV panel, G n is the insolation on the surface of the Earth in the horizontal plane, G 0 is the standard insolation 1000 (Wh/m 2 ), T is the air temperature, T j is the temperature of the PV panel, T jref is the reference temperature of the PV panel and T jref = 25 ( • C), AM is the air mass ratio, AM 0 is the air mass ratio for the Sun at the zenith, AM 0 = 1.5,A is the active surface of the panel and p, q, m and u are constants.
The following dependence allows replacing the solar insolation G n with solar radiation G.We consider the average daily parameter measurements and assume that AM has a constant value for one daily measurement, depending on the calendar day.Because the G values are measured, the daily change of the AM parameter is included in the G measurement.With these assumptions, (2) takes the form: where c 1 , c 2 , c 3 , c 4 and c 5 are constants.
In [18], the value of c' 5 ∈ (1.0618, 1.6601) was determined, depending on the panel manufacturer.In Equations ( 3)-( 5), there is the parameter T j -the panel temperature.The authors made air temperature measurements.In [27], it was shown that there is the following relationship between the air temperature and the panel temperature: where h is a constant and t is the air temperature.Considering the above, Equation (3) takes the form: and ( 5) can be simplified to the following formula: where: a, b, c, d and e and c 1 , c 2 , c 3 , c 4 , c 5 and c 6 are constants.A higher degree of polynomial approximating power in relation to (5) results from the fact that (8) takes into account the dependence of photovoltaic panel efficiency on insolation.This phenomenon was not modeled in (5).
The measurements contain the total energy produced by one square meter of the PV panel surface during the period of 24 h, e.g., E = P × t, where P is the power of the PV panel operating under the MPPT condition, time t = const = 24 h.
Taking the above into account, we obtain energy E = k×P.If we use Matlab to find the constant coefficients of the polynomial equation of the power output of a PV panel, we have: The value of the constant k will be included in the calculated coefficients c 1 , . . ., c 6 .The presented analysis allows to use measured energy E instead of power in the process of calculation constants c 1 , . . ., c 6 .
In order to interpolate the measurement results with ( 7) and ( 8), the following parameters were determined: a, b, c, d, e, c 1 , . . ., c 6 , h using Matlab's lsqcurvefit function [28].The interpolation method with minimization of mean square error was applied, as shown in Algorithm 1. Tables 1 and 2 contain the calculated values of parameters.In this section, the goal is to design a fuzzy application system that predicts the total daily production of electricity by the solar panel, based on insolation and air temperature.
The structure of the forecasting system was obtained using a classic engineering approach.The optimal values of the fuzzy system parameters were determined by Matlab software.The components of the system are presented in Figure 4.For the given values of the linguistic variables, we specify the triangular fuzzy sets, as shown in Figure 4. We do not specify sets for the variable P, because they will be determined automatically.Membership functions for the linguistic values are given by the following equations (where the symbols ∧ and ∨ mean the minimum and maximum, respec- Based on the models presented in Section 2.2 and in accordance with the principles given in [29], let us introduce the following linguistic variables: temperature t, insolation g and power P. Let us define the following sets of linguistic values for the introduced variables: g ∈ {low, medium, high}, P ∈ {low1, low4, low7, medium2, medium3, medium5, medium8, high6, high9}.(12) For the given values of the linguistic variables, we specify the triangular fuzzy sets, as shown in Figure 4. We do not specify sets for the variable P, because they will be determined automatically.Membership functions for the linguistic values are given by the following equations (where the symbols ∧ and ∨ mean the minimum and maximum, respectively): , and Numerical constants that appear in ( 13) and ( 14) are taken from the measurements data and depend on minimal and maximal values of temperature and insolation.Ranges for t and g are as follows: t ∈ (−5; 31), g ∈ (102.6;8371).Figure 5 shows the chart of functions given by (13); the chart of functions ( 14) looks similar.Taking into account the power models from Section 2.2 and the values of variables t and g, nine rules can be formulated to determine the power produced by the panel.Applying the algorithm described in [30] and the Matlab software for the training data, numerical values for elements of the P set were obtained, as shown in the Table 3.

Name
Value Name Value Taking into account the power models from Section 2.2 and the values of variables t and g, nine rules can be formulated to determine the power produced by the panel.Applying the algorithm described in [30] and the Matlab software for the training data, numerical values for elements of the P set were obtained, as shown in the Table 3.  15)-( 18) and the chart form the Figure 6 are citations from [20].We place them here so that the reader can understand the method without the need for checking other publications.Similarly to Section 2.3, let us introduce the following linguistic variables: temperature t ∈ {low, low}, insolationg ∈ {low, low} and power P = {p 1 , p 2 , p 3 , p 4 }.Let us assume that the temperature and irradiation are bounded: t ∈ (−α t , β t ), g ∈ (−α g , β g ).For the given values of linguistic variables, let us define fuzzy sets shown below: Energies 2021, 14, x FOR PEER REVIEW 9 of Figure 6.The chart of the linear membership functions by ( 12) and ( 13) [20].
Figure 6 shows the charts of the membership functions µlow(t) and   () ̅̅̅̅̅̅̅̅̅ .The valu of the variable P will be real numbers.In [20], it is shown that with expressed condition the zero-order Takagi-Sugeno system described by the following rules: is equivalent to the following equation: Equations ( 3) and ( 19) define the same polynomial: they have a degree of 1 and bo are functions of temperature and insolation.Therefore, the system can be modeled by (1 only when on the input there is given the temperature of the PV panel, not the air tempe ature.12) and ( 13) [20].
Figure 6 shows the charts of the membership functions µ low (t) and µ low (t).The values of the variable P will be real numbers.In [20], it is shown that with expressed conditions the zero-order Takagi-Sugeno system described by the following rules: IF t is low AND g is low THEN P = p 1 , IF t is low AND g is low THEN P = p 2 , IF t is low AND g is low THEN P = p 3 , IF t is low AND g is low THEN P = p 4 , is equivalent to the following equation: Equations ( 3) and ( 19) define the same polynomial: they have a degree of 1 and both are functions of temperature and insolation.Therefore, the system can be modeled by (19) only when on the input there is given the temperature of the PV panel, not the air temperature.

Rule Based System-Nonlinear Membership Functions
As in Section 2.4, we cite Equation ( 20) and the chart from the Figure 7 from the work [20], where it was shown that using a certain class of nonlinear membership functions, it is possible to present a zero-order Takagi-Sugeno system as the scalar product of two matrices.Let us assume the following denotes:  In [20], it was shown that with the given assumptions, the zero-order Takagi-Sugeno system described by the rules: is equivalent to the following equation: where: n1, …, n9 are constant parameters.The Formula ( 21) is a generalization of polynomials (3), ( 7) and ( 8), so the system is able to model the daily production of energy with both air temperature and the panel temperature.
Using the test data file and the Matlab program similar to the one showed on the Algorithm 1, parameters of Equation ( 21) were computed.

Results
This section presents the results of energy forecasting for developed models.The accuracy of the models was estimated on the bases of various forecast error measures.Suppose that temperature t ∈ (−α t , β t ) and insolation g ∈ (−α g , β g ), i.e., the values of temperature and solar radiation are limited to a certain range.For given values of linguistic variables, let us define fuzzy sets as follows: where parameter λ satisfies the condition 0 < λ ≤ 1.In the further part of the discussion, we will assume that λ = 1.The chart of the membership functions µ low (t), µ medium (t) and µ high (t) for the parameter λ = 1 is shown in Figure 7.
In [20], it was shown that with the given assumptions, the zero-order Takagi-Sugeno system described by the rules:  (21) where: n 1 , . . ., n 9 are constant parameters.The Formula ( 21) is a generalization of polynomials ( 3), ( 7) and ( 8), so the system is able to model the daily production of energy with both air temperature and the panel temperature.
Using the test data file and the Matlab program similar to the one showed on the Algorithm 1, parameters of Equation ( 21) were computed.Table 4 contains obtained values.

Results
This section presents the results of energy forecasting for developed models.The accuracy of the models was estimated on the bases of various forecast error measures.

Measures for Estimating Forecast Errors
In the literature on the problem of forecasting energy, the accuracy of prognostic models is determined by means of various measures.This often makes it difficult to compare the results of different authors and their prognostic methods.Therefore, it is advisable to present the obtained results in the form of standardized measures for calculating forecast errors.Thus, the accuracy of the models developed by us will be presented by using the error measures described below.
Mean error (ME): Mean Absolute Error (MEA): Mean Absolute Percentage Error (MAPE): Root Mean Squared Error (RMSE): Absolute Percentage Error (δ P ): where E i is the measurement of energy in the solar installation on the i-th day, E p i is the forecast of energy production on the i-th day, N is number of samples and e i = E p i − E i is the error of the forecast.

Forecast Errors Calculations
Table 5 presents the calculated errors of forecasts of particular models for the training data, where MP 1 is the analytical model described by (7), MP 2 is the analytical model described by (8), TSi is the ANFIS model described in Section 2.3, TS_nl is the Takagi-Sugeno fuzzy model with nonlinear membership functions given by (21).Table 6 presents forecast errors for the test data.Figure 8a shows the distribution of the relative percentage errors (26) of energy forecasts for the MP 1 and MP 2 analytical models, marked as δMP1 and δMP2, in the test set.Figure 8b presents the distribution of the relative percentage errors of energy prediction for the TSi and TS_nl models, also in the test set.The areas of disks and areas enclosed by circles are proportional to values of errors.A gray disk included inside of the circle means that for the given pair (temperature, insolation), the model represented on the chart by the disk gives lower forecasting error comparing with the model represented by the circle.Figure 8 shows that every of investigated models has low forecasting quality for low temperatures and insolation values.Aggregated measures presented in Tables 5 and 6 do not show these properties of models.
Figure 9 shows measured energy production and energy forecasts for the training data (174 days), and Figure 10 presents values energy measurements and forecasts for 173 days of the test data.Both charts allow to evaluate general quality of the model from Section 2.3 and show complexity of the PV panel energy production forecasting problem in the temperate climate area.Value of the forecasting energy for a succeeding day can be significantly different regardless of a season.The model correctly approximates training data (Figure 9) and keeps the quality for the test data (Figure 10).

Conclusions and Discusion
After the comparison of the quality of measurement data interpolation of the acquired model with the analytical model from the references, one should draw the conclusion that such a system can be applied in forecasting (the TSi column in Tables 5 and 6).Its performance is significantly better than that of analytical equations in all error measures.However, for one of the main error measures, namely, the MAPE error, the TS_nl rule system generates significantly smaller errors than the mathematical models and a little better than the ANFIS model.
Figure 8b presents the distribution of the relative percentage errors of energy prediction for the TSi and TS_nl models, also in the test set.The areas of disks and areas enclosed by circles are proportional to values of errors.A gray disk included inside of the circle means that for the given pair (temperature, insolation), the model represented on the chart by the disk gives lower forecasting error comparing with the model represented by the circle.Figure 8 shows that every of investigated models has low forecasting quality for low temperatures and insolation values.Aggregated measures presented in Tables 5 and 6 do not show these properties of models.7) and ( 8) for MP1 and MP2 models; (b) TS system with triangular membership functions of the ANFIS model (δTSi) and the TS system with nonlinear membership functions given by Equation ( 21 7) and ( 8) for MP 1 and MP 2 models; (b) TS system with triangular membership functions of the ANFIS model (δTSi) and the TS system with nonlinear membership functions given by Equation ( 21) (δTS_nl).On the basis of reference works in the area of applying analytical methods in fuzzy logic, it has been pointed out that the forecasting methods based on fuzzy logic are generalization of analytical equations, which depend on what membership function is applied to fuzzy sets.The best of the studied systems based on fuzzy logic, the analytical form of which is different than the discussed analytical equations, turn out to be better than the analytical equation (the TS_nl column in Tables 5 and 6).

Conclusions and Discusion
After the comparison of the quality of measurement data interpolation of the acquired model with the analytical model from the references, one should draw the conclusion that such a system can be applied in forecasting (the TSi column in Tables 5 and 6).Its performance is significantly better than that of analytical equations in all error measures.However, for one of the main error measures, namely, the MAPE error, the TS_nl rule system generates significantly smaller errors than the mathematical models and a little better than the ANFIS model.
On the basis of reference works in the area of applying analytical methods in fuzzy logic, it has been pointed out that the forecasting methods based on fuzzy logic are generalization of analytical equations, which depend on what membership function is applied to fuzzy sets.The best of the studied systems based on fuzzy logic, the analytical form of which is different than the discussed analytical equations, turn out to be better than the analytical equation (the TS_nl column in Tables 5 and 6).

Software for Energy Production Forecast
Based of the above considerations, a prototype software for daily energy production forecast has been developed.The development platform is the CPDev engineering environment [31].This platform allows to create control programs in languages of the IEC 61131-3 standard: structured chart (ST), instruction list (IL), ladder diagram (LD), functional block diagram (FBD) and sequential function chart (SFC).These programs can be deployed to different PLC devices and installed in solar panel sites.The forecasting software is currently at the Technology Readiness Level 3 (TRL) and consists of three main modules (see Figure 11a): the main program module, visualization panel management module and Human-Machine Interface (HMI) events processing module.Modules communicate by the use of global variables.The algorithm for the energy production forecast is as following (see Algorithm 2): 1.

3.
Calculate the energy production forecast (lines [19][20][21][22][23]. The function of reading the weather forecast is currently being simulated but will be programmed as a custom function block, as described in the paper [32].Two remaining functions are fully implemented.A calculation of the irradiation on the tilted PV panel surface is performed according to a previous paper [33].Required parameters (albedo, diffusion model, solar panels total area, inverter efficiency, etc.) are entered in the settings panel (Figure 11b).Forecasting of the energy production is done by one of the three functions, MODEL1, MODEL2 and MODEL3, which implement Equations ( 7), ( 8) and (21), respectively.Coefficients of the mentioned equations are entered as constants in the settings panel.

Software for Energy Production Forecast
Based of the above considerations, a prototype software for daily energy production forecast has been developed.The development platform is the CPDev engineering environment [31].This platform allows to create control programs in languages of the IEC 61131-3 standard: structured chart (ST), instruction list (IL), ladder diagram (LD), functional block diagram (FBD) and sequential function chart (SFC).These programs can be deployed to different PLC devices and installed in solar panel sites.The forecasting software is currently at the Technology Readiness Level 3 (TRL) and consists of three main modules (see Figure 11a

Conclusions
The paper presents an overview of selected models of daily power production by photovoltaic panels.Parameters for individual models were computed and their quality assessed.The parameters of all model were determined in such a way as to ensure adjustment to the measurement data obtained from the photovoltaic system installation.
Studies have shown that the best model is a two-input Takagi-Sugeno system with nonlinear membership functions (TS_nl).Such a system is equivalent to a continuous linear function of two variables: insolation and temperature.
Noteworthy is the model described by Equations ( 7) and ( 8), because its quality is slightly lower than that of the TS_nl model, but its advantage is the low technical complexity and the existence of the analytical form of the model.The model can be used with both air and panel temperature.Since the latter quantity is not forecasted, it should be determined indirectly.
If you use the forecasts of insolation and temperature, the quality of forecasting power production depends on the quality of the weather forecast.Authors take the position that with a system model based on real measurements, one should strive to use high-quality forecasting data.With the development of weather forecasting methods, the quality of power output forecasts described in the paper will improve.High quality of the mentioned forecasts is related to the financing of green energy producers.A proper estimation of supply allows to gain a competitive advantage on the energy market.

Energies 2021 , 17 Figure 1 .
Figure 1.Distribution of measurement points (MT-test, ML-learning) in the space of temperature T and insolation G, T × G.Figure 1. Distribution of measurement points (M T -test, M L -learning) in the space of temperature T and insolation G, T × G.

Figure 1 .
Figure 1.Distribution of measurement points (MT-test, ML-learning) in the space of temperature T and insolation G, T × G.Figure 1. Distribution of measurement points (M T -test, M L -learning) in the space of temperature T and insolation G, T × G.

Figure 1 .
Figure 1.Distribution of measurement points (MT-test, ML-learning) in the space of temperature T and insolation G, T × G.

Figure 2 .
Figure 2. Distribution of measurement points in the temperature set T.

Figure 3 .
Figure 3. Distribution of measurement points for the set of insolation G.

Figure 2 .
Figure 2. Distribution of measurement points in the temperature set T.

Figure 1 .
Figure 1.Distribution of measurement points (MT-test, ML-learning) in the space of temperature T and insolation G, T × G.

Figure 2 .
Figure 2. Distribution of measurement points in the temperature set T.

Figure 3 .
Figure 3. Distribution of measurement points for the set of insolation G.Figure 3. Distribution of measurement points for the set of insolation G.

Figure 3 .
Figure 3. Distribution of measurement points for the set of insolation G.Figure 3. Distribution of measurement points for the set of insolation G.

Figures 1 -
Figures 1-3 allow to visually evaluate the quality of input data.From Figure 1, we can say that elements of learning and test sets are distributed quite uniformly over the space of measurements.Two remaining charts show values of temperature and insolation typical for the temperate climate area where the city of Rzeszów lies.Short winder days, cloudy spring and autumn are the reason for many measurements with low values of insolation and values of temperature around 8 • C.

Figure 4 .
Figure 4.The draft rule system based on ANFIS.

Figure 4 .
Figure 4.The draft rule system based on ANFIS.

Figure 5 .
Figure 5.The chart of membership functions of Equation (13).

Figure 8 .
Figure 8. Errors of approximation for the test data: (a) Equations (7) and (8) for MP1 and MP2 models; (b) TS system with triangular membership functions of the ANFIS model (δTSi) and the TS system with nonlinear membership functions given by Equation (21) (δTS_nl).
Figure 8. Errors of approximation for the test data: (a) Equations (7) and (8) for MP1 and MP2 models; (b) TS system with triangular membership functions of the ANFIS model (δTSi) and the TS system with nonlinear membership functions given by Equation (21) (δTS_nl).

Figure 9
Figure 9 shows measured energy production and energy forecasts for the training data (174 days), and Figure 10 presents values energy measurements and forecasts for 173 days

Figure 8 .
Figure 8. Errors of approximation for the test data: (a) Equations (7) and (8) for MP 1 and MP 2 models; (b) TS system with triangular membership functions of the ANFIS model (δTSi) and the TS system with nonlinear membership functions given by Equation (21) (δTS_nl).

Energies 2021 ,
14, x FOR PEER REVIEW 13 of 17of the test data.Both charts allow to evaluate general quality of the model from Section 2.3 and show complexity of the PV panel energy production forecasting problem in the temperate climate area.Value of the forecasting energy for a succeeding day can be significantly different regardless of a season.The model correctly approximates training data (Figure9) and keeps the quality for the test data (Figure10).

Figure 9 .
Figure 9.The values of (EDC) energy measurements and (EDC) energy forecasts obtained from the ANFIS (TSi) model (the training data set, 174 days).

Figure 9 .
Figure 9.The values of (E DC ) energy measurements and (E DC ) energy forecasts obtained from the ANFIS (TSi) model (the training data set, 174 days).

Figure 9 .
Figure 9.The values of (EDC) energy measurements and (EDC) energy forecasts obtained from the ANFIS (TSi) model (the training data set, 174 days).

Figure 10 .
Figure 10.The values of (EDC) energy measurements and (EDC) energy forecasts obtained from the ANFIS (TSi) model (the test data set, 173 days).

Figure 10 .
Figure 10.The values of (E DC ) energy measurements and (E DC ) energy forecasts obtained from the ANFIS (TSi) model (the test data set, 173 days).
): the main program module, visualization panel management module and Human-Machine Interface (HMI) events processing module.Modules communicate by the use of global variables.The algorithm for the energy production forecast is as following (see Algorithm 2): 1. Get weather forecast (lines 9-11).2. Calculate the irradiation on the panel surface (lines 12-18).3. Calculate the energy production forecast (lines 19-23).

Figure 11 .Algorithm 2 Figure 11 .
Figure 11.(a) Structure of the program; (b) the Human-Machine Interface (HMI) in the CPVis the simulation environment.

Table 1 .
(5)orithm 1 A Matlab program for computing coefficients of the Equation(5).Values of the parameters of Equation (7), calculated from the training data set.

Table 2 .
Values of the parameters of Equation (8), calculated from the training data set.

Table 3 .
Computed linguistic values of P based on the training data set.

Table 3 .
Computed linguistic values of P based on the training data set.

Table 4
contains obtained values.

Table 4 .
Parameters of Equation (18) calculated from the training data set.
IF t is high AND g is high THEN P = p 9 , is equivalent to the following equation:

Table 4 .
Parameters of Equation (18) calculated from the training data set.

Table 5 .
Forecasts errors for the training data.

Table 6 .
Forecasts errors for the test data.

Algorithm 2
The main function of the energy production forecast program.