Medium-and long-term power load forecasting model

. Power load is an important part of power system, and power load forecasting has an important impact on power system analysis, design and control. With the development of smart micro grid, load forecasting has gradually become an important module in the energy management system, It is "source, network, load and storage" "An important link in energy flow matching. The staged combined demand forecasting model of power grid based on neural network and polynomial regression is adopted, and judgment conditions are added to the neural network. If the training sample data does not converge in the neural network training process, the neural network forecasting is terminated, and the data is automatically transferred to the polynomial regression model to obtain the forecasting results. This method can be initially used for annual and monthly load forecasting. It is an intelligent micro grid The planning of has laid a certain technical foundation.


Introduction
Load forecasting is to explore the internal relationship between power load and various related factors according to the change law of power load, so as to develop a theoretical method that can scientifically reflect the relationship between past and future loads, and finally obtain the load value at a specific time in the future [1]. Load forecasting plays an extremely important role in conventional power systems and smart microgrids. High precision load forecasting is convenient for scientific dispatching and optimal configuration of power networks, which can provide users with safe and reliable power and improve social and economic benefits. According to the length of time, load forecasting can be divided into longterm, medium-term, short-term and ultra short-term forecasting [2]. Medium and long term load forecasting is usually based on the year, which can provide data reference for micro grid planning and construction; Short term load forecasting can usually be carried out in monthly, weekly, daily and hourly units, which should provide basis for the adjustment of power balance between regions; Ultra short term load forecasting is usually used for real-time dispatching, system security analysis, control strategies, and improving economic benefits in minutes. Medium and long-term load forecasting methods include unit consumption method [3], electric power elasticity coefficient method [4], trend extrapolation method [5], regression analysis method [6] and artificial neural network method [7]; Short term and ultra short term load forecasting methods include time series method [8] ,grey forecasting method [9], support vector machine method [10], wavelet analysis method [11] and comprehensive model. In the actual load forecasting work, data anomalies may occur in the detection, recording, conversion, transmission and other processes of historical data, or load data may change abnormally due to sudden changes in weather, line maintenance, emergencies, etc. [13]. These abnormal data usually interfere with the load forecasting results. If they are directly used for load forecasting, they will have a certain impact on the forecasting accuracy, or they can not get an ideal forecasting result at all [14] This paper uses the forecasting method combining regression analysis and trend extrapolation to identify abnormal data through horizontal comparison of load data, and then correct the abnormal data through interpolation, and then analyze the load data of historical time series, Find the appropriate function model curve to fit, and then get the load forecast data.

Combined
demand forecasting model based on neural network and polynomial regression 2.1 Neural network model The advantage of neural network is that it can effectively adapt to the laws of nonlinear relations through a large number of learning and training processes, and well fit and map the nonlinear relations. The rules for learning and training are easy to understand and operate. Based on the above characteristics, the neural network model is applicable to the prediction of power economic indicators that require high prediction efficiency and are affected by complex factors. The basic structure of neural network is composed of input layer, hidden layer and output layer. The input layer and the hidden layer have N and L neurons respectively, and usually meet L>2N; The number of neurons in the output layer is M. The topology of BP neural network is shown in Figure 1. The sample data is input into the input layer and the output layer, and the computer is used to learn the mapping relationship between the input and output parameters. The use of the model does not depend on the specific expression of the mapping relationship, but is based on the principle of the minimum error signal, using the back transmission error signal to adjust the threshold and link weight of the neuron. The error signal refers to a certain norm of the prediction result and the expected value. Based on the back transmission of the error signal, the weight vector under the minimum error condition is calculated. Since the error is a discrete function, the minimum value cannot be calculated simply by derivative, but the minimum gradient should be calculated by iterative process. In practice, the number of iterations n and the error limit are set in the initial conditions. In the process of error back propagation, the weight correction can reduce the error, and the component change of the weight vector is consistent with the direction of gradient reduction. Theoretically, when the number of samples tends to infinity, the error should converge, but in practical application, when the number of iterations n reaches the maximum, the error still cannot meet the requirements of the error limit, and the network training fails, that is, it does not converge. If the goal is to solve the weight vector meeting the gradient limit requirements, the network training failure is that the gradient is still not less than the specified value after the completion of iterations, and the goal weight vector cannot be calculated.

Polynomial regression model
Regression analysis is used to analyze the functional relationship between dependent variables and independent variables. It is divided into polynomial regression and multiple polynomial regression. When there is only one independent variable, it is a single variable regression, and multiple independent variables are multiple regression. The regression equation of unary m-degree polynomial is: In the univariate regression analysis, if the relationship between the dependent variable and the independent variable is nonlinear, but no appropriate function curve can be found to fit, the univariate polynomial regression can be used. The greatest advantage of polynomial regression is that the measured points can be approximated by adding higher order terms of x until satisfactory results are obtained. Polynomial regression is a powerful tool to study the specific quantitative relationship between elements, which can establish a mathematical model reflecting the specific quantitative relationship between geographical elements. It can accurately measure the degree of correlation between various factors and the degree of regression fitting, and can accurately express the complex change rules of data series. It has been proved that continuous functions on a closed interval can always be approximated by a polynomial of a higher power under the specified accuracy. On the premise of large sample data, the use of polynomial regression can also achieve better prediction results. Regression analysis takes polynomial regression as a typical representative, and any continuous function can be approximated by this method by dividing the interval. Therefore, this method has been widely used in finance, voice and other fields.

A staged combined demand forecasting model based on neural network and polynomial regression
From the above analysis, we can know that the advantage of neural network is that it can effectively adapt to the laws of nonlinear relations through a large number of learning and training processes, and well fit and map nonlinear relations. In addition, its learning rules are simple and easy to implement. Therefore, it can effectively solve the problem of power demand forecasting. However, its shortcomings are also obvious. In the training process, it is difficult to ensure the global optimization, and it is easy to fall into the local. Therefore, in order to prevent the optimization from falling into the local, this paper adds a polynomial regression model. The specific solutions are as follows. After the convergence condition of BP neural network is set, for example, the relative error is not greater than 3% according to the power system regulations. In the training process, there may be non convergence, that is, when training and learning samples, it is difficult to ensure that the neural network is globally optimal, and it is easy to fall into the cycle of local optimal, thus affecting the prediction accuracy. At this time, in order to continue to obtain the prediction results of the given data, it is necessary to use other prediction methods. This paper adds judgment conditions to the neural network model, such as training 100000 times. When the sample data training does not converge, the sample data will be automatically filled into the polynomial regression model, so as to terminate the neural network prediction, jump out of the local minimum loop, and build a polynomial regression model to obtain the prediction results. The combined model method is automatic intelligent training and learning, with high accuracy and generalization ability, and can be used in the prediction of various indicators of power economy. The advantage of the neural network based on the neural network polynomial regression staged combination model for complex power grid demand forecasting is that it can effectively adapt to the laws of nonlinear relations through a lot of learning and training, and well fit and map the nonlinear relations. In addition, its learning rules are simple and easy to implement. Based on the above characteristics, the neural network model is applicable to the forecasting of power economic indicators that require high forecasting efficiency and are affected by complex factors, and has been widely used in power load forecasting. However, when the neural network is training and learning samples at the same time, it is difficult to ensure the global optimization, and it is easy to fall into the local optimal cycle, which may affect the prediction accuracy. Polynomial regression is a powerful tool to study the specific relationship between elements, which can establish mathematical models reflecting the specific relationship between geographical elements. It can accurately measure the degree of regression fit and correlation between various factors. It has been proved that continuous functions on a closed interval can always be approximated by a polynomial of a higher power under the specified accuracy. Therefore, this method has been widely used in finance, voice and other fields. Therefore, this paper establishes a neural network and polynomial staged combination forecasting model to forecast regional power grid load. In order to avoid the local minimum problem of the neural network, the solution given in this paper is to add judgment conditions in the neural network, such as the relative error of 0.3 and the training times of 100000. If the training sample data still does not converge during 100000 times of training, the data will be automatically transferred to the polynomial regression model, the neural network prediction will be terminated, the local optimization will be skipped, and the polynomial regression model will be established to obtain the prediction results. The staged combination method can be trained and learned automatically and intelligently, and it has high precision and generalization ability. In the established neural network model, there is only one hidden layer, and the number of neurons in the hidden layer adopts the trial and error method. First, set fewer neurons, and gradually increase the number of neurons in the training process until the training is successful and the error reaches the set range. If the sample is still not convergent after 100000 times of training, the data will be automatically filled into the polynomial regression model, the neural network prediction will be terminated, the endless loop will be jumped out, and the polynomial regression model will be established to obtain the prediction results.

Example analysis
In order to verify the validity of the model, this paper selects the load demand and influencing factor data of Chongqing, China, from 2012 to 2021 as the modeling data to forecast the medium and long-term load demand of power demand. Based on the field survey and data collection, we found that the high energy consuming industries in this region account for a large proportion of electricity consumption. By analyzing the correlation between independent variables and dependent variables, this paper finally selects four macroeconomic factors including regional gross product, regional population, industrial gross product and the whole society's fixed asset investment as influencing factors to forecast the annual maximum load demand of the power grid. The historical data of the maximum annual load and its influencing factors in the region from 2012 to 2021 are shown in Table  3  The normalized input and output data are brought into the neural network and polynomial regression staged combination prediction model proposed in this paper for training and learning. We set the convergence condition of the neural network as: relative error 0.3. When the number of training N ≥ 100000 is still not convergent, stop training the neural network and establish a polynomial regression model. According to the prediction model combining neural network and polynomial regression, the results are shown in Figure 2. At the same time, this paper uses BP neural network and multiple linear regression model to forecast the load demand of the region, and makes a comparison. The prediction results of the comparison model are shown in Figure 2. It can be seen from Figure 2 that the overall fitting effect of BP neural network and polynomial staged combination forecasting model is good, with the absolute error value MAE of 0.066 and the mean square error (MSE) of 0.430. The neural network multiple regression staged combination forecasting model has obvious advantages, can obtain higher forecasting accuracy, and its high accuracy and generalization ability can be applied to medium and long-term power demand forecasting.

Conclution
In this paper, a staged combined demand forecasting model of power grid based on neural network and polynomial regression is used to add judgment conditions to the neural network. If the training sample data does not converge in the neural network training process, the neural network forecasting is terminated, and the data is automatically transferred to the polynomial regression model to obtain the prediction results. The average prediction error is below 10, which fully demonstrates the practicability and effectiveness of this method, and can lay a certain technical foundation for the subsequent microgrid planning and configuration.