Improving the energy efficiency of oil production using identification and prediction of operating modes of production wells based on data analysis methods, machine learning and neural networks

. Currently, there is a need to improve the systems and control of pumping equipment in the oil and gas production and oil and gas transport industries. Therefore, an adaptive neural network control system for an electric drive of a production well was developed. The task of expanding the functional capabilities of asynchronous electric motors control of the oil and gas production system using the methods of neural networks is solved. We have developed software modules of the well drive control system based on the neural network, an identification system, and a scheme to adapt the control processes to changing load parameters, that is, to dynamic load, to implement the entire system for real-time control of the high-speed process. In this paper, based on a model of an identification block that includes a multilayered neural network of direct propagation, the control of the well system was implemented. The neural network of the proposed system was trained on the basis of the error back-propagation algorithm, and the identification unit works as a forecaster of system operation modes based on the error prediction. In the initial stage of the model adaptation, some fluctuations of the torque are observed at the output of the neural network, which is associated with new operating conditions and underestimated level of learning. However, the identification object and control system is able to maintain an error at minimum values and adapt the control system to a new conditions, which confirms the reliability of the proposed scheme.


Introduction
The need of developing mathematical models of control objects, the application of analytical approaches to the interpretation of the control system, as well as other restrictions do not allow the application of the classical theory of automatic control to multidimensional dynamic objects.To solve such problems in 1943 [1], a mathematical model of a neuron and a software implementation of an artificial neural network (ANN) were proposed.Saerens M. and Soquet A. [2] proposed to use an approximation method for estimating errors in the domain of control in the back distribution network.This allows the ANN to adapt during the study of the control object.
In the framework of production processes of transport and oil preparation, an important condition is the real-time control of a given technological regime.To solve this problem, in the works [3][4][5], the authors presented management methods based on neural networks and simultaneous identification of the object.However, the error in the operation of these methods and the considerable time spent working off the disturbing influences do not allow them to be applied to the process under consideration.

Problem statement and main task
Artificial neural networks are the models of the biological neurons of a human brain.The elements of ANN are strongly interconnected.Parallel and crosslinks creates networks of simple adaptive elements according to their structural hierarchical organization, which are aimed at interacting with objects of the real world similarly to the processes of human thinking.The main purpose of training neural networks is the choice of network weights through its course so that there is a correspondence between the necessary input / output signals The theory of a single-layer neural network and the algorithm of perceptron convergence was proposed in 1960 [6].The difficulties encountered by neural network researchers according to [7] were that single-layer neural networks were very limited and too simplistic to solve complex problems.The lack of a suitable learning procedure for ANNs ultimately led to a decrease in interest in neural networks in the late 1960s.However, an event that helped eliminate these difficulties occurred, it was the development of an error back-propagation algorithm [6].The input signals xi are multiplied by the weights wi, which are also called synaptic weights and summed into the resulting signal shifted by the value of w0:.The parametric uncertainty of an asynchronous motor is a consequence of a change in its temperature and dynamic load.Existing adaptive controllers may be suitable for those mechanisms whose parameters either remain constant or change very slowly [9][10].Therefore, the main objective of this work is to develop an adaptive neural network control system for the coordinates of an asynchronous motor.

Development of a mathematical model of asynchronous electric motor for a pumping unit of a production well
The solution to the problem of mathematical modeling is associated with the choice of the coordinate system, since the current, flow coupling and voltage of the electric motor are represented as vectors, and these parameters are connected with the corresponding winding (stator or rotor).The coordinate system rigidly connected with the stator is oriented along the axes (α, β), with the rotor along the axes (d, q),and along the axes (u, ν) it rotates relative to the fixed stator with a speed ωс.Kirchhoff's equation for an asynchronous electric motor has the form [11]: where L1, L2, L12 is the inductance of the stator and rotor windings and their mutual inductance, U1 is the stator voltage; I1, I2 -stator and rotor current; R1, R2 is the active electrical resistance of the stator and the rotor; ψ1, ψ2 is stator and rotor flux linkage; Based on the experimental data, we have chosen a sigmoidal function (Figure 1).The system consists of a control object, a database, an adder, implemented in the form of a functional stack, an identification neural network included in a neuro-emulator and a classical control system.
The system is similar to the neural control circuit with an emulator and a controller that was presented in [15][16][17][18][19][20], where the neurocontroller is trained on the inverse model of the control object, and the neuroemulator is trained on the real model of the control object.Despite the drawbacks, this system is very easy to implement, and taking into account the experience of other researchers can significantly improve the accuracy and controllability of the object, and hence increase energy efficiency.
To train network, we will define a multilayered network of direct distribution with randomly chosen weights and a training set consisting of network input pairs that are the desired outputs

Analysis of simulation results
Training of the neural network in the system is carried out with respect to the velocity equation.Figure 2 shows the simulation results without an adjustments and identification block (1) and the simulation results of a proposed system with the adaptive prediction system and motor speed error reduction.The electromagnetic moment varies from 0 to 300 N•m for system (1) and from 0 to 220 N•m for system (2) at the time point of 0.0s; and the same results we get at the time point of 2.0s respectively.Fig. 2. Simulation results without an identification system (1) and modelling with an identification block, database and the system for predicting the well operating modes (2).
The induction motor currents vary from 0 to 500 Amps for the system (1) and from 0 to 275 Amps for the system (2).In the initial stage of the adaptation of the model, some fluctuations of angular velocity and torque output values are observed, which is associated with adaptation to new operating conditions.However, the proposed system is able to maintain an error at the minimum values (less than 5%) and adapt the control system to the new operating modes, which confirms the reliability of the designed identification and prediction of operating modes of production well's system.

Discussion
Based on the research conducted, an algorithm for training the neural network of the identification block using the back-propagation algorithm was developed.Based on the identification block, which adjusts the network coefficients and adjusts the function of the object real values, and then builds predicted values and gives the optimal settings for the controller of the control system, the control of an asynchronous electric motor of the production well was implemented.The neural network of the proposed system was trained on the basis of the error back-propagation algorithm, and the identification unit worked in the mode of operation modes prediction and the system error prediction.This model has shown good performance when controlling an object under dynamic load conditions.However, an increase in the error at the low speeds zone is observed, which can be explained by the fact that training was based on the nominal mode of our electromechanical system's (motor and load) operation of the downhole pumping machine.Prospects for further research will be the research and development of identification and control schemes using various combinations of neural networks and their types.

Conclusion
Thus, artificial neural networks are a new type of mathematical models for managing dynamic objects, since they are built according to the principle of organization and functioning of biological nerve cells of the brain, which allows the ANN to learn examples, compile and process incoming information in parallel, allows associativity and guarantees high reliability of its management system.In this work, based on a model of an identification block that includes a multilayered neural network, the control of an oil well system was implemented.
x2, ..., xn are input signals; w1, w2, ..., wn are the synaptic weights of the n-th neuron; Si is the function of input actions and the threshold element w0; f is an activation function; y is the output of the neuron.
electric angular speed; pn is a number of poles pairs of the engine; ω is the angular velocity of the Also, it is possible to represent systems (3) in a vector form for the purpose of implementing vector control.To obtain correct training values for the network controller we have developed a spark data analysis system.

,
XD, as well as the output values of network Y [21-23].The task of training is to select weighting factors to minimize a certain objective function.The objective function is the sum of the network errors squared in the examples from the training set.A minimization of the function is the least squares solution.

y
is the real output of the n-th output layer of the network for the p-th neuron in the j-th learning example, , jp d is the desired output.To find the minimum and determine the weights that are part of the function () , () N jp yx , we will use the method of steepest descent, in which at each training step we will change the weights.For modeling neural network structure it is used machine learning framework.

Fig. 1 .
Fig. 1.System identification and prediction model of operating modes of production wells.