A combined prediction method for natural gas calorific value based on Parrot optimization algorithm
By using a method based on the Parrot optimization algorithm and combining multiple calorific value prediction sub-models, the weights are optimized to build a combined prediction model, which solves the problem of low accuracy of a single algorithm model in the combined prediction of natural gas calorific value, improves prediction accuracy and supports natural gas energy measurement. .
Patent Information
- Application Number
- CN202410706934.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-06-03
AI Technical Summary
In the prior art, in the combination prediction of natural gas calorie, the prediction accuracy of a single algorithm model is low, and there is a lack of experimental verification and error analysis of typical natural gas stations.
A method based on the Parrot optimization algorithm is used to collect basic data of multi-air source pipeline networks, clean and fill outliers and missing values, and establish multiple calorific value prediction sub-models. The weights are optimized through the Parrot optimization algorithm to build a combined prediction model.
The predictive accuracy of the predictive model of natural gas incubation combination is improved, and the energy measurement that supports the natural gas is provided to ensure the construction and safe operation of the natural gas pipeline network.
Smart Images

Figure CN118469087B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural gas calorific value of a pipeline network, and in particular to a natural gas calorific value combination prediction method based on a Parrot optimization algorithm. Background Art
[0002] With the gradual expansion of the scale of natural gas pipeline construction and the formation of a multi-gas supply pattern, natural gas trade exchanges have become more frequent. The traditional volume measurement method can no longer reflect the true value of natural gas energy and cannot meet the measurement needs of natural gas. In order to achieve accurate measurement of natural gas, make full use of natural gas, and promote trade fairness, the measurement method must shift from volume measurement to energy measurement.
[0003] During the pipeline transportation of natural gas, the components of natural gas will change at different stations or at different times in the same station, which will cause the heat released by natural gas combustion to be different. Therefore, it is crucial to obtain the calorific value of natural gas in the energy metering method. However, due to the limitations of the direct measurement method in the field and the installation of gas chromatographs at all pipeline stations to measure the calorific value of natural gas, which will increase the construction cost, the selection of appropriate methods to establish a calorific value combination prediction model has become an important way to obtain the calorific value of natural gas. At present, mature prediction algorithms have been gradually applied to the field of calorific value combination prediction, such as the prediction of straw calorific value based on neural network model and the prediction of coal calorific value based on multivariate linear regression model. However, the prediction model is established based on a single algorithm, and the prediction accuracy of the model is low. However, in the field of natural gas calorific value combination prediction, most studies propose to track the dynamic components of the natural gas pipeline network or use an indirect assignment calculation model. The research on the prediction method is not comprehensive, and few studies propose to realize calorific value combination prediction based on a combined algorithm model. At the same time, some existing methods still lack experimental verification and error analysis of typical natural gas stations. In the context of the diversification and complexity of natural gas pipeline network construction, it is urgent and important to reasonably select prediction algorithms to establish a combined algorithm calorific value combination prediction model to obtain calorific value and improve the prediction accuracy of the model to provide support for the realization of natural gas energy metering.
[0004] In summary, the present invention provides a natural gas calorific value combination prediction method based on the Parrot optimization algorithm, which makes up for the problem of low accuracy and large error in the calorific value combination prediction of natural gas based on a single algorithm to establish a calorific value combination prediction model, improves the prediction accuracy of the calorific value combination prediction model, and plays a positive role in promoting the orderly, rapid, efficient and controllable establishment of a natural gas energy metering system. At the same time, it improves the natural gas calorific value combination prediction method, provides strong support for natural gas energy metering, and is of great significance to ensuring the construction and safe operation of the natural gas pipeline network. Summary of the invention
[0005] In order to solve the problem of combined prediction of natural gas calorific value in multi-gas source pipeline network, the present invention proposes a combined prediction method of natural gas calorific value based on Parrot optimization algorithm. This method can obtain the calorific value of each distribution station in the multi-gas source pipeline network, and provide a technical basis and ideas for the metering station to obtain the calorific value.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] The present invention provides a natural gas calorific value combined prediction method based on the Parrot optimization algorithm, comprising:
[0008] S1: Collect basic data of multi-gas source pipeline network;
[0009] S2: Clean and fill in abnormal values and missing values in the basic data of multi-gas source pipeline network;
[0010] S3: Establish a natural gas calorific value prediction sub-model;
[0011] S4: Calculate the error between the model prediction value and the actual value of natural gas calorific value, compare the error size and select the sub-model for establishing the combined model;
[0012] S5: The Parrot optimization algorithm is used to solve the weight optimization model, and the optimal weight is combined to establish a natural gas calorific value combination prediction model based on the Parrot optimization algorithm.
[0013] Furthermore, the basic data of the gas source network described in step S1 include the gas source calorific value, the sub-station calorific value, the sub-station inlet pressure, the sub-station inlet temperature, the sub-station inlet flow, the pipeline diameter and the pipeline length of the multi-gas source network; among which, the gas source calorific value, the sub-station inlet pressure, the sub-station inlet temperature, the sub-station inlet flow, the pipeline diameter and the pipeline length are the input parameters of the prediction model, and the sub-station calorific value is the output parameter of the prediction model.
[0014] Furthermore, the steps of cleaning and filling abnormal values and missing values in the basic data of the multi-gas source pipeline network described in step S2 include:
[0015] S201: Divide the basic data of the pipeline network into different categories of data, wherein the gas source calorific value of the multi-gas source pipeline network, the sub-transmission station inlet pressure, the sub-transmission station inlet temperature, the sub-transmission station inlet flow, the pipeline diameter and the pipeline length are divided into input categories, and the sub-transmission station calorific value is separately divided into an output category;
[0016] S202: Based on the characteristics of the input data, the DBscan clustering method and the single-class support vector machine algorithm are used to detect outliers on the input categories;
[0017] S203: Detect missing values in each data category by logical reasoning;
[0018] S204: A filling strategy is used to supplement the basic data in the multi-gas source network, wherein the input category is filled using the mean filling method and the output category is filled using the random forest algorithm.
[0019] Further, the calorific value prediction submodel described in step S3 includes a natural gas calorific value prediction submodel based on a regression equation, a natural gas calorific value prediction submodel based on a response surface analysis, a natural gas calorific value prediction submodel based on a BP neural network, and a natural gas calorific value prediction submodel based on a genetic algorithm;
[0020] The natural gas calorific value prediction sub-model based on the regression equation includes a prediction model of a multiple linear regression equation and a prediction model of a multiple nonlinear regression equation;
[0021] The prediction model equation formula of the multivariate linear regression equation is:
[0022] y i =α0+α1x1+α2x2+...+α k x ki +ε
[0023] In the formula, α0, α1, α2...α k is the regression coefficient; ε is the random error, assuming ε~N(0,σ 2 );
[0024] The prediction model of the multivariate nonlinear regression equation includes a prediction model based on a logarithmic equation, a prediction model based on a power function equation, and a prediction model based on a polynomial function equation;
[0025] The prediction model equation formula based on the logarithmic equation is:
[0026] lm i =lnA+α2lnx 2i +α3lnx 3i +...+α k lnx ki +u i
[0027] Where lnA is the constant term of the regression equation; α2, α3, ..., α k is the regression coefficient; x 2i ,x 3i ,x 4i ,...,x ki To influence the dependent variable y i The independent variable u i is a random error;
[0028] The prediction model equation formula based on the power function equation is:
[0029]
[0030] In the formula, A is the constant term of the regression equation; is a random error;
[0031] The prediction model equation formula based on the polynomial function equation is:
[0032]
[0033] Where α0, α1, ..., α k is the regression coefficient;
[0034] The calorific value combined prediction model equation based on response surface analysis is:
[0035]
[0036] In the formula, a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,τ,β,χ,δ,φ, is the correlation coefficient of the equation; y is the calorific value of the distribution station; X1, X2, X3, X4, X5, and X6 are respectively the calorific value of the gas source, the gas source pressure, the pipeline temperature, the pipe diameter, the pipe length, and the gas source flow rate;
[0037] The steps of establishing the combined heat generation prediction model based on the BP neural network include the selection of hidden layers, a forward transfer subprocess and a reverse transfer subprocess;
[0038] The selection formula of the hidden layer is:
[0039]
[0040] In the formula, n1 is the number of hidden layer nodes; n is the number of input layer nodes; m is the number of output layer nodes; a is an adjustment constant between 1 and 10;
[0041] The forward transfer subprocess is formulated as follows:
[0042]
[0043] x j =f(S j )
[0044] In the formula, w ij is the weight between nodes i and j; x i is the value of node i; b j is the threshold of node j; x j is the output value of node j;
[0045] The reverse transfer subprocess is formulated as follows:
[0046]
[0047]
[0048]
[0049] Where, d j is the output result of node j in the output layer; y j is the test value of the j node in the output layer; b is the threshold; E is the square error; N is the number of training samples; ε is the convergence accuracy; η is the learning rate; Δw(i,j) is the weight correction;
[0050] The formula of the combined heat value prediction model equation based on genetic algorithm is:
[0051] y i =H i a1 +P j a2 +T j a3 +L j a4 +D j a5 +Q j a6
[0052]
[0053] In the formula, y i is the predicted calorific value of the distribution station j; H i is the measured calorific value of gas source i; P j is the pressure of the distribution station j; T j is the inlet temperature of distribution station j; L j is the distance from distribution station j to the gas source; D j Q is the diameter of the pipeline between the distribution station j and the gas source; j is the inflow flow of distribution station j; a1, a2, a3, a4, a5, a6 are dimensionless coefficients; D is the sum of the variances between the predicted value and the actual value; is the actual calorific value of distribution station j.
[0054] Furthermore, the error between the predicted value of the calculation model described in step S4 and the actual value of the calorific value of natural gas refers to the average value of the absolute error of each prediction sample, and the formula is:
[0055]
[0056] Where, MAE is the mean absolute error; is the residual sum.
[0057] Furthermore, the Parrot optimization algorithm is used to solve the weight optimization model in step S5, and a natural gas calorific value combination prediction model based on the Parrot optimization algorithm is established in combination with the optimal weight. The solving steps include:
[0058] S501: Establish a weight optimization model and use the Parrot optimization algorithm to solve the weight optimization model. The model formula is:
[0059]
[0060] S502: Set the population size to N, the maximum number of iterations to T, the lower bound of the search space to lb, the upper bound of the search space to ub, and the population initialization formula to:
[0061]
[0062] S503: Calculate the population fitness according to the weight model objective function and update the optimal population position;
[0063] S504: Generate a random positive integer y in the range of [1,4], and select an update strategy for each parrot population to update its position according to the random number result, wherein the update strategy includes a foraging behavior strategy, a stay behavior strategy, a communication behavior strategy, and a fear behavior strategy;
[0064] When y=1, the parrot population selects the foraging behavior strategy to update the position, and the update formula is:
[0065]
[0066] In the formula, The current location of the parrot population; Updated location of the parrot population; X best To initialize the optimal position of the parrot population in the current search phase; is the current population average position; Levy (D) is the Levy distribution, which is used to describe the flight situation of parrots; t is the current iteration number;
[0067] The population average position formula is:
[0068]
[0069] When y=2, the parrot population chooses the stay behavior strategy to update the position, and the update formula is:
[0070]
[0071] Where, X best Levy (D) indicates the process of flying to the host, and r·ones (D) indicates the process of randomly staying at a certain part of the host;
[0072] When y=3, the parrot population chooses the communication behavior strategy to update the position, and the update formula is:
[0073]
[0074] Where P is a random number generated in the range [0,1]; It represents the process of individuals joining a parrot population to communicate; It means the process of individuals flying out immediately after communication;
[0075] When y=4, the parrot population chooses the fear behavior strategy to update the position, and the update formula is:
[0076]
[0077] In the formula, It indicates the process of flying back to the owner; It means the process of moving away from strangers;
[0078] S505: Determine whether t≥T holds. If so, terminate the algorithm and output the optimal weight. Otherwise, return to S503 to continue weight optimization.
[0079] S506: Combine the optimized weights of the model output to build a natural gas calorific value combined prediction model, expressed as:
[0080] y=∑ω i y i
[0081] Where y is the prediction result of the combined prediction model; ω i is the weight corresponding to the i-th seed model; y i is the predicted value of the i-th seed model.
[0082] In summary, the present invention provides a natural gas calorific value combined prediction method based on the Parrot optimization algorithm: collect data on gas source calorific value, sub-station calorific value, sub-station inlet pressure, sub-station inlet temperature, sub-station inlet flow, pipeline diameter and pipeline length of a multi-gas source pipeline network; clean and fill in abnormal values and missing values in the basic data of the multi-gas source pipeline network; construct basic models for combined calorific value prediction based on regression equation, response surface analysis, BP neural network and genetic algorithm respectively; the error between the predicted value of the calculation model and the actual value of the natural gas calorific value refers to the average value of the absolute errors of each prediction sample, and the sub-model used to establish the combined model is selected by comparing the error size; the Parrot optimization algorithm is used to solve the weight optimization model, and combined with the weight optimization results, a calorific value combined prediction model based on the Parrot optimization algorithm is proposed to realize the combined prediction of the calorific value of each sub-station in the multi-gas source pipeline network. Existing research on the calorific value of natural gas mainly focuses on dynamic component tracking of natural gas pipelines and the use of indirect energy assignment calculation models. The research on prediction methods is not comprehensive and rarely proposes to realize calorific value combination prediction based on combined algorithm models. At the same time, some existing methods still lack experimental verification and error analysis of typical natural gas stations. The present invention focuses on establishing a calorific value combination prediction model based on the Parrot optimization algorithm to obtain the calorific value of natural gas. Considering the differences in gas quality and gas supply capacity between different gas sources, as well as the low accuracy and large error of the calorific value combination prediction model based on a single algorithm, the calorific value combination prediction model of the Parrot optimization algorithm is established with the goal of improving the prediction accuracy of the model, which improves the existing calorific value combination prediction method and provides strong support for the energy metering of natural gas. At the same time, the accuracy of the prediction model is verified in combination with specific application examples, and the assignment results and errors are further analyzed to ensure the practicality of the prediction model. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] Figure 1 It is a flow chart of the present invention;
[0084] Figure 2 The flow chart of the weight optimization model solved by the Parrot Optimization Algorithm of the present invention;
[0085] Figure 3 It is the relative error of the prediction result of the calorific value combination prediction model based on the linear regression equation, the logarithmic function equation, the power function equation, and the polynomial function equation in the specific application embodiment of the present invention;
[0086] Figure 4 It is the relative error of the prediction results of the calorific value combination prediction model based on response surface analysis, BP neural network, genetic algorithm and combined algorithm in the specific application embodiment of the present invention. DETAILED DESCRIPTION
[0087] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0088] like Figure 1 As shown, the present invention provides a natural gas calorific value combined prediction method based on the Parrot optimization algorithm, comprising the following steps:
[0089] S1: Collect basic data of multi-gas source pipeline network;
[0090] S2: Clean and fill in abnormal values and missing values in the basic data of multi-gas source pipeline network;
[0091] S3: Establish a natural gas calorific value prediction sub-model;
[0092] S4: Calculate the error between the model prediction value and the actual value of natural gas calorific value, compare the error size and select the sub-model for establishing the combined model;
[0093] S5: The Parrot optimization algorithm is used to solve the weight optimization model, and the optimal weight is combined to establish a natural gas calorific value combination prediction model based on the Parrot optimization algorithm.
[0094] In one embodiment, the basic data of the gas source network described in step S1 includes the gas source calorific value, the sub-station calorific value, the sub-station inlet pressure, the sub-station inlet temperature, the sub-station inlet flow, the pipeline diameter and the pipeline length of the multi-gas source network; wherein the gas source calorific value, the sub-station inlet pressure, the sub-station inlet temperature, the sub-station inlet flow, the pipeline diameter and the pipeline length are the input parameters of the prediction model, and the sub-station calorific value is the output parameter of the prediction model.
[0095] In one embodiment, the steps of cleaning and filling abnormal values and missing values in the basic data of the multi-gas source pipeline network in step S2 include:
[0096] S201: Divide the basic data of the pipeline network into different categories of data, wherein the gas source calorific value of the multi-gas source pipeline network, the sub-transmission station inlet pressure, the sub-transmission station inlet temperature, the sub-transmission station inlet flow, the pipeline diameter and the pipeline length are divided into input categories, and the sub-transmission station calorific value is separately divided into an output category;
[0097] S202: Based on the characteristics of the input data, the DBscan clustering method and the single-class support vector machine algorithm are used to detect outliers on the input categories;
[0098] S203: Detect missing values in each data category by logical reasoning;
[0099] S204: A filling strategy is used to supplement the basic data in the multi-gas source network, wherein the input category is filled using the mean filling method and the output category is filled using the random forest algorithm.
[0100] In one embodiment, the calorific value prediction submodel described in step S3 includes a natural gas calorific value prediction submodel based on a regression equation, a natural gas calorific value prediction submodel based on a response surface analysis, a natural gas calorific value prediction submodel based on a BP neural network, and a natural gas calorific value prediction submodel based on a genetic algorithm;
[0101] The calorific value combined prediction model based on regression equation includes a prediction model of multiple linear regression equation and a prediction model of multiple nonlinear regression equation;
[0102] The prediction model equation formula of the multivariate linear regression equation is:
[0103] y i =α0+α1x1+α2x2+...+α k x ki +ε (1)
[0104] In the formula, α0, α1, α2...α k is the regression coefficient; ε is the random error, assuming ε~N(0,σ 2 );
[0105] The prediction model of the multivariate nonlinear regression equation includes a prediction model based on a logarithmic equation, a prediction model based on a power function equation, and a prediction model based on a polynomial function equation;
[0106] The prediction model equation formula based on the logarithmic equation is:
[0107] lm i =lnA+α2lnx 2i +α3lnx 3i +...+α k lnx ki +u i (2)
[0108] Where lnA is the constant term of the regression equation; α2, α3, ..., α k is the regression coefficient; x 2i ,x 3i ,x 4i ,...,x ki To influence the dependent variable y i The independent variable u i is a random error;
[0109] The prediction model equation formula based on the power function equation is:
[0110]
[0111] In the formula, A is the constant term of the regression equation; is a random error;
[0112] The prediction model equation formula based on the polynomial function equation is:
[0113]
[0114] Where α0, α1, ..., α k is the regression coefficient;
[0115] The calorific value combined prediction model equation based on response surface analysis is:
[0116]
[0117] In the formula, a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,τ,β,χ,δ,φ, is the correlation coefficient of the equation; y is the calorific value of the distribution station; X1, X2, X3, X4, X5, X6 are the calorific value of the gas source, gas source pressure, pipeline temperature, pipe diameter, pipe length and gas source flow rate;
[0118] The steps of establishing the combined heat generation prediction model based on the BP neural network include the selection of hidden layers, a forward transfer subprocess and a reverse transfer subprocess;
[0119] The selection formula of the hidden layer is:
[0120]
[0121] In the formula, n1 is the number of hidden layer nodes; n is the number of input layer nodes; m is the number of output layer nodes; a is an adjustment constant between 1 and 10;
[0122] The forward transfer subprocess is formulated as follows:
[0123]
[0124] x j =f(S j ) (8)
[0125] In the formula, w ij is the weight between nodes i and j; x i is the value of node i; b j is the threshold of node j; x j is the output value of node j;
[0126] The reverse transfer subprocess is formulated as follows:
[0127]
[0128] Where, d j is the output result of node j in the output layer; y j is the test value of the j node in the output layer; b is the threshold; E is the square error; N is the number of training samples; ε is the convergence accuracy; η is the learning rate; Δw(i,j) is the weight correction;
[0129] The formula of the combined heat value prediction model equation based on genetic algorithm is:
[0130] y i =H i a1 +P j a2 +T j a3 +L j a4 +D j a5 +Q j a6 (12)
[0131]
[0132] In the formula, y i is the predicted calorific value of the distribution station j; H i is the measured calorific value of gas source i; P j is the pressure of the distribution station j; T j is the inlet temperature of distribution station j; L j is the distance from distribution station j to the gas source; D j Q is the diameter of the pipeline between the distribution station j and the gas source; j is the inflow flow of distribution station j; a1, a2, a3, a4, a5, a6 are dimensionless coefficients; D is the sum of the variances between the predicted value and the actual value; is the actual calorific value of distribution station j.
[0133] In one embodiment, the error between the predicted value of the calculation model described in step S4 and the actual value of the calorific value of natural gas refers to the average value of the absolute errors of each prediction sample, and the formula is:
[0134]
[0135] Where, MAE is the mean absolute error; is the residual sum.
[0136] In one embodiment, step S5 uses the Parrot optimization algorithm to solve the weight optimization model, and establishes a natural gas calorific value combination prediction model based on the Parrot optimization algorithm in combination with the optimal weight, including:
[0137] S501: Establish a weight optimization model and use the Parrot optimization algorithm to solve the weight optimization model. The model formula is:
[0138]
[0139] S502: Set the population size to N, the maximum number of iterations to T, the lower bound of the search space to lb, the upper bound of the search space to ub, and the population initialization formula to:
[0140]
[0141] S503: Calculate the population fitness according to the weight model objective function and update the optimal population position;
[0142] S504: Generate a random positive integer y in the range of [1,4], and select an update strategy for each parrot population to update its position according to the random number result, wherein the update strategy includes a foraging behavior strategy, a stay behavior strategy, a communication behavior strategy, and a fear behavior strategy;
[0143] When y=1, the parrot population selects the foraging behavior strategy to update the position, and the update formula is:
[0144]
[0145] In the formula, The current location of the parrot population; Updated location of the parrot population; X best To initialize the optimal position of the parrot population in the current search phase; is the current population average position; Levy (D) is the Levy distribution, which is used to describe the flight situation of parrots; t is the current iteration number;
[0146] The population average position formula is:
[0147]
[0148] When y=2, the parrot population chooses the stay behavior strategy to update the position, and the update formula is:
[0149]
[0150] Where, X best Levy (D) indicates the process of flying to the host, and r·ones (D) indicates the process of randomly staying at a certain part of the host;
[0151] When y=3, the parrot population chooses the communication behavior strategy to update the position, and the update formula is:
[0152]
[0153] Where P is a random number generated in the range [0,1]; It represents the process of individuals joining a parrot population to communicate; It means the process of individuals flying out immediately after communication;
[0154] When y=4, the parrot population chooses the fear behavior strategy to update the position, and the update formula is:
[0155]
[0156] In the formula, It indicates the process of flying back to the owner; It means the process of moving away from strangers;
[0157] S505: Determine whether t≥T holds. If so, terminate the algorithm and output the optimal weight. Otherwise, return to S503 to continue weight optimization.
[0158] S506: Combine the optimized weights of the model output to build a natural gas calorific value combined prediction model, expressed as:
[0159] y=Σω i y i (twenty two)
[0160] Where y is the prediction result of the combined prediction model; ω i is the weight corresponding to the i-th seed model; y i is the predicted value of the i-th seed model.
[0161] To further illustrate the present scheme, the present invention takes a multi-gas source pipeline network as a specific application example and conducts research on a combined prediction model for the calorific value of natural gas.
[0162] In combination with this specific application example and the method of constructing a combined calorific value prediction model, a calorific value prediction sub-model is constructed with the gas source calorific value, sub-station inlet pressure, sub-station inlet temperature, sub-station inlet flow, pipeline diameter and pipeline length as the prediction model input parameters, and the sub-station calorific value as the prediction model output parameter.
[0163] (1) The calorific value prediction sub-model constructed based on the linear regression equation is:
[0164] y=34.247+1.259×10 -5 x1-0.013x2-3.246×10 -5x3+0.009x4+0.064x6;
[0165] (2) The heat generation prediction sub-model constructed based on the logarithmic equation is:
[0166] y=3.351-8.355×10 -5 ln x3+0.002ln x4+0.001ln x5+0.067ln x6;
[0167] (3) The heat generation prediction sub-model constructed based on the power function equation is:
[0168] y=x1 0.295 +x2 -1.388 +x3 -0.145 +x4 -2.321 +x5 0.875 +x6 0.843 ;
[0169] (4) The heat generation prediction sub-model constructed based on the polynomial function equation is:
[0170] y=36.277+5.661×10 -6 x1-0.005x2-3.695×10 -10 x3+8.608×10 -7 x4-3.97×10 -10 x5+1.591×10 -10 x6;
[0171] (5) The calorific value prediction sub-model based on response surface analysis is:
[0172]
[0173] (6) In the construction of the combined prediction model of heat value based on BP neural network prediction algorithm, the tangent S-type function is selected as the transfer function from the input layer to the hidden layer, and the linear purelin function is selected as the transfer function from the hidden layer to the output layer. At the same time, the LM algorithm is used as the training method of the BP neural network, and the maximum number of training times is set to 1000 times, the learning rate is 0.04, and the convergence error is 0.001;
[0174] (7) For the genetic prediction algorithm, the initial population size is set to 60, the binary code length is set to 56, the crossover probability is set to 0.25, the mutation probability is set to 0.05, and the number of iterations is set to 1000.
[0175] When constructing a calorific value combination prediction model based on the Parrot optimization algorithm, the prediction accuracy of the prediction model is improved based on the principle of minimizing the prediction result error of the calorific value prediction model. Therefore, when selecting the sub-model of the Parrot optimization algorithm prediction model, it is necessary to compare and analyze the evaluation indicators of different basic models, and select the basic models with small errors and high determination coefficients for optimization combination. By applying the constructed calorific value combination prediction basic model to a specific example, the evaluation results of different calorific value combination prediction basic models are obtained through calculation, and the accuracy of the models is ranked and numbered from high to low. The specific results are shown in Table 6.
[0176] Table 6 Evaluation results of different heat value combination prediction basic models
[0177]
[0178] When constructing a combined model containing multiple basic models, the selection of sub-models cannot be based solely on quantity. Too many sub-models may weaken the accuracy of the prediction results. Therefore, it is necessary to remove redundant assignment basic models based on the evaluation results of different calorific value combination prediction models to achieve the purpose of optimizing the combined prediction model. This example selects the top three sub-models with high accuracy for combination, namely genetic algorithm calorific value combination prediction model f1, response surface analysis calorific value combination prediction model f2, and BP neural network calorific value combination prediction model f3.
[0179] A weight optimization model is established and the Parrot optimization algorithm is used to solve the weight optimization model. The model formula is:
[0180]
[0181] The heat value combination prediction model established after solving the Parrot optimization algorithm is:
[0182] y=0.4744y1+0.3216y2+0.2040y3;
[0183] In the formula, y is the prediction result of the combined algorithm calorific value combination prediction model, y1 is the prediction result of the genetic algorithm calorific value combination prediction model; y2 is the prediction result of the response surface analysis calorific value combination prediction model, and y3 is the prediction result of the BP neural network calorific value combination prediction model.
[0184] Different calorific value combination prediction models are used for calorific value prediction in this specific application example, and the calorific value prediction results of different sub-transmission stations in the pipeline network are shown in Table 8. It can be seen that the predicted calorific value based on the linear regression equation, exponential function equation, and polynomial function equation calorific value combination prediction model is quite different from the actual calorific value, and the model prediction effect is poor; the predicted calorific value based on the power function equation model is slightly different from the actual calorific value, and the overall distribution is relatively uniform; the predicted calorific value obtained based on the response surface analysis model is basically consistent with the actual calorific value, but the difference between the two is within 0.2MJ / m 3 The prediction results based on the BP neural network model fluctuate significantly compared with the actual calorific value, and the prediction effect is less stable; the prediction results based on the genetic algorithm and the combined algorithm model are not much different from the actual calorific value, with a difference of 0.15MJ / m 3 The prediction results of the combined algorithm model are smaller than those of the above-mentioned calorific value combination prediction model, indicating that the prediction effect of the combined algorithm calorific value combination prediction model is better and the accuracy is higher.
[0185] Table 8 Prediction results of different prediction models
[0186]
[0187]
[0188] In order to quantitatively analyze the relative errors of different calorific value combination prediction models, relative error analysis of different calorific value combination prediction models was performed. Figure 3 It can be seen that the error of the linear regression equation calorific value combination prediction model is relatively large, with a maximum error of 2.29% and an overall error of less than 2%. Figure 4 It can be seen that the maximum error of the polynomial equation calorific value combination prediction model is 1.42%, and the overall error is less than 1.0%; the maximum error of the logarithmic function equation calorific value combination prediction model is 1.10%, and the other errors are less than 1.0% overall; the maximum error of the power function equation calorific value combination prediction model is 0.74%, and the other errors are less than 0.6% overall, and the prediction effect is good. The relative errors of the other four prediction models are relatively small, and the overall errors are less than 0.5%. Among them, the maximum error of the response surface analysis calorific value combination prediction model is 0.43%, the maximum error of the BP neural network calorific value combination prediction model is 0.59%, and the maximum error of the genetic algorithm calorific value combination prediction model is 0.45%, while the maximum error of the combined algorithm calorific value combination prediction model is 0.41%. Compared with other prediction models, the error is the smallest and meets the calorific value combination prediction requirements, and the model prediction accuracy is higher. Therefore, the combined algorithm calorific value combination prediction model has a good prediction effect.
[0189] The above is only an example of the embodiment of the present specification and is not intended to limit the embodiment of the present specification. For those skilled in the art, the embodiment of the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiment of the present specification shall be included in the scope of the claims of the embodiment of the present specification.
Claims
1. A natural gas calorific value combined prediction method based on Parrot optimization algorithm, characterized in that: The following steps are involved: S1: Collect basic data of multi-gas source pipeline network; S2: Clean and fill in abnormal values and missing values in the basic data of multi-gas source pipeline network; S3: Establish a natural gas calorific value prediction sub-model; S4: Calculate the error between the model prediction value and the actual value of natural gas calorific value, compare the error size and select the sub-model for establishing the combined model; S5: The Parrot optimization algorithm is used to solve the weight optimization model, and the natural gas calorific value combination prediction model based on the Parrot optimization algorithm is established in combination with the optimal weight; The specific steps of S5 are: S501: Establish a weight optimization model and use the Parrot optimization algorithm to solve the weight optimization model. The model formula is: S502: Set the population size to N, the maximum number of iterations to T, the lower bound of the search space to lb, the upper bound of the search space to ub, and the population initialization formula to: S503: Calculate the population fitness according to the weight model objective function and update the optimal population position; S504: Generate a random positive integer y in the range of [1,4], and select an update strategy for each parrot population to update its position according to the random number result, wherein the update strategy includes a foraging behavior strategy, a stay behavior strategy, a communication behavior strategy, and a fear behavior strategy; When y=1, the parrot population selects the foraging behavior strategy to update the position, and the update formula is: In the formula, The current location of the parrot population; Updated location of the parrot population; X best To initialize the optimal position of the parrot population in the current search phase; is the current population average position; Levy (D) is the Levy distribution, which is used to describe the flight situation of parrots; t is the current iteration number; The formula for the average position of a population is: When y=2, the parrot population chooses the stay behavior strategy to update the position, and the update formula is: Where, X best Levy (D) indicates the process of flying to the host, and r·ones (D) indicates the process of randomly staying at a certain part of the host; When y=3, the parrot population chooses the communication behavior strategy to update the position, and the update formula is: Where P is a random number generated in the range [0,1]; It represents the process of individuals joining a parrot population to communicate; It means the process of individuals flying out immediately after communication; When y=4, the parrot population chooses the fear behavior strategy to update the position, and the update formula is: In the formula, It indicates the process of flying back to the owner; It means the process of moving away from strangers; S505: Determine whether t≥T holds. If so, terminate the algorithm and output the optimal weight. Otherwise, return to S403 to continue weight optimization. S506: Combine the optimized weights of the model output to build a natural gas calorific value combined prediction model, expressed as: and=Σω i and i Where y is the prediction result of the combined prediction model; ω i is the weight corresponding to the i-th seed model; y i is the predicted value of the i-th seed model.
2. A natural gas calorific value combined prediction method based on the Parrot optimization algorithm as claimed in claim 1, characterized in that: The basic data of the gas source network described in step S1 include the gas source calorific value, the sub-station calorific value, the sub-station inlet pressure, the sub-station inlet temperature, the sub-station inlet flow, the pipeline diameter and the pipeline length of the multi-gas source network; among which, the gas source calorific value, the sub-station inlet pressure, the sub-station inlet temperature, the sub-station inlet flow, the pipeline diameter and the pipeline length are the input parameters of the prediction model, and the sub-station calorific value is the output parameter of the prediction model.
3. A natural gas calorific value combined prediction method based on the Parrot optimization algorithm as claimed in claim 1, characterized in that: The abnormal values and missing values in the basic data of cleaning and filling the multi-gas source pipeline network described in step S2 include: S201: Divide the basic data of the pipeline network into different categories of data, wherein the gas source calorific value of the multi-gas source pipeline network, the sub-transmission station inlet pressure, the sub-transmission station inlet temperature, the sub-transmission station inlet flow, the pipeline diameter and the pipeline length are divided into input categories, and the sub-transmission station calorific value is separately divided into an output category; S202: Based on the characteristics of the input data, the DBscan clustering method and the single-class support vector machine algorithm are used to detect outliers on the input categories; S203: Detect missing values in each data category by logical reasoning; S204: A filling strategy is used to supplement the basic data in the multi-gas source network, wherein the input category is filled using the mean filling method and the output category is filled using the random forest algorithm.
4. A natural gas calorific value combined prediction method based on the Parrot optimization algorithm as claimed in claim 1, characterized in that: The calorific value prediction submodel described in step S3 includes a natural gas calorific value prediction submodel based on a regression equation, a natural gas calorific value prediction submodel based on a response surface analysis, a natural gas calorific value prediction submodel based on a BP neural network, and a natural gas calorific value prediction submodel based on a genetic algorithm; The natural gas calorific value prediction sub-model based on the regression equation includes a prediction model of a multiple linear regression equation and a prediction model of a multiple nonlinear regression equation; The prediction model equation formula of the multivariate linear regression equation is: y i =α0+α1x1+α2x2+...+α k x ki +e Where α0, α1, ..., α k is the regression coefficient; ε is the random error, assuming ε~N(0,σ 2 ); The prediction model of the multivariate nonlinear regression equation includes a prediction model based on a logarithmic equation, a prediction model based on a power function equation, and a prediction model based on a polynomial function equation; The prediction model equation formula based on the logarithmic equation is: girl i =lnA+α2lnx 2i +α3lnx 3i +...+α k lnx ki +u i Where lnA is the constant term of the regression equation; α2, α3, ..., α k is the regression coefficient; x 2i ,x 3i ,x 4i ,...,x ki To influence the dependent variable y i The independent variable u i is a random error; The prediction model equation formula based on the power function equation is: In the formula, A is the constant term of the regression equation; is a random error; The prediction model equation formula based on the polynomial function equation is: Where α0, α1, ..., α k is the regression coefficient; The calorific value combined prediction model equation based on response surface analysis is: In the formula, a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,τ,β,χ,δ,φ, is the correlation coefficient of the equation; y is the calorific value of the distribution station; X1, X2, X3, X4, X5, and X6 are respectively the calorific value of the gas source, the gas source pressure, the pipeline temperature, the pipe diameter, the pipe length, and the gas source flow rate; The steps of establishing the combined heat generation prediction model based on the BP neural network include the selection of hidden layers, a forward transfer subprocess and a reverse transfer subprocess; The selection formula of the hidden layer is: In the formula, n1 is the number of hidden layer nodes; n is the number of input layer nodes; m is the number of output layer nodes; a is an adjustment constant between 1 and 10; The forward transfer subprocess is formulated as follows: x j =f(S j ) In the formula, w ij is the weight between nodes i and j; x i is the value of node i; b j is the threshold of node j; x j is the output value of node j; The reverse transfer subprocess is formulated as follows: Where, d j is the output result of node j in the output layer; y j is the test value of the j node in the output layer; b is the threshold; E is the square error; N is the number of training samples; ε is the convergence accuracy; η is the learning rate; Δw(i,j) is the weight correction; The formula of the combined heat value prediction model equation based on genetic algorithm is: y i =H i a1 +P j a2 +T j a3 +L j a4 +D j a5 +Q j a6 In the formula, y i is the predicted calorific value of the distribution station j; H i is the measured calorific value of gas source i; P j is the pressure of the distribution station j; T j is the inlet temperature of distribution station j; L j D is the distance from distribution station j to the gas source; j Q is the diameter of the pipeline between the distribution station j and the gas source; j is the inflow flow of distribution station j; a1, a2, a3, a4, a5, a6 are dimensionless coefficients; D is the sum of the variances between the predicted value and the actual value; is the actual calorific value of distribution station j.
5. A natural gas calorific value combined prediction method based on the Parrot optimization algorithm according to claim 1, characterized in that: The error between the calculation model prediction value and the actual value of natural gas calorific value in step S4 refers to the average value of the absolute error of each prediction sample, and the formula is: Where, MAE is the mean absolute error; is the residual sum.
Citation Information
Patent Citations
Method for constructing photovoltaic power station generation capacity short-term prediction model based on multiple neural network combinational algorithms
CN105184678A
Multi-time scale air conditioner load prediction method
CN114202102A