Model of medium-term forecasting of energy mix in Poland

The paper presents analyses based on data published by ARE S.A. (Energy Market Agency) concerning the balance and structure of electricity generation. The data include monthly amount of energy generated by main activity power plants (thermal, hydropower and wind), independent power producers and industrial combined heat and power plants. The forecasting method based on Adaptive Neuro-Fuzzy Inference System (ANFIS) provides a tool for making a short-term forecast of electricity generation, together with its structure, by means of which it is possible to analyze the energy mix. The results of estimation and verification of the above-mentioned model are presented as well as selected forecast results.


Technological development in the power industry
There is no exaggeration in saying that the present time witnesses technological revolution in power industry. Yearly investment spent on renewable energy sources (RES) in the world exceeds investment in conventional energy. Apart from that, technology of energy storing is also developing. Because of that, the significance of fossil fuels is diminishing, together with the methods predicting the development of power industry on the basis of the available resources of such fuels in a country. Still, the trends that can be distinguished within the application of particular technologies provide a basis for forecasting electricity generation in not too distant time horizons, taking into account the history of time series. A real revolution in the power sector can however be caused by a technological breakthrough, bringing about sharp changes in the structure of electricity generation in a longterm horizon and calling for significant changes in forecasting methods.
An energy mix is a balance of primary energy consumed in a country. In general contexts, this notion takes into account global generation in the whole economy, defining the structure of energy carriers and technologies supplying energy to all groups of consumers. In the power industry, the notion of energy mix is understood with reference to electricity. This paper defines energy mix as a structure of sources generating electricity, divided according to carriers of primary energy and technologies The energy mix has to ensure energy and power balance, at the same time minimizing its own cost.

Balance of electricity generation -input data for a forecasting model
The publication "Statystyka elektroenergetyki polskiej" [1] (Statistics of the power industry in Poland) by Energy Market Agency (ARE S.A.) contains data concerning electricity generation and consumption. Using the data, it is possible to analyze the structure of electricity generated from various carriers. To this end, a database for electricity generation was created with a division into monthly periods for the years 2004-2016, for the following categories of generation: thermal power plants, wind power plants, hydroelectric power plants, independent power producers, generation from renewable energy sources, industrial power plants and import of electricity. The above-mentioned data will be subsequently used for constructing forecasting models. Table 1 presents selected data for the last calendar year available in statistical reports. The data presented in Table 1 indicate that the greatest share of electricity in Poland is generated by fossil fuel plants, combusting coal and lignite.

RES in the structure of electricity generation in Poland
Directive 2009/28/EC of the European Parliament and of the Council of 23 April 2009 on the promotion of the use of energy from renewable sources specifies the strategic objectives of power policy concerning RES for the EU and for the particular countries. According to the directive, the share of RES in the final gross energy consumption in Poland should achieve the level of 15 % in 2020 [2]. Table 2 and Fig. 1 present the increase in the contribution of RES to electricity generation. The development of RES has to be correlated with the development of the power grid [3], and to actions ensuring the safety of its operation [4].   Table 3). The power obtained from wind farms remained practically unchanged in the last year, and the potential of biomass increased slightly from 1281.1 MW to 1362.0 MW.  Electricity generation from RES increases systematically (Table 4). The greatest share of electricity generated from RES comes from hydroelectric power plants and biogas. The dynamics of the increase in energy coming from photovoltaic systems should also be noted.

The fuzzy model and ANFIS
The load of the system is influenced both by deterministic and random variables. In publications [6,7] it was demonstrated that a number of quantities characterizing the variation of load within a year can be approximated by periodically varying functions. The dynamic functions of the system load take into account yearly increases or decreases. The data published by ARE S.A. [1] include statistical reports of monthly balance of energy generation and consumption, and the analysis of time series confirms the thesis that they vary periodically with dynamic changes. An appropriate tool to forecast time series with periodic variation appears to be an adaptive system of inference applying neural networks. The issue has been widely discussed in the literature [8][9][10][11][12], including works by the author of the paper.
The theory of fuzzy sets (1965) and fuzzy logic (1973) was created by Lofti A. Zadeh [13]. The theory of fuzzy sets has been applied for the description of phenomena and concepts of ambiguous character or of not clearly delineated boundaries. A membership function was defined, which attributes to each element of the set its degree of membership in the set. Typical membership functions are those of the class S, π, γ, t or L. The applications of fuzzy sets and fuzzy inferencing include a wide spectrum of domains, from simple to highly complex ones, e.g. the classic Mamdani-Zadeh control system with a set of rules (the linguistic model) and blocks of fuzzification, inferencing, and defuzzification.
The fuzzy model is a logical one in which the "if -then" rules determine qualitatively the dependences between variables. At the input of the fuzzy model variables taking real sharp (or "crisp") values are introduced. Then the fuzzification block determines the membership degree of the sharp values in fuzzy sets by means of membership functions, which have to be precisely estimated, so for each assumed function, its coefficients are established. On the basis of the input membership degrees the output function is computed from the aggregation of conclusions derived from all the inferences. The output membership function is defined as an output fuzzy set. A sharp output value is obtained by the defuzzification of this set, typically by finding the center of maximum, center of weight or center of sums, which yields the sharp output value.
The adaptive neuro fuzzy inference system model ANFIS was first presented in 1993 [8]. The model ANFIS is a technique of data learning that utilizes both fuzzy logic and neural networks [9], transforming input data into an output variable. Neural networks are used for determining the parameters of the fuzzy inference system. Owing to this, it is possible to implement a fairly complicated model without the need to carry out effortconsuming analysis on the part of the user. Other advantages of the system include fast and accurate process of learning, availability of a large array of membership functions and an adequate description of the properties of the model by means of fuzzy rules.
In the design of the fuzzy inference system, selected functions of the computation package Fuzzy Logic Toolbox, Matlab ® , MathWorks, Inc. were implemented. Parameters of the membership functions were estimated by a backpropagation algorithm, employing the least squares method.
ANFIS utilizes fuzzy sets constructed on the basis of input data. Modeling in this inference system is similar to many other identification techniques. The set of input data is divided into two parts. One part is employed in the process of learning by ANFIS, primarily in order to compute membership function parameters. The other part of the input set, which does not play a role in learning, is used in the process of the model verification.
Once the model has been constructed and verified, it is possible to apply it as a prediction tool. In the prediction of electricity generation by various kinds of power plants, the Sugeno-type fuzzy inference was used in the model ANFIS. This method is in many respects similar to Mamdani method, e.g. the fuzzification technique and fuzzification operator are the same, the difference being that in Sugeno-type inference the output membership function can be only linear or constant. The defuzzification process employs the method of weighed arithmetic mean to compute a sharp output value.

ANFIS prediction model
In the prediction process it was assumed that the values of energy generation per month are known X(t) for t=1, ..., T for each variable on the basis of the time series for the revenue of each type of power station specified in Table 1 (i.e. main activity producers of thermal, wind and hydro power, independent producers of thermal and RES power, industrial plants and import). In the balance time series are given for 8 variables. Taking into account that the set of statistical data for each variable is relatively small (T=120, the time series includes the period of ten years), a two-dimensional input vector of learning data was selected on the basis of trials w(t)=[X(t-12) X(t)], with the output data of the learning set corresponding to the prediction trajectory s(t)=X(t+12). The twelve-month shift in the input data justifies the variation cycle for each of the variables under analysis.
For each t in the interval 1 ÷ 108, 96 values of the input/output data set were obtained. The first 48 values were used in the learning process and the other 48 in the verification process. In the model built in this way, i.e. with 2 input variables, the number of fuzzy rules is 4, and the number of estimated parameters is 24 -the number of values in the learning set is only twice as big as the number of parameters.
The results of estimation and verification of the prediction model based on ANFIS presented in the figures illustrate the behavior of only one of the eight variables, specifically electricity generation in main activity producers of thermal power (X(t) in Fig. 2). Fig. 3 presents estimated functions of variable membership w(t), and Fig. 4 presents RMSE for consecutive epochs of the sample verified. The comparison of real data on electricity generation with the predictions of the model ANFIS (Fig. 5) indicates that the differences are small. Absolute errors of the ex post prediction for electricity generated by thermal power plants are shown in Fig. 6, and MAPE obtained from them is 2.40 % ( Table 5).
Prediction models for the other variables were built in a similar way. The character of variability in the past time series for independent producer RES generation, with a clear increase trend, led to a large MAPE (Fig. 7) and rendered the ANFIS prediction model inadequate. Thus, RES generation was computed using the simple regression model.      Table 5 compiles MAPEs for ex post forecasts of monthly electricity balances on the supply side. There may be some objections concerning the accuracy of prediction for imported electricity, but this is due to a random character of that variable. On the basis of the prediction model utilizing ANFIS, a forecast was made of monthly electricity balances in the period 2017÷2020. The results are presented in Table 6.
The structure of total prediction of electricity generation in 2020 drawn on the basis of Table 6 is presented in Fig. 8. Global supply of electricity in 2020 will be 171,1 TWh. The greatest share (78%) is contributed by thermal power plants, with wind power plants (2%), hydro power plants (3%) and RES IPP (1%) amounting to the total share of only 6% in the production.

Conclusions
ANFIS is a useful tool for making predictions on the basis of time series characterized by periodic variability, as is the case with monthly variation in the power generated by various kinds of power plants. Because of this, it is possible to predict the structure of electricity generation in a medium-term horizon.
It has to be noted that the prediction model utilizing ANFIS makes use only of information included in the history of processes being input and output variables. The structure of electricity generation, however, is being increasingly influenced by decisions resulting from the power policy and environmental policy [2]. Thus, in further research linguistic variables will be introduced to take into consideration the external environment of the model. Apart from preferences following from the power policy and environmental policy, it might be advisable to allow for the development of technology in the future prediction models based on ANFIS.