Prediction of sulfur content in propane and butane after gas purification on a treatment unit

. The acidic compounds such as Mercaptans, H 2 S and COS are commonly present in the liquid LPG streams in the south Pars gas processing plant. Sulfur contaminants not only lead to odor problems but can form objectionable oxides on combustion and cause environmental pollution. In present study, Support Vector Machine (SVM) is employed to develop an intelligent model to predict the sulfur content of propane and butane products of Liqueﬁed Petroleum Gas (LPG) treatment unit of south Pars gas processing plant of Assaluyeh/ Iran. A set of seven input/output plant data each consisting of 365 data has been used to train, optimize, and test the model. Model development that consists of training, optimization and test was performed using ran-domly selected 70%, 15%, and 15% of available data respectively. Test results from the SVM developed model showed good compliance with operating plant data. Squared correlation coefﬁcients for developed models are 0.97 and 0.99 for propane and butane sulfur content, respectively. According to the results of the present case study, SVM could be regarded as a reliable accurate approach for modeling the sulfur content of LPG treatment unit of a natural gas processing plant.


Introduction
Liquefied Petroleum Gas (LPG) referred to predominately propane or butane, either separately or in mixtures, which is maintained in a liquid state under specific pressure/temperature within the confining vessel (Santos et al., 2016).LPG is a valuable energy source that is used worldwide for numerous business applications in industry and transportation.The largest market for LPG is the domestic/commercial market, followed by the chemical industry where it is used as a petrochemical feedstock and the agriculture industry (Safadoost et al., 2014).
Valuable LPG is a natural gas processing by-product in south Pars gas complex refineries and stored as a liquid in atmospheric pressure tank.LPG delivered to customers as single-phase pressurized liquid products and should meet some specifications for sales as it is shown in Table 1 (Moaseri et al., 2013;Asil and Shahsavand, 2014).LPG is treated to reduce total sulfur content to meet sweetness specifications.Sulfur may be presented as hydrogen sulfide, carbonyl sulfide, carbon disulfide and mercaptan.All forms may be present in the same liquid.Sulfur contaminants not only lead to odor problems but can form objectionable oxides on combustion and cause environmental pollution (Safadoost et al., 2014;Mahdipoor and Ashkezari, 2016).H 2 S absorption into NaOH solution is one of the main methods to for H 2 S removal (Bashipour et al., 2017;Sharifi and Omidbakhsh Amiri, 2017).The treatment process for removal of H 2 S, mercaptan and elemental sulfur follows techniques and philosophies that have been well defined over years and will discussed in details in subsequent section.
H 2 S absorption into NaOH solution is one of the main methods to produce sodium sulfide (Na 2 S) and H 2 S removal.Other methods to produce Na 2 S are reduction of sodium sulfate (Na 2 SO 4 ) by solid carbonaceous materials, reduction of Na 2 SO 4 by gaseous reducing agents, exchange decomposition of barium sulfide (BaS) with sodium sulfate, carbonate, and hydroxide as well as an electrolytic method Notable attempts to develop accurate practical models for complicated chemical processes have been carried out with the aim of minimizing operational costs.In recent years, application of modeling methods which deal with input/output data of industrial plants have received considerable attention.Support Vector Machine (SVM) has been emerged as a proven technology which offers an alternative way to address problems with no specific relationship between input and output parameters.The main advantage of such models over existing approaches is the capability of learning and generalizing data, fault tolerance and inherent contextual information processing in addition to fast computation potential (Raynal et al., 2016).Such characteristics make them perfect candidates for applications where the complexity of the data or task demands high computational costs (Haghbakhsh et al., 2012;Adib et al., 2013Adib et al., , 2015;;Moradi et al., 2016).
In this study, SVM model is developed to determine the output variables of south Pars natural gas processing plant.Since the purpose of the process is to reduce the sulfur content of propane and butane product of LPG treatment unit of south Pars gas processing plant of Assaluyeh, the input parameters are amine, caustic and feed flowrate of this unit and the output variables are total sulfur of propane and butane of this unit.A large dataset of these variables are gathered from the plant and introduced to the algorithm.The models are then compared to actual plant data and with each other and then the accuracy of the models is assessed through calculation of Average Absolute Deviation Percent (ADD%).

Process description
The acidic compound, Mercaptans, H 2 S and COS are commonly present in the liquid LPG streams in the south Pars gas processing plant.Due to the nature of the upstream process unit, the liquid butane stream will typically contain mainly Mercaptans.However, the liquid propane stream will typically contain Mercaptans and reasonable amount of H 2 S and COS.Sulfur compound concentration in LPG is shown in Table 2.
Liquid propane is treated first in an amine treating unit to remove H 2 S and COS to acceptable level.In the amine unit, H 2 S and COS are removed from propane using 21% of DEA (Di-Ethanol-Amine) solution as solvent.Amine solvents are very often used for natural gas deacidification purposes as they can be adapted to various specifications and to a wide range of feed gas compositions (Magne ´-Drisch et al., 2016).Amine section consists of an extractor column for H 2 S removal and a COS removal section with mixersettlers.As indicated in Figure 1 the propane feed originating from the H 2 S extraction column is led to three mixer-settler combination in series which will remove COS from the propane stream.This line up together with sufficient mixing and resistance time in two stages enables maximum COS removal.Expected H 2 S and COS levels in propane are 1-2 ppm wt.H 2 S sulfur and 1-2 ppm wt.COS sulfur.Then propane routed to caustic extraction section for mercaptan removal.
Both propane and butane are fed to a caustic extraction column for removal of mercaptan.In both extractor column for propane and butane, the LPG streams are contacted counter-currently with caustic in a column filled random packing.The rich caustic coming from both extractors is combined and sent to the regeneration section.The extractors are designed for maximum achievable mercaptan removal.The overall reaction for extraction and regeneration for the Mercaptans (R-SH) is expressed below: Caustic process flow diagram is shown in Figure 2. Amine and caustic flow rate are two important variables which affect the total sulfur in LPG product.Amine extractor column run with a flow of amine solvent which is well in excess of the minimum required for H 2 S removal.This is because the minimum solvent rate is more typically set by minimum flows for wetting and providing interfacial surface area.Also in mixer-settler, to ensure sufficient contact between liquid hydrocarbon and the solvent, the volumetric ratio between liquid hydrocarbon and the solvent must not be changed noticeably.The lower solvent flowrate will result in poor COS extraction and a much higher ratio may lead to a reversed phase mixture.In caustic extraction section, an increase in the caustic circulation flow rate leads to a reduction of mercaptan sulfur in LPG but disulfide oil level in the LPG will increase.On the reverse, a reduction in caustic circulation flow rate means a reduction in disulfide oil but the mercaptan sulfur in LPG will increase.This means that there is an optimum caustic circulation flow rate in order to minimize the total LPG sulfur.

Support vector machine
Support Vector Machine introduced first by Vapnik (1998), like Artificial Neural Networks (ANN), is an intelligent learning approach equipped learning algorithm that analyzes data and find patterns of input/output data.Support Vector Machine training procedure converges to optimum output results faster and it is not need to control model parameters (Cortes and Vapnik, 1995;Pelckmans et al., 2002;Suykens et al., 2002;Curilem et al., 2011).For detailed information about the SVM refer to our  (Haghbakhsh et al., 2012;Adib et al., 2013Adib et al., , 2015;;Moradi et al., 2016).Pattern recognition or classification can be performed by SVM in a data set consisting of N data point x k ; y k f gk ¼ 1; 2; . . .; N where x k is a p-dimensional vector and y k can get one of the two values, either +1 or À1 (i.e., y k 2 fþ1; À1gÞ indicating the class to which the point x k belongs.In their basic form, they learn a linear hyperplane that separates a set of positive samples from a set of negative samples with maximum margin.Consider Figure 3 which shows two possible splitting hyperplanes and their related margins.Both hyperplanes can appropriately categorize all the given data.However, we expect the hyperplane with the larger margin to be more accurate in classifying new data than the hyperplane with the smaller margin.This is the reason that SVM searches for the hyperplane with the largest margin (Zaidi, 2015).
A separating hyperplane can be written as w AE x -b = 0 (Agarwal et al., 2008;Ye ´lamosa et al., 2009), where w is the normal vector to the hyperplane and b represents the offset of the hyperplane from origin that is referred to as bias.The offset along the vector w from the origin can be   4, for the cases that the training data are linearly separable, two hyperplanes can separate the data in a way that there are no data points between them.Obviously these hyperplanes can be described as: By using geometry, one can show that distance between these two hyperplanes is 2/||w||, so the problem of ||w|| minimization is required to maximize hyperplane margin.It is also required to prevent data points from falling into the margin, and other necessary constraints are imposed as (Ye ´lamosa et al., 2009): that can be rewritten as (Ye ´lamosa et al., 2009): Constraint minimization of ||w|| is thus required to develop an ideal classifier.Such minimization problem is difficult to solve, however it is possible to substitute 0.5 ||w|| 2 instead of ||w|| in problem.Chiang et al. (2004) showed that minimization problem can be formulated as: where a i is Lagrangian multiplier that helps in finding the local minimum or maximum of a function (Mehdizadeh and Movagharnejad, 2011).The problem of equation ( 8) can be solved by standard quadratic programming techniques that results in finding normal vector to the hyperplane as presented in equation ( 9): Input/output SVM model with the general form of y = f(x) takes the form of equation ( 11) in feature space (Eslamimanesh et al., 2012;Kulkarni et al., 2005):  where f(x) represents output vector and K(x, x k ) is the kernel function calculated from the inner product of the two vectors x and x k in the feasible region built by the inner product of the vectors U(x) and U(x k ) as follows (Eslamimanesh et al., 2012): Among choices for Kernel function the Radial Basis Function (RBF) Kernel that is used extensively (Zhao, 2009;Ding et al., 2012) has been applied in this work that is presented in equation ( 12), where r is kernel parameter to be determined by an external optimization algorithm during the internal SVM calculations.Bias, b, is usually determined by using primal constraints as (Kulkarni et al., 2005): Lagrangian multipliers, a i , can be calculated by solving following quadratic programming problem (Terzica et al., 2010): Subject to constraints 0 a i ci ¼ 1; :::; N ; where c is regularization parameter and controls the tradeoff between complexity of the SVM model and the number of non-separable points.This compact formulation of quadratic optimization has been proved to have a unique solution (Agarwal et al., 2008).In conclusion, the SVM takes the form of the constrained optimization problem of equation ( 15) in order to obtain the optimum value of c (Vapnik, 1998;Zanghirati and Zanni, 2003;Agarwal et al., 2008): Subject to where e is the precision threshold and n i , n Ã i represent the slack variables with nonnegative values to ensure feasible constraints.The first term in equation ( 15) represents model complexity while the second term represents the model accuracy or error tolerance.The Mean Square Error (MSE) and Mean Absolute Error (MAE) as defined by equations ( 16) and ( 17) are used to calculate prediction error of the developed SVM model.
where O i is the simulation results of SVM model, T i represents real time plant data of the natural gas sweetening plant and n denotes the number of the data used for model evaluation.Figure 5 presents the SVM model algorithm in flowchart format.

Results and discussion
4.1 Data analysis The gas processing plant under study in this work, is located in south Pars gas field, in Asaluyeh/Iran.A data set of seven series of input/output data is collected from the LPG treatment unit.Each data series consists of 365 data points of the plant under normal operating conditions in span of one year.All data series are scattered in a wide range for which the maximum and minimum numerical values are presented in Table 3.In order to estimate qualitative correlations between these input/output plant data, Figures 6 and 7 are depicted for better visualization.Figures 8-10 show sulfur content of LPG products, which are output variable of the LPG treatment unit, versus caustic, amine and LPG flowrate of this unit.
Since the input data cannot be changed systematically during normal plant operation, it is difficult to find relevant relationships between input and output variables.Therefore, data mining is performed to demonstrate the effect of varying inputs on process outputs (Adib et al., 2013).Figures 11 and 12 illustrate some of the input/output data for the LPG treatment unit.As can be seen in Figure 11, the two vertical axes show the ratio of amine and caustic flowrate to propane flowrate of LPG treatment unit.By increasing the amine and caustic flowrate to extractor column, total sulfur of propane decreases significantly.In this case, the lower solvent flowrate will result in poor COS extraction and a much higher ratio may lead to a reversed phase mixture.Therefore, for mercaptan removal the optimum ratio could be regarded as 0.12, and for amine extractor the same ratio could be regarded as an applicable ratio.As indicated in Figure 12, this ratio could be set as 0.65 for the ratio of the caustic to butane flow rate of LPG treatment unit.

Model parameters
In SVM model, the two key parameters are regularization parameter (c) and kernel parameter (r 2 ) which determines the tradeoff between the fitting error minimization and the smoothness of the estimated function.Optimum numerical values of these two parameters are calculated using Genetics Algorithm which is applied in the SVM Matlab codes.The details of GA optimization procedure are presented by Adib et al. (2013).The optimization procedure has been repeated several times in order to guarantee that the developed model's parameters are very close to optimum results.The optimum values of c and r 2 were reported in Table 4.

Model validation
The operating plant data collected over the span of one year is used in this case study.Since the developed model is based on normalized data, it is essential to map input data to its normalized form before the running of the model.The output results of the model should also be changed to its real values for output results to be compared with natural gas processing plant data.Training, optimization and testing are three different subsets of data which are required to However, it can be seen from this figure that some predicted output have much higher deviation from the real plant data.Such deviations could be due to some inherent noise of real plant data that can be alleviated if the learning procedure is equipped with some proper noise filtering routines.No filtering tool is used in this study to expose reliability of model prediction for industrial applications.To quantify the difference between these two models Average Absolute Deviation Percent (AAD%), as defined by equation ( 18), is used: where y i , x i , and n represent operating plant data, model predictions and number of operating plant data point used to calculate AAD% respectively.Summary of calculated AAD% for SVM based model prediction of this natural gas processing plant is presented in Table 5.Also, Table 6 reports accuracy of developed models in terms of MSE, MAE and squared correlation coefficient (R 2 ) between the operating plant data and SVM prediction results.A SVM based model is optimum if R 2 , MAE and MSE are found as close as possible to 1, 0, and 0, respectively.
As indicated, SVM model prediction results show acceptable compatibility with the actual plant data.Therefore, SVM could be regarded as a strong tool for prediction output parameter of a natural gas processing plant.

Conclusion
This study demonstrates the applicability of SVM to develop accurate input/output model for total sulfur content of LPG treatment unit of south Pars natural gas processing plant.The plant itself is a very complex one in natural gas industries and the real time data used is a valuable test that allows reliable evaluation of SVM model.As indicated in these two models, SVM model prediction results show more compatibility with the actual plant data.The kernel parameters for developed model are determined and model predictions are compared with real plant data of amine and caustic extractor columns.The numerical values of AAD% calculated for output variables showed a great importance if the predicted data are to be used for monitoring and/or control purposes.This study reveals the applicability and reliability of SVM as a modeling tool in oil and gas industries.Such approaches for oil and gas industries are perfect candidates for applications where the complexity of the data or task demands high computational costs

Fig. 10 .
Fig. 10.3D illustration of caustic and amine flowrate for butane sulfur content.

Fig. 11 .
Fig. 11.Effect of amine and caustic flowrate on sulfur content of propane.

Fig. 14 .
Fig. 14.Comparison between simulation results and real total sulfur of butane.

Table 2 .
Sulfur compound concentration in LPG of south Pars gas processing plant.

Table 3 .
The range of operating plant data used for model development.

Table 4 .
The optimum values of the SVM model parameters for output variables.

Table 6 .
Statistical parameters of the performance of developed model for sulfur content.

Table 5 .
AAD% values of SVM models for total sulfur of LPG treatment unit.