Medium term load forecasting using fuzzy logic approach: A case study of Taroudannt province

. Increasing energy efficiency and reliability of power grids is becoming an essential part of grid energy management. Accurately predicting load demand is one of the most important responsibilities of any power utility. This paper focuses on medium term load forecasting for the Moroccan province of Taroudannt using historical monthly load data for five years (2018-2022), temperature and wind speed. This study is the first of its kind in Morocco, particularly within the province of Taroudannt. The main objective is to contribute to the improvement of energy efficiency in the Souss Massa region. To forecast consumed energy, the fuzzy logic approach is used. Three different models are developed, considering three defuzzification methods, namely Centroid, Bisector and smallest of maximum (SOM). The model is tested using data from the year 2022. The simulation results show that the SOM prediction values are less precise, with a mean error of 13 %. In contrast, the other two methods generate the more reasonable and satisfactory values which are closer to the actual load, with the mean absolute percentage error (MAPE) less than 8.5 %. The result obtained demonstrate that the proposed model is capable of accurately forecasting future load for Taroudannt province.


Introduction
To better manage operations and efficiently planning, both in terms of purchasing and generating electric power to ensure network balance and meet customer demand, utilities need to make important decisions.Load forecasting has become a very essential task for utilities and is one of the powerful tools that helps power system operators improve their services and ensure the grid reliability.
Electric load forecasting is classified into four categories depending on the forecast period and the required objectives [1]- [4]:  Very Short-Term Load Forecasting (VSTLF): employed to forecast load for a timeframe ranging from few minutes to a few hours. Short Term Load Forecasting (STLF): employed to forecasts load from one hour to one week.It can help us to estimate load flow and to make decisions that can intercept overloading.


Medium Term Load Forecasting (MTLF): employed to forecasts load from one week to one year.MTLF is used for the purpose of scheduling fuel supplies and the management of units. Long Term Load Forecasting (LTLF): this method has its period which is longer than a year.STLF relies on the consideration of multiple variables, including time-related factors and weather data.When generating medium-and long-term forecasts, it takes into consideration historical load patterns, weather data, the number of customers in distinct categories, economic and demographic data, as well as their projected trends, alongside other relevant factors.It's important to note that weather conditions play a pivotal role in load forecasting, especially in short-and mid-term predictions.Various meteorological variables are taken into account for load forecasting, with temperature, humidity, and wind speed being the primary factors frequently used to predict load demand [5].
Considering the reasons and requirements, any of the mentioned categories can be selected.In this study, we focus on medium-term load forecasting to predict future load.
In the literature various forecasting methods have been explored [1], including linear regression [5], the Autoregressive Integrated Moving Average (ARIMA) model [6], fuzzy logic [7]- [9], and Artificial Neural Network (ANN) [5], [10], [11].Among all these techniques, fuzzy logic and ANN are largely used [8], [12].However, fuzzy logic seems to be more advantageous due to its distinct qualities.For instance, when there are reasonable fluctuations between the weather parameters and load, fuzzy logic demonstrates better performance by minimizing forecast errors [7].
This paper presents a mid-term load forecasting model based on fuzzy logic approach.Three models, depending on three defuzzification methods, are developed to forecast the monthly load for the province of Taroudannt, town of Souss-Massa region, Morocco, using historical loads and meteorological data for 2018-2022.The inputs used for the fuzzy logic model are the Month Index (MI), Temperature (T) and Wind Speed (WS).
The structure of this paper is as follows; Initially, we provide a concise overview of load forecasting techniques.The second section describes the methodology and materials employed in this study.Section 3 is dedicated to presenting the results and engaging in a discussion, while Section 4 serves as the conclusion of the paper.

Historical data collection
The historical load dataset was obtained from the National Electricity Office, located in the province of Taroudannt, which is an imperial Moroccan town situated along the Souss Valley and approximately 80 kilometers east of Agadir as shown the map in Fig. 1.The meteorological data, including temperature and wind speed, were obtained from the database of historic Moroccan weather [13].
Fig. 2 shows the monthly load demand profile of the Taroudannt province over the years 2018-2022.This figure is plotted by using the collected historic data.From these curves, we can see that, due to the meteorological characteristics of the Taroudannt province, that the consumed energy fluctuates between the summer and winter periods.It rises to its peaks during the summer and falls considerably outside the summer.

Concept of fuzzy logic system
Fuzzy logic (FL) goes beyond binary logic and enables computers to emulate human reasoning on the basis of imprecise information [14].It establishes non-linear links between meteorological factors and monthly energy consumption using a membership function [6].In this paper, the three parameters temperature, month index and wind speed are used as inputs to the fuzzy logic model while load is an output.
The structure of the fuzzy inference system (FIS) is shown in Fig. 3 and comprises three key elements: the fuzzification, the knowledge base component and the defuzzification unit.
The design of FIS is carried out through the following sequential steps [15], [16], identification of inputs and outputs, fuzzification of inputs and outputs, establishment of rule strength, derivation of rule consequent, integration of rule consequents and application of defuzzification process.

Assigning of membership function
MFs, also known as membership functions, are responsible of defining the degree of fuzziness within a fuzzy set.Thus, the shape of MFs holds great significance in addressing specific problems as they significantly impact fuzzy inference systems.Various shapes can be utilized, including triangular, trapezoidal, Gaussian, and more.However, the essential requirement for an MF is that it should consistently range between 0 and 1 [17], [18].
The load and meteorological parameters are considered as the universe of discourse.These are sorted as Low, Medium, and High and they serve as a subset of the fuzzy sets.
In this work triangular membership function is arbitrarily chosen.
To determine the membership functions for the different subsets of fuzzy sets, an analysis of the data collected shows that inputs and outputs can be best categorized according to the classification presented in Table 1.The membership functions are implemented as given in Fig. 5 -Fig.7.

Fuzzy rules base
A fuzzy rule base is a main component of FIS.This is a set of fuzzy rules that define the relationships between the system's inputs and outputs.The accuracy and reliability of our forecasting output hinges upon the meticulous formulation and application of these rules.The antecedents are funneled into the heart of the fuzzy inference engine and subjected to the governing rules, and the inference system, with its nuanced understanding, proceeds to produce the corresponding outputs.
In cases where we have more than one variable serving as antecedents, we employ fuzzy operators such as AND, OR, and NOT.These operators serve as the connective tissue, allowing us to harmonize these variables into coherent fuzzy sentences.It's through this linguistic approach that we capture the intricate relationships between the input variables, transcending the limitations of binary logic.
Fig. 8 shows 24 rules used in this work.

Defuzzification process
Defuzzification is the process of transforming fuzzy outputs, which represent uncertainty or membership in linguistic terms, into a single and concrete output value [19].
Various defuzzification methods are available to achieve this, and the choice of method depends on the specific application and the desired outcome.The goal of defuzzification is to select the most appropriate single value from the fuzzy output.We define here some popular defuzzification methods used to perform this work [20]. The centroid method (also known as the center of gravity or COG method) for defuzzification, the output value is determined by finding the center of gravity of the output fuzzy set.This involves calculating a weighted average of the values in the fuzzy set, where the weights are determined by the membership degrees of the values.The result is a single crisp value that represents the "center" or "balance point" of the fuzzy output.
 The smallest of the maxima, one of the Maxima methods that consider values with maximum membership. it provides the lowest value in the domain with maximum membership.
 The Bisector of Area (BOA) method, also known as the Center of Area (COA) method, is a defuzzification technique used in fuzzy logic.This method identifies the position under the fuzzy set's curve at which equal areas exist on both sides.This approach helps determine a crisp output value that represents the "balance" or "center" of the fuzzy set, based on its area distribution.
Fig. 9 shows the fuzzy logic model based on "Centroid" defuzzification method.

Fuzzy logic model and simulation
To implement fuzzy logic models, Fuzzy Logic Designer (FLD) of MATLAB environment is used.In this paper, three models are tested and compared, considering the effect of defuzzification methods including Smallest of Maximum (SOM), Bisector of area and Centroid of area methods.
The generated Simulink model based on the fuzzy logic controller is shown in Fig. 10.As can be seen, three inputs data are multiplexed and sent into the fuzzy logic controller and the output is captured on a display.

Results and discussion
The performance of fuzzy logic models is judged by calculating the absolute percentage error (APE) and the mean absolute percentage error (MAPE).These errors are given by ( 1) and (2).
Where ALoad(i) and FLoad(i) respectively are the actual and the forecast loads of the month represented by index i, i ϵ {1,2,3, … 12}.Among the many defuzzification methods that have been proposed in the literature, three methods are adopted in this work.
Fig. 11 shows the representation of the actual and forecasted load for 2022.While Fig. 12 shows the average forecasted load for 2022 compared with actual load by calculating of absolute error.From Fig. 11 and Table 2, It can be observed that the SOM prediction values are less precise, it has the mean error of 13 %.while the other two methods generate the values closer to the actual load.The prediction error is the smallest by using centroid method with The MAPE value less than 8.5 %.
Fig. 12 illustrates the result of a load forecast using the average model.This model is determined by calculating the average of the values obtained from three previous defuzzification methods.as can be seen this model is better in terms of accuracy prediction.especially for the summer period, when the load profile presents high peaks, so that the forecast error is very close to zero for the months of June, July, and August.

Conclusion
This paper proposes a methodology for medium term load forecasting using a Fuzzy Logic Approach.The relationship between temperature, wind speed, and load is identified through a case study in a particular province in Morocco.This study is the first of its kind in Morocco, particularly within the province of Taroudannt.with the primary aim of enhancing energy efficiency in the Souss Massa region.This work has successfully simulated load forecasting using three defuzzification methods: centroid, bisector, and SOM functions.Upon comparing the tested models, it is observed that the three models were able to capture the dynamic behavior of weather variables for load forecasting.However, the model based on bisector and centroid methods produced much more accurate results for Medium-term.
Finally, it has been observed that the difference between predicted and actual load using an average model presents a MAPE of 9.25%.
The next work will be dedicated to developing two other models based on artificial intelligence techniques which are ANN and Adaptive Neuro-Fuzzy Inference (ANFIS) and evaluating its performance in comparison with the fuzzy logic approach.

Table 2 .
Monthly actual and forecasted load for 2022 using three defuzzification methods.