Background
After the reform is opened, Chinese oil and gas pipeline enterprises also enter the stage of the reform development, a large number of foreign oil and gas pipeline related advanced technologies are introduced, and the foreign advanced management experience is actively learned, so that the overall level of the construction of the oil and gas pipelines in China is obviously improved. The Chuanqi east transportation engineering is another natural gas long-distance pipeline network transportation engineering following the West-east transportation engineering of China. The total investment is 626.76 hundred million yuan, the general plain gas field of Dazhou, Sichuan, Chongqing, Hubei, Jiangxi, Anhui, Jiangsu, Zhejiang and Shanghai 6 province in West province spans 2 cities, the total length of the pipeline is 2170 kilometer, and the natural gas is transported 120 billions of cubic meters in a year, which is equivalent to 1/7 of the natural gas consumption in China in 2009. To date, China has formed a basic pipeline network traversing east-west and longitudinal north and south, and has very important significance for ensuring stable transportation of oil and gas fields, meeting the requirements of industrial production and people life on oil and gas energy, and ensuring sustainable, stable and balanced development of social economy.
In the process of conveying the buried pipeline, the buried pipeline is influenced by a plurality of corrosion factors due to complex geological conditions, and can be divided into four corrosion factors of physics, chemistry, electrochemistry and microorganisms according to properties. Among the physical factors are: water content, volume weight, porosity, temperature, texture, etc.; the chemical factors include: pH, sulfate content, chloride content, sulfide content, and the like; the electrochemical corrosion mainly comprises: soil resistivity, potential gradient, redox potential, etc.; the microbial corrosion includes: sulfate reducing bacteria, neutral sulfurous bacteria, etc. With the increase of the service life, the corrosion depth of the pipeline can be gradually increased under the corrosion factors, so that the corrosion rate of the pipeline can be accurately predicted, effective protective measures can be taken in time, the pipeline safety accidents can be reduced, and a theoretical basis is provided for the updating and maintenance work of the pipeline.
Statistically, pipeline accidents 10798 occur in 1992 and 2012 in the United states, wherein the accidents caused by corrosion account for 18.5%; corrosion leakage accidents account for more than half of all pipeline accidents occurring in 2000 + 2012 of canada. The corrosion problem of oil and gas pipelines in China is also prominent, and domestic scholars find that 39.5 percent of accidents are caused by pipeline corrosion through statistics of natural gas pipeline accidents in Sichuan province; in a particularly serious accident of leakage and explosion of Donghuang oil pipelines in Qingdao in 2013, investigation shows that corrosion is one of important reasons for perforation and leakage of the pipelines. Therefore, establishing a reliable pipeline corrosion rate prediction model has important significance for reducing accidents and avoiding casualties.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a KPCA-BAS-GRNN-based buried pipeline external corrosion rate prediction method, which can realize the prediction of pipeline corrosion rate and has higher reliability.
In order to achieve the purpose, the method for predicting the corrosion rate outside the buried pipeline based on KPCA-BAS-GRNN comprises the following steps:
1) acquiring detection data of corrosion outside the buried pipeline, and constructing an external pipeline corrosion index system according to the detection data of the corrosion outside the buried pipeline;
2) constructing a corrosion prediction model of the generalized regression neural network;
3) dividing the data of the pipeline external corrosion index system obtained in the step 1) into a training sample and a test sample, training a corrosion prediction model of the generalized regression neural network through the training sample, optimizing a smooth factor sigma of the corrosion prediction model by adopting a Tianniu Lexus search algorithm, inputting the test sample into the trained corrosion prediction model of the generalized regression neural network to obtain a predicted value, judging the superiority and inferiority of the trained corrosion prediction model of the generalized regression neural network according to the predicted value and an actual measurement value, inputting the detection data of the external corrosion of the buried pipeline to be predicted into the trained corrosion prediction model of the generalized regression neural network to obtain the external corrosion rate of the buried pipeline when the trained corrosion prediction model of the generalized regression neural network is superior, and when the trained corrosion prediction model of the generalized regression neural network is inferior, go to step 1).
Let training sample X ═ X
1,x
2,…,x
n},x
i∈R
p,R
pFor the input space, P is the dimensionality of the data, i is 1, …, n, the input space is mapped with a mapping function Φ: r
p→ F, X → X, wherein,
the covariance matrix C in the feature space is:
solving the eigenvalue lambda and eigenvector v of the covariance matrix C in the eigenspace, lambda being more than or equal to 0, and setting the eigenvalue of the covariance matrix C in the eigenspace to be more than or equal to 0 and less than or equal to lambda1≤λ2≤…≤λnCorresponding feature vector is v1,v2,…,νnIt is written as:
substituting formula (1) and formula (2) into middle phi (x)
i)·Cv=λ(Φ(x
i) V) and let K ═ K (K)
ij)
n×n=(Φ(x
i)·Φ(x
j) (i, j ═ 1, 2, …, n) to obtain K α ═ n λ α, where K is the kernel matrix and the eigenvalue of K is n λ α
iThe feature vector of K is alpha
1,α
2,…,α
nTaking the normalized eigenvector alpha corresponding to the first m eigenvalues
1,α
2,…,α
mWherein, in the step (A),
at v
rProjection g
r(x
j) Comprises the following steps:
is provided with
Then there is
Selecting the first M components in the formula (3) as principal components, reducing the dimension by KPCA to obtain an extracted principal component coefficient matrix alpha, and then performing linear transformation on the training sample X by using the extracted principal component coefficient matrix alpha to obtain the training sample X
And finally, training the corrosion prediction model of the generalized regression neural network by using the training sample X after linear transformation.
The generalized regression neural network is composed of an input layer, a hidden layer and a linear output layer.
The detection data of the corrosion outside the buried pipeline comprise soil resistivity, oxidation-reduction potential, chloride ion content, sulfate ion content, water content, PH, salt content, stray current, density of damage points, cathodic protection rate, natural potential and sulfide content at different detection points.
The invention has the following beneficial effects:
the invention relates to a buried pipeline external corrosion rate prediction method based on KPCA-BAS-GRNN, which is characterized in that during specific operation, a longicorn stigma search algorithm is adopted to optimize a smooth factor sigma of a corrosion prediction model, the influence of human factors during parameter selection is reduced, a test sample is input into the corrosion prediction model of a trained generalized regression neural network to obtain a predicted value, when the error between the predicted value and an actual measurement value is less than or equal to a preset value, the corrosion prediction model of the trained generalized regression neural network is correct, during actual prediction, detection data of the buried pipeline external corrosion to be predicted can be input into the trained corrosion prediction model to obtain the buried pipeline external corrosion rate, the reliability is high, and the longicorn stigma search (BAS) algorithm is an intelligent optimization algorithm developed based on the foraging principle of the longicorn in 2017, and adjusting the position of the longicorn according to comparison of the left and right longicorn odor intensity, and finally obtaining an optimal output value.
Detailed Description
The invention is described in further detail below with reference to the accompanying drawings:
referring to fig. 1, the method for predicting the corrosion rate outside the buried pipeline based on KPCA-BAS-GRNN in the invention comprises the following steps:
1) acquiring detection data of the corrosion outside the buried pipeline, wherein the detection data of the corrosion outside the buried pipeline comprises soil resistivity, oxidation-reduction potential, chloride ion content, sulfate ion content, water content, PH, salt content, stray current, damage point density, cathodic protection rate, natural potential and sulfide content at different detection points, and then constructing an external corrosion index system of the pipeline according to the detection data of the corrosion outside the buried pipeline;
2) constructing a corrosion prediction model of the generalized regression neural network; the generalized regression neural network consists of an input layer, a hidden layer and a linear output layer, wherein in the hidden layer, the number of neurons is equal to the number of learning samples, and the weight LW of the network input and the first layer is calculated by using a dist distance formula
1,1The node function of Q neurons in the layer is a Gaussian function,
n is the number of samples, sigma is a smooth factor, a linear function is adopted as a transfer function of the output layer, and finally, the predicted value expression output by the GRNN network is as follows: a is
2=purelin(LW
2,1×a
1/suma
1)。
3) Dividing the data of the pipeline external corrosion index system obtained in the step 1) into a training sample and a test sample, training a corrosion prediction model of the generalized regression neural network through the training sample, optimizing a smooth factor sigma of the corrosion prediction model by adopting a Tianniu Lexus search algorithm, inputting the test sample into the trained corrosion prediction model of the generalized regression neural network to obtain a predicted value, judging the superiority and inferiority of the trained corrosion prediction model of the generalized regression neural network according to the predicted value and an actual measurement value, inputting the detection data of the to-be-predicted buried pipeline external corrosion into the trained corrosion prediction model of the generalized regression neural network to obtain the buried pipeline external corrosion rate when the trained corrosion prediction model of the generalized regression neural network is superior, and when the trained corrosion prediction model of the generalized regression neural network is inferior, go to step 1).
Specifically, let training sample X ═ X
1,x
2,…,x
n},x
i∈R
p,R
pFor the input space, P is the dimensionality of the data, i is 1, …, n, the input space is mapped with a mapping function Φ: r
p→ F, X → X, wherein,
the covariance matrix C in the feature space is:
solving the eigenvalue lambda and eigenvector v of the covariance matrix C in the eigenspace, lambda being more than or equal to 0, and setting the eigenvalue of the covariance matrix C in the eigenspace to be more than or equal to 0 and less than or equal to lambda1≤λ2≤…≤λnCorresponding feature vector is v1,v2,…,νnIt is written as:
substituting formula (1) and formula (2) into middle phi (x)
i)·Cv=λ(Φ(x
i) V) and let K ═ K (K)
ij)
n×n=(Φ(x
i)·Φ(x
j) (i, j ═ 1, 2, …, n) to obtain K α ═ n λ α, where K is the kernel matrix and the eigenvalue of K is n λ α
iThe feature vector of K is alpha
1,α
2,…,α
nTaking the normalized eigenvector alpha corresponding to the first m eigenvalues
1,α
2,…,α
mWherein, in the step (A),
at v
rProjection g
r(x
j) Comprises the following steps:
is provided with
Then there is
Selecting the first M components in the formula (3) as principal components, reducing the dimension by KPCA to obtain an extracted principal component coefficient matrix alpha, and then performing linear transformation on the training sample X by using the extracted principal component coefficient matrix alpha to obtain the training sample X
And finally, training the corrosion prediction model of the generalized regression neural network by using the training sample X after linear transformation, wherein the specific flow is shown in FIG. 3, and the mathematical formula is described as follows:
a) creating random vector of longicorn beard orientation and carrying out normalization processing
Where rands () is a random function and k represents the spatial dimension.
b) Creating spatial coordinates of longicorn stigma left and right whiskers, i.e.
Wherein x isrtThe position coordinate of the t-th iteration of the right cow whisker is obtained; x is the number ofltThe position coordinate of the t-th iteration of the left antenna of the longicorn; x is the number oftThe centroid coordinate of the longicorn at the t iteration; d0Is the distance between two whiskers;
c) judging the left and right beard odor intensity according to the fitness function, namely f (x)l) And f (x)r) (x) is a fitness function;
d) iterative updating of longicorn positions
Wherein, deltatSign () is a sign function for the step factor of the t-th iteration.
The method selects the average relative error as a fitness function of the GRNN model, and optimizes sigma by adopting BAS.
In addition, the present invention employs an Average Relative Error (ARE) and a coefficient of determination (R)2) Evaluating the advantages and disadvantages of the corrosion prediction model, specifically:
wherein n is the number of samples,
is the predicted value of the ith sample, y
iDetermining the value interval of the coefficient as [0,1 ] for the actual value of the ith sample]The closer the value is to 1, the better the model performance is, and the smaller the corresponding error is.
Simulation experiment
The east transportation of Sichuan gas is another long-distance pipeline network transportation project of natural gas after east transportation project of West gas in China is put into use, and the designed transportation capacity of pipelines is 120 hundred million m3And a, designing gas transmission pressure to be 10.0Mpa, pipe diameter to be 1016mm, steel pipe material to be X70, total length to be 2170Km, complicated soil along the line, multiple corrosion factors and serious corrosion condition outside the pipeline, and dividing the corrosion factors into 3 types of physics, chemistry and electrochemistry according to properties. The experiment adopts a real-time buried chip method, the corrosion rate is calculated through the mass change of the test chip, and no corrosion protection measure is set on the surface of the test chip. Along the lineSelecting 60 groups of test pieces in the monitoring points, recording the appearance of the test pieces, the description of corrosion products and soil parameters on site, and collecting soil samples. 60 groups of data are obtained through experimental analysis, and 12 main corrosion factors are determined to be used as an external corrosion index system, which is shown in figure 4. Finally, representative 15 sets of data were selected for predictive analysis, as detailed in table 1.
TABLE 1
Because the data dimensions of the external corrosion influence factors of the buried pipeline are different, firstly, the data are standardized, the result is shown in table 2, generally, KPCA has no fixed form requirement on the determination of the kernel function, and the invention selects RBF function: k (x, y) ═ exp (— | | x-y | | | non-conducting phosphor2/σ2) The normalized 12 variables were subjected to nonlinear feature extraction, and the calculated cumulative contribution ratios are shown in table 3.
TABLE 2
TABLE 3
As can be seen from Table 3, the cumulative contribution rate of the first 3 items exceeds 85%, so the first 3 main components are selected as the influence factors of the corrosion outside the buried pipeline, and the first 3 main components are F1,F2,F3Then the expression is as follows:
the prediction effect of the GRNN model is analyzed, 0.1, 0.2, 0.3, 0.4 and 0.5 are respectively selected as the spread values, 10 groups of training values and 5 groups of prediction values are constructed, and reference is made to fig. 5 and 6. The result shows that the prediction result of the GRNN model is unstable, accurate prediction of the corrosion rate of the pipeline cannot be realized, and the BAS algorithm is adopted to search for the optimal spread value, so that the stability and the accuracy of GRNN network prediction can be effectively improved.
From equation (10), 15 sets of data for KPCA reconstruction are available, setting BAS parameters: initial step size delta0And 3, dividing the extracted 15 groups of data into a training sample set and a testing sample set, and respectively substituting the training sample set and the testing sample set into a BAS-GRNN model for training and predicting, wherein the minimum RMSE after BAS optimization is 0.02042, the convergence state is reached after 54 times of iteration, and the spread value is 0.6747 according to the result shown in FIG. 7.
In order to verify the accuracy of the KPCA-BAS-GRNN model prediction, the output result is subjected to inverse normalization processing and is compared with a BP network and a PCA-SVM model, the training results of the three models are shown in figure 8, the difference between the actual value and the predicted value is represented by a residual error in order to visually express the model prediction effect, the result is shown in figure 9, and the comparison of the prediction results and the model performance evaluation of the three models are shown in table 4.
TABLE 4
As can be seen from Table 4, the average relative errors of BP, PCA-SVM and the KPCA-BAS-GRNN model are respectively 9.84%, 8.09% and 5.21%, the BAS-GRNN fitting result is better, the determining coefficient of the KPCA-BAS-GRNN model reaches 0.93, the model performance is greatly improved, and the prediction effect is better.
The matters not described in detail in the present specification belong to the prior art known to those skilled in the art, and the above embodiments are only for illustrating the present invention and not for limiting the present invention. Although the related embodiments of the present invention and the accompanying drawings are disclosed for illustrative purposes, those skilled in the art will appreciate that; various substitutions, changes, modifications and the like are possible without departing from the spirit and scope of the present invention and the appended claims. Therefore, all equivalent technical solutions also belong to the scope of the present invention, and the protection scope of the present invention should be defined by the claims, not limited to the disclosure of the best embodiment and the accompanying drawings.