ŁAbędA-GrudZiAk Diagnostic technique baseD on aDDitive moDels in the tasks of the ongoing exploitation of gas network

In extensive fittings used for transporting large quantities of gas under high pressure for long distances, monitoring of the fittings condition becomes a significant problem, in respect of correct functioning of the measuring devices, as well as the occurrence of possible leakage. Exploitation of gas network requires periodic tightness controls and elimination of faults and leaks. When a leak is discovered in the gas pipeline, it undergoes repair work, which is conducted after shutting down a certain section of the network by shut-off valves or temporary closure. Works on active gas pipelines are considered hazardous and must be performed by qualified teams. Difficult conditions of exploitation are placing increasingly high demands on long duration and high degree of reliability of control systems. Due to flammability, any breakdowns causing unsealing of the fittings and gas effusion pose a risk of explosion and environmental contamination. These risks may be eliminated by current detection which enables prediction of the possible necessity of switching off pumping or excluding the leaky section of the pipeline. In the current exploitation of gas networks a number of solutions can be used allowing for monitoring and diagnostics, with particular consideration of leakage detection. The methods of detection of transmission networks can be divided into two general categories [2, 11, 21]: direct (external), when the detection is conducted from the outside of the pipe by applying specialized devices and visual observation, and indirect (internal), when the detection is based on the measurements and analysis of parameters of flow process, such as pressure, flow, temperature. Among the direct methods we can differentiate acoustic methods [12], which are based on the detection of noise generated by a leak and require installing acoustic sensors along the pipeline. Indirect methods are divided into methods based on detecting sound waves caused by effusion, methods based on balancing the medium inflowing toand outflowing from the pipeline and analytical methods based on mathematical model and measuring data of the object, obtained from telemetric system [7, 8, 17, 22]. Natural gas is a viscous and compressible gas, the physicochemical parameters of which are strongly dependent on pressure and temperature conditions. For description of such a medium, application of complicated equations of state is necessary, such as virial or cubic equations of state of the gas [5, 23]. The dynamics of elementary section of the gas pipeline can also be described by partial differential equations system [7, 17], which can be derived from mass and momentum conservation principles and solved by explicit or implicit methods. Optimization algorithms based on neural networks or swarm intelligence [1, 9, 16] can also be applied for the analysis of work of certain sections of transmission network. It is a technique of artificial intelligence based on the observation of social behavior in organized populations. To identify whether there is a leakage or not, a support vector machine (SVM) can be used, i.e. the algorithm identifying the relationship between the elements (measurement results, in this case) on the basis of the examples – sets of training data, comprising cases with and without a leakage [3]. Direct methods require vast experience from the operator of the device, thus fault detection services are each time contracted to specialized companies. On the other hand, indirect methods, in which the expert (company employee) observes network parameters and detect anomalies, have a number of disadvantages, significantly decreasing their value. First of all, the system doesn’t indicate faults automatically what demands continuous attention of an expert. On the other hand, Zofia M. ŁAbędA-GrudZiAk


Introduction
In extensive fittings used for transporting large quantities of gas under high pressure for long distances, monitoring of the fittings condition becomes a significant problem, in respect of correct functioning of the measuring devices, as well as the occurrence of possible leakage.Exploitation of gas network requires periodic tightness controls and elimination of faults and leaks.When a leak is discovered in the gas pipeline, it undergoes repair work, which is conducted after shutting down a certain section of the network by shut-off valves or temporary closure.Works on active gas pipelines are considered hazardous and must be performed by qualified teams.
Difficult conditions of exploitation are placing increasingly high demands on long duration and high degree of reliability of control systems.Due to flammability, any breakdowns causing unsealing of the fittings and gas effusion pose a risk of explosion and environmental contamination.These risks may be eliminated by current detection which enables prediction of the possible necessity of switching off pumping or excluding the leaky section of the pipeline.
In the current exploitation of gas networks a number of solutions can be used allowing for monitoring and diagnostics, with particular consideration of leakage detection.The methods of detection of transmission networks can be divided into two general categories [2,11,21]: direct (external), when the detection is conducted from the outside of the pipe by applying specialized devices and visual observation, and indirect (internal), when the detection is based on the measurements and analysis of parameters of flow process, such as pressure, flow, temperature.Among the direct methods we can differentiate acoustic methods [12], which are based on the detection of noise generated by a leak and require installing acoustic sensors along the pipeline.Indirect methods are divided into methods based on detecting sound waves caused by effusion, methods based on balancing the medium inflowing to-and outflowing from the pipeline and analytical methods based on mathematical model and measuring data of the object, obtained from telemetric system [7,8,17,22].
Natural gas is a viscous and compressible gas, the physicochemical parameters of which are strongly dependent on pressure and temperature conditions.For description of such a medium, application of complicated equations of state is necessary, such as virial or cubic equations of state of the gas [5,23].The dynamics of elementary section of the gas pipeline can also be described by partial differential equations system [7,17], which can be derived from mass and momentum conservation principles and solved by explicit or implicit methods.
Optimization algorithms based on neural networks or swarm intelligence [1,9,16] can also be applied for the analysis of work of certain sections of transmission network.It is a technique of artificial intelligence based on the observation of social behavior in organized populations.To identify whether there is a leakage or not, a support vector machine (SVM) can be used, i.e. the algorithm identifying the relationship between the elements (measurement results, in this case) on the basis of the examples -sets of training data, comprising cases with and without a leakage [3].
Direct methods require vast experience from the operator of the device, thus fault detection services are each time contracted to specialized companies.On the other hand, indirect methods, in which the expert (company employee) observes network parameters and detect anomalies, have a number of disadvantages, significantly decreasing their value.First of all, the system doesn't indicate faults automatically what demands continuous attention of an expert.On the other hand,

Zofia M. ŁAbędA-GrudZiAk
Diagnostic technique baseD on aDDitive moDels in the tasks of the ongoing exploitation of gas network technika Diagnostyki oparta na aDDytywnych moDelach regresyjnych w zaDaniach bieżącej eksploatacji sieci gazowej* The article presents a method of estimating the pressure value at given nodes of natural gas transmission network for the purposes of predicting changes of the process state during its exploitation.For this purpose additive regression model was applied together with non-parametric estimation techniques, which was used for monitoring the operation of gas networks, as well as designing the system of fault detection, and then -the assessment of sensitivity for particular faults.Research was conducted on the basis of data from the analytical model of network simulator, which is adjusted to the actual gas transmission network.
sciENcE aNd tEchNology the most technologically advanced solutions are based on a simulation model of gas transmission network and are the most complex at the same time.

Research methodology
It is extremely difficult to formulate a model on the basis of physical equation for such object as gas network, and identification of its parameters provides additional complications.It is not always possible to reconstruct geometric dimensions or roughness for old pipelines, which are hard to identify and locate.Moreover, gas pipelines are very diverse objects, in terms of daily and annual values of volume flow, what makes application of the above mentioned methods highly difficult.On the other hand, increasing the number of the process entries violently increases calculating inputs in neural modeling.
The paper presents alternative technique, which overcomes the limitations connected with non-linear multidimensional modeling.These are additive models [4].The method of identification based on additive model is a new approach in the diagnostics of industrial processes and was presented in the Author's works published, among others, in [13,15,20] positions of Bibliography.
The aim of this paper is to develop effective methods of signal pressure modeling at certain nodes of gas transmission network for the purposes of fault detection.The model is intended to provide reproduction of measuring signals and to be used to calculate the residuals.The main assumption is a possibility to develop fault detection algorithms with the use of additive model, estimated on the basis of archive process data.
In the course of research the following research problems were formulated, related to the chosen process of fault detection: Uncertainty and incompleteness of knowledge on the di-• agnosed object.Detection methods based on object models require the possession of archive or simulation sets of measuring signals, related to the operation of the diagnosed object.Such sets are often subject to inaccuracies, errors, shortages and interferences.In order to create the correct model on the basis of uncertain measuring data, data mining methods were used as preliminary data processing in the form of cleaning/ converting data.High complexity of the diagnosed object.

•
Due to the dynamic nature of the phenomena occurring in the gas pipelines, the choice of the appropriate structure of the model of object diagnosis has significant impact on the accuracy of identification.Adopting oversimplified or excessively complicated model may influence the reliability of diagnostic system in an unfavorable way.It is necessary to compare models with different structure and complexity.In general, a model with a higher number of predictors gives more accurate prediction, however it is also more prone to over-training.In order to compare the quality of two or more models, expert knowledge was used, as well as final prediction error (FPE) test and Akaike information criterion (AIC), which measure of goodness of fit of the model to measuring data, considering the number of parameters.

•
Implementation of fault detection system requires correct model of diagnosed object.Such model has to be accurate so as to allow for proper estimation of the process outlet, and on the other hand -allowing for prediction resistant to interferences and measurement noises.The paper investigates the use of non-parametric estimation techniques -locally polynomial smoothers and natural cubic spline.These methods have single smoothing parameters controlling the "smoothness" of the estimator of regression function and their values are usually selected by generalized cross-validation (GCV) criterion, de-grees of freedom (df), which is equal to the number of basic functions of a smoothing function, or by determining bandwidth (span), which is the proportion of data used in each local fit.Choosing the right technique and smoothing parameter allows for reducing the problem of over-fitting of the model to the learning data, thus increasing its generalization properties for the test data.Uncertainty connected with the inaccuracy of the model,

•
the influence of non-measurable interferences and noises.
Regardless of the applied identification technique, there is always the problem of model uncertainty, i.e. the difference between the behavior of the model and the system.This leads to the necessity of constructing the fault detection systems, which are robust to model inaccuracy, the influence of non-measurable interferences and noises.The quality of the detection system depends, to a great degree, on its decision-making part.In the research we used fixed thresholds imposed on the residual signal.Robustness was performed with the use of statistical characteristics of residuals.
Below, the essence of the proposed method is presented in re-• spect to the conducted research.

Additive regression model
Considering the MISO (Multiple Input, Single Output) system with 1 p > input signals 1 2 , ,..., p X X X , and one output signal Y , the additive model is defined by: where α is some constant, error ε is a sequence of independent of 1 2 ( , ,..., ) p X X X and identically distributed random variables with the mean E( ) ε =0 and the finite variance Var( ) ε σ = 2 .The φ j s are ar- bitrary univariate functions one for each predictor j X and not necessarily linear.We do not assume monotonic properties nor analytical forms of the functions φ j .The additive model can be nonlinear in relation to j X but still is linear with respect to φ j j X ( ).Let us point that we do not assume that the variables j X are independent [6].
Hence, the use of lines delaying j X signals ensures dynamic properties of the model (1) and leads to the increase of the robustness of the model (thus the increase of robustness of the fault detection system) to the influence of impulse interferences affecting measuring signals.(2) which finds the value of parameter α , equals α and the set of one dimensional functions ˆ( ) j φ ⋅ .Thus, we avoid the necessity of estimation in the multidimensional space.
For higher flexibility, relations φ j between output signal and input signals are fitted with the use of nonparametric smoothing techniques such as: locally linear smoothers or natural cubic splines [6,13].In order to estimate additive model, we applied backfitting algorithm, which, when fulfilling certain assumptions, converges to the unique solution, independent of the starting functions [6].

Evaluation of process model and verification rules
Verification of the model is a procedure aiming at verifying the quality of the evaluated model, in fact it is specifying the type of error performed by the model while imitating the behavior of true process.The use of the specified model for simulation of output signal for the test data set is an objective evaluation of the process model.
Application of additive model of pressure distribution in the gas network requires its calibration, which takes place off-line on the basis of archive data, with the assumption that data have been recorded in the period when no faults occurred.A properly calibrated model has predictive properties allowing for achieving sufficiently close representation of the actual system under diverse conditions.In order to verify the quality of the estimated model, the mean squared error (MSE), mean absolute deviation error (MADE), mean absolute percentage error in relation to range of measured output signal (MAPE) and variance of errors (VAR) were obtained.

Fault diagnosis
A significant problem encountered by each pipeline operator is safe exploitation.With time, processes occurring in different parts of the construction with different intensity, change exploitation parameters of the pipeline.A lot of information can be provided by periodic inspections, regardless of the actual technical condition of the pipeline.On this basis operator may decide on possible repair or renovation of the pipeline, and in extreme case -on the replacement of a section or a whole pipeline.In the majority of cases, the service is not necessary as technical condition of the pipeline is good.
Present-day control and monitoring systems of industrial processes more and more often implement highly advanced functions related to diagnostics of process and automatic control devices.Such supervision over the object consists in making use of the model as the source of information on standard course of the processes, which enables noticing early symptoms of unfavorable changes in the object, as well as support the operators of the process in securing the object.
Diagnostics of technical object consists in carrying out a series of operations, which result in detecting, localizing and identifying possible faults.This article undertakes the issues of the first stage of diagnostic proceeding, i.e. fault detection -identifying prohibited deviations from the normal behaviour in the plant or its instrumentation like sensors and actuators [10].The continuation of this research will be designing algorithms of fault localization.

Fault detection system
Fault detection aims at noticing faults in the object and specifying the moment of detection through the realization of diagnostic tests.A set of tests is automatically performed by the computer and should be suited in such a way to enable detecting all faults that may occur during exploitation of the industrial object.A negative test result is a symptom of abnormal state, e.g. a fault.
On the basis of additive model we are able to calculate pressure distribution in the network according to known values of accessible measurement variables, measured in actual network, and then to monitor the differences (the so-called residuals r) between the values of pressure measured in the actual network and those estimated with the use of additive model.The general scheme of generating the residuals with the use of additive model is presented in Figure 1.
For the majority of normal states of gas network operation, acknowledging veracity of the model, the residuals should be close to 0, and after the occurrence of fault their values should start to differ from 0. Having residuals generated by the additive model, there is a need to design decision algorithm, on the basis of which the evaluation of residuals value will take place, and the decision on detecting the symptom of fault will be made.
In the research we applied the simplest decision algorithm, which compares the values of residuals with the threshold values.Fault symptom is detected in t time if the diagnostic signal takes on value equal to 1, i.e. when the threshold value has been crossed by the residual.The threshold values are calculated with the use of statistical data describing the residuals values in normal operating conditions.It has to be emphasized that a possibility of generating false symptoms depends on the selected thresholds size as the acceptance region of the residual values and time interval, on the basis of which a decision is made.When the limits are too low, the algorithms generate a lot of false alarms, and when the limits are too high -detection is significantly delayed.

Indicators of detection quality
The above scheme of fault detection is based on idealized assumptions that the model is a faithful copy of the system and perfectly represents its dynamics, as well as that noises and interferences in the system are known.These assumptions obviously cannot be fulfilled in practice.In terms of fault detection robustness can be defined as maximizing fault detection with simultaneous minimization of undesirable effects such as interferences, measurement noises, changes in input signals and system states.
In order to verify the quality of the proposed detection algorithm the following indicators of diagnosis quality were applied in the research: -detection time, which is measured from the beginning of simulation of the fault to the moment of its symptom occurrence θ fd • -the degree of false detection, the value of which provides information on the number of false alarms θ td • -the degree of correct detection, the value of which provides information on the effectiveness of fault detection.
It has to be taken into account that the values of indicators of detection quality are strictly dependent on the set of process variables fully reflecting functioning of the object and the choice of threshold values of the algorithm.

The object of diagnosis -a part of gas pipeline Warsaw-Białystok
Due to the inability to realize actual faults, research was conducted on the basis of data from gas network simulator adjusted to actual gas network located at the vast area of Poland.The simulator was designed on the basis of analytical models in the system of advanced monitoring and diagnostics (AMandD) [18,19] in the Institute of Automatic Control and Robotics, Warsaw University of Technology.
This work was partially realized within a framework of a research and development project entitled "Research on the systems of detection and localization of gas pipelines leak", no OR00 0013 06 [14,20,22].Verification tests were conducted with the use of R-project program, intended for advanced statistical calculations [4].

Description of the analyzed part of gas pipeline
The fragment of the gas network used for the research comprises a part of actual gas pipeline Warsaw-Białystok, from Wólka Radzymińska entrance station to all points of consumption supplied from this station, i.e. none of the sections conducts gas outside the monitored area (Figure 2).This gas pipeline is relatively well metered and is very typical for national network, as it contains numerous branches and collection points equipped with reduction-measurement stations.
Within research, parts of network were selected, for which additive partial models were prepared.Further, we specified the standard faults later used for testing detection algorithms, created the sets of learning and testing data, acknowledging simulation of the chosen faults.

The use of additive models
Diagnostics of the process with the use of additive partial models requires preparing models of small parts of the network, locally reacting for faults and covering the whole modeled object with it range.In the conducted research, we analyzed the possibility of application of additive models ADD Name_of_the_node with different structure, rendering pressure values in particular nodes of the industrial gas network.Due to the lack of flow measurement (measurements of consumption flow in particular nodes are available only) we decided to use the value of pressure in the surrounding points of consumption and estimated flow of gas.The estimated flow is calculated on the basis of accumulated sum of consumptions from points located behind the analyzed fragment, taking into account the dynamics of the change of volume of gas accumulated in the pipeline [18].In order to assess usability of additive models in fault detection of a gas pipeline, faults were simulated, such as leakage and malfunction of pressure measurement sensor in 2 chosen locations of the pipeline (Figure 2).
In order to achieve greater flexibility in estimating additive models, we conducted comparative analysis of the 2 alternative smoothing methods -natural cubic spline and locally polynomial smoother.Research showed that the most favorable results of identification were obtained by the former with df=4 parameter, or alternatively by local linear smoother with span=0.55parameter.It has to be stressed that the choice of technique and smoothing parameter also influences the quality of fault detec-tion.In this paper, the results were presented for natural cubic spline with a parameter specifying the number of degrees of freedom of the smoothing function.
By applying backfitting algorithm, the models of particular nodes were able to be estimated.On the basis of learning data from the up state of the process, we achieved estimated values of gas pressure (Pwe prediction) together with actual values of gas pressure with process data (Pwe), as well as corresponding residuals.Below, exemplary results of modeling for Ostrołęka node are presented.Figures 3 and 4 show signal rendering, as well as residuals and histogram of residuals normalized to the range [−1, 1].
In order to check the quality of the estimated models, the values of different goodness-of-fit measures were calculated.Results for exemplary additive models ADD Troj , ADD Nieg and ADD Ostr are presented in Table 1.
The obtained results are satisfactory.Partial models accurately reflect the dynamics of the process, due to the use of inputs delayed by 1 and 2 sampling steps.The results of modeling almost perfectly follow the simulated process, what confirms the lack of significant deviation from null value, except for a single outliers.MADE and MAPE errors for particular models don't exceed the value of 3e-05 and 0.06% of the variability range of the process output, respectively.
For verification of detection algorithms 2 leaks and 2 malfunctions of pressure sensors were used, while different levels of fault extension were introduced in order to check general change of models sensitivity.Description of faults is presented in Table 2.   f working conditions and particular faults and the corresponding plots of the residual values are presented in Figures 5 -9.
It can be stated on the basis of the above residuals that we obtained very good detection of measuring circuits faults -the highest absolute values of residuals were achieved for faults such as pressure jump in the pipeline station.All local models detect faults very well in all tested localizations.In the case of leakage simulation the reaction of residual (at such a high level of leakage) is noticeable, but significantly smaller.As an example, sensitivity of ADD Troj model for 1 f leakage is 0.96% of variability range of the measured value, and ADD Nieg model -0.37%, actually at the level of about 25% of calculating errors of the model for testing sample.
The values of indicator of θ td true detection for decision algorithm based on particular additive models are compiled in Tables 3 -4.
In the above tables the values of indicators of true detection, which were the highest among particular models are marked in red.The values of θ td indicator were very high, and the rate of dt t detection time -about 1-2 minutes.Moreover, the highest values of θ td false detection factor in particular test samples were 0.5%.It results mostly from some defects of thresholding methods.When analyzing residual signal recorded during the operation of gas pipeline in nominal conditions (Figure 5 and 6) we can observe that in some time intervals there are significant deviations of residual signal from null value (momentary fault symptoms).Such deviations, caused by interferences or modeling errors may result in false alarms.

Conclusions
The paper presents an effective solution allowing for modeling and prediction of pressure distribution in precisely determined nodes of gas network with the use of additive model for the purposes of fault detection.This is a new approach in industrial processes diagnostics, which expands the possibilities in the field of dynamic approximation and multidimensional non-linear objects.Basic objective of the prepared fault detection algorithms was fulfilling requirements resulting from the specificity of process diagnostics, presented in section 2.
The proposed additive models are a favorable approach to process identification issues.They avoid problems of dimensionality, because the regression function is modeled by the sum of the functions of particular input signals.They allow for constructing non-linear process models on the basis of expert knowledge and with the use of measuring data, available from contemporary automatic control systems.At the same time, it needs to be stated that the accuracy of the model describing gas pressure distribution in the network and the quality of the introduced data (learn-   The accuracy of additive models obtained in the phase of identification was high and sufficient to be used in detection algorithms.The majority of verified models are of high sensitivity towards pressure measuring circuits faults.Faults of 2% of the measured value can be effectively detected.The usability of partial models for leakage detection is much lower than towards the faults of pressure measuring circuits.Leak detection of quite large size is possible behind the modeled section.At the same time, constructed models are hardly sensitive for faults in the form of small leakages.Generally, sensitivity of residuals for gas leakage is much higher with the use of those nodes of network, which are located near the leakage (just in front of).
Due to high compressibility of gas, which makes the pressures in the pipeline much less sensitive for gas leakage (variation of pressures in the situation of leak is inconsiderable) and variable gas flow, which is a function of gas demand, which the supplier doesn't have impact on, the values of residuals differentiated from the models of pressure distribution in the network will change.Hence, the diagnostics of gas transmission network is much more complicated than diagnostics of liquid conducting pipelines.
To sum up, we can state that additive models are a more favorable approach to fault detection issues.They avoid the problems of non-linear dynamic modeling and don't require large calculating inputs, what create good prospects for future applications of these models in the issues of fault location.However, it needs to be emphasized that additive model is almost always an approximation of the true regression surface, but nevertheless it retains high prognostic usability.
can be estimated by minimization of the residual sum of squares:

Fig. 1 .
Fig. 1.The scheme of generating the residuals with the use of additive model.

Fig. 3 .Fig. 4 .
Fig. 3. Pwe_Ostroleka signal rendering on the basis of learning sample for ADD Ostr model.

Fig. 5 .Fig. 6 .
Fig. 5. Pressure distribution in the network (Pwe_Trojany), residuals under nominal conditions and the occurrence of 1 f and 2 f faults

Table 1 .
The goodness-of-fit of additive models.

Table 2 .
Chosen scenarios of fault simulation

Table 3 .
θ td indicator of the quality of 1

Table 4 .
θ td indicator of the quality of 5