Identification of Indicator Diagram Type in the Oil Well by BP Neural Network

Wax sticking in oil wells has always been a difficult problem in oil exploitation. Wax sticking in oil wells exists not only in the exploitation stage, but also in every link of oil production. Accurate identification of indicator diagram type is very important to prevent oil well wax sticking. In this paper, a BP neural network method is proposed to identify indicator diagram types. This model makes full use of indicator diagram data, simplifies complex mechanism research, and has wider practicability. Through the calculation of an example, the BP neural network established in this paper can accurately identify the type of indicator diagram.


Introduction
The indicator diagram can intuitively reflect the suspension point displacement and load changes of the oil pumping unit, which is an important means for field engineers to analyze the operating conditions of the oil pumping unit. However, field engineers basically use field experience identify indicator diagrams, and there is no systematic identification means and perfect identification system as technical guidance [1][2][3]. On the basis of the high computing power of the computer, Artificial Neural Network can quickly identify various non-linear images, and can realize machine learning and self-improvement. Therefore, artificial neural network is used to identify the type of indicator diagrams, which has feasibility and great potential.

Basic Principles of BP Algorithm
There are many neural network models, among which multilayer perceptron neural network is the most widely used. BP neural network is one of them. BP neural network is a system that can effectively learn the discriminant function from the sample set. Therefore, this paper uses a relatively simple three-layer BP neural network [4][5].
The BP neural network has three levels; they are the input layer, the middle layer, and the output layer, respectively. Initialize the weight matrix Wij and Vjk randomly, input the normalized value Oi from the nodes of the input layer in turn, and obtain the node input mj of the middle layer: Then excitation function gets the output Mj of the middle layer: The commonly used excitation function is the Sigmoid function: In the formula: j γ ----the threshold of node mj; The advantage of the sigmoid function is that it can make the same network process large signals and small signals, and it can still work even when the input signal changes greatly.
Calculate the input nk of the output layer node: Finally, obtain the calculated output Nk: Obtain error of the output layer ak: Then obtain weight matrix Vkj from the adjusted hidden layer to output layer: In the formula: η ----learning constant; Similarly, the error of the middle layer bj is obtained: Then obtain the layer weight matrix Wjk from the adjusted input layer to hidden layer: Start a new round of calculated output-weight adjustment process with the weight matrix Wjk, Vjk and input parameter Oj, know the error between the calculated output and the desired output meets the accuracy requirements, and the whole training process ends.
The learning constants take 0.1 to 0.4 to ensure the self-adjustment speed of the weight matrix and avoid the shock in the adjustment process of weight matrix.

Establishment of BP Neural Network
In order to fully reflect the features of the indicator diagram as much as possible, the linear interpolation of its up-down strokes is 36 points, and the input nodes are set to 77, Oi Normalized area:  Table.1. Table 1. Correspondence table of  Note: "Others" is not a type, but the sum of the types that have not been summarized.

BP network training and learning
The accurate and reliable BP neural network must use a large number of samples for the model to learn and train. The training samples selected in this paper are all single-fault samples, so ensure that this model can have good accuracy for each type of fault. And the number of samples of each type of fault selected in this paper is consistent, so avoid this model too sensitive to a certain type of fault.
In the sample training process, the number of learning nodes is 0.4, and the number of hidden nodes is 25. The maximum error of each output node of a single sample is less than 0.1, and the mean square sum of the output error of the sample library is less than 0.02, it as the end condition. The sample training also follows the following rules: (1) Use the until-type loop, all samples adjust the weight matrix once before the second round of training; (2) The sample training of a type of indicator diagram is concentrated in one round of training; (3) The indicator diagram samples of similar type or little difference need to be separated by at least two rounds, such as gas influence and gas lock, so ensure the accuracy of learning; (4) The number of samples for training and learning increases from small to large, and the sample types increase from small to large to accelerate the learning speed;

Case Analysis
This paper finally identified a total of 40 indicator diagram samples under 20 different faults. Fig.1 and Fig.2 are two indicator diagrams with typical fault, they are identified with the model in this paper, and the results are shown in Table.2 and Table.3. Table 2. Calculated output of indicator diagram 1

Conclusion
(1) The algorithm of BP neural network and its feasibility for indicator diagram identification were summarized (2) The new method which uses BP artificial neural network method to identify the type of indicator diagram was put forward, and specific design steps were given.
(3) BP neural network can be used to identification of fault types of indicator diagrams via example verification. The network construction and the extraction of input features are particularly important for the construction of the whole model.
(4) Reasonable selection and scientific classification of samples are conducive to build BP neural network models more quickly.