Processing curves pressure changes on the results of well test based on fuzzy regression trees

V. E. Lyalin1 , K. S. Chernyshev2 , I. M. Grigorev3 , M. V. Danilov4

1, 2, 3, 4Kalashnikov Izhevsk State Technical University, Izhevsk, Russia

1Corresponding author

Vibroengineering PROCEDIA, Vol. 12, 2017, p. 225-230.
Received 5 June 2017; accepted 7 June 2017; published 30 June 2017

Copyright © 2017 JVE International Ltd. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Creative Commons License
Table of Contents Download PDF References
Cite this article
Views 21
Reads 6
Downloads 703

The problems arising in the use of finite-difference approximation in a situation when an analytical solution is very difficult or impossible to obtain are investigated. This paper describes the generation of fuzzy inference system based on the CART (classification and regression tree) method. The resulting fuzzy system was used to determine the parameters of the oil reservoir to the well test after tuning parameter. Computational experiments are used to demonstrate the applicability of the fuzzy system for non-linear regression analysis.

Keywords: well testing, fuzzy logic, regression trees, CART.

1. Introduction

Mathematical models of the reservoir-reservoir are created by solving the diffusion equation under various boundary conditions. Models are defined by three different components that characterize the formation, the well and its vicinity (internal boundary conditions) and the outer boundaries of the formation (external boundary conditions). In the general case, the change in pressure is first due to the influence of internal boundaries, then at intermediate times the pressure change corresponds to the basic behavior of the productive formation, and finally, after a sufficiently long time, the pressure change is determined mainly by external boundary conditions.

The general equation of fluid filtration in an oil reservoir is described by the following diffusion equation [1]:

2 P r 2 + 1 r P r = ϕ μ c t k P t ,

where P is the pressure; r – distance along the radius from the wellbore; t – time; ϕ – porosity; μ – viscosity; ct – the total compressibility of the system; k – absolute permeability.

To obtain analytical solutions of the diffusion Eq. (1), the Laplace integral transformation is applied, which leads to a smoothing of the errors of the experimental functions. In addition, based on the exact solution in images, it is possible to obtain asymptotic solutions for t and t0 in the time domain and to use them effectively in solving inverse problems [4].

One way or another, the application of the Laplace transform is limited to those cases when the solution of the differential equation can be obtained analytically. However, this is not always the case. Therefore, if an exact solution cannot be obtained, it is possible to replace the differential equation by its finite-difference analogue [4, 5]. The definition of the parameters of linear and nonlinear differential equations refers to the construction of the so-called “gray box” model. The model is called so, since its mathematical structure is given in explicit form. The relationships between all parameters and variables of the model are known. The gray box model is convenient for using various methods of system identification.

2. Computational example

Let us consider an example of a simple model of heat propagation in an isolated metal rod of length L [3]. One end of the rod is heated with thermal power ut, at the other end a temperature measurement is performed yt. Under ideal conditions, this system is described by the equation of thermal conductivity (diffusion):

x t , ξ t = κ 2 x t , ξ ξ 2 ,

where κ is the coefficient of thermal conductivity; xt,ξ – rod temperature at point ξ at the time t.

To obtain a time-continuous model in the state space, the second derivative on the right-hand side of Eq. (2) is replaced by a finite-difference approximation:

2 x t , ξ ξ 2 = x t , ξ + Δ L - 2 x t , ξ + x t , ξ - Δ L Δ L 2 ,

where ξ=kΔL; k=1,2,,n; n=L/ΔL. Such a transformation leads to a system with a finite set of n states xt,kΔL, Each of which represents a certain average temperature of the rod in the range kΔLξ<k+1ΔL. In other words, the order of the system depends on the size ΔL of the spatial grid.

As a result, the diffusion Eq. (1) can be represented as a time-continuous linear system in the state space:

x ˙ t = A x t + B u t + K e t ,           x 0 = x 0 ,         y t = C x t + D u t + e t ,

where xt is the state vector; ut – input vector; et – vector of noises; yt – system reaction vector; x0 – vector of initial states of the system. For our problem:

x t = x t , 0 x t , k Δ L x t , L ,             x 0 = x 0,0 x 0 , k Δ L x 0 , L ,           y t = y t ,           u t = u t ,
A = κ Δ L 2 - 1 1 0 0 0 1 - 2 1 0 0 0 1 - 2 0 0 0 0 0 - 2 1 0 0 0 1 - 1 ,           B = 1 / Δ L 0 0 0 0 ,           K = 0 0 0 0 0 ,
C = 1 0 0 0 0 ,           D = 0 .

Furthermore, having sufficient observations can use any suitable method for identification systems (e.g., a method of minimizing the prediction error (PEM), which is largely based on an autoregressive moving average model, taking into account external influences (ARMAX) for estimating parameter κ.

3. The derivation of the scheme

Despite the great flexibility of the described method of replacing a differential equation by a finite-difference one, it has a number of serious drawbacks. This approach should be applied with great caution, since finite-difference approximation is equivalent to direct differentiation of experimental functions and is fraught with large errors [4, 5]. In addition, there is, for example, a reservoir model with a non-conductive discharge, which, in fact, is two-dimensional. If we use the Laplace transform, then for this model there is an analytical expression for changing the pressure in the well. However, the use of a numerical solution of this problem for obtaining system Eq. (4) may require an excessive number of state variables. Also, it may be noted that there are certain difficulties in creating a model of the form Eg. (4) for processing well test data obtained pressure recovery method. The problem is related to the dependence of the vector of initial conditions on the parameters of the formation.

In addition to the difficulties mentioned above, when working with finite differences, there is perhaps the main obstacle to the wider application of models of the type Eq. (4). For each new set of observations, the corresponding differential equation must be solved each time, which is associated with a large computational cost. It would be more convenient to have in advance a set of numerical solutions that would approximate the complex functional relationship between the independent variables (in this case the flow rate of the well), the parameters (in this case the formation) and the dependent variables (in this case the well pressure). For such purposes, so-called soft computing methods are widely used: neural networks and fuzzy logic inference systems [2]. As shown by a number of studies [1], the latter are usually preferable. The reasons are more simple adjustment of fuzzy systems, as well as a more understandable internal structure and logic of the operation of such systems, based on rules.

Modern systems of fuzzy inference are based on the application of a particular method of structural optimization to determine the structure of its rules base [8]. To solve the problems of non-linear regression, the classification and regression tree (CART) trees, which are special cases of decision trees, have gained particular popularity. With minor changes, CART can be used to identify the structure of the fuzzy rules base. Consider the basic steps necessary to generate a fuzzy logic inference system based on CART as applied to the analysis of well data.

The well test method of pressure recovery was formed on the basis of the analytical model:

P D B U t D = P D t p D + P D t D - P D t p D + t D ,

where PDBU – dimensionless pressure change in well test method of pressure recovery; PD – dimensionless pressure change during well testing by lowering the level; tD – dimensionless time change; tpD – dimensionless time during which production was carried out prior to the closure of the well.

Information on the reservoir and the fluid that saturates it is taken from Table. 1. The total number of points Nt over a period of 0.01 to 100 hours was 51. In general, Nc=50 random pressure curves were generated. Half of them were used as a training sample, the other half as a test sample. In this case, the areas of changes in the parameters k, S and C were, respectively 0,01;0,1 µm2, 0;10 and 0,01;0,1 m3/MPa. The total volume of observation points Ns=NtNc=2550.

In view of the wide variation in the values of time and the change in pressure, instead of real values t and ΔPBU during training, we used, respectively logt and logΔPBU. This has positively affected the entire learning process, so it is known that correct scaling of dependent and independent variables can significantly improve the conditionality of the problem [7].

Table 1. Information on the formation and the fluid that saturates it

Borehole radius (rw)
Reservoir thickness (h)
Volume factor (Bo)
Viscosity (μ)
Porosity (ϕ)
Initial pressure (Pi)
Total compressibility (ct)
Operating rate (q)

In accordance with the CART algorithm, a regression tree was constructed to predict the response ΔPBU as a function of the predictors k, S, C and t.

In the work, the fuzzy system performed a logical conclusion by Sugeno (in particular, the fuzzy first-order Sugeno model is used), since this simplifies the further parametric adjustment of the system [10, 12].

Since the regression tree is a particular case of a decision tree, it can be represented as a set of clear rules. Denote the set of independent variables and parameters at the input of the tree as xii=1,I¯ and the dependent variable at the output of the tree as y. Any rule consists of a premise and a corollary. The premise in this case is the result of a comparison xi with a certain threshold value wn in the n-th node of the tree (n=1,N¯). Let vn1,I¯ be the index of the input variable, by which the comparison takes place in the n-th node of the tree. Each tree node, except terminal nodes (leaves), has two descendants: left and right. If the result xvn<wn is true, further comparisons are made in the left child node. If the result xvnwn is true, further comparisons are performed in the right child node. In the future, without specifying the type of relationship, we will write down simply xvnwn. Then any rule can be represented in the following general form:

I F m x v m w m ,         y = y l ,

where m1,N¯ – the index of the node, only through which it is possible to get into the l-th sheet.

In order to make the clear rule Eq. (6) unclear, it is necessary to fuzzy the premises and the consequence of the rule. In the premise xvnwn is replaced by the operation of belonging to a fuzzy set An, i.e. xvnAn. This is equivalent to calculating the membership function μAnxvn, in which the sigmoid function was chosen:

μ A n x ; α n , c n = s i g x ; α n , c n = 1 + e - α n x - c n - 1 ,

where usually cn=wn; αn is configured by the user or calculated automatically. Moreover, the sign determines the type of fuzzy relation.

During the construction of the tree, a training sample was used, which can be represented as an ordered set of observations S=x1,d,,xI,d,ydd=1,D¯. When a tree is traversed, each q-th node, including the terminal one, can be assigned a subset SqS as a result of the decomposition SnS for n-th node, who is the parent of the q-th node. The breakdown is carried out in accordance with xvnwn. In this case, the equalities x-n=1Dnd=1Dnxvn,d and yl=1Dld=1Dlyd.

Let us calculate the following mean square error:

σ n = 1 D n d = 1 D n x v n , d - x - n 2 .

As a result, the parameter αn in Eq. (7) can be associated with σn the following way:

α n = 1 K σ n l n 1 + e r f K / 2 1 - e r f K / 2 ,

where erfx – error function; K>0.

The choice αn of Eq. (9) ensures equality of the areas under sigx;αn,cn and the Laplace function Φx;cn,σn in the interval -Kσn;Kσn. Experiments have shown that the choice K=1 is quite satisfactory.

A consequence in the fuzzy Sugeno rule is presented in the following form [10, 12]:

f l = p 0 , l + i = 1 I p i , l x i .

Let us denote Xl=xi,dT the matrix of observations of input variables that fall into the l-th sheet, and yl=yd is the vector of observations of the output variable in the same sheet. Then, to find the vector of unknown parameters pl=pm,l, m=0,I¯ we need to solve the following normal equations:

X ~ l T X ~ l p l = X ~ l T y l ,

where X~r=Xr1 – supplemented by units to the right of the matrix of input observations.

The solution Eq. (11) can be carried out by any suitable factorization method of the matrix X~r. If X~r turns out to be degenerate, then we can use the Sugeno model of zero order:

p 0 , l = y l ,           p i , l = 0 , i = 1 , I ¯ .

Fig. 1. Mean square error in training and test samples

 Mean square error in training  and test samples

Fig. 2. Cross-raft of normalized actual and calculated values

 Cross-raft of normalized actual  and calculated values

4. Results and discussions

After the structure of the fuzzy system has been determined, its parametric adjustment (optimization) [6, 9] is required, at which both the rule conclusions and the membership functions of the terms of the input variables are adjusted at the same time. The hybrid optimization method ANFIS [8, 11] (adaptive neural-fuzzy inference system), in which the linear parameters are tuned for the Kalman filter, and the non-linear parameters by the gradient method of back propagation of the error, proved particularly successful. However, in principle, all parameters can be adjusted only by the gradient method, that is, like the neural network training algorithms.

Table 2. Estimates of parameters and variances

Permeability k, μm2
Skin factor S
Accumulation coefficient C, m3/MPa
Dispersion σ2, MPa2
Analytical model
0,0499±0,0146 %
0,0500±0,0023 %
Fuzzy CART
0,0492±0,0150 %
0,0506±0,0064 %

In the study, the tuning was performed on the basis of ANFIS using the same training sample as in the construction of CART. To avoid retraining the fuzzy system, a test sample was tested at this stage. In Fig. 1 shows the graphs of mean-square errors obtained from the training and test samples. A square is marked by a fuzzy system having a minimum error on the test set. In Fig. 2 a cross-raft is constructed, where the normalized values produced by the fuzzy system are located along the abscissa axis and the normalized values from the test sample along the ordinate. Correlation coefficient ρ=0,9968.

To simulate the random error, normally distributed, the data well testing used a random number generator with zero expectation and variance 10-4 МPа2. The true values of the parameters were k= 0,05 mkm2, S=5, C= 0,05 m3/MPа.

The results of parameter estimates using the analytical model and fuzzy CART are given in Table 2. The curves of the change in pressure and its derivative obtained by both methods are shown in Fig. 3.

Fig. 3. Dynamics of pressure and its derivative

 Dynamics of pressure and its derivative

5. Conclusions

Based on the studies carried out, the following conclusions can be drawn. Fuzzy systems, whose structure of rules base are formed on the basis of CART, are really capable of approximating complex nonlinear dependencies between independent variables, parameters and dependent variables. Such systems can be successfully used to perform nonlinear regression analysis. However, they should not expect high accuracy, the resulting estimates, as in the case of analytical or numerical models. The main application of fuzzy inference systems is seen in distinguishing between candidate models.


  1. Aziz H., Settari E. Mathematical Modeling of Reservoir Systems. Institute for Computer Research, Moscow-Izhevsk, 2004, p. 416, (in Russian). [Search CrossRef]
  2. Kruglov V. V., Long M. I., Golunov R. Y. Fuzzy Logic and Artificial Neural Networks. Fizmatlit, Moscow, 2001, p. 224, (in Russian). [Search CrossRef]
  3. Courant R., Gilbert D. Methods of Mathematical Physics. Vol. 2, GTTI, Moscow, 1945, p. 620, (in Russian). [Search CrossRef]
  4. Mirzadjanzadeh A. H., Hasanov M. M., Bakhtizin R. N. Modeling of Oil and Gas Production Processes. Nonlinearity, Non-Equilibrium, Uncertainty. Institute for Computer Research, Moscow-Izhevsk, 2004, p. 368, (in Russian). [Search CrossRef]
  5. Samarsky A. A. The Theory of Difference Schemes. Nauka, Moscow, 1977, p. 656, (in Russian). [Search CrossRef]
  6. Attetkov A. V., Galkin S. V., Zarubin V. S. Optimization Methods. Publishing House of the Moscow State Technical University, NE Bauman, Moscow, 2003, p. 440, (in Russian). [Search CrossRef]
  7. Dennis J., Schnabel R. Numerical Methods for Unconstrained Optimization and Nonlinear Equations. Society for Industrial and Applied Mathematics, Philadelphia, 1996, p. 378. [Publisher]
  8. Kruglov V. V. Adaptive systems of fuzzy inference. Journal of Neurocomputers: Development and application, Vol. 3, 2003, p. 15-19, (in Russian). [Search CrossRef]
  9. Orlov A. I. Optimization Tasks and Fuzzy Variables. Znanie, Moscow, 1980, p. 64, (in Russian). [Search CrossRef]
  10. Terano T., Asai K., Sugeno M. Fuzzy Systems Theory and Its Applications. Academic Press, San Diego, CA, 1992, p. 268. [Search CrossRef]
  11. Jang J.-S. R., Sun Mizutani C.-T.-E. Neuro-Fuzzy and Soft Computing. Prentice-Hall, New Jersey, 1997, p. 640. [Search CrossRef]
  12. Johansen T. A. Robust identification of Takagi-Sugeno-Kang fuzzy models using regularization. 5th IEEE International Conference on Fuzzy Systems, New Orleans, Vol. 2, 1996, p. 180-193. [Search CrossRef]

Articles Citing this One

Vibroengineering PROCEDIA
S. V. Denisov, V. E. Lyalin, M. V. Danilov, K. S. Chernyshev