Short-term Load Forecasting Model for Microgrid Based on HSA-SVM

Short-term load forecasting for microgrid is the basis of the research on scheduling techniques of microgrid. Accurate load forecasting for microgrid will provide the necessary basis for cooperative optimization scheduling. Short-term loadforecasting model for microgrid based on support vector machine(SVM) is constructed in this paper. The harmony search optimization algorithm(HSA) is used to optimize the parameters of the SVM model, because it has the advantages of fast convergence speed and better optimization ability. Through the simulation and test of the actual microgrid load system, it is proved that the short-term loadforecasting model for microgrid based on HSA-SVM can effectively improve the prediction accuracy.


Introduction
Smart city is the deep expansion and integrated application of information technology, and it is an important part of the development of the new global strategic industries.Smart city with advanced technical conditions provides a platform for the development of microgrid, and the development of microgrid will provide strong energy support for the smart city.For smart cities, research on collaborative optimization scheduling technology of microgrid group "source-netload-reserve" has the important practical significance.Short-term load forecasting for microgrid is the basis of the research on scheduling techniques of microgrid.Accurate load forecasting for microgrid will provide the necessary basis for cooperative optimization scheduling [1][2].
Microgrid is constructed by the micro source, load, energy storage devices , control and protection devices [3][4].The prediction accuracy of short-term load forecasting model for microgrid directly affects the safety and economy of the system.
In the early stage of short-term load forecasting, the traditional forecasting methods such as time series method and regression analysis method are researched and applied.However, due to the strong non-linearity of power load, it is difficult for these methods to simulate the complex and variable power load, and the prediction accuracy is not satisfactory.In recent years, with the continuous development of intelligent technology, intelligent methods such as expert system, fuzzy logic and neural network are widely used in the field of short-term load forecasting [5][6][7].For the neural network model, the neural network based on BP algorithm can describe the nonlinear relationship between load and impact factor well and is widely used in short-term load forecasting.However, this kind of model has some shortcomings such as slow convergence, easy falling into the local minimum point and so on [8].
SVM is a statistical learning theory for classification and regression.It is a new type of machine learning algorithm based on the principle of structural risk minimization.Its basic idea is to transform the input space into a high-demensional space by using the nonlinear transformation defined by the inner-product function, in which an exact description of the nonlinear relationship between input variables and output variables is studied.The core problem is to find a principle of induction to minimize the risk function and get the best promotion ability.SVM has been widely used in the field of short-term load forecasting [9][10].
HSA is a new heuristic global search algorithm that simulates the process by which the band makes the most beautiful harmony by repeatedly adjusting the instrument.Each instrument is analogous to each solution variable of the optimization problem, and the harmonies performed are analogous to the objective function of the optimization problem.HSA has been widely used in the field of engineering [11][12].
Short-term loadforecasting model for microgrid based on HAS-SVM is constructed in this paper.HSA is used to optimize the parameters of SVM model, and it has better generalization and convergence.Through the simulation and test of the actual microgrid load system, it is proved that the short-term loadforecasting model for microgrid based on HSA-SVM can effectively improve the prediction accuracy.
2 Short-term load forecasting model for microgrid based on HSA-SVM 2.1 Support vector machine SVM is a new machine learning algorithm based on the statistical learning theory.With strict mathematical theory foundation, clear geometry simulation and good generalization ability, it has its unique superiority in solving the problem of non-linear small sample.The algorithm transforms the real problem into a high dimensional space through nonlinear transformation, and the linear function is constructed in the high dimensional space to replace the nonlinear discriminant function in the original space.Compared with the artificial neural network of machine learning, SVM can effectively overcome the problem of "dimension disaster" and avoid falling into local optimal solution.
SVM transforms the input space into a highdemensional space by using the nonlinear transformation defined by the inner-product function, in which an exact description of the nonlinear relationship between input variables and output variables is studied.The core problem is to find a principle of induction to minimize the risk function and get the best promotion ability.Assumed the load sample   x is the input vector, i y is the output vector，and l is the sample size.
The regression function can be expressed as: Where  is the weight vector .In the high dimensional mapping space, the sample point   i i y x ), (  is linear through this transformation.b is constant.Then the regression estimation function is approximated in the high dimensional space, and the regression estimation problem is defined as the minimization of the structural risk of a loss function.The optimal regression function is the minimum functional under certain constraint conditions, which can be expressed as: The certain constraint conditions can be expressed as: Where C is the penalty factor, and it is constant.i  and  i  are the relaxation variable;  is the coefficient of insensitive loss function.By constructing the Lagrange function, the dual function can be obtained, which can be expressed as: The constraint conditions can be expressed as: The inner product in (7) is replaced by the kernel function , and it can be expressed as: The kernel function is any symmetric function that satisfies the Mercer condition.The advantage of using the kernel function is that it no longer needs know the concrete form of the mapping ) (x  , and does not need to deal with the high dimensional characteristic space directly, only the kernel function is needed.The common kernel functions include linear kernel function, polynomial kernel function, radial basis kernel function and so on.In this paper, the Gauss kernel function is adopted, which can be expressed as: Where  is the Gauss kernel parameter.
When the parameter ) ( is not zero in (8), the corresponding vector i x is called the support vector.

Optimization for parameters of SVM based on improved HSA
As can be seen from the previous section, the SVM using Gaussian kernel function contains four pending parameters, and they are l、 C 、  、  .The choice of these parameters does not have any theoretical basis, and the choice of these parameters has a great influence on the prediction performance of SVM, which is the difficulty of SVM application.In this paper, these sensitive parameters are optimized by the improved HSA.
HSA is a new heuristic global search algorithm that simulates the process by which the band makes the most beautiful harmony by repeatedly adjusting the instrument.Each instrument is analogous to each solution variable of the optimization problem, and the harmonies performed are analogous to the objective function of the optimization problem.HSA has been widely used in the field of engineering.
HSA first generates a harmony memory (HM) containing M solution and a feasible region of each variable.Then, the new solution is randomly searched for each variable in the HM with the retention probability p 1 , and the new solution is searched in the feasible domain with the probability 1-p 1 .For the new solution from HM, it is locally perturbed with the probability p 2 .Finally, compare the new solution with the worst solution in HM, if it is better than the worst solution, then replace.The process is repeated until the maximum number of iterations is met.Compared with the traditional such as particle swarm optimization algorithm and genetic algorithm, HSAhas strong generality, fast convergence speed and better optimization ability.
The steps in the procedure of HSA are as follows: Step 1: Initialize the problem and algorithm parameters; Step2: Initialize the harmony memory; Step 3: Improvise a new harmony; Step 4: Updatethe harmony memory; Step 5: Chech the stopping criterion.The generation of new solutions in HSAand the disturbance to the new solution are the most critical step.The improved HSA adopted in this paper is improved for this key step.The basic HSA is disturbed by the fixed probability PAR, the disturbance bandwidth is BW, and the perturbation formula can be expressed as: The disturbance method with fixed parameters can't reflect the global search ability and the local search ability of HSA.In this paper, the method of adaptive reduction of the disturbance probability and bandwidth with the iterations number is adopted, which can be expressed as: Where n is the number of current iterations; N is the maximum number of iterations;r∈(0,1);Z is the any number.
After the improvement, the PAR and BW of HSA have higher value in the early stage of the algorithm, in order to increase the scope of the algorithm and obtain the strong global search ability.With the increase of the number of iterations, PAR and BW gradually decrease, which makes the algorithm explore near the optimal value to obtain the strong local search ability.

Quantitative treatment of load and influence factors
According to the previous research results, the factors affecting the load level of microgrid mainly include the date type and the climate factor.The date type factors are divided into working day (from Monday to Friday), weekend(Saturday, Sunday), and legal holidays.The meteorological factors that affect the load mainly include temperature, humidity, sunshine intensity and rainfall, among which the temperature has the greatest impact on the load.

Example simulation
For the short-term load forecasting model of microgrid based on HSA-SVM, the input and output of training samples are as follows: The input of the short-term load forecasting model of microgrid based on HSA-SVM can be described as: Where d represents the forecasting day; t represents the forecasting time; d s is the date type of the forecasting day; are the maximum temperature, the minimum temperature and the average temperature of the day before the day before the forecasting day; The output of the short-term load forecasting model of microgrid based on HSA-SVM isthe load at the forecasting time in the forecasting day.
For improve the prediction accuracy of the shortterm load forecasting model of microgrid based on HSA-SVM, the load data need to be normalized which can be described as: The short-term load forecasting model of microgrid based on HSA-SVM is used to predict the actual load of microgrid.For SVM, l is 14，C is 3，  is 0.01，and  is 0.2, which are decided by improved harmony search optimization algorithm.
To verify the validity of the short-term load forecasting model of microgrid based on HSA-SVM (Model I)proposed in the paper, the forecasting model based on BP-NN (Model II) and the forecasting model based on conventional SVM (Model III)are constructed.The three models predict the load of the microgrid at 24 points in one day, respectively.The error comparison of three models is shown in Table 1.

Conclusion
Short-term loadforecasting model for microgrid based on support vector machine (SVM) is constructed in this paper.
The harmony search optimization algorithm(HSA) is used to optimize the parameters of the SVM model, because it has the advantages of fast convergence speed and better optimization ability.Through the simulation and test of the actual microgrid load system, it is proved that the short-term loadforecasting model for microgrid based on HSA-SVM can effectively improve the prediction accuracy.


is the Lagrange multiplier.The regression function after solving can be expressed as: temperature, the minimum temperature and the average temperature of the third day before the forecasting day.
are the load at the t-1th time, the tth time and the t+1th time in the day before the day before the forecasting day;

Table 1
The error comparison of three models It can be observed from Table1that the forecasting effect of the short-term load forecasting model of microgrid based on HSA-SVM is optimal.Compared to model II, EMAPE and EMAX can improve 3.85% and 5.91% respectively.Compared to model III, EMAPE and EMAX can improve 1.92% and 3.19% respectively.
MAPE : the mean absolute percentage error; E MAX :the maximum relative error.