Neural Network-Based Beam Pumper Model Optimization

Beam pumper is the earliest and most popular rod pumper driven by surface dynamic transmission devices. Drawing on modern theories and methods of industrial model design, the model optimization of beam pumper could promote the diversity, serialization, standardization, generalization, precision balance, and energy reduction of beam pumper design. Therefore, this study tries to optimize the model of beam pumper based on a neural network. Specifically, the system efficiency of beam pumper was decomposed, the surface and downhole working efficiencies were analyzed, and the model optimization flow was explained for beam pumper. Then, a radial basis function (RBF) neural network was established and trained by the sample data on beam pumper model. Besides, the mapping between model parameters and the optimization objective (system efficiency) was constructed. Moreover, the authors summed up the model optimization contents of beam pumper and predicted the relevant parameters of model optimization. The results demonstrate the effectiveness of our model.


Introduction
Beam pumper is the earliest and most popular rod pumper driven by surface dynamic transmission devices [1][2][3][4]. It has long attracted the attention of sci-tech researchers. In the past two decades, more and more new beam pumpers have been developed and put into production [5][6][7][8][9][10][11]. A key link of the research and development (R&D) for new beam pumpers is to fully consider the structural performance indices of the pumper, strike a balance between pumper model, pumper functions, and production efficiency, and maximize the economic value of the beam pumper [12][13][14][15][16]. Beam pumper designers are faced with a major task: optimize the model of beam pumper by modern theories and methods of industrial model design, without changing the working performance of beam pumper [17][18][19][20][21]. e model optimization could promote the diversity, serialization, standardization, generalization, precision balance, and energy reduction of beam pumper design.
Considering the rods, tubes, and liquid columns of beam pumper, Zi-Ming et al. [22] established a three-dimensional (3D) dynamic model, which can be expressed as a set of partial differential equations. To make the model more reasonable, an experiment was carried out on South 1-2-22 Well in Daqing Oilfield, and the calculated torque curve was contrasted with the measured torque curve. e experimental results show that the 3D dynamic model is highly accurate and precise and applicable to the design and optimization of the structure and well operation of the beam pumper. Gu et al. [23] modeled and optimized beam pumper by an artificial neural network (ANN). e optimization was realized with Strength Pareto Evolutionary Algorithm 2 (SPEA2). In this way, the optimal set of operation parameters was obtained, which maximizes the oil production, and minimizes power consumption. Li et al. [24] proposed a new particle swarm optimization (PSO) algorithm based on chaotic search and introduced it into the optimal design of beam pumper. e new PSO takes the minimum peak torque factor of the stroke of the beam pumper as the objective function, providing a novel way for the design of complex structures. Based on the API-RP-11L design guidelines, Yang et al. [25] put forward a design optimization method for beam pumper. eir method not only offers an efficient and rapid optimization tool for the modular design of beam pumper but also provides an overall design formula that meets the API design specifications. Drawing on the domestic research of the modular design of beam pumper, Niu [26] suggested combining beam pumper modularization with parametric design. Following the function method, the main structural parameters were collected from the serial module division and subjected to parametric design. e overall performance of the design results was tested and analyzed from both kinematics and kinetics.
e current research of industrial model design and optimization mostly targets cars, home appliances, and computer numerically controlled (CNC) machine tools. e studies on beam pumper mainly focus on shape optimization issues like kansei engineering, and the introduction of emotional factors.
ere is no report that predicts and optimizes the model parameters of beam pumper based on the results of system efficiency analysis. erefore, this study attempts to optimize the model of beam pumper based on a neural network. e main contents are as follows: (1) e system efficiency of beam pumper was decomposed, and the surface and downhole working efficiencies were analyzed.
(2) e model optimization flow was explained for a beam pumper. (3) A radial basis function (RBF) neural network was established and trained by the sample data on beam pumper model. Besides, the mapping between model parameters and the optimization objective (system efficiency) was constructed. (4) After summing up the contents of beam pumper model optimization, the authors predicted the relevant optimization parameters, selected the best optimization scheme, and evaluated the effect of the scheme through field test. e proposed model was proved effectively through experiments.

System Efficiency Analysis
e model structure of beam pumper is illustrated in Figure 1, where 1-12 represent skid base, motor, crank counterweight, connecting rod, crank, reduction box, latching beam, rear support, beam, horsehead, beam hanger, and bracket, respectively. e system efficiency of beam pumper is defined as the ratio of the energy consumed by the pumper to lift the oil to the total energy consumption of the pumper. Based on the system efficiency analysis, the model parameter optimization of beam pumper can be viewed as a multiobjective optimization problem. e traditional approximation model and optimization algorithm can effectively optimize the model parameters of some beam pumpers, but the optimization effect is dampened by their undesirable prediction accuracy. To predict and optimize the model parameters of beam pumper from the perspective of energy conservation, the first step is to decompose the system efficiency of beam pumper and analyze the energy-saving mechanism.
rough stepwise analysis on efficiency decomposition of beam pumper, this study obtains the indices affecting the efficiency, finds the way to enhance the efficiency, and identifies the main indices for energy conservation of beam pumper. e balance and energy consumption of beam pumper were systematically analyzed, laying a solid theoretical basis for further improvement of beam pumper. e efficiency analyses are as follows: e system efficiency δ a of beam pumper is the product between the surface working efficiency δ b and the downhole working efficiency δ c : (1) e surface working efficiency of the pumper is the integrated efficiency of pumper components such reduction box, motor, and rod under normal conditions. e downhole working efficiency refers to the integrated efficiency of the core downhole components, such as sucker rod, tubing string, sealing device, and deep well pump.
Among them, the motor efficiency is the input-output power ratio of the motor. It includes several forms of energy loss, such as copper loss, iron loss, and heat dissipation. e copper loss is equal to the product of the square of the current and the resistance. e iron loss is the loss of energy due to the resistance of ferrous materials during the change of magnetic field poles. e output efficiency of the belt of the reduction box is usually defined as the ratio of the output power of the reduction box to that of the motor, which is normally greater than 85%. e efficiency of the belt consists of wear power and deformation power. Let R y be the longitudinal curved elastic modulus of the belt; J be the crosssectional inertial moment of the belt; m be the rotation speed of the belt; β be the wrap angle of the belt. en, the wear power can be calculated by Let ΔT 2 be the power loss induced by belt deformation; u be the linear speed of the belt; X be the cross-sectional area of the belt; R K be the tensile elastic modulus of the belt; and G be the tension of the belt. en, the deformation power can be calculated by e efficiency of reduction box is composed of its bearing operation efficiency, and box member loss. Let H, u e , and g be the load, linear speed, and friction coefficient of the bearing, respectively. en, the frictional power loss T c of the supplementary bearing can be calculated by Let g be the friction coefficient; L be the coefficient; c be the diameter of the polished rod; f be the effective height of the sealing; T τ be the tubing pressure; T s be the power of the polished rod. en, the transmission efficiency of the sealing device can be calculated by e power loss of the deep well pump mainly covers three parts: the power loss induced by mechanical friction, the leakage power loss of the pump, and the hydraulic power loss of the pump. Let c 1 and k be the diameter and length of the plunger, respectively; Δt be the difference between upper and lower pressures of the plunger; ξ be the radial gap between the plunger and the steel drum; λ be the viscosity of the well liquid; σ be the eccentric ratio; ρ be the eccentricity.
en, the power loss induced by mechanical friction of the deep well pump can be calculated by e leakage power loss of the pump can be calculated by Let c be the drag coefficient of the well fluid passing through the flow valve bank; φ be the density of the well fluid; W be the flow of the well fluid passing through the pump valve orifice; and χ be the size of the orifice. en, the hydraulic power loss of the pump can be calculated by e power loss of the tubing includes leakage power loss and hydraulic power loss of the tubing. Let Δt be the pressure difference between tubing and casing; W be the wellhead production of the oil well; and W be the displacement of the deep well pump. en, the leakage power loss of the tubing can be calculated by Let i be the grade number of sucker rod; μ be the friction factor of the tubing corresponding to grade i sucker rod; K i be the length of grade i sucker rod; c ic be the equivalent inner diameter of the tubing corresponding to grade i sucker rod; v i be the well fluid speed corresponding to grade i sucker rod; and W be the flow of the tubing. en, the hydraulic power loss of the tubing can be calculated by Let W be the daily fluid production of the pumper; F � F c + 1000(T τ − T r )/φh be the effective lift of the pumper; F c be the depth of the dynamic liquid depth; T τ and T r be the pressures of the tubing and casing, respectively. en, the effective power of the pumper can be expressed as follows: Considering the components of beam pumper, the system efficiency was considered as the integration of the above aspects. If the efficiency is too low in any aspect, the overall efficiency of beam pumper will be influenced. In terms of motor factors, it is necessary to consider the specification, power, working voltage, and power factor of the motor. In terms of belt rotation, it is necessary to consider the following issues: the size of the belt, the matching between wheels and grooves, the suitability of the degree of tightness, and the cleanness of the belt. In terms of reduction box operation, it is necessary to consider the sufficiency and quality of gear oil, the intactness of components, and the smoothness of the oilway. In terms of sealing device, it is necessary to consider the alignment of the horsehead, the matching between sealing method and wellhead, and the degree of airtightness. In terms of the sucker rod, it is necessary to consider the timely cleaning of wax, punctual adjustment/replacement of the centering device, and the utilization of large tubing. In terms of deep well pump and tubing, it is necessary to consider implementing maintenance on a timely basis.
rough the above analysis on the balance and energy saving theory of the beam pumper, the following criteria were selected for evaluating practical application: changing the operating parameters of electrification, load torque, Computational Intelligence and Neuroscience power frequency, load rate, and power factor; changing the transmission mode of the pumper to reduce the oscillation of the net torque; and adopting a structural balancing device for the pumper. Figure 2 explains the flow of beam pumper model optimization. According to the calibration principle of steadystate system efficiency, the model optimization of beam pumper roughly contains four steps: model construction and scheme design, system efficiency calibration and correction, surface and downhole working condition calibration, and model optimization and verification. To improve the efficiency of the pumper, it is necessary to determine the order between efficiency correction and calibration according to the actual situation, or to perform them simultaneously.

RBF-Based Optimization
To enhance system efficiency by optimizing model parameters, this study obtains model samples through a reasonable design of beam pumper and train an RBF neural network based on these samples. en, the authors set up the mapping relationship between the model parameters of beam pumper, which are identified in the preceding section, and the optimization objective (system efficiency). e purpose is to lower pumper energy consumption and improve the system efficiency of beam pumper. e topology of RBF neural network is inspired by the perception ability of the retina. Figure 3 shows the structure of RBF neural network. Let a be the input; D i be the center of the receptive field of retinal neurons; H(.) be the radial basis activation function. en, the signal outputted by retinal neurons can be characterized by the following function: e transfer function between input layer and hidden layer is usually defined as a Gaussian distribution function. Let m be the number of input layer nodes, j � 1, 2, 3, . . ., m, l � 1, 2, 3, . . ., m; M be the number of output layer nodes; D i be the data at node i in the hidden layer; ε i be the width of the  first node in the hidden layer, i � 1, 2, 3, . . ., t; t be the number of hidden layer nodes; a l − D i be the Euclidean distance between a l and D i ; θ ij be the weight from the i-th hidden layer node to the j-th output layer node. en, the transfer function from the input layer to the output layer of RBF neural network can be expressed as follows: e above analysis shows that RBF neural network mainly consists of D i , ε i , and θ ij . e hidden layer nodes of RBF neural network can be obtained through k-means clustering (KMC) through the following steps: Step 1. Select t random cluster heads D i from w samples of model parameters of beam pumper. For any sample a n , the class λ (n) of the sample can be calculated by Step 2. Define the class of the cluster head, which is the closest to sample a n , out of the t cluster heads as λ (n) . Let D i be that cluster head. Based on the calculation results of λ (n) , the head D i of the class can be recalculated by Repeat the above two steps until the cluster head changes very little, that is, the cluster head no longer changes, thereby determines the hidden layer nodes of the proposed network.
Let ζ i be the minimum Euclidean distance between the ith hidden layer node and other nodes; υ be the overlapping coefficient. en, the node width ε i can be determined by After D i and ε i are determined, the weight θ ij can be obtained by the pseudo-inverse matrix method, according to the inputted model parameters and outputted optimized parameters of network training.
In actual practice, the hidden layer nodes of the RBF neural network obtained through KMC face several problems: the clustering results are significantly affected by the initial nodes, the clustering may fall into the local optimal trap, and the training algorithm could not converge. To avoid these problems and diversify hidden layer nodes, this study introduces the niche-sharing technique to determine the t hidden layer nodes D i among the w model parameters.
In the niche-sharing mechanism, the Euclidean distance between individuals a i and a j is denoted as ζ ij ; the niche radius is denoted as ε mic ; the adjustment constant of the sharing function is denoted as ϕ. For individuals a i and a j in the population, the sharing function can be defined as follows: For a niche containing l individuals, the sharing degree e i of individual a i in the population can be defined as follows: Let g i be the initial fitness of a i . en, the sharing fitness g i ′ of that individual can be expressed as follows: Based on the niche-sharing technique, the t hidden layer nodes D i can be determined as follows: To derive the sharing degree SD(ζ nm ) between any two model parameter samples a n and a m of beam pumper, the first step is to compute the Euclidean distance ζ nm between them: e sum Ψ of the Euclidean distances between a n and other samples can be calculated by Computational Intelligence and Neuroscience e niche radius ε mic can be calculated by SD(ζ nm ) can be calculated by For any sample a n , the sharing degree e n can be calculated by e sharing fitness g i ′ of sample a n can be calculated by Finally, g n ′ values are ranked in descending order, and the t samples with the greatest g n ′ are chosen as the hidden layer nodes D i of the proposed neural network. Table 1 summarizes the contents of model optimization for beam pumper. Table 2 lists the prediction results on the model optimization parameters.

Experiments and Results Analysis
According to the schemes in Table 2, the improved beam pumper had smaller torques and cyclic load coefficient than the original machine. e mean input power of the motor can be obtained by the formulas in the preceding sections. e saved electrical energy is the energy consumption corresponding to the mean active power reduced by the falling cyclic load coefficient. e following conclusions can be drawn from the analysis on the model optimization schemes of beam pumper: the power phase difference factor of the motor is inversely proportional to the periodic load coefficient, because the reduction of the factor lowers the difference. e various measures of model optimization all contribute to energy saving. e only difference lies in the hanging point load and the initial value. Model optimization schemes like adding a balancing device does not change the size of the rod, or the stroke of the pumper. But the other optimization measures can reduce the hanging point load, directly reducing the load of the pumper, and indirectly increasing the operation time and safety level of the machine.   e three curves represent the mean torque, the maximum torque, and the minimum torque. According to the actual well condition specified by Yang et al. [25], the best choices are beam balancing, and adopting double horseheads.
It can be observed that the beam pumper after the model optimization through system efficiency analysis differed slightly in performance from the original beam pumper, but the optimized beam pumper achieved more stable torque curves, and ideal torque conditions. is study prepares a training set of 500 parameter samples and a test set of 100 samples, which are related to beam pumper model. e small test set may lead to overfitting. To solve the problem, cross validation was carried out to optimize the model. Since system efficiency is the optimization objective, the error and precision of the output efficiency of our model were selected as the metrics of model prediction performance. Figure 6 compares the actual system efficiency and predicted system efficiency in different groups of test samples. e system efficiency was predicted well at any sample. Figure 7 compares the predicted errors of different test groups. Obviously, the mean absolute errors (MAEs) were mostly smaller than 1. A few test groups had a slightly large MAE because the system energy consumption varies with working conditions. But the overall errors are desirable.
After finalizing the model of our neural network, the outliers were removed from the verification points of system efficiency. Figure 8 shows the errors between actual and predicted system efficiencies. It can be seen that the predicted system efficiencies on the test set were not very different from the actual values, and the output points were near the straight line of actual values. Hence, the proposed neural network boasts a good fitting effect, and a high prediction precision.
e experimental results show that the proposed optimization scheme basically achieved the expected effect, especially on consumption reduction and efficiency improvement. However, the stability, reliability, and energyefficiency of the scheme in actual application need to be   Computational Intelligence and Neuroscience 7 further tested. After the improved beam pumper operated stably for several hours, the current, power, and efficiency of the entire device were measured. e results show that the energy-efficiency of the improved device fell short of expectations, and only 11.5% of electricity was saved, compared to the original beam pumper. Besides, the rear balancing weight of the beam is quite heavy in the weight balancing structure. It adds to the difficulty for oil production engineers to complete the balancing operation, and slightly reduces security. Nevertheless, the proposed scheme is advantageous in terms of low retrofitting cost and high time efficiency.

Conclusion
is study puts forward an optimization approach for the model of beam pumper. First, the system efficiency of beam pumper was decomposed, the surface and downhole working efficiencies of beam pumper were analyzed, and the flow of beam pumper model optimization was clarified. Next, the model samples of beam pumper were adopted to train the proposed RBF neural network, and the mapping relationship was established between model parameters and the optimization objective (system efficiency). rough experiments, the authors summed up the contents of model optimization for beam pumper, predicted the model optimization parameters, and drew the torque curves of surface and downhole component optimization schemes, revealing that the optimized beam pumper achieved more stable torque curves, and ideal torque conditions. Finally, the system efficiencies were obtained at each test sample in different groups, the predicted errors of different test groups were compared, and the predicted system efficiencies were contrasted with the actual efficiencies. e results show that the proposed neural network boasts a good fitting effect, and a high prediction precision.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.