# Fuzzy-Swarm Intelligence-Based Short-Term Load Forecasting Model as a Solution to Power Quality Issues Existing in Microgrid System

Authors: Demsew Mitiku Teferra; Livingstone M. H. Ngoo; George N. Nyakoe
Journal: Journal of Electrical and Computer Engineering
 (2022)

---

## Abstract

Load demand is highly stochastic and uncertain. This is because it was highly influenced by a number of variables like load type, weather conditions, time of day, the seasonality factor, economic constraints, and other randomness effects. The loads are categorized as holiday loads (national and religious), weekdays, and weekend days. The nonlinearity and uncertain characteristics of electrical load in a microgrid are one of the major sources of power quality problems in a microgrid system, and they can be handled using an accurate load forecast model. The fuzzy load prediction model can effectively handle these nonlinearity and uncertainty characteristics to have an accurate load forecast, but the main challenge with this model is its inability to accommodate a large volume of historical load and weather information when the membership function of the input and output fuzzy variables and the number of the fuzzy rules are tremendous. The swarm intelligence load forecast model based on particle swarm optimization algorithms can improve the limitations of the fuzzy system and increase its forecasting performance. The parameters of time, temperature, historical load, and error correction factors are considered as the Fuzzy and Fuzzy-PSO model input variables, while the forecasted industrial load is the only output variable. The Gaussian membership function is considered for both the input and output fuzzy variables. A 3-year historical hourly load data of an Ethiopian industrial system is used to train and validate both prediction models. The mean absolute percentage error (MAPE) is used to evaluate the performance of these prediction models. The Fuzzy-PSO load prediction model shows results that have superior performance to the fuzzy-alone load prediction results.


---

## Body

## 1. Introduction

Load forecasting is a critical component of building an energy management system in a microgrid. It is categorized as very-short-term load forecast (VSTLF), short-term load forecast (STLF), medium-term load forecast (MTLF), and long-term load forecast (LTLF), which are based on the forecasting horizon and the application of predicting the load. The very-short-term load forecasting predicts the load in minutes to the hourly interval. Short-term load forecasting (STLF) predicts one-day up to one-week hourly loads, whereas medium-term load forecasting predicts loads from one-month to one-year time horizon, and long-term load forecasting is the prediction of loads that are more than one-year period [1–3]. The purpose of demand forecasting is to schedule energy generation, assess the security of the power system, and also schedule electricity prices. In order to reduce the capacity and investment cost of the energy storage system, we should maintain a permanent balance between generation and consumption. A disparity between supply and demand will lead to economic losses for the utility. Undergeneration will compromise the reliability and security of the grid, resulting in power outages. These power interruptions will necessitate compensation of the customers by the power suppliers, thus leading to reduced profits or even losses. On the other hand, overgeneration will result in losses due to high generation costs. Forecast information also influences the customers’ decisions on energy management strategies like load shedding to smooth the load curve and limit peak loads. Utilities also place electricity price bids based on the future values of the demand and its corresponding prices [1, 3]. In this research, the STLF strategy was implemented in order to accurately balance generation and demand. It also helps us to maintain the power quality and stability of the distribution system with the minimum capacity of an energy storage system. Various STLF methods have been previously developed. Some of these methods include regressions, neural networks, similar day approach, time series method, fuzzy logic, and hybrid forecasting methods. The regression technique [4–11] is one of the most widely used statistical techniques usually employed to model the relationship between load consumption and other factors such as weather, day type, and customer class, but this technique needs a large volume of historical data to develop a mathematical load relationship.Kumar Singla et al. [12] developed a short-term load prediction model using the Mamdani approach fuzzy logic toolbox and obtained a significant prediction error improvement between +3.67% and −3.75%. According to Gohil and Gupta [13], the fuzzy load prediction model provides a significant accuracy level for predicting holiday and working day loads as compared to conventional approaches. A forecast for special days (holidays) is carried out using an artificial neural network (ANN) and a fuzzy inference method [14]. The simulation result shows the ANN model improves the accuracy level of the fuzzy. Cevick and Cuncas [15] used the fuzzy load prediction approach to forecast future holiday loads. The study provides a significant accuracy level of MAPE of between 2.03% and 11.29%.Gao et al. [16, 17] developed a short-term load forecasting method based on a least squares support vector machine (LS-SVM) combined with fuzzy control and bacterial colony chemotaxis optimization algorithm. In [16], the methodology is based on the prediction of the peak and valley loads and determining the prediction coefficients using the fuzzy rule tuning approach for the prediction of similar day future loads, whereas in [17] the bacterial colony chemotaxis optimization algorithm is used to determine hyperparameters of LS-SVM. Both methods improve the prediction accuracy. Short-term load forecasting using an artificial neural network (ANN) technique is conducted by [18, 19]. In [18], the weekday and weekend day loads are separately treated, and the training of neural network has been done separately for weekdays and weekend days. The neural network toolbox with 20 neurons has been used for forecasting an island load, and the prediction accuracy is promising. According to [19], short-term load forecasting is done to optimally estimate the load flow in a certain power system network. The result shows an accurate load forecast that helps with optimal generation planning and load flow studies.Yang et al. [20–22] developed an improved Wang–Mendel fuzzy model based on the PSO algorithm to improve the learning capability and forecasting accuracy of the fuzzy system. The PSO algorithm helps to optimize the fuzzy rules of the WM fuzzy model. The model yields a very good forecasting accuracy of MAPE of 2.57%. The fuzzy load prediction model for short-term load forecasting lacks self-learning and tuning capability for stochastic and nonlinear load variations. The fuzzy rule base and the fuzzy membership function are the two variables tuned by using PSO. The PSO considers the mean-square error as the optimization objective function from the fuzzy membership function tuning approach. The simulation result demonstrated a significant improvement in forecasting accuracy.Swarm intelligence is an area of artificial intelligence based on the collective and decentralized behavior of individuals that interact with each other and with the environment. PSO is a stochastic evolutionary algorithm based on swarm intelligence that searches for the solution to optimization problems in a specific search space and is able to predict the social behavior of individuals according to defined objectives [23]. A deep learning model for day-ahead load forecasting based on expert knowledge is discussed in [24, 25]. In these methods, the peak load is forecasted using nonlinear historical load data, temperature data, and economic metric data over a similar time horizon. In [25, 26], a hybrid short-term load forecasting approach using a fuzzy logic control system is developed. The short-term load forecasting approach in [26] and a short-term load forecasting model of a nuclear charging station based on PSO-SVM are proposed. The PSO is used to optimize the parameters of the support vector machine (SVM) for optimal charging and discharging operations of a nuclear charging station. The load forecast result based on the normalized root-mean-square error (NRMS) as a fitness measuring tool is used as a prewarning signal of the charging station. The Fuzzy-PSO load prediction model was also discussed in [27]. In [27], the load prediction model only accounts for the weekday and weekend industrial load, and the result obtained is at a high level of prediction accuracy. This paper is an extension of the paper in [27], which accounts for holiday loads and adds a new fuzzy input parameter called the error correction factor that further helps to tune the fuzzy system and also improves the forecasting accuracy.The rest of the paper is organized as follows. Section2 discusses the analysis of industrial raw data. Section 3 presents the problem formulation of the Fuzzy-PSO load prediction model. Section 4 is about results and Section 5 is about the discussion. Section 6 contains the conclusion, and the references and lists of abbreviations are at the end of the paper.


## 2. Industrial Load Data Analysis

Two data sets are required for an effective forecast model of the industrial load. These data sets are the training data set and the model validation (testing) data set. The training and testing load data and weather information are collected from an industrial load that is fed from a 15 kV Kaliti substation in Addis Ababa, Ethiopia. The 24-hour load data is collected from 2017 to 2020 G.C and the holiday, weekday (Monday to Friday), and weekend day (Saturday and Sunday) annual average hourly load data is identified and analyzed for the Fuzzy-PSO load prediction model design. The data from 2017 to 2018 is used to train the Fuzzy-PSO model, whereas the 2019/20 load data is used to validate the model in all the load categories mentioned earlier. The MATLAB programming and MATLAB/Simulink working environments are used to model both the Fuzzy and Fuzzy-PSO load prediction models. Both the training and validation industrial load data sets are prepared in a 24-hour data format based on the raw industrial load data that was collected from the case study area.(1)Pi=1T∑t=1TLt,where Pi is the average load in the ith hour, which is computed using the average value of the available load data size in a similar time frame. T is the total load data size in days, and it is 365 for the validation data set, but 730 for the training load data set. Lt is the industrial load in the ith hour of the tth day.


### 2.1. Holiday Load Profile

In the study area, the categories and number of holidays in each year are identified. In Ethiopia, five national holidays, five Christian holidays, and three Muslim holidays are found in a calendar year. After analysis using (1), the training and testing load profile curve from 2017 to 2020 is presented in Figures 1–6. Since each holiday has different load characteristics, the load prediction model is separately treated.Figure 1
Hourly load profile of religious holidays in 2017/18.Figure 2
Hourly load profile of religious holidays in 2018/19.Figure 3
Hourly load profile of religious holidays in 2019/20.Figure 4
Hourly load profile of national holidays in 2017/18.Figure 5
Hourly load profile of national holidays in 2018/19.Figure 6
Hourly load profile of national holidays in 2019/20.


### 2.2. Weekday Load Profile

For the training and testing of the Fuzzy-PSO load prediction model, the annual average weekday load data from 2017 to 2020 G.C is computed using (1) and presented in Figure 7. The load data in 2017 and 2018 is used to train the Fuzzy-PSO load prediction model, whereas the annual average load data in the 2019/20 calendar year is used to validate the load prediction model for this load category.Figure 7
Weekdays hourly average load profile in 2017–2020.


### 2.3. Weekend Load Profile

For the training and testing of the Fuzzy-PSO prediction model, the annual average weekend load data from 2017 to 2020 G.C is presented in Figure8. The load data in 2017 and 2018 is used to train the Fuzzy-PSO load prediction model, whereas the annual average load data in the 2019/20 calendar year is used to validate the model for the weekend load.Figure 8
Weekend days hourly average load profile in 2017–2020.


### 2.4. Overall System Load Profile

The total system load in Figure9 is used to forecast the overall industrial system load in order to model the microgrid system which is part of ongoing research. To consider the inconsistency of load variation in various events mentioned, a scaling factor (SF) based on the peak load and average system load ratio is considered for both training and testing data sets. The scaling factor is computed using the peak and average industrial load values of both the training and testing load data set values. It can be expressed as(2)SF=LpeakLmean,where SF is the scaling factor, Lpeak is the peak demand, and Lmean is the mean demand of the corresponding training and testing data set values.Figure 9
All events’ hourly average training and testing load data set of the system.The Fuzzy-PSO load prediction model proposed in this paper can be scaled up by increasing the volume of the training and validation dataset. In addition to that, it also expanded by considering the different critical fuzzy input parameters that have a direct impact on load prediction result.


## 2.1. Holiday Load Profile

In the study area, the categories and number of holidays in each year are identified. In Ethiopia, five national holidays, five Christian holidays, and three Muslim holidays are found in a calendar year. After analysis using (1), the training and testing load profile curve from 2017 to 2020 is presented in Figures 1–6. Since each holiday has different load characteristics, the load prediction model is separately treated.Figure 1
Hourly load profile of religious holidays in 2017/18.Figure 2
Hourly load profile of religious holidays in 2018/19.Figure 3
Hourly load profile of religious holidays in 2019/20.Figure 4
Hourly load profile of national holidays in 2017/18.Figure 5
Hourly load profile of national holidays in 2018/19.Figure 6
Hourly load profile of national holidays in 2019/20.


## 2.2. Weekday Load Profile

For the training and testing of the Fuzzy-PSO load prediction model, the annual average weekday load data from 2017 to 2020 G.C is computed using (1) and presented in Figure 7. The load data in 2017 and 2018 is used to train the Fuzzy-PSO load prediction model, whereas the annual average load data in the 2019/20 calendar year is used to validate the load prediction model for this load category.Figure 7
Weekdays hourly average load profile in 2017–2020.


## 2.3. Weekend Load Profile

For the training and testing of the Fuzzy-PSO prediction model, the annual average weekend load data from 2017 to 2020 G.C is presented in Figure8. The load data in 2017 and 2018 is used to train the Fuzzy-PSO load prediction model, whereas the annual average load data in the 2019/20 calendar year is used to validate the model for the weekend load.Figure 8
Weekend days hourly average load profile in 2017–2020.


## 2.4. Overall System Load Profile

The total system load in Figure9 is used to forecast the overall industrial system load in order to model the microgrid system which is part of ongoing research. To consider the inconsistency of load variation in various events mentioned, a scaling factor (SF) based on the peak load and average system load ratio is considered for both training and testing data sets. The scaling factor is computed using the peak and average industrial load values of both the training and testing load data set values. It can be expressed as(2)SF=LpeakLmean,where SF is the scaling factor, Lpeak is the peak demand, and Lmean is the mean demand of the corresponding training and testing data set values.Figure 9
All events’ hourly average training and testing load data set of the system.The Fuzzy-PSO load prediction model proposed in this paper can be scaled up by increasing the volume of the training and validation dataset. In addition to that, it also expanded by considering the different critical fuzzy input parameters that have a direct impact on load prediction result.


## 3. Problem Formulation of the Fuzzy-PSO Load Prediction Model

In this research, a new approach of industrial load forecasting to model a microgrid system has been developed based on a raw industrial load data from the field. The main contributions of this work are as follows:(i)
Introducing the PSO algorithm in the fuzzy load forecast model based on the training and validation data set correlation. An automatic learning and training input data-based generation of the fuzzy rules and optimal parameters of the Gaussian fuzzy membership functions.(ii)
A new fuzzy input variable called the error correction factor (ECF) has been introduced to further enhance the performance of the prediction model and.(iii)
The ECF fuzzy variable is computed from the Simulink fuzzy load prediction model based on equation (3) and it is considered as a time series fuzzy input variable.The ECF is a time series normalized error of the validation load and forecasted load data values. The deviation of the forecast value from the validation data set gives us a pre-indicator to understand the forecasting direction and model adjustment of the Fuzzy-PSO industrial load prediction model.


### 3.1. Fuzzy Logic System

The load prediction model is based on four fuzzy input variables and a single fuzzy output variable whose Gaussian membership function and all the rules are later optimized using the particle swarm optimization algorithm. The fuzzy is trained using PSO based on the available input and output training data set correlation. The fuzzy input variables are temperature, error correction factor, historical load, and time of the day. The forecasted load is the only output fuzzy variable. Both the input and output fuzzy variables have Gaussian membership function as shown in Figure10 and it has two fundamental parameters: the mean (c) and the standard deviation (b). The error correction factor introduced in this research has highly improved the performance of the prediction model, and it can be computed based on the available data values using the following mathematical relation, which was later modeled in Simulink.(3)ECF=FA−FFFA,where FA is the actual load data set and FF is the forecasted load data set. The ECF data is automatically calculated in the fuzzy load prediction model using Simulink and a 24-hour ECF time series data is obtained in the process. The ECF data computed in the fuzzy prediction model is later used to train the fuzzy model using PSO.Figure 10
The Gaussian fuzzy membership function.The fuzzy inference engine incorporates all possible rules that help to map the output from the fuzzy inputs based on the training dataset. LetAik be the ith fuzzy input variable (xi) of k’s membership function and Bt is the t’s membership function of the output variable (yi); then the fuzzy rule is generated as follows:Ifx1 is A1k and x2 is A2k and ........ and xn is Ank, then yi is Bt.The fuzzifier in the fuzzy load prediction model is formulated as follows [28]:(4)μA′xi′=1,ifxi′=xi,0,otherwise.The defuzzification of the load prediction model, based on the center-average defuzzifiers, is also formulated as follows [28]:(5)y=∑l=1Tyclωl∑l=1Tωl.


### 3.2. Particle Swarm Optimization

PSO is basically the intelligence of bird flocking or fish schooling and it was first introduced by Kennedy and Eberhart in 1995 [29] and later the original PSO is modified by Shi and Eberhart in 1999 [30] in order to improve the convergence rate and accuracy level by considering the inertia weight factor, ω.The algorithm is given as follows [27]:(i)
PSO parameters are being initialized [ω, c1, c2, r1, r2].(ii)
Random generation of the initial solution in the swarm’s search space. The velocity and position of each particle are randomly initialized and evaluated according to the fitness function of the initial solution in order to determine the personal best and global best particle in the population.(iii)
Update the velocity and position of each particle using the following formula.(6)Vidt+1=ω.Vidt+c1r1Pidt−xidt+c2r2Gdt−xidt,xidt+1=xidt+Vidt+1.(iv)
Update the personal best and global best position of the particle at each iteration.(7)Pidt+1=xidt+1iffXkt+1≤fPkbt,Gkbt+1=Xkt+1iffXkt+1≤fGkbt.(v)
Go to step (iii) when the termination criterion is not satisfied; otherwise, terminate the algorithm.f is the fitness function; in this research, it is the mean absolute percentage error (MAPE), t is the current iteration, c1 and c2 are the acceleration coefficients, r1 and r2 are evenly distributed random number in the range 0 to 1, and Pidt and Gdt are the personal best and global best positions of the particles in the population.


### 3.3. Premature Convergence Problem of Fuzzy-PSO Algorithm

Early convergence to the local optimum point is one of the problems that rarely happen in a particle swarm optimization algorithm. The control of the inertia weight (ω), the cognitive, and social acceleration coefficients will improve the performance of PSO algorithm in various application. Zhang et al. [31] proposed a mutation strategy to avoid the premature convergence to local optimum of PSO. In this paper, in order to avoid the premature convergence of the Fuzzy-PSO load prediction model, a method by Ratnaweera et al. [32] was used. This method needs less computational time, is easy to implement, and integrates to the basic PSO algorithm. According to [32], a linearly increasing social acceleration factor and a linearly decreasing cognitive acceleration factor are of help to boost the global searching capability while also balancing the local searching of the particles in a multidimensional particles search space. The inertia weight (ω), cognitive acceleration factor (c1), and social acceleration factors (c2) are dynamically varying and computed using equations (8)–(10) and later incorporated to the PSO algorithm in MATLAB programming. At every iteration, these PSO parameters are adjusted to minimize and avoid the premature convergence problem of the Fuzzy-PSO load prediction model.(8)ωt=ωmax−ωmax−ωmin×tIt,(9)c1t=c1max+c1min−c1max×tIt,(10)c2t=c2max+c2max−c2min×tIt.Here, t is the current iteration, It = 300 is the total number of iterations, ωmax=0.99 is the maximum inertia weight, ωmin=0.1 is the minimum inertia weight, c1min  = 0.25 is the minimum value of cognitive acceleration factor, c1max=2.5 is the maximum value of cognitive acceleration factor, c2min=0.25 is the minimum value of social acceleration factor, and c2max=2.5 is the maximum value of social acceleration factor.


### 3.4. Encoding of Fuzzy Variables Using the PSO Algorithm

The PSO algorithm is used to tune the fuzzy membership function of an industrial load prediction model using the Mamdani fuzzy inference system approach. Figure11 demonstrates the tuning process of the Fuzzy-PSO load prediction model to improve the performance of the fuzzy logic system. There are two parameters (standard deviation b and mean c) which represent each fuzzy membership function of the “n” input variables and the “q” fuzzy output variable of the fuzzy system. If each input variable has an “m” fuzzy membership function and each fuzzy output variable has a “t” fuzzy membership function, then the total parameters of the input (X) and output (Y) fuzzy variables are represented in equations (11) and (12). The parameters (bi and ci) of every fuzzy membership function in each fuzzy variable (input and output) can be encoded with the PSO particles using Eq. 13–Eq. 20.(11)X=∑i=1n2×mi,(12)Y=∑i=1q2×ti,(13)X=xbxc,(14)Y=ybyc,(15)xb=x11bx21b..xn1bx12b…x1mbx22b…x2mb....xn2b.….xnmb,(16)xc=x11cx21c..xn1cx12c…x1mcx22c…x2mc....xn2c.….xnmc,(17)yb=y11by21b..yq1by12b…y1tby22b…y2tb....yq2b.….yqtb,(18)yc=y11cy21c..yq1cy12c…y1mcx22c…y2mc....yq2c.….yqmc,(19)x11b=p1p2…ps,(20)y11b=p1p2…ps,where X is a 2 × n × m parameter of the input fuzzy variable, Y is a 2 ×q× t parameter of the fuzzy output variables, xijc is the mean parameter of the input variables’ ijth membership function, xijb is the standard deviation parameter of the input variables’ ijth membership function, bi and ci are the fuzzy Gaussian membership function parameters for each input and output membership function.Figure 11
Fuzzy-PSO tuning process for load prediction.A summary of the above discussion is presented in Table1. A total of 42 unknown fuzzy parameters needs to be optimized using the PSO algorithm. If the swarm size is 100, then all the 42 parameters are encoded with 100 PSO particles, and in every iteration of running the simulation of the PSO algorithm, 42 fuzzy membership function parameters are computed, and the values are updated after evaluating the fitness of the cost function. Therefore, the parameters of both the input and output fuzzy variables are encoded with the particles in the swarm. For example, xb11 = p1 + p2 + p3 + ⋯ + ps, where p is the individual particle in the swarm of population “s.”Table 1
The fuzzy parameter encoding using the particles of PSO.
ParametersParameters of the fuzzy membership functionDimensional search space of particlesbi1ci1bi2ci2bi3ci3bi4ci4bi5ci5Timexb11xc11xb12xc12xb13xc13xb14xc14xb15xc152×m1=2×5= 10Temperaturexb21xc21xb22xc22xb23xc232×m2=2×3=6ECFxb31xc31xb32xc32xb33xc332×m3=2×3=6Historical loadxb41xc41xb42xc42xb43xc43xb44xc44xb45xc452×m4=2×5=10Forecasted loadyb1yc1yb2yc2yb3yc3yb4yc4yb5yc52×mt=2×5=10Total fuzzy system parameters encoding to run the PSO simulation42


### 3.5. Fitness Function of the Optimization Problem

Based on the definition of fuzzy parameters in the previous expressions, the following fuzzy prediction model fitness measurement method given in (21) is used. The fitness function of the Mamdani fuzzy membership function is the mean absolute percentage error (MAPE) that measures the performance of the model and is evaluated as follows [27]:(21)mape=1n∑i=1nyi−y^iyi.The fitness function of the optimization problem is formulated as follows:(22)fibi,ci=minimizmape,0≤bi≤ci.Here yi is the testing data set, y^i is the forecasted load data sets, and n is the forecasting time horizon.


## 3.1. Fuzzy Logic System

The load prediction model is based on four fuzzy input variables and a single fuzzy output variable whose Gaussian membership function and all the rules are later optimized using the particle swarm optimization algorithm. The fuzzy is trained using PSO based on the available input and output training data set correlation. The fuzzy input variables are temperature, error correction factor, historical load, and time of the day. The forecasted load is the only output fuzzy variable. Both the input and output fuzzy variables have Gaussian membership function as shown in Figure10 and it has two fundamental parameters: the mean (c) and the standard deviation (b). The error correction factor introduced in this research has highly improved the performance of the prediction model, and it can be computed based on the available data values using the following mathematical relation, which was later modeled in Simulink.(3)ECF=FA−FFFA,where FA is the actual load data set and FF is the forecasted load data set. The ECF data is automatically calculated in the fuzzy load prediction model using Simulink and a 24-hour ECF time series data is obtained in the process. The ECF data computed in the fuzzy prediction model is later used to train the fuzzy model using PSO.Figure 10
The Gaussian fuzzy membership function.The fuzzy inference engine incorporates all possible rules that help to map the output from the fuzzy inputs based on the training dataset. LetAik be the ith fuzzy input variable (xi) of k’s membership function and Bt is the t’s membership function of the output variable (yi); then the fuzzy rule is generated as follows:Ifx1 is A1k and x2 is A2k and ........ and xn is Ank, then yi is Bt.The fuzzifier in the fuzzy load prediction model is formulated as follows [28]:(4)μA′xi′=1,ifxi′=xi,0,otherwise.The defuzzification of the load prediction model, based on the center-average defuzzifiers, is also formulated as follows [28]:(5)y=∑l=1Tyclωl∑l=1Tωl.


## 3.2. Particle Swarm Optimization

PSO is basically the intelligence of bird flocking or fish schooling and it was first introduced by Kennedy and Eberhart in 1995 [29] and later the original PSO is modified by Shi and Eberhart in 1999 [30] in order to improve the convergence rate and accuracy level by considering the inertia weight factor, ω.The algorithm is given as follows [27]:(i)
PSO parameters are being initialized [ω, c1, c2, r1, r2].(ii)
Random generation of the initial solution in the swarm’s search space. The velocity and position of each particle are randomly initialized and evaluated according to the fitness function of the initial solution in order to determine the personal best and global best particle in the population.(iii)
Update the velocity and position of each particle using the following formula.(6)Vidt+1=ω.Vidt+c1r1Pidt−xidt+c2r2Gdt−xidt,xidt+1=xidt+Vidt+1.(iv)
Update the personal best and global best position of the particle at each iteration.(7)Pidt+1=xidt+1iffXkt+1≤fPkbt,Gkbt+1=Xkt+1iffXkt+1≤fGkbt.(v)
Go to step (iii) when the termination criterion is not satisfied; otherwise, terminate the algorithm.f is the fitness function; in this research, it is the mean absolute percentage error (MAPE), t is the current iteration, c1 and c2 are the acceleration coefficients, r1 and r2 are evenly distributed random number in the range 0 to 1, and Pidt and Gdt are the personal best and global best positions of the particles in the population.


## 3.3. Premature Convergence Problem of Fuzzy-PSO Algorithm

Early convergence to the local optimum point is one of the problems that rarely happen in a particle swarm optimization algorithm. The control of the inertia weight (ω), the cognitive, and social acceleration coefficients will improve the performance of PSO algorithm in various application. Zhang et al. [31] proposed a mutation strategy to avoid the premature convergence to local optimum of PSO. In this paper, in order to avoid the premature convergence of the Fuzzy-PSO load prediction model, a method by Ratnaweera et al. [32] was used. This method needs less computational time, is easy to implement, and integrates to the basic PSO algorithm. According to [32], a linearly increasing social acceleration factor and a linearly decreasing cognitive acceleration factor are of help to boost the global searching capability while also balancing the local searching of the particles in a multidimensional particles search space. The inertia weight (ω), cognitive acceleration factor (c1), and social acceleration factors (c2) are dynamically varying and computed using equations (8)–(10) and later incorporated to the PSO algorithm in MATLAB programming. At every iteration, these PSO parameters are adjusted to minimize and avoid the premature convergence problem of the Fuzzy-PSO load prediction model.(8)ωt=ωmax−ωmax−ωmin×tIt,(9)c1t=c1max+c1min−c1max×tIt,(10)c2t=c2max+c2max−c2min×tIt.Here, t is the current iteration, It = 300 is the total number of iterations, ωmax=0.99 is the maximum inertia weight, ωmin=0.1 is the minimum inertia weight, c1min  = 0.25 is the minimum value of cognitive acceleration factor, c1max=2.5 is the maximum value of cognitive acceleration factor, c2min=0.25 is the minimum value of social acceleration factor, and c2max=2.5 is the maximum value of social acceleration factor.


## 3.4. Encoding of Fuzzy Variables Using the PSO Algorithm

The PSO algorithm is used to tune the fuzzy membership function of an industrial load prediction model using the Mamdani fuzzy inference system approach. Figure11 demonstrates the tuning process of the Fuzzy-PSO load prediction model to improve the performance of the fuzzy logic system. There are two parameters (standard deviation b and mean c) which represent each fuzzy membership function of the “n” input variables and the “q” fuzzy output variable of the fuzzy system. If each input variable has an “m” fuzzy membership function and each fuzzy output variable has a “t” fuzzy membership function, then the total parameters of the input (X) and output (Y) fuzzy variables are represented in equations (11) and (12). The parameters (bi and ci) of every fuzzy membership function in each fuzzy variable (input and output) can be encoded with the PSO particles using Eq. 13–Eq. 20.(11)X=∑i=1n2×mi,(12)Y=∑i=1q2×ti,(13)X=xbxc,(14)Y=ybyc,(15)xb=x11bx21b..xn1bx12b…x1mbx22b…x2mb....xn2b.….xnmb,(16)xc=x11cx21c..xn1cx12c…x1mcx22c…x2mc....xn2c.….xnmc,(17)yb=y11by21b..yq1by12b…y1tby22b…y2tb....yq2b.….yqtb,(18)yc=y11cy21c..yq1cy12c…y1mcx22c…y2mc....yq2c.….yqmc,(19)x11b=p1p2…ps,(20)y11b=p1p2…ps,where X is a 2 × n × m parameter of the input fuzzy variable, Y is a 2 ×q× t parameter of the fuzzy output variables, xijc is the mean parameter of the input variables’ ijth membership function, xijb is the standard deviation parameter of the input variables’ ijth membership function, bi and ci are the fuzzy Gaussian membership function parameters for each input and output membership function.Figure 11
Fuzzy-PSO tuning process for load prediction.A summary of the above discussion is presented in Table1. A total of 42 unknown fuzzy parameters needs to be optimized using the PSO algorithm. If the swarm size is 100, then all the 42 parameters are encoded with 100 PSO particles, and in every iteration of running the simulation of the PSO algorithm, 42 fuzzy membership function parameters are computed, and the values are updated after evaluating the fitness of the cost function. Therefore, the parameters of both the input and output fuzzy variables are encoded with the particles in the swarm. For example, xb11 = p1 + p2 + p3 + ⋯ + ps, where p is the individual particle in the swarm of population “s.”Table 1
The fuzzy parameter encoding using the particles of PSO.
ParametersParameters of the fuzzy membership functionDimensional search space of particlesbi1ci1bi2ci2bi3ci3bi4ci4bi5ci5Timexb11xc11xb12xc12xb13xc13xb14xc14xb15xc152×m1=2×5= 10Temperaturexb21xc21xb22xc22xb23xc232×m2=2×3=6ECFxb31xc31xb32xc32xb33xc332×m3=2×3=6Historical loadxb41xc41xb42xc42xb43xc43xb44xc44xb45xc452×m4=2×5=10Forecasted loadyb1yc1yb2yc2yb3yc3yb4yc4yb5yc52×mt=2×5=10Total fuzzy system parameters encoding to run the PSO simulation42


## 3.5. Fitness Function of the Optimization Problem

Based on the definition of fuzzy parameters in the previous expressions, the following fuzzy prediction model fitness measurement method given in (21) is used. The fitness function of the Mamdani fuzzy membership function is the mean absolute percentage error (MAPE) that measures the performance of the model and is evaluated as follows [27]:(21)mape=1n∑i=1nyi−y^iyi.The fitness function of the optimization problem is formulated as follows:(22)fibi,ci=minimizmape,0≤bi≤ci.Here yi is the testing data set, y^i is the forecasted load data sets, and n is the forecasting time horizon.


## 4. Simulation Results

Both the training and testing data set values of the fuzzy input and output variables are presented on a 24-hour basis and it was discussed in Section1. Therefore, the forecast is a short-term industrial load prediction of various events that exist in a calendar year with a 24-hour forecasting horizon.


### 4.1. Holiday Load Forecast

Holidays are special events that exist once a year in a calendar year, and such types of loads have distinctive characteristics such that they should be treated separately for the purpose of load prediction accuracy. These loads are special loads that exist during national holidays, Christian holidays, and Muslim holidays. The Christian holidays include Christmas, Siqilet, Easter, Epiphany, and Meskel. The Muslim holidays include Mewulid, Eidaldeha, and Eidalfetir, whereas in the national holidays, Adwa victory, New Year, Labor Day, and Patriots’ Day are considered. The Fuzzy-PSO prediction of this special event provides a high level of prediction accuracy. The Fuzzy-PSO prediction results of all the holiday load scenarios are presented in Figures12–23 and discussed in Section 5.Figure 12
The Fuzzy-PSO prediction of Christmas load.Figure 13
The Fuzzy-PSO prediction of Siqilet load.Figure 14
The Fuzzy-PSO prediction of Meskel load.Figure 15
The Fuzzy-PSO prediction of Eidaldeha load.Figure 16
The Fuzzy-PSO prediction of Epiphany load.Figure 17
The Fuzzy-PSO prediction of Mewulid load.Figure 18
The Fuzzy-PSO prediction of Easter load.Figure 19
The Fuzzy-PSO prediction of Eidalfetir load.Figure 20
The Fuzzy-PSO prediction of New Year load.Figure 21
The Fuzzy-PSO prediction of Labor Day load.Figure 22
The Fuzzy-PSO prediction of Adwa load.Figure 23
The Fuzzy-PSO prediction of Patriots’ Day load.


### 4.2. Weekday and Weekend Day Load Prediction

The weekday loads are the loads operated during normal periods where both national and religious holidays are omitted when they fall on Monday through Friday. The loads in this period should be treated separately because they have a different operational characteristic than holiday loads (Figure24). On the other hand, the weekend day loads are the loads on Saturday and Sunday. Some private institutions consider Saturday as a working day, but still, the weekend has its own distinctive load characteristics, as shown in Figure 25.Figure 24
The Fuzzy-PSO prediction of weekday load.Figure 25
The Fuzzy-PSO prediction of weekend day load.


### 4.3. The Overall System Load Prediction

The total system load is the average load considering all the events mentioned earlier and it was scaled using a constant scaling factor to account its vulnerability due to the distinctive nature of various load events. The prediction result is used to model the microgrid system. The scaling factor is computed from the data sets and it is 1.3 for training data and 1.4 for testing data sets using equation (2).The true correlation between the predicted total system load and the corresponding fuzzy input variables for the load prediction model based on the available data set is presented in Figures26–29.Figure 26
Correlation between forecast load and time for total system load.Figure 27
Correlation between forecast load and ECF for total system load.Figure 28
Correlation between forecast load and temperature for total system load.Figure 29
Correlation between forecast load and historical load for total system load.The optimized values of the fuzzy membership function and fuzzy rules are presented in Tables2 to 6 for the total system load presented in Figure 30, and Table 7 presents the summary of the load prediction performance result.Table 2
Fuzzy-PSO optimized result of temperature for microgrid model.
Membership functionInitial fuzzy parametersPSO optimized parametersbicibiciLow8.075.58.075.5Normal4.23204.2321.93High8.0734.626.0935.19Table 3
Fuzzy-PSO optimized result of time for microgrid model.
Membership functionFuzzy parametersPSO optimized parametersbicibiciNight2.8031.72.3961.628Forenoon2.80382.3029.115Noon2.803122.08117.591Afternoon2.803161.64016.176Evening2.80322.32.39620.995Table 4
Fuzzy-PSO optimized result of ECF for microgrid model.
Membership functionFuzzy parametersPSO optimized parametersbicibiciNegative0.6−10.557−1Null0.07500.11340.0471Positive0.610.50621Table 5
Fuzzy-PSO optimized result of historical load for microgrid model.
Membership functionFuzzy parametersPSO optimized parametersbicibiciVery low27025002702503Low2463636609.95809Average24647502464930High24658752465697Very high27070002466875Table 6
Fuzzy-PSO optimized result of overall forecasted load for microgrid model.
Membership functionFuzzy parametersPSO optimized parametersInitial possible rulesPSO generated rulesOptimized rulesbicibiciVery low400200040020162225129115Low40040004003930Average40060004195759High40080004009263Very high4001000040010000Figure 30
The Fuzzy-PSO prediction of the total system load for microgrid model.Table 7
Performance evaluation of fuzzy-alone and Fuzzy-PSO load prediction model based on MAPE.
No.EventMethodsFuzzyFuzzy-PSO1Easter3.541.842Epiphany7.185.653Siqilet9.052.484Christmas11.593.055Meskel10.563.046Eidalfetir5.783.547Mewulid9.346.318Eidaldeha6.615.029New Year9.566.1010Adwa victory11.093.5511Patriots’ day9.343.2212May_205.373.4513Labor Day8.653.6114Weekday13.894.1715Weekend day13.93.3116System load8.853.62


## 4.1. Holiday Load Forecast

Holidays are special events that exist once a year in a calendar year, and such types of loads have distinctive characteristics such that they should be treated separately for the purpose of load prediction accuracy. These loads are special loads that exist during national holidays, Christian holidays, and Muslim holidays. The Christian holidays include Christmas, Siqilet, Easter, Epiphany, and Meskel. The Muslim holidays include Mewulid, Eidaldeha, and Eidalfetir, whereas in the national holidays, Adwa victory, New Year, Labor Day, and Patriots’ Day are considered. The Fuzzy-PSO prediction of this special event provides a high level of prediction accuracy. The Fuzzy-PSO prediction results of all the holiday load scenarios are presented in Figures12–23 and discussed in Section 5.Figure 12
The Fuzzy-PSO prediction of Christmas load.Figure 13
The Fuzzy-PSO prediction of Siqilet load.Figure 14
The Fuzzy-PSO prediction of Meskel load.Figure 15
The Fuzzy-PSO prediction of Eidaldeha load.Figure 16
The Fuzzy-PSO prediction of Epiphany load.Figure 17
The Fuzzy-PSO prediction of Mewulid load.Figure 18
The Fuzzy-PSO prediction of Easter load.Figure 19
The Fuzzy-PSO prediction of Eidalfetir load.Figure 20
The Fuzzy-PSO prediction of New Year load.Figure 21
The Fuzzy-PSO prediction of Labor Day load.Figure 22
The Fuzzy-PSO prediction of Adwa load.Figure 23
The Fuzzy-PSO prediction of Patriots’ Day load.


## 4.2. Weekday and Weekend Day Load Prediction

The weekday loads are the loads operated during normal periods where both national and religious holidays are omitted when they fall on Monday through Friday. The loads in this period should be treated separately because they have a different operational characteristic than holiday loads (Figure24). On the other hand, the weekend day loads are the loads on Saturday and Sunday. Some private institutions consider Saturday as a working day, but still, the weekend has its own distinctive load characteristics, as shown in Figure 25.Figure 24
The Fuzzy-PSO prediction of weekday load.Figure 25
The Fuzzy-PSO prediction of weekend day load.


## 4.3. The Overall System Load Prediction

The total system load is the average load considering all the events mentioned earlier and it was scaled using a constant scaling factor to account its vulnerability due to the distinctive nature of various load events. The prediction result is used to model the microgrid system. The scaling factor is computed from the data sets and it is 1.3 for training data and 1.4 for testing data sets using equation (2).The true correlation between the predicted total system load and the corresponding fuzzy input variables for the load prediction model based on the available data set is presented in Figures26–29.Figure 26
Correlation between forecast load and time for total system load.Figure 27
Correlation between forecast load and ECF for total system load.Figure 28
Correlation between forecast load and temperature for total system load.Figure 29
Correlation between forecast load and historical load for total system load.The optimized values of the fuzzy membership function and fuzzy rules are presented in Tables2 to 6 for the total system load presented in Figure 30, and Table 7 presents the summary of the load prediction performance result.Table 2
Fuzzy-PSO optimized result of temperature for microgrid model.
Membership functionInitial fuzzy parametersPSO optimized parametersbicibiciLow8.075.58.075.5Normal4.23204.2321.93High8.0734.626.0935.19Table 3
Fuzzy-PSO optimized result of time for microgrid model.
Membership functionFuzzy parametersPSO optimized parametersbicibiciNight2.8031.72.3961.628Forenoon2.80382.3029.115Noon2.803122.08117.591Afternoon2.803161.64016.176Evening2.80322.32.39620.995Table 4
Fuzzy-PSO optimized result of ECF for microgrid model.
Membership functionFuzzy parametersPSO optimized parametersbicibiciNegative0.6−10.557−1Null0.07500.11340.0471Positive0.610.50621Table 5
Fuzzy-PSO optimized result of historical load for microgrid model.
Membership functionFuzzy parametersPSO optimized parametersbicibiciVery low27025002702503Low2463636609.95809Average24647502464930High24658752465697Very high27070002466875Table 6
Fuzzy-PSO optimized result of overall forecasted load for microgrid model.
Membership functionFuzzy parametersPSO optimized parametersInitial possible rulesPSO generated rulesOptimized rulesbicibiciVery low400200040020162225129115Low40040004003930Average40060004195759High40080004009263Very high4001000040010000Figure 30
The Fuzzy-PSO prediction of the total system load for microgrid model.Table 7
Performance evaluation of fuzzy-alone and Fuzzy-PSO load prediction model based on MAPE.
No.EventMethodsFuzzyFuzzy-PSO1Easter3.541.842Epiphany7.185.653Siqilet9.052.484Christmas11.593.055Meskel10.563.046Eidalfetir5.783.547Mewulid9.346.318Eidaldeha6.615.029New Year9.566.1010Adwa victory11.093.5511Patriots’ day9.343.2212May_205.373.4513Labor Day8.653.6114Weekday13.894.1715Weekend day13.93.3116System load8.853.62


## 5. Discussion

The computational cost of the Fuzzy-PSO load prediction model is measured based on the convergence rate of the algorithm, the computational time required to execute the prediction model, and the performance of the fitness function. The computational time depends on the number of iterations, the number of particles considered in the swarm, the number of fuzzy input variables, the number of fuzzy membership functions in each fuzzy input and output variable, the size of the input and output training dataset, and the performance of the hardware device (computer) used to simulate the model. For the Fuzzy-PSO load prediction model, 4 fuzzy input variables, 100 PSO particles, 300 iterations, and 17,520-hour training dataset values are simulated using an 8 GB RAM, core i7 Dell Latitude 7400 computer. The simulation takes several hours to simulate the Fuzzy-PSO load prediction model because of the complexity of the model, the large number of fuzzy membership functions, and the large number of iterations considered. The simulation converges to the solution very quickly after 15 iterations based on the calculation of the mean-absolute percentage error as a performance measurement index. The mean absolute percentage error is considered as a cost function to measure the performance of the Fuzzy-PSO load prediction model. The high level of prediction accuracy is recorded during the Easter holiday, and its industrial load prediction result is presented in Figure18. The Fuzzy-PSO prediction model during Easter forecasts the load with a prediction accuracy of 1.84% (MAPE), which is significantly very high as compared with the fuzzy prediction model result alone of 3.54%. The Fuzzy-PSO load prediction model for the weekday yields a MAPE of 4.17%, which is a very high accuracy level compared to the fuzzy-alone load prediction model of 13.89% MAPE. The Fuzzy-PSO load prediction model for the weekend load has a prediction accuracy of 3.3% MAPE, whereas the overall industrial load Fuzzy-PSO load prediction result has a prediction accuracy of 3.62% MAPE. In general, the Fuzzy-PSO load prediction model has a fast convergence rate and very high prediction accuracy level and needs a supercomputer to improve the computational time of the prediction algorithm.All the fuzzy inputs and fuzzy output membership functions are encoded using all 100 PSO particles. Each membership function is represented using two basic fuzzy parameters: the standard deviation (b) and mean (c), so the values of b and c are optimized using the training input and output dataset correlation. Similarly, the initial fuzzy rules are updated and optimized using the data correlation between the training input and output dataset. The Fuzzy-PSO algorithm executes the correlation between the fuzzy input variables (time, ECF, temperature, and historical load) and the fuzzy output variable (forecasted load) based on the training data set and training performance of the PSO. The correlation between time and forecasted load is presented in Figure 26, and from the correlation graph, we can understand that the time of the day can affect the load forecast result. During the early morning and after-night periods, the industrial load is low, while it is at its maximum during the daytime between 9 am and 15 am. The correlation between forecasted load and ECF demonstrates that at an ECF margin of ±20%, the change in the forecasted load is negligible, but at lower (negative big) and higher (positive big) values of the ECF, it has a great impact on the forecasted load. The incremental or decremental magnitude of the forecasted load depends on the sign and magnitude of the ECF values. The impact of temperature and historical load on the forecast of industrial load is very clear. They have a direct relationship with the forecasted load based on the characteristics of the temperature and historical load in the training dataset. Table 7 demonstrates the forecasting accuracy of the Fuzzy and Fuzzy-PSO load prediction models in terms of the mean absolute percentage error of the forecasted dataset and the validation dataset measured in percentage (%).


## 6. Conclusion

A microgrid is a viable option to supply reliable, efficient, and affordable power to an industrial customer. This load prediction work is ongoing research that forms an integral part of microgrid design. The particle swarm optimization algorithm is an intelligent technique implemented to optimize the fuzzy load prediction approach. The model provides an accurate load prediction result whose absolute-mean percentage error is less than 5% in most of the scenarios that were discussed in this paper. The Fuzzy-PSO load prediction model manipulates large volumes of fuzzy input and output data for both the training and testing datasets in order to generate fuzzy rules and fuzzy membership functions used for the load prediction model. The termination criteria of the PSO algorithm matter the accuracy level of the load prediction model. The number of iterations or the acceptable tolerance of error considered in the Fuzzy-PSO load prediction model also has a significant impact on the simulation result. The load prediction model during the New Year and Mewulid holidays is simulated based on a maximum fuzzy rule generation iteration of 50 and an overall fuzzy system optimization maximum iteration number of 250, which yields a very low level of prediction accuracy as compared with the other scenarios. Introducing a new fuzzy input variable (i.e., error correction factor) also improves the load prediction model based on the Fuzzy-PSO prediction approach.



---

*Source: 3107495-2022-04-18.xml*