# A combined support vector regression with firefly algorithm for prediction of bottom hole pressure

- 47 Downloads

**Part of the following topical collections:**

## Abstract

Bottom hole pressure (BHP) is a fundamental parameter for the proper design of the production process and the development of reservoirs. BHP can be measured directly through the deployment of pressure down-hole gauges (PDG) or by the application of existing correlations and mechanistic models based on surface measurements. Unfortunately, these methods suffer from two main problems: the cost of measurement which is quite expensive mainly for PDG, and the inaccuracies for the correlations and mechanistic models, due to the limitation of their ranges of application. In this work, a new model based on support vector regression (SVR) optimized with firefly algorithm (FFA) is proposed to predict BHP of vertical wells with multiphase flow. Firefly algorithm is implemented for the optimal selection of SVR hyper-parameters. SVR-FFA model development is done using real-life measurement datasets obtained from distinct Algerian oil wells. The performance of the SVR-FFA model is compared with another hybridization SVR-genetic algorithm, trial and error SVR and with existing correlations and mechanistic models. The results demonstrate that the SVR-FFA model outperforms all the other models.

## Keywords

Flowing bottom hole pressure (BHP) BHP correlations and mechanistic models Support vector regression (SVR) Firefly algorithm (FFA)## 1 Introduction

Bottom hole pressure (BHP) is an essential parameter for a well from its completion till its abandonment stage. It is used to establish the development strategies, design facilities (such as well head completion and tubing size), and also in predicting suitable time for implementing activation mechanisms. Two main categories of methods can be distinguished for estimating BHP: the first is by using a permanent gauge in the bottom hole or by applying well testing; and the second is by a direct calculation using well-known empirical correlations and mechanistic models that are based on the available surface measurements. The most widely used correlations for BHP determination are those proposed by Hagedorn and Brown [1], Duns and Ros [2], Orkiszewski [3], Beggs and Brill [4], Aziz and Govier [5], Mukherjee and Brill [6]. The mechanistic models includes those of Ansari et al. [7], Chokshi et al. [8], Gomez et al. [9] and Gray [10]. Although the accuracy of the first category (i.e. gauge and well tests) and the simplicity of application of the second (i.e. the correlations and the mechanistic models), both of them present sensible limitations. These incudes the cost which is expensive for the first category, and the poor performances for the second, since all the existing correlations and mechanistic models were developed under a range of conditions, consequently, when their applications are out of these domains, their results became mediocre.

During the last years, data-driven through its different methods has been increasingly introduced in several fields of science and technology including petroleum engineering, to resolve practical problems [11, 12, 13]. Accordingly, very attractive frameworks such as Artap, which is based on machine learning and nature-inspired algorithms have been implemented for practical applications [14]. Accurate prediction of BHP using data-driven techniques is one of these successful applications as we have demonstrated in our previously published work [15]. On the other hand, support vector regression (SVR) is one of the most popular data-driven methods. It is characterized by the high generalization capability that is assured by the exploitation of both structural risk minimization (SRM) and empirical risk minimization (ERM) principles [16]. It has been applied in various fields of science and technology, such as signal processing [17], finance [18], biology [19], biomedicine [20], engineering [21, 22], oil industry [23, 24] and others. Many articles shed light the successful application of this tool in petroleum and reservoir engineering. Ansari and Gholami [25] have applied SVR to estimate the saturation pressure of crude oils. Na’imi et al. [16] have used SVR to estimate reservoir porosity and water saturation distributions. Bian et al. [26] have employed SVR to predict minimum miscibility pressure (MMP) of the system CO_{2}-oil. Fattahi et al. [27] have used SVR in the prediction of asphaltene precipitation.

Recently, firefly algorithm (FFA), which is a population-based and a nature-inspired heuristic algorithm has been applied in many fields as a global optimization approach [28]. It is based on flashing behavior of fireflies [29]. This algorithm often leads to a significant improvement for solving problems with multimodal functions. In this paper, it is applied as an optimization method to increase the accuracy and the prediction reliability of SVR by finding the optimum SVR hyper-parameters.

This research aims to establish a robust and fast approach to estimate BHP in vertical wells with multiphase flow using hybridization SVR with firefly algorithm. 100 field data gathered from various Algerian fields and covering a wide range of variables are used for this purpose. The performance of the combined SVR-FFA model is compared with SVR-GA (hybridization SVR and genetic algorithm), SVR-TE trial and error SVR) and existing correlations and mechanistic models.

The rest of the paper is organized as follows. Section 2 briefs the implemented data-driven technique, i.e. SVR and the applied optimization algorithms. Section 3 describes the utilized data sets. Results are presented and discussed in Sect. 4. The paper ends with Sect. 5 which summarizes the main findings of the study.

## 2 Methodology

### 2.1 Support vector regression (SVR)

*C,*and the term \(K\left( {x_{i} ,x_{j} } \right)\) represents the kernel function. This latter aims to map the input space into some higher dimensional space. This trick allows SVR to conveniently solve non-linear regression problems. There are many kernel functions proposed in the literature [33], the popular ones are polynomial function, radial basis function (RBF) and Gaussian function. In this study, RBF is used as the kernel function and it is defined as shown below:

The ideal performance and the high accuracy of SVR depend greatly on the combination of \(C, \varepsilon\) and the kernel function parameter \(\gamma\). Hence, it is necessary to optimize these parameters using robust algorithms able to automatically select their optimum combination.

### 2.2 Firefly algorithm (FFA)

Firefly algorithm is a smart-swarm based algorithm which was developed by Yang [34] for solving optimization problems. The inspiration and the basic formulation of FA is based on the natural behavior of fireflies which emulate flashes of lights as a strategy of communication. Accordingly, one firefly is attracted towards other if the latter one emits higher light intensity [29]. It is worth noting that the brightness of every firefly imitates the quality of the solutions.

In the above-equation, the term \(\beta_{0} e^{{ - \gamma r_{i,j}^{2} }} \left( {x_{i} - x_{j} } \right)\) corresponds to the attraction effect; and the term \(\alpha \left( {rand - \frac{1}{2}} \right)\) is a randomization term and essentially it provides a random sign or direction, where \(\alpha\) corresponds to the randomization coefficient. \(\beta_{0}\) is the light intensity at distance \(r = 0\) and generally it corresponds to 1. \(\gamma\) is absorption coefficient, whose the value is distributed over [0, ∞]. The Cartesian distance is applied to calculate the distance between any two fireflies i and j: \(r_{i,j} = \sqrt {\mathop \sum \nolimits_{k = 1}^{D} \left( {x_{i,k} - x_{j,k} } \right)}\).

The traveling mechanism of fireflies is repeated iteratively until a stopping condition is satisfied. The fittest firefly represents the best solution.

In this paper, firefly algorithm is employed to tune SVR hyper-parameters (\(C, \varepsilon\) and \(\gamma\)).

### 2.3 Genetic algorithm (GA)

Genetic algorithm (GA) is an evolutionary optimization technique based on genetic principles developed by Holland [35]. The algorithm begins by representing an initial population of possible solution in a form of chromosomes. Then, three types of genetic operators are applied to explore the different regions of the search space and find the optimal solutions. These operators are: selection, crossover and mutation operators. More details about these operators can be found in previously published works [35, 36]. This process is repeated until some predefined termination criteria are fulfilled.

## 3 Data analysis

Statistical parameters for the study datasets

Parameters | Min value | Max value | Mean |
---|---|---|---|

| |||

Q | 8 | 1660 | 226.46 |

Q | 22,500 | 572 | 6018.22 |

Q | 0 | 750 | 16.34 |

Oil gravity | 0.569 | 0.931 | 0.724 |

Gas gravity | 0.602 | 0.884 | 0.703 |

ID (in) | 1.61 | 4.404 | 2.52 |

Depth (ft) | 3678 | 14,742 | 8977.02 |

WHP (Psi) | 450 | 8472 | 2828.30 |

WHT (°F) | 46 | 184 | 105.25 |

GOR (bbl/scf) | 701 | 1,170,000 | 62,147.66 |

| |||

BHP (Psia) | 653 | 11,250 | 3927.60 |

## 4 Results and discussions

FFA and GA setting parameters

Algorithm | Parameters | Value/setting |
---|---|---|

FFA | Number of fireflies | 20 |

Maximum number of iterations | 30 | |

alpha | 0.5 | |

beta | 5 | |

gamma | 1 | |

GA | Population size | 20 |

Crossover’s probability | 90% | |

Mutation’s probability | 70% | |

Type of replacement | Elitist (10% of the population) | |

Type of selection | Linear ranking | |

Max number of generations | 30 |

^{2}) are calculated by the following equations:

Obtained SVR hyper-parameters for developed models

C | ε | γ | |
---|---|---|---|

SVR-FFA | 9500.70 | 0.0145 | 6.5980 |

SVR-GA | 9128.40 | 0.1625 | 6.7002 |

SVR-TE | 9050 | 0.3500 | 8.25 |

^{2})) are shown in Table 4. According to Table 4, for the whole data set, the AARD %, R

^{2}and SD values are 2.13% (1.01% for the training data and 6.65% for the test data), 0.9981 (0.9997 for the training data and 0.9917 for the test data) and 4.13% (2.86% for the training data and 9.20% for the test data) for SVR-FFA, while these values for the SVR-GA are 2.20% (1.09% for the training data and 6.63% for the test data), 0.9981 (0.9997 for the training data and 0.9918 for the test data) and 4.18% (2.94% for the training data and 9.17% for the test data), respectively, and for SVR-TE are 2.66% (1.65% for the training data and 6.72% for the test data), 0.9980 (0.9995 for the training data and 0.9922 for the test data) and 4.96% (3.79% for the training data and 4.96% for the test data) respectively. The comparison reveals that SVR-FFA model gives the best performance with the data as shown from the values of the three statistical indicators.

Comparison of SVR-FFA. SVR-GA and SVR-TE models for BHP prediction

Model | AARE (%) | R | SD (%) | |
---|---|---|---|---|

Training | SVR-FFA | 1.01 | 0.9997 | 2.86 |

SVR-GA | 1.09 | 0.9997 | 2.94 | |

SVR-TE | 1.65 | 0.9995 | 3.79 | |

Testing | SVR-FFA | 6.65 | 0.9917 | 9.20 |

SVR-GA | 6.63 | 0.9918 | 9.17 | |

SVR-TE | 6.72 | 0.9922 | 9.62 | |

All | SVR-FFA | 2.13 | 0.9981 | 4.13 |

SVR-GA | 2.20 | 0.9981 | 4.18 | |

SVR-TE | 2.66 | 0.9980 | 4.96 |

^{2}and SD respectively. The comparison demonstrates the large superiority of SVR-FFA compared with other conventional methods. In summary, the performance and the accuracy analyses clarified that SVR, whether optimized or not, have a reliable ability to predict BHP. Also, it should be noted that the proposed SVR-FFA model, achieved minimum average absolute percent error and resulting more accurate output estimation over the other SVR or conventional approaches, thanks to the usage of FFA meta-heuristic algorithm for hyper-parameters optimization and tuning. “Appendix 1” reports detailed steps for using the established SVR-FFA.

## 5 Conclusions

- 1.
This study also provides a considerable improvement over previous proposed correlations and mechanistic models with broader applicability in terms independent variable ranges.

- 2.
The proposed paradigms based on SVR provided very satisfactory prediction abilities.

- 3.
Among the implemented models, SVR coupled with FFA is deemed the most reliable and outperforms the other proposed schemes.

- 4.
SVR-FFA exhibited excellent prediction performance with an overall AARD value of 2.13% and a total determination coefficient of 0.9981.

- 5.
The newly proposed hybridizations in this study outperform the prior correlation and mechanistic models for predicting BHP.

## Notes

### Compliance with ethical standards

### Conflict of interest

The author declares that he has no conflict of interest.

## References

- 1.Hagedorn AR, Brown KE (1965) Experimental study of pressure gradients occurring during continuous two-phase flow in small-diameter vertical conduits. J Pet Technol 17:475–484. https://doi.org/10.2118/940-PA CrossRefGoogle Scholar
- 2.Duns Jr. H, Ros NCJ et al. (1963) Vertical flow of gas and liquid mixtures in wells. In: The 6th World one health congress.Google Scholar
- 3.Orkiszewski J et al (1967) Predicting two-phase pressure drops in vertical pipe. J Pet Technol 19:829–838CrossRefGoogle Scholar
- 4.Beggs DH, Brill JP et al (1973) A study of two-phase flow in inclined pipes. J Pet Technol 25:607–617CrossRefGoogle Scholar
- 5.Aziz K, Govier GW et al (1972) Pressure drop in wells producing oil and gas. J Can Pet Technol 11:38Google Scholar
- 6.Mukherjee H, Brill JP (1985) Pressure drop correlations for inclined two-phase flow. J Energy Resour Technol 107:549. https://doi.org/10.1115/1.3231233 CrossRefGoogle Scholar
- 7.Ansari AM, Sylvester ND, Shoham O, Brill JP et al. (1990) A comprehensive mechanistic model for upward two-phase flow in wellbores. In: SPE annual technical conference and exhibitionGoogle Scholar
- 8.Chokshi RN, Schmidt Z, Doty DR et al. (1996) Experimental study and the development of a mechanistic model for two-phase flow through vertical tubing. In: SPE western regional meetingGoogle Scholar
- 9.Gomez LE, Shoham O, Schmidt Z, Chokshi RN, Northug T et al (2000) Unified mechanistic model for steady-state two-phase flow: horizontal to vertical upward flow. SPE J 5:339–350CrossRefGoogle Scholar
- 10.Gray HE (1974) Vertical flow correlation in gas wells. API user’s manual for API 14B subsurface controlled subsurface safety valve sizing computer program (1974)Google Scholar
- 11.Nait Amar M, Zeraibi N, Redouane K (2018) Pure co
_{2}-oil system minimum miscibility pressure prediction using optimized artificial neural network by differential evolution. Pet Coal 60:284–293Google Scholar - 12.Menad NA, Noureddine Z, Hemmati-Sarapardeh A, Shamshirband S, Mosavi A, Chau K (2019) Modeling temperature dependency of oil-water relative permeability in thermal enhanced oil recovery processes using group method of data handling and gene expression programming. Eng Appl Comput Fluid Mech 13:724–743Google Scholar
- 13.Menad NA, Noureddine Z (2019) An efficient methodology for multi-objective optimization of water alternating CO
_{2}EOR process. J Taiwan Inst Chem Eng 99:154–165CrossRefGoogle Scholar - 14.Pánek D, Orosz T, Karban P (2019) Artap: robust design optimization framework for engineering applications. In: Third international conference on intelligent computing in data sciences ICDS201. IEEE, pp. 1–5 (
**in Press**)Google Scholar - 15.Nait Amar M, Zeraibi N, Redouane K (2018) Bottom hole pressure estimation using hybridization neural networks and grey wolves optimization. Petroleum. 4:419–429. https://doi.org/10.1016/j.petlm.2018.03.013 CrossRefGoogle Scholar
- 16.Na’imi SR, Shadizadeh SR, Riahi MA, Mirzakhanian M (2014) Estimation of reservoir porosity and water saturation based on seismic attributes using support vector regression approach. J Appl Geophys 107:93–101. https://doi.org/10.1016/j.jappgeo.2014.05.011 CrossRefGoogle Scholar
- 17.Vapnik V, Golowich SE, Smola AJ (1997) Support vector method for function approximation, regression estimation and signal processing. In: Advances in neural information processing systems, pp 281–287Google Scholar
- 18.Trafalis TB, Ince H (2000) Support vector machine for regression and applications to financial forecasting. In: Proceedings of the IEEE-INNS-ENNS international joint conference on neural networks. IJCNN 2000. Neural computing: new challenges and perspectives new Millenn. IEEE, vol 6, pp 348–353. https://doi.org/10.1109/ijcnn.2000.859420
- 19.Schölkopf B, Tsuda K, Vert JP (2004) Kernel methods in computational biology. MIT Press, LondonCrossRefGoogle Scholar
- 20.Khandoker AH, Palaniswami M, Karmakar CK (2009) Support vector machines for automated recognition of obstructive sleep apnea syndrome from ECG recordings. IEEE Trans Inf Technol Biomed 13:37–48. https://doi.org/10.1109/TITB.2008.2004495 CrossRefGoogle Scholar
- 21.Clarke SM, Griebsch JH, Simpson TW (2005) Analysis of support vector regression for approximation of complex engineering analyses. J Mech Des 127:1077. https://doi.org/10.1115/1.1897403 CrossRefGoogle Scholar
- 22.Wen YF, Cai CZ, Liu XH, Pei JF, Zhu XJ, Xiao TT (2009) Corrosion rate prediction of 3C steel under different seawater environment by using support vector regression. Corros Sci 51:349–355. https://doi.org/10.1016/J.CORSCI.2008.10.038 CrossRefGoogle Scholar
- 23.Nait Amar M, Zeraibi N (2018) Application of hybrid support vector regression artificial bee colony for prediction of MMP in CO <inf> 2 </inf>-EOR process. Petroleum. https://doi.org/10.1016/j.petlm.2018.08.001 CrossRefGoogle Scholar
- 24.Menad NA, Noureddine Z, Hemmati-Sarapardeh A, Shamshirband S (2019) Modeling temperature-based oil-water relative permeability by integrating advanced intelligent models with grey wolf optimization: application to thermal enhanced oil recovery processes. Fuel 242:59CrossRefGoogle Scholar
- 25.Ansari HR, Gholami A (2015) An improved support vector regression model for estimation of saturation pressure of crude oils. Fluid Phase Equilib 402:124–132. https://doi.org/10.1016/J.FLUID.2015.05.037 CrossRefGoogle Scholar
- 26.Bian X-Q, Han B, Du Z-M, Jaubert J-N, Li M-J (2016) Integrating support vector regression with genetic algorithm for CO
_{2}-oil minimum miscibility pressure (MMP) in pure and impure CO2 streams. Fuel 182:550–557. https://doi.org/10.1016/J.FUEL.2016.05.124 CrossRefGoogle Scholar - 27.Fattahi H, Gholami A, Amiribakhtiar MS, Moradi S (2015) Estimation of asphaltene precipitation from titration data: a hybrid support vector regression with harmony search. Neural Comput Appl 26:789–798CrossRefGoogle Scholar
- 28.Fister I, Fister I, Yang X-S, Brest J (2013) A comprehensive review of firefly algorithms. Swarm Evol Comput 13:34–46. https://doi.org/10.1016/J.SWEVO.2013.06.001 CrossRefGoogle Scholar
- 29.Yang XS (2009) Firefly algorithms for multimodal optimization. In: Lecture notes in computer science (Including subseries lecture notes in artificial intelligence and lecture notes in bioinformatics). Springer, Berlin, pp 169–178. https://doi.org/10.1007/978-3-642-04944-6_14 CrossRefGoogle Scholar
- 30.Vapnik V (1995) The nature of statistical learning theory. Springer, New York. https://doi.org/10.1007/978-1-4757-3264-1 CrossRefzbMATHGoogle Scholar
- 31.Burges CJC (1998) A tutorial on support vector machines for pattern recognition. Data Min Knowl Discov 2:121–167. https://doi.org/10.1023/A:1009715923555 CrossRefGoogle Scholar
- 32.Shawe-Taylor J, Cristanini N (2004) Kernel methods for pattern analysis. Cambridge University Press, CambridgeCrossRefGoogle Scholar
- 33.Forrester AIJ, Sbester A, Keane AJ (2008) Engineering design via surrogate modelling. J Wiley. https://doi.org/10.1002/9780470770801 CrossRefGoogle Scholar
- 34.Yang X-S (2009) Firefly algorithms for multimodal optimization. In: International symposium on stochastic algorithms, pp 169–178CrossRefGoogle Scholar
- 35.Sivanandam SN, Deepa SN (2007) Introduction to genetic algorithms. Springer, BerlinzbMATHGoogle Scholar
- 36.Menad NA, Hemmati-Sarapardeh A, Varamesh A, Shamshirband S (2019) Predicting solubility of CO
_{2}in brine by advanced machine learning systems: application to carbon capture and sequestration. J CO2 Util 33:83–95CrossRefGoogle Scholar