ВЕСТНИК ТОМСКОГО ГОСУДАРСТВЕННОГО УНИВЕРСИТЕТА 2024 Управление, вычислительная техника и информатика № 69
Tomsk: State University Journal of Control and Computer Science
Original article UDC 519.6
doi: 10.17223/19988605/69/3
Neural network model and software for an information system to intelligently analyze gas quality
Mais P. Farkhadov1, Sergei V. Vaskovskii2, Ivan A. Brokarev3
12 V.A. Trapeznikov Institute of Control Sciences of the Russian Academy of Sciences, Moscow, Russian Federation 3 National University of Oil and Gas "Gubkin University", Moscow, Russian Federation
3 brokarev. i@gubkin. ru
Abstract. The problem of analyzing the quality of natural gas is solved by traditional methods of gas chromatography. The article proposes an alternative approach using neural networks. An automated information system to determine energy parameters of natural gas and its operation were studied. The system testing was conducted on experimental data obtained from real gas mixtures in laboratory conditions. The gas quality indicators were calculated and the conclusion about system applicability was drawn. The developed mathematics and software allow to provide high performance for the information system in important cases where gas properties can change quickly and constant monitoring is required. Based on experimental results, an algorithmic solution was proposed for natural gas quality analysis, that allows to obtain necessary data with lower time and financial costs.
Keywords: natural gas quality analysis; assessment of analysis system accuracy; automated information system.
For citation: Farkhadov, M.P., Vaskovskii, S.V., Brokarev, I.A. (2024) Neural network model and software for an information system to intelligently analyze gas quality. Vestnik Tomskogo gosudarstvennogo universiteta. Upravlenie, vychislitelnaja tehnika i informatika - Tomsk State University Journal of Control and Computer Science. 69. pp. 22-30. doi: 10.17223/19988605/69/3
Научная статья
doi: 10.17223/19988605/69/3
Нейросетевая модель и программное обеспечение для информационной системы
интеллектуального анализа качества газа
Маис Паша оглы Фархадов1, Сергей Владимирович Васьковский2, Иван Андреевич Брокарев3
12Институт проблем управления им. В.А. Трапезникова Российской академии наук, Москва, Россия 3Российский государственный университет нефти и газа (национальный исследовательский университет)
им. И.М. Губкина, Москва, Россия
3 brokarev. i@gubkin. ru
Аннотация. Проблема анализа качества природного газа решается традиционными методами газовой хроматографии. В статье предлагается альтернативный подход с использованием нейронных сетей. Изучены автоматизированная информационная система определения энергетических параметров природного газа и ее функционирование. Тестирование системы проводилось на экспериментальных данных, полученных на реальных газовых смесях в лабораторных условиях. Рассчитаны показатели качества газа и сделан вывод о применимости системы. Разработанное математическое и программное обеспечение позволяет обеспечить высокую производительность информационной системы в случаях, когда свойства газа могут быстро меняться и требуется постоянный мониторинг. На основе результатов экспериментов предложено алгоритмическое решение для анализа качества природного газа, позволяющее получить необходимые данные с меньшими временными и финансовыми затратами.
© M.P. Farkhadov, S.V. Vaskovskii, I.A. Brokarev, 2024
Ключевые слова: анализ качества природного газа; оценка точности системы анализа; автоматизированная информационная система.
Для цитирования: Фархадов М.П., Васьковский С.В., Брокарев И.А. Нейросетевая модель и программное обеспечение для информационной системы интеллектуального анализа качества газа // Вестник Томского государственного университета. Управление, вычислительная техника и информатика. 2024. № 69. С. 22-30. doi: 10.17223/19988605/69/3
Introduction
To modernize oil and gas industry, as well as to solve complex industrial problems too difficult for traditional methods, there are a large number of examples of how to use neural networks in this industry [1-5]. One of the promising tasks where artificial neural networks can be used is to analyze natural gas quality. Currently, there are a large number of different methods to analyze the quality indicators of natural gas [6-9].
As a result of the study to analyze advantages and disadvantages of existing methods and automated information systems to determine gas quality indicators, the following conclusions are made. Currently, physicochemical methods of gas quality analysis and such methods-based systems prevail in industry. The main methods are gas chromatography and calorimetry to determine the energy characteristics of natural gas. Physicochemical methods to analyze the component composition and energy parameters of gas have a number of significant disadvantages. In particular, these disadvantages are high cost and large size of the equipment. Also, it takes a lot of time to analyze a single sample.
Currently, alternative analytical methods to analyze gas quality, and systems based on these methods, are being developed. However, these systems are not yet widely used. The characteristic features of systems based on analytical methods are low time costs to analyze, to use models (in particular neural networks), to obtain the required concentrations of components, to use relatively inexpensive and commercially available measuring devices.
This article discusses the problem of calculating the required quality indicators of natural gas using artificial neural networks. The implemented solution based on the information processing method provides analysis of gas quality with low time costs. The performance of the system is expressed in determining the required quality indicators using data obtained from measuring instruments and software for calculating parameters.
1. AIS architecture
The developed architecture of the gas quality analysis system determines the component composition of the equivalent pseudo-gas model and energy parameters of natural gas with low time costs. Also, the architecture uses neural network models, in particular recurrent neural networks, to find unknown concentrations of components of the equivalent pseudo-gas model if the measured properties of the gas are known. Finally, the architecture measures physical parameters of gas with commercially available and relatively inexpensive measuring devices.
The main advantages of the system are as follows. The system analyzes gas mixtures at low time costs -up to several seconds (compared to tens of minutes for a portable gas chromatograph to do the same job), and highly accurately as neural network models are used. The achieved accuracy is up to the third class (±0.5 MJ/m3) in determining the energy parameters of gas according to the existing regulatory documents. The system measures gas mixture parameters at lesser cost as it uses commercially available measuring devices up to hundreds of thousands of rubles (the cost of a high-precision industrial chromatograph exceeds one million rubles). Finally, the system has smaller size of the measuring equipment compared to a traditional chromatograph.
To accurately analyze natural gas quality, various automated information systems (AIS) based on physical and chemical methods of analysis are currently used in industry. It should be noted that when such AIS is used, the analysis is ensured to be accurate as gas mixtures are measured directly and appropriately process the data. But such systems have the following disadvantages: significant time and economic costs
to analyze data, system development is labor intensive, and the system's equipment is costly to service. Therefore, it is relevant to develop a new method and means to process information, as well as an AIS to implement them to analyze natural gas quality at low development and operation costs.
Currently, neural networks are widely used in oil and gas industry to solve industrial problems too complex for existing methods and algorithms. Neural network models determine operational and cost indicators, control pressure in a gas distribution network, forecast natural gas viscosity, etc. Neural network technology is also relevant to develop new methods and means to process information for intelligent analysis of the quality of natural gas.
As a practical implementation of the proposed solutions, this article experimentally confirms the proposed method of information processing, in particular, how to implement an AIS to analyze gas quality. In the process of studying the system, the results obtained earlier in [10-12] are used. In particular, the developed neural network model is used, apply the multi-criteria assessment to select input parameters, use the algorithm to switch to an equivalent pseudo-gas model, assess reliability by means of a probabilistic method.
The AIS architecture functions as follows. At the process facility where it is planned to apply the developed AIS, in a bypass (a bypass pipeline of the process unit used to transport gas parallel to the shut-off and control valves) from the main process pipe, there are two measuring chambers (main and backup).
The measurement data is sent to a personal computer via a concentrator. The measurements received from the input data module are sent to an algorithm subsystem implemented on a PC in Matlab. The AIS architecture consists of three main units: an information subsystem that implements the developed algorithms, a subsystem to obtain measurement information, including measured physical parameters of gas; a subsystem to calculate energy parameters. The neural network analysis algorithm chooses network architecture and trains the network.
The measurement information subsystem consists of measuring devices and equipment that can be used to obtain values of physical parameters to evaluate how the system operates as a whole. It is worth noting that this subsystem was tested on a model that has all the properties of the proposed system. In particular, the subsystem is able to highly accurately analyze mixtures since the mixtures are prepared by mass flow controllers, and measured using commercially available and relatively inexpensive measuring devices.
The studied subsystem of measurement information also visualizes the main measured parameters, in particular, the speed of sound, thermal conductivity, and carbon dioxide concentration to clearly present the measurement process. To visualize the process, algorithms from the corresponding subsystem are used, in particular, the algorithm to visualize how the parameters of the initial mixtures and the parameters of pseudo-gas mixtures differ from one another. The proposed subsystem to obtain measurement information was tested on available measurement equipment, its main function is to provide measurement information for subsequent processing in the next subsystem.
2. Neural network architecture
The neural network algorithms generate data for the model, develop the model itself, train the model, and test the model on a data array. The data import algorithm is designed to upload data in a convenient format; the format depends on the platform from where the data is imported. The main neural network analysis algorithm includes a number of algorithms implementing the following functions: to skip a number of models if there is no need to consider them; multicriterially assess input parameters and subsequently select the most suitable set of input data; divide data into training, validation, and test samples, then choose sample size, number of splits, and the fraction of data going to each of the samples; select sets of input and output data, round them to values that can be obtained by measuring devices; calculate the matrix of correlation coefficients, normalize and cross-validate the data; implement neural network models.
For the neural network models, set parameters, including model architecture, training algorithm, training termination criterion, number of training cycles. Then calculate training errors for all models, reversely denormalize data, calculate accuracy indicators during training and testing of the neural network models and select a model for subsequent testing.
The architecture of the neural network model is a simple recurrent neural network (RNN) with one hidden layer. The number of neurons in the input layer is three according to the number of input physical parameters (sound speed, thermal conductivity, carbon dioxide concentration). The number of neurons in the output layer is three according to the number of output concentrations of pseudo-gas components except for the concentration of carbon dioxide. The number of neurons in the hidden layer is eleven. A sigmoid function in the form of a hyperbolic tangent for the hidden layer and a linear activation function for the output layer are chosen as the neuron activation functions. The structure of the developed RNN is shown in Figure 1 (n, k, m - the number of neurons in the input, hidden and output layers).
Fig. 1. Neural network model to determine an equivalent pseudogas mixture
The stage of developing a statistical model includes a number of sequential tasks that must be solved to develop the required model, namely, choosing a statistical model, choosing a model architecture, choosing model parameters, training the model, assessing the accuracy of the developed model, testing the developed model. Each of these stages is a multi-stage task, consisting of several subtasks that must be solved for the successful development of the required model. It should be noted that before training the model, the data are cross-validated, i.e. cross-validation is a method of evaluating an analytical model and its behavior on independent data.
The model is tested on a test data sample. This sample includes data that was not used to train the neural network model. The preliminary test sample includes more than four thousand gas mixtures, formed similarly to the training sample, which included approximately one hundred thousand gas mixtures.
The algorithm subsystem gives an important advantage to the proposed architecture of the AIS for gas quality analysis. The algorithms are implemented to prepare the data array and develop the neural network model. At this stage, due to the multifunctionality of the subsystem, it is possible to skip or modify some stages, and so to adjust the subsystem to a specific task. Also in this subsystem it is possible to preliminary train and test the model, multicriterially assess the input parameters, switch to the equivalent pseudo-gas model and other algorithms that make it simpler to further develop the system and provide an opportunity to test some stages of the system's operation.
To assess the accuracy of the model, as in the previous steps, the following parameters are calculated: average absolute error and average relative error. Given the fact that a model can have a satisfactory average error, but at the same time have outliers at individual points, it is also necessary to calculate the maximum absolute error and the maximum relative error.
3. Algorithm subsystem and software
This subsystem includes software with implemented algorithms for the main functions of the subsystem. In the proposed implementation of the system simulation model, the application software package for
solving technical computing problems Matlab with the NIST REFPROP plugin is used as software. As a package of application programs for implementing algorithms and calculating gas parameters in the problem under study, it is possible to use software that operates on modern operating systems, including Linux, macOS and Windows, in which it is possible to implement the given algorithms, which is an advantage of the developed system - the property of the multifunctionality of the system.
The algorithms subsystem includes the following algorithms: algorithms for generating calculated data, algorithms for conducting neural network analysis, algorithms for primary data visualization.
The algorithm for forming the component composition of a gas consists of setting the minimum and maximum (according to standards) concentration values of each component, followed by enumerating all possible variants of the component composition with setting the step for each component. The algorithm for calculating the component composition of an equivalent pseudogas model consists of using the methods described above to calculate, based on the component composition of the source gas, the component composition of a four-, five-component pseudogas model or two types of pseudogas simultaneously, which can be specified in this algorithm. The algorithm for setting temperature and pressure allows you to add pressure and temperature values in the specified range to the component composition to generate calculated data. The algorithm for calculating physical parameters and energy characteristics for a source gas and a model of an equivalent pseudogas consists of choosing the standard by which the calculation will be made, selecting the parameters to be calculated, units of measurement, generating a report on possible calculation errors and generating an array of calculated data. The diagram of the algorithm for calculating physical parameters and quality indicators in NIST REFPROP is shown in the figure 2.
Fig. 2. Scheme of the algorithm for calculating physical parameters and quality indicators in NIST REFPROP
Algorithms that implement neural network analysis consist of generating data for the model, developing the model itself, training it, and testing it on calculated data. The data import algorithm is designed to generate a convenient for presentation type of calculated data, depending on the platform from which the import is carried out. The main algorithm of neural network analysis includes a number of algorithms that implement the following functions: multi-criteria assessment of input parameters; dividing data into training, validation,
test samples with a choice of sample size and number of splits; selection of a set of input and output data; calculation of the matrix of correlation coefficients, normalization and cross-validation of data; implementation of statistical models, calculation of accuracy indicators when training and testing statistical models. Algorithms for simulating a statistical model consist of testing the model selected in the previous step and calculating accuracy indicators at the model testing stage. Algorithms for visualizing calculated data consist of constructing graphs based on differences in the parameters of initial gas mixtures and models of equivalent pseudo-gas mixtures to calculate the deviation and its contribution to the error of the method, as well as graphs on the process of training and testing models to search for possible errors in the course of these processes and eliminate them from the implementation of the algorithms.
The subsystem of the above algorithms is an important advantage of the developed gas quality analysis system, which implements algorithms for preliminary preparation of calculated data and development of a neural network model. At this stage, due to the multifunctionality of the subsystem, it is possible to skip or modify some stages, adjusting the subsystem to a specific task. Also in this subsystem it is possible to implement preliminary training and testing of the model, multi-criteria assessment of input parameters, transition to an equivalent pseudogas model and other algorithms that simplify further development of the system and make it possible to test some stages of the system's operation.
4. Experimental testing
The subsystem of gas analysis was implemented using the same software as the algorithm subsystem. To test the proposed subsystem, a measurement experiment was conducted. In the experiment the physical parameters of gas are measured, in particular, the speed of sound, thermal conductivity coefficient and carbon dioxide concentration for the original gas mixtures and for the corresponding four- and five-component pseudo-gas mixtures. These parameters under the selected thermodynamic standard conditions were measured by two identical measuring devices to assess how reliable the obtained measurement data is. The speed of sound and thermal conductivity were measured for a matrix of gas mixtures. This matrix was built by gradually increasing the content of the components to cover the selected object, namely Russian natural gas. The studied gas mixture matrix corresponds to the ranges of components of Russian natural gas. This, in turn, means that in the experiment, all the natural gas under study was covered; this is another advantage of the system in terms of its testing coverage.
Figure 2 shows the thermal conductivity data for a methane-nitrogen gas mixture. Figure 3 shows the measurement results for the mixture of 96% methane, 4% nitrogen. It is worth noting that the jumps in graphs 3 and 4 are explained by the fact that at the beginning and end of the measurements, a check is made on pure methane to control how reliable the measurements are and to further correct the data on temperature and pressure.
Fig. 2. The results of thermal conductivity measurements in a methane - nitrogen mixtures
Fig. 3. The results of thermal conductivity measurements for a 96% methane, 4% nitrogen gas mixture
At the next step, the accuracy indicators are calculated of both the component composition of the equivalent pseudo-gas model and of the energy parameters of the gas. This subsystem tests the developed neural network model on the obtained experimental data after the model is corrected and the data is preliminarily processed. The testing results (with the calculated maximum absolute deviation (MAD), average absolute deviation (AAD) and root mean square deviation (RMD) are shown in Table.
Accuracy of component composition of pseudo-gas determined by neural network model on experimental data
Component MAD, molar fraction, % AAD, molar fraction, % RMD
Methane 0,93 0,55 0,63
Propane 0,56 0,38 0,37
Nitrogen 0,48 0,27 0,25
Figures 4 and 5 show how accurately the energy characteristics of the gas are determined (lower volumetric calorific value and Wobbe index).
Fig. 4. Accuracy of volumetric calorific value determined by neural network on the testing stage
ci Wobbe index
44 45 46 47 48 49 50 51 52 53
according to reference data, MJ/m3
MAD = 0.48 MJ/m3 AAD = 0.24 MJ/m3
- • • , .. • * • • . . ». , ... • • * • • • t • • " 1 i • .' Î - • • i* * j :: V3.. :. : ..'¡L -V? • rNjail • ■ * • • •
1
44 45 46 47 48 49 50 51 52 53
according to reference data, MJ/m3
Fig. 5. Accuracy of Wobbe index value determined by neural network on the testing stage.
4. Conclusions
An automated information system is developed to determine the values of energy characteristics of natural gas based on measurements of a given set of gas physical parameters. The AIS architecture consists of an information subsystem that implements the developed algorithms, a measurement information subsystem, and an analysis subsystem. The advantage of the system is its distributed structure, which means that failure of one of the units does not lead the entire system to stop completely. The AIS operates by means of software to perform calculations and measuring devices to provide measurement information.
It is worth noting that high system performance of the system is extremely important for cases where gas properties can change quickly and need to be monitored constantly. For example, the system can monitor how associated gas from oil fields is processed, where the oil fields previously went into flares. Also, the system can monitor gas obtained by hydraulic fracturing, and biogas from various sources [13, 14].
A number of algorithms, methods, and technologies were implemented in the system. These include neural network technologies, multi-criteria assessment of input parameters, an algorithm to switch to an equivalent pseudo-gas model, and reliability assessment using a probabilistic method. All these methods also provide advantages to the system. The developed methods and architecture of the system allow us to study and analyze various modern methods to determine the quality of natural gas, to verify how equipment operates, and to experimentally study how to assess the accuracy of natural gas quality measurements. Based on the research results, an algorithmic solution was proposed, and software was implemented to operate within the existing automated information system to analyze natural gas quality with lower time and financial costs. A crucial part of further work is the calculation and study of the reliability of the automated information system [15].
References
1. Anagnostis, A., Papageorgiou, E. & Bochtis, D. (2020) Application of Artificial Neural Networks for Natural Gas Consumption
Forecasting. Sustainability. 12. 6409. DOI: 10.3390/su12166409
2. Ashena, R., Thonhauser, G. (2015). Application of Artificial Neural Networks in Geoscience and Petroleum Industry. In: Cranga-
nu, C., Luchian, H. & Breaban, M. (eds) Artificial Intelligent Approaches in Petroleum Geosciences. Springer, Cham. DOI: 10.1007/978-3-319-16531-8_4
3. Etesami, D., Zhang, W.J. & Hadian, M. (2021) A formation-based approach for modeling of rate of penetration for an offshore gas
field using artificial neural networks. Journal of Natural Gas Science and Engineering. 95. pp. 104. DOI: 10.1016/j.jngse.2021.104104
4. Gomaa, I., Elkatatny, S. & Abdulraheem, A. (2020) Real-time determination of rheological properties of high over-balanced drilling
fluid used for drilling ultra-deep gas wells using artificial neural network. Journal of Natural Gas Science and Engineering. 77. pp. 103. DOI: 10.1016/j.jngse.2020.103224
5. Lötters, J.C., van der Wouden, E.J., Groenesteijn, J., et al. (2014) Real-time composition determination of gas mixtures. Proc.
SENSORS. Valencia, Spain. pp. 1640-1643.
6. Altfeld, K. & Schley, P. (2012) Development of natural gas qualities in Europe. Heat Processing. 3. pp. 77-83.
7. Boersma, A., Sweelssen, J. & Blokland, H. (2018) Multiparameter sensor array for gas composition monitoring. Proc. Eurosensors.
2(13). pp. 867.
8. Dörr, H., Koturbash, T. & Kutcherov, V. (2019) Review of impacts of gas qualities with regard to quality determination and energy
metering of natural gas. Measurement Science and Technology. 30(2). Article ID 022001.
9. Hribar, R., Potocnik, P., Silc, J. & Papa, G. (2018) A comparison of models for forecasting the residential natural gas demand
of an urban area. Energy. 167. pp. 511-522.
10. Brokarev, I.A. & Vaskovskii, S.V. (2020) Multi-criteria estimation of input parameters in natural gas quality analysis. Advances in Systems Science and Applications. 20(2). pp. 60-69. DOI: 10.17223/19988605/55/2
11. Brokarev, I.A., Farkhadov, M.P. & Vaskovskii, S.V. (2021) Recurrent neural networks to analyze the quality of natural gas. Vestnik Tomskogo gosudarstvennogo universiteta. Upravlenie vychislitel'naya tekhnika i informatika - Tomsk State University Journal of Control and Computer Science. 55. pp. 11-17. DOI: 10.17223/19988605/55/2
12. Brokarev, I.A., Vaskovskii, S.V. & Farkhadov M.P. (2024) Automated information system for natural gas quality analysis. Large-Scale Systems Control. 108. pp. 174-191.
13. Koturbash, T., Bicz, A. & Kutcherov, V.G. (2021) Real-time quality metering of propanated biomethane. International Journal of Oil, Gas and Coal Technology. 27(1). pp. 8.
14. Wu, F., Yan, Y. & Yin, C. (2017) Real-time microseismic monitoring technology for hydraulic fracturing in shale gas reservoirs: A case study from the Southern Sichuan Basin. Natural Gas Industry. 4(1). pp. 68-71.
15. Kalimulina, E.Y. (2017) Analysis of system reliability with control, dependent failures, and arbitrary repair times. International Journal of System Assurance Engineering. 8. pp. 1-9. DOI: 10.1007/s13198-016-0520-5
Information about the authors:
Farhadov Mais Pasha ogly (Doctor of Technical Sciences, Chief Researcher, V.A. Trapeznikov Institute of Control Sciences of the Russian Academy of Sciences, Moscow, Russian Federation). Email: [email protected]
Vaskovskii Sergei V. (Candidate of Technical Sciences, Senior Researcher, V.A. Trapeznikov Institute of Control Sciences of the Russian Academy of Sciences, Moscow, Russian Federation). E-mail: [email protected]
Brokarev Ivan A. (Candidate of Technical Sciences, Senior Lecturer of the Department of Automation of Technological Processes of the Russian State University of Oil and Gas (National Research University) named after I.M. Gubkin, Moscow, Russian Federation). E-mail: [email protected]
Contribution of the authors: the authors contributed equally to this article. The authors declare no conflicts of interests. Информация об авторах:
Фархадов Маис Паша оглы - доктор технических наук, главный научный сотрудник, заведующий лабораторией Института проблем управления им. В.А. Трапезникова Российской академии наук (Москва, Россия). E-mail: [email protected] Васьковский Сергей Владимирович - кандидат технических наук, старший научный сотрудник лаборатории Института проблем управления им. В.А. Трапезникова Российской академии наук (Москва, Россия). E-mail: [email protected] Брокарев Иван Андреевич - кандидат технических наук, старший преподаватель кафедры автоматизации технологических процессов Российского государственного университета нефти и газа (Национальный исследовательский университет) им. И.М. Губкина» (Москва, Россия). E-mail: [email protected]
Вклад авторов: все авторы сделали эквивалентный вклад в подготовку публикации. Авторы заявляют об отсутствии конфликта интересов.
Received 24.09.2024; accepted for publication 02.12.2024 Поступила в редакцию 24.09.2024; принята к публикации 02.12.2024