Petroleum Science and Technology ISSN: 1091-6466 (Print) 1532-2459 (Online) Journal homepage: http://www.tandfonline.com/loi/lpet20 Estimation of water content of natural gases using particle swarm optimization method Mohammad-Ali Ahmadi, Zainal Ahmad, Le Thi Kim Phung, Tomoaki Kashiwao & Alireza Bahadori To cite this article: Mohammad-Ali Ahmadi, Zainal Ahmad, Le Thi Kim Phung, Tomoaki Kashiwao & Alireza Bahadori (2016) Estimation of water content of natural gases using particle swarm optimization method, Petroleum Science and Technology, 34:7, 595-600, DOI: 10.1080/10916466.2016.1153655 To link to this article: http://dx.doi.org/10.1080/10916466.2016.1153655 Published online: 25 May 2016 Submit your article to this journal View related articles View Crossmark data Full Terms & Conditions of access and use can be found at http://www.tandfonline.com/action/journalInformation?journalCode=lpet20 Download by: [University of Nebraska, Lincoln] Date: 26 May 2016, At: 03:15 PETROLEUM SCIENCE AND TECHNOLOGY , VOL , NO , – http://dx.doi.org/./.. Estimation of water content of natural gases using particle swarm optimization method Mohammad-Ali Ahmadia , Zainal Ahmadb , Le Thi Kim Phungc , Tomoaki Kashiwaod , and Alireza Bahadorie Downloaded by [University of Nebraska, Lincoln] at 03:15 26 May 2016 a Department of Petroleum Engineering, Ahwaz Faculty of Petroleum Engineering, Petroleum University of Technology, Ahwaz, Iran; b School of Chemical Engineering, Engineering Campus, Universiti Sains Malaysia, Penang, Malaysia; c Department of Chemical Process and Equipment, Faculty of Chemical Engineering, Hochiminh City University of Technology, Hochiminh City, Vietnam; d Department of Electronics and Control Engineering, National Institute of Technology, Niihama College, Niihama, Japan; e School of Environmental Science and Engineering, Southern Cross University, Lismore, Australia ABSTRACT KEYWORDS A precise estimation of natural gas water content is a significant constraint in appropriate planning of natural gas production, processing services and transmission The main contribution of this research is to develop a machine learning approach for predicting water content of sweet and sour natural gases In this regard, a joining of particle swarm optimization and an artificial neural network was utilized The suggested model presents good predictions of the sour natural gas water content with following circumstances, including CO2 contents of 0–40 mol%, H2 S contents of 0–50 mol%, pressures in range from atmospheric to 70,000 KPa for sour gas and 100,000 KPa for sweet gas, and temperatures from 10–200°C for sweet gases and 10–150°C for sour gases Artificial neural network; modeling; natural gas; particle swarm optimization; water content Introduction Natural gases often contain water at the source or as a result of sweetening with an aqueous solution Operating experience and thorough engineering have proved that it is necessary to reduce and control the water content of gas to ensure safe processing and transmission (Bahadori, 2009; Bahadori and Vuthaluru, 2009; Ghiasi et al., 2015; Bahadori et al., 2008) There are several methods available for calculating water contents of natural gases (Carroll, 2002) In general, for acid gas concentrations less than about 30%, existing methods are satisfactory For higher acid gas concentrations (above 50%), particularly at higher pressures, existing methods can lead to serious errors in estimating water contents (Hubbard, 1987) One of the machine learning methods that is successfully applied and broadly employed in different engineering disciplines is artificial neural networks (ANN) Coupling artificial neural networks and heuristic optimizers for modeling nonlinear systems specially in chemical and petroleum engineering has been changed into hot topics between research scientists (Ahmadi, 2011, 2012, 2015; Ahmadi and Shadizadeh, 2012; Ahmadi and Golshadi, 2012; Ahmadi et al., 2013a, 2013b; Ahmadi and Ebadi, 2014; Ahmadi et al., 2014; Ahmadi and Pournik, 2015; Ahmadi et al., 2015a, 2015b, 2015c, 2015d, 2015e, 2016; Ahmadi and Bahadori, 2015a; 2015b) This article deals with joining a heuristic optimizer (particle swarm optimization [PSO]) and a feedforward ANN method to estimate natural gas water content The main task of PSO is to decide an optimal CONTACT Alireza Bahadori Alireza.bahadori@scu.edu.au School of Environmental Science and Engineering, Southern Cross University, Lismore, Australia Color versions of one or more of the figures in the article can be found online at www.tandfonline.com/lpet © Taylor & Francis Group, LLC Downloaded by [University of Nebraska, Lincoln] at 03:15 26 May 2016 596 M.-A AHMADI ET AL Figure The flow chart of ANN optimized with PSO algorithm interconnection weights and bias of the ANN model to improve capability and integrity of it Finally, different precise data sets extracted from open literatures (Wichert and Wichert, 2003; Bahadori et al., 2009) were employed to test, train and validate the aforementioned method in estimating natural gas water content The outputs of PSO-ANN method certifies that this machine learning model can predict natural gas water content with high precision and accuracy Coupling PSO algorithm and ANN PSO was employed to optimize an ANN model by deciding the optimum values of interconnection weights and bias of ANN This is assessed by considering a proper fitness function In this study mean square error of the ANN outputs was selected as the cost function, which should be minimized In other words, the main aim of PSO algorithm is to minimize the MSE value of ANN outputs In PSO algorithm, every particle illustrates a candidate solution of the optimization puzzle (in this work the bias and interconnection weights of ANN are solutions) Each element of a particles’ position vector demonstrates single ANN weight or bias Using this design, PSO algorithm can be used to evaluate the proper biases/weights for ANN model to minimize the MSE value (Kennedy and Eberhart, 1995; Eberhart and Kennedy, 1995; Eberhart et al., 1996; Kennedy, 1997) It is worth to mention that the gbest particle is defined as the particle have the lowest MSE value and the MSE value of the gbest particle is compared to the preset accuracy If the pre-set accuracy is satisfied consequently the training process is terminated The same process is continued till the preset accuracy is gained (Kennedy and Eberhart, 1995; Eberhart and Kennedy, 1995; Eberhart et al., 1996; Kennedy, 1997) The box-chart of the PSO-ANN is demonstrated through Figure (Kennedy and Eberhart, 1995; PETROLEUM SCIENCE AND TECHNOLOGY 597 Table Details of trained ANN with PSO for prediction water content a natural gas Type Value/comment Input layer Hidden layer Output layer Hidden layer activation function Output layer activation function Number of max iterations c and c in Eq () Number of particles Logsig Purelin Downloaded by [University of Nebraska, Lincoln] at 03:15 26 May 2016 Eberhart and Kennedy, 1995; Eberhart et al., 1996; Kennedy, 1997) Finally, Table reports the details of the proposed PSO-ANN model Results and discussion In this study PSO-ANN approach was employed to build consistent model to estimate the natural gas water content It was presented by the temperatures (T), pressure (P) and equivalent H2 S mole fraction (H2 S and CO2 mole fraction [y = yCO2 +0.7yH2S ]) data as input variables Before starting the training process of ANN model, the data samples should be divided into two different groups called training and testing data banks In this regard, by employing random selection method the extracted data samples were divided into two categories Training data bank was 75% of the whole data samples and the rest 25% of whole data was employed for testing and validating the PSO-ANN model In other words, for training ANN model by PSO, 75% of the whole data was employed and the rest ones were used to determine the reliability and capability of the PSO-ANN model The efficiency of trained ANN model by PSO algorithm can be also assessed by employing a regression analysis between the PSO-AANN results and the real values of natural gas water content The cross-plots of actual natural gas water content versus estimated values of training and testing data set by employing PSO-ANN approach is depicted in Figure As can be seen in Figure 2, a comparison between predicted and actual water content of natural gas is shown during the testing and training steps for hybrid PSO– ANN approach As shown in Figure 2, there were no major dissimilarities between the outcomes of the PSO-ANN model and the actual values of natural gas water content It is clear that the PSO–ANN model illustrates high degree of reliability in estimating natural gas water content, with MSE for the training and test sets 0.00005 and 0.000048, respectively Figure Regression plots of the PSO–ANN model for both testing and training data set Downloaded by [University of Nebraska, Lincoln] at 03:15 26 May 2016 598 M.-A AHMADI ET AL Figure Comparison between PSO-ANN outputs and sour gas/sweet gas water content ratio versus H S equivalent mole fraction Figure Relative error distribution versus corresponding natural gas water content Figure Relative error distribution versus corresponding pressure Downloaded by [University of Nebraska, Lincoln] at 03:15 26 May 2016 PETROLEUM SCIENCE AND TECHNOLOGY 599 Figure Relative error distribution versus corresponding H S equivalent mol% Figure depicts the comparison between PSO-ANN outputs and actual values of sour gas/sweet gas water content ratio versus corresponding H2 S equivalent mole fraction As shown in Figure 3, PSO-ANN could predict sour/sweet gas water content ratio with reasonable accuracy and precision Figure demonstrates the relative errors of PSO-ANN outputs versus corresponding natural gas water content The relative errors vary from +20% to –20% Figures and illustrate the relative errors of PSO-ANN outputs versus corresponding pressure, as well as the relative errors of PSO-ANN outputs versus corresponding H2 S equivalent mole fraction (Figure 6) Conclusions The feasibility of joining PSO algorithm and an ANN scheme to estimate water content of both sour and sweet natural gases was considered The proposed PSO-ANN model could predicts natural gas water content with MSE and R2 of 0.000048 and 0.9999, respectively Employing PSO led to the rise of inclusive penetrating ability for selecting suitable initial weights of ANN References Ahmadi, M A (2011) Prediction of asphaltene precipitation using artificial neural network optimized by imperialist competitive algorithm J Pet Explor Prod Technol 1:99–106 Ahmadi, M A (2012) Neural network based unified particle swarm optimization for prediction of asphaltene precipitation Fluid Phase Equilib 314:46–51 Ahmadi, M A (2015) Developing a robust surrogate model of chemical flooding based on the artificial neural network for enhanced oil recovery implications Mathemat Pet Eng 2015:706897 Ahmadi, M A., and Bahadori, A (2015a) A LSSVM approach for determining well placement and conning phenomena in horizontal wells Fuel 153:276–283 Ahmadi, M A., and Bahadori, A (2015b) Determination of oil well production performance using artificial neural network (ANN) linked to the particle swarm optimization (PSO) tool Petroleum 1:118–132 Ahmadi, M A., and Ebadi, M (2014) Evolving smart approach for determination dew point pressure of condensate gas reservoirs Fuel 117:1074–1084 Ahmadi, M A., Ebadi, M., and Hosseini, S M (2014) Prediction breakthrough time of water coning in the fractured reservoirs by implementing low parameter support vector machine approach Fuel 117:579–589 Ahmadi, M A., Ebadi, M., Shokrollahi, A., and Majidi, S M J (2013a) Evolving artificial neural network and imperialist competitive algorithm for prediction oil flow rate of the reservoir Appl Soft Comput 13:1085–1098 Downloaded by [University of Nebraska, Lincoln] at 03:15 26 May 2016 600 M.-A AHMADI ET AL Ahmadi, M A., and Golshadi, M (2012) Neural network based swarm concept for prediction asphaltene precipitation due to natural depletion J Pet Sci Eng 98–99:40–49 Ahmadi, M A., Kashiwao, T., and Bahadori, A (2015a) Prediction of oil production rate using vapor-extraction technique in heavy oil recovery operations, Pet Sci Technol 33:1764–1769 Ahmadi, M A., Kashiwao, T., Rozyn, J., and Bahadori, A (2016) Accurate prediction of properties of carbon dioxide for carbon capture and sequestration operations Pet Sci Technol Ahmadi, M A., and Pournik, M (2015) A predictive model of chemical flooding for enhanced oil recovery purposes: application of least square support vector machine Petroleum DOI: 10.1016/j.petlm.2015.10.002 Ahmadi, M A., Pournik, M., and Shadizadeh, S R (2015b) Toward connectionist model for predicting bubble point pressure of crude oils: application of artificial intelligence Petroleum 1:307–317 Ahmadi, M A., and Shadizadeh, S R (2012) New approach for prediction of asphaltene precipitation due to natural depletion by using evolutionary algorithm concept Fuel 102:716–723 Ahmadi, M A., Zahedzadeh, M., Shadizadeh, S R., and Abassi, R (2015c) Connectionist model for predicting minimum gas miscibility pressure: application to gas injection process Fuel 148:202–211 Ahmadi, M A., Zeinali Hasanvand, M., and Bahadori, A (2015d) A LSSVM approach to predict temperature drop accompanying a given pressure drop for the natural gas production and processing systems Int J Ambient Energy Available at: http://dx.doi.org/10.1080/01430750.2015.1055515 Ahmadi, M A., Zendehboudi, S., Dusseault, M., and Chatzis, I (2015e) Evolving simple-to-use method to determine water-oil relative permeability in petroleum reservoirs Petroleum DOI: 10.1016/j.petlm.2015.07.008 Ahmadi, M A., Zendehboudi, S., Lohi, A., Elkamel, A., Chatzis, I (2013b) Reservoir permeability prediction by neural networks combined with hybrid genetic algorithm and particle swarm optimization Geophys Prospect 61:582–598 Bahadori, A (2009) Document estimation of hydrate inhibitor loss in hydrocarbon liquid phase Pet Sci Technol 27:943– 951 Bahadori, A., and Vuthaluru, H B (2009) Document simple methodology for sizing of absorbers for TEG (triethylene glycol) gas dehydration systems Energy 34:1910–1916 Bahadori, A., Vuthaluru, H B., and Mokhatab, S (2009) Method accurately predicts water content of natural gases Energy Sources, Part A 31:754–760 Bahadori, A., Vuthaluru, H B., Tadé, M O., and Mokhatab, S 2008 Predicting water-hydrocarbon systems mutual solubility Authors of Chemical Engineering and Technology 31:1743–1747 Carroll, J J (2002) The water content of acid gases and sour gas from 100°F to 220°F and pressures to 10,000 psia 81st Annual GPA Convention, Dallas, T X., March 11–13 Eberhart, R C., and Kennedy, J (1995) A new optimizer using particle swarm theory Proc Sixth Int Symp Micro Mach Human Sci 39–43 Eberhart, R C., Simpson, P K., Dobbins, R., and Dobbins, R W (1996) Computational intelligence PC tools San Diego, CA: Academic Press Professional Ghiasi, M M., Esmaeili-Jaghdan, Z., Halali, M A Lee, M., Abbas, A., and Bahadori, A (2015) Development of soft computing methods to predict moisture content of natural gases J Taiwan Institute of Chemical Engineers 55:36–41 Hubbard, R (1987) Recent developments in gas dehydration and hydrate inhibition 2nd Technical Meeting of Gas Processors Association GCC Chapter, Bahrain, October 27 Kennedy, J (1997) The particle swarm: social adaptation of knowledge Proc IEEE Int Conf Evol Comput 303–308 Kennedy, J., and Eberhart, R (1995) Particle swarm optimization Proc IEEE Int Conf Neural Networks 4:1942–1948 Wichert, G C., and Wichert, E (2003) New charts provide accurate estimations for water content of sour natural gas Oil Gas J 101:64–66 ... – http://dx.doi.org/./.. Estimation of water content of natural gases using particle swarm optimization method Mohammad-Ali Ahmadia , Zainal Ahmadb , Le Thi Kim... temperatures from 10–200°C for sweet gases and 10–150°C for sour gases Artificial neural network; modeling; natural gas; particle swarm optimization; water content Introduction Natural gases often... PSO-AANN results and the real values of natural gas water content The cross-plots of actual natural gas water content versus estimated values of training and testing data set by employing PSO-ANN approach