{'fraction_non_alphanumeric': 0.032007332722273144, 'fraction_numerical': 0.012465627864344637, 'mean_word_length': 4.743524952621605, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Exergy graph-based fault detection and isolation of a gas-to-liquids process

With the sheer size of modern process plants, the Fault Detection and Isolation (FDI) field continues to gain popularity. FDI is a sophisticated concept which aims to detect and isolate anomalies that occur within a plant to avoid losses of personnel, damages to the environment, and financial implications. It does so in a way which is more direct, efficient and safer than what human operators are capable of. One approach to FDI is to consider the exergy characterisation of a system. By describing the exergy of the system units and streams, in this case a gas-to-liquids (GTL) process plant, the various process variables are encapsulated under a universal energy-domain parameter. The advantage of this being that it can describe the physical states as well as the chemical characteristics of the process. Previous work which utilised exergy characterisation along with a fixed-threshold approach showed promise. This study however, shows that the approach falls short when presented with 3 % faults. These results motivated the investigation of utilising attributed graphs, which package exergy data into a framework that preserves structural information of the plant. The usefulness of finding similarities (called graph matching) between the graphs constructed of operational conditions and pre-collected fault conditions to detect and isolate faulty conditions, is demonstrated. The technique performs well when considering fault magnitudes bigger than 8 % but deteriorates when applied to smaller, 3 % faults. The poor performance could be ascribed to the graph matching aspect, which is described by a single distance value that discards dimensionality. Future work will therefore look into the graph matching technique specifically, aiming to retain more informative dimensions.


INTRODUCTION
In most industrial process plants, operators are tasked with the monitoring and management of operations. This means overseeing a large number of units and associated process variables. When anomalies occur within the plant, the operators are expected to detect, diagnose and rectify the situation in the shortest possible time. As technology progresses these industrial processes are enhanced, resulting in even more complex systems. Consequently, the operators' responsibilities could escalate beyond their capabilities. Sometimes the mishandling of events by operators result in costly incidents, not only risking human life and the environment, but also causing detrimental financial situations. Two well-known incidents that illustrate this, is the methyl isocyanate (MIC) leak in Bhopal, India which claimed thousands of lives, according to Kletz (1998). The second incident, as highlighted by Venkatasubramanian et al. (2003), was the Kuwait Petrochemical Mina al Ahmadi oil refinery explosion which resulted in $100 million in damages. This is where Fault Detection and Diagnosis (FDD) schemes are of interest. By employing an appropriate FDD approach, the efforts required of operators are reduced, the rectification of anomalies are more efficient and the associated cost and health risks are limited. The advancement of FDD approaches would therefore specifically benefit volatile and expensive processes such as seen in the petrochemical industries (PCIs). FDD approaches are generally categorised as being either model-based or datadriven; the main difference being whether an analytical model is present. Model-based methods utilises analytical or structural models of a process and its behaviours, encapsulating both normal and faulty aspects. Datadriven techniques do not make use of explicit models; but rather derive mathematical relations, based on provided historical process data, between faults and the effects thereof. When surveying literature pertaining to chemical processes, the approaches seem to lean towards being data-driven. The most prominent approaches being either statistical, as applied by Choi et al. (2005), Xie et al. (2013), Ghosh et al. (2014), Fezai et al. (2018), and Dong and Qin (2018); or machine learning as demonstrated by Watanabe and Hirota (1991), and Sorsa et al. (1991), to name but a few. Venkatasubramanian et al. (2003) states that it would not be impossible to develop analytical models of petrochemical (PC) processes but that it would be exceptionally challenging. Recent research, such as done by Chiang and Braatz (2003), Maki et al. (2004) and Chiang et al. (2015), show hybrid approaches taking the forefront. The hybridisation, which is usually a combination of model-based and data-driven techniques, endeavours to leverage the advantages afforded by the different approaches whilst minimising the drawbacks. Of noticeable interest is the approach proposed by Chiang and Braatz (2003) which aimed at combining causal maps and Partial Least Square (PLS) methods in order to include process connectivity information. Much in the same direction of thinking, Marais et al. (2019), proposed a hybrid approach which makes use of energy properties of the system. Not only is the energy description a unifying parameter across different domains, but it is also a way of abstracting data. The energy properties are then packaged in such a manner that the physical structural information of the system is retained. In the work of Greyling et al. (2019) the same approach was applied to a gas-to-liquids (GTL) process, incorporating exergy rather than energy. By monitoring the exergy, additional information is encapsulated, specifically regarding the chemical characteristics of the system. The results recorded in the work done by Greyling et al. (2019) showed promise, however the question that arose was whether a fixed-threshold approach would still work if the system faults' magnitudes were smaller. This paper is divided into two parts. The first part focusses on evaluating the threshold approach performance when presented with 3 % faults. The results proved to be less than stellar, which meant some alterations were required. It must however be emphasised that the exergy and structural information concepts still hold promise; the issue seemed to be the fixed-threshold applied. Therefore, keeping with the exergy characterisation and wanting to preserve the structural information, Ould-Bouamama et al. (2014) suggest that a graphical method would allow for both. Such graphical approaches would also provide different mathematical schemes of detecting and isolating considered faults. Most of the graphical approaches reviewed by Ould-Bouamama et al. (2014) make use of graphs to describe system properties and relevant causal relations. For this study the most suitable graphical approach was chosen to be attributed graphs along with graph matching, a popular technique that quantifies the dissimilarities of compared graphs. The second part of the paper therefore demonstrates the usefulness of comparing operational graphs to faulty graphs (stored in a database) in order to detect and isolate faulty conditions. The paper starts off with briefly detailing the GTL model and exergy characterisation thereof. Section 3 goes on to describe the considered faults' detail and their locations. The threshold approach as applied to 3 % faults and the results obtained is summarised in Section 4. Section 5 gives a quick overview of attributed graphs and graph matching and goes on to detail the methodology as these are applied to the GTL process. The fault detection and isolation results obtained are given in Section 6 with the paper being concluded in Section 7.

THE GAS-TO-LIQUIDS PROCESS
A gas-to-liquids (GTL) process is used to transform gaseous feedstock, such as natural gas, into hydrocarbon liquids. A GTL process usually comprises of three principal sections as shown in Fig. 1. In the first section the natural gas is reformed to obtain synthesis gas, also referred to as syngas. The syngas is made up of a certain ratio of hydrogen (H 2 ) and carbon monoxide (CO), depending on the intended end-products. The produced syngas is then introduced to a Fischer-Tropsch reactor which converts the syngas into an array of hydrocarbons (syncrude). The upgrading section is used to rework the syncrude to hydrocarbon products of particular chain lengths. Since the upgrading section is quite complex only the first two sections of the GTL process, shown boxed in Fig. 1, are considered in this study. Interested readers are referred to the works of Rafiee and Hillestad (2010), Panahi et al. (2011), De Klerk (2011), and Knutsen (2013 for comprehensive information on the GTL process and the modelling thereof.

Synthesis gas production
Fischer-Tropsch synthesis

Upgrading section
Feed Syngas Syncrude Products Fig. 1. A process diagram of a gas-to-liquids (GTL) process

Simulation model
In order to have a representative system to work with, a steady-state simulation model was constructed in the commercial process simulator, Aspen HYSYS ® . No process variations were intentionally included in this study. The exact particulars on how the model was developed, the operating points and validation of the model are comprehensively documented in Greyling et al. (2019). However, some of the most important modelling aspects are highlighted as: (1) Autothermal reformer (ATR) (a) No pre-reformer was included as there was no recycling to the ATR. (b) The feedstocks used were pure methane (CH 4 ), steam (H 2 O (g)), oxygen (O 2 ) and carbon dioxide (CO 2 ). (2) Fischer-Tropsch reactor (FTR) (a) A plug flow reactor in conjunction with a separator was used to represent a multi-tubular fixed bed (MTFB) reactor. (b) The syngas that was fed into the FTR was at a temperature of 210°C.

Exergy characterisation
According to Dincer and Rosen (2013), exergy is defined as being a quantitative measure of an energy quantity's usefulness to perform work. Unlike energy which is based only on the first law of thermodynamics, exergy also takes into account the second law of thermodynamics. The second law states that entropy cannot decrease in any real process, therefore the ability to deliver valuable work is eventually lost. In other words exergy is not conserved and some exergy losses would occur which could be quantified by using the process' exergy balance (Magnanelli et al. (2018)). Therefore the most prominent advantage of using exergy is that it enables a manner of quantifying the quality of an energy stream or (more importantly) the efficiency of various elements. Consequently, any deviation of the known efficiencies could be indicative of an anomaly within the system. To characterise the GTL system the intrinsic exergy of each stream was calculated. It is important to note that exergy is always evaluated relative to a reference environment (RE). This means that the RE's intensive properties will determine the exergy. For physical exergy, these include temperature and pressure and are typically T 0 = 25°C and P 0 = 101.325 kPa. However, the chemical exergy is based on an environment consisting of certain reference elements. Various methods exist for selecting and calculating the standard chemical exergy (b 0 ch ) of these reference elements with the RE proposed by Szargut (2007) being the most distinguished one. In order to automatically calculate the physical and chemical exergy within Aspen HYSYS ® , user variables were developed. A user variables is a section of program code that the user creates, which can access various elements of the Aspen HYSYS ® model. To calculate the physical exergy per mole is used where h and s are the current enthalpy and entropy, respectively, and h 0 and s 0 the enthalpy and entropy at RE state. The total physical exergy (B ph ) is obtained by multiplying the stream's molar flow rate with the computed intrinsic physical exergy. The chemical exergy is calculated by making use of with x (i) being the mole fraction and b 0 ch(i) the standard molar chemical exergy of substance i. The utilised b 0 ch(i) values were defined by Szargut's (2007). In order to utilise (2), the standard molar chemical exergies of all the relevant substances were firstly made available to the simulation basis by creating a user property tabulating the corresponding values. Not all substances' standard chemical exergies were readily available but were precalculated (Greyling et al. (2019)). Seeing as the GTL process would inevitably have multi-phase streams and since some substances have different standard chemical exergies based on their phase, Equation (2) was modified to account for this. Thus the total chemical exergy is the sum of the vapour, liquid and aqueous phases mathematically expresses as (3) Whenever a certain phase was not present, the phase exergy was assumed to be zero. The complete details on how the physical and chemical exergy user variables were developed is also discussed in Greyling et al. (2019).
The assumption was made that the physical exergy (B ph ) and chemical exergy (B ch ) of all the streams and units were available to utilise. The next iteration of the research will look into using fewer data points that carry more importance.

SYSTEM FAULT SPECIFICATIONS
Before the considered faults are introduced, a recap of the terminology is crucial. According to Shah (2011), a failure is a permanent disruption of the system's operations. A disturbance is an unknown input that negatively affects the system's performance where a fault is any unintentional deviation of a parameter from its normal behaviour. A fault can be further classified based on its physical location or the effects on the system operation. Faults classified based on their location are system faults, actuator faults, and sensor faults. The different fault effects can be seen as additive, multiplicative, abrupt, incipient, intermittent, permanent, or transient. In order to evaluate the fault detection capabilities of the proposed approaches, eleven relevant fault conditions were identified. These eleven faults include system faults and actuator faults. For this study however, the proposed system need not distinguish between the two fault-categories. The reasoning behind how the faults were chosen, was established in Greyling et al. (2019). The details of faults and their location are summarised in Table 1. The locations of the faults are also visually depicted using danger triangles, as shown in Fig. 2. In order to keep track of the magnitude variation of the faults, fault IDs were assigned to each. The general form of the fault ID is given as F pq r where p denotes the relevant GTL section, q the type of fault within the section and r the magnitude deviation considered; the magnitude variations being 3 %, 8 %, 9 %, 10 %, 11 %, 12 %, and 25 %. The most important datasets to take note of are: • F pq 1 are the eleven faults that deviated with a magnitude of 3 %. • F pq 4 are the eleven faults that deviated with a magnitude of 10 %. • F pq R is a random selection of various magnitude deviations, excluding 3 and 10 % magnitudes, of each one of the eleven faults.
The specified datasets are shown highlighted in Table 1 for easy identification. The GTL model was modified individually and simulated for every fault tabulated, each time recording all the streams' physical exergy (B ph ) and chemical exergy (B ch ) to use as the exergy characterisation information.

A THRESHOLD APPROACH
It is important to note that the threshold approach developed, evaluated and the results documented in Greyling et al. (2019) were considering the 10 %   Fpq 4 and Fpq R † Fpq r -p represents the section, q the fault number and r the magnitude deviation (F pq 4 ) deviations only. The approach performed very well, successfully detecting all eleven faults and the resultant isolability being 100 %. Detection being able to correctly indicate that a fault was present and isolability specifically referring to whether the faults were uniquely distinguishable from one another. Subsequently the question arose as to how well the approach would perform when small fault magnitudes are evaluated. To determine this, the following methodology was applied to the 3 % dataset (F pq 1 ): (1) Firstly the collected exergy data, per stream, was normalised with respect to the normal condition.
(2) Next a simple threshold function was applied to the normalised values in order to obtain a qualitative value for each entry. The threshold function used is described by: In (4), z represents the normalised exergy value being considered and y the magnitude of the resultant fault element. In order to assign an appropriate value to κ, the solver deviations seen within the Aspen HYSYS ® environment were utilised. As the simulation model was rerun -under identical conditions -small solver variations were noticed.
To ensure that these simulation variations were distinguishable from the faults, the variances were quantified. This was achieved by calculating the statistical experimental error between 10 simulation runs. The threshold κ-value was found to be 0.00635; the precise calculation hereof shown in Greyling et al. (2019).
(3) After applying the threshold function to the normalised data, a 20 × 2 qualitative matrix is obtained with the form (4) When evaluating the detection and isolation performance (a) any non-zero matrix would indicate a fault condition (b) any identical matrices, for different fault conditions, would signify unisolability Table 2 shows the qualitative matrices obtained for dataset F pq 1 after applying the threshold function. When evaluating the matrices, a shortcoming in terms of detection is evident. Seeing that the qualitative matrix of fault F 231 is zero, the fault condition was not successfully detected. To calculate the detection rates of a proposed approach, a confusion matrix is drawn up. The idea behind a confusion matrix is to determine the number of instances where the decision of the approach: • resulted in a true negative (TN) -the approach detected a fault-free condition and the true condition was indeed fault-free (value assigned to a) • resulted in a false negative (FN) -the approach detected a fault-free condition and the true condition was faulty (value assigned to b) • resulted in a false positive (FP) -the approach detected a fault condition and the true condition was actually fault-free (value assigned to c)

Bph Bch Bph Bch Bph Bch Bph Bch Bph Bch Bph Bch Bph Bch Bph Bch Bph Bch Bph Bch Bph Bch
• resulted in a true positive (TP) -the approach detected a fault condition and the true condition was faulty (value assigned to d) Subsequently, the detection rates r F P , r F N , r T P , and accuracy are calculated by making use of these assigned values. Ideally, the false positive rate (r F P ) and false negative rate (r F N ) should be 0 % and the true positive rate (r T P ) and accuracy 100 %. A confusion matrix is completed for the threshold approach and is shown in Fig. 3. Evaluating these obtained rates, it is clear that the threshold approach did not perform flawlessly, therefore motivating the development of a different approach.

True condition
Rate Formula % Fault-free Fault

Detection condition
Fault-free True negative False negative rFP = c (a+c) × 100 0

Background
Graph theory has been in use since the 1730's and became very popular in the 1930's. It is mathematical in nature and the concepts thereof have diverse capabilities. A broad spectrum of applications are seen throughout literature, including pattern recognition, transportation and even economics. A graph essentially consists of an ordered pair G = (V, E), where V is the set of vertices (also called nodes) and E the set of edges (sometimes referred to as links or arcs). Usually vertices represent certain properties of a system, whereas the edges are used to describe the incidence relation of the vertices to themselves or other vertices within the graph, as stated by Bondy and Murty (1976). Furthermore, the graph vertices and edges can contain information. If the information is simply a name or number, the graph is called a labelled graph. Should additional information in the form of attributes be available, the graph is called an attributed graph. The edges can also be either directional or have no direction related to it. From the definition it is evident then why graph theory can be utilised in so many fields, notwithstanding FDD.
To show how one would go about constructing an attributed graph of the GTL process, the ATR unit will be used as an illustrative example. Fig. 4 (a) shows the ATR unit with its feed streams and syngas product stream. Firstly, each feed stream is represented by a node (nodes 1-4). These nodes are then connected to the ATR unit node (node 5) via directed edges, just as the process flow diagram depicts. The attributes of the nodes and edges are described by the energy characteristics calculated of the process. The completed attributed graph of the ATR unit is shown in Fig. 4 (b). An invaluable aspect of graph theory, called graph matching, is the determination of how similar one graph is to another. As summarised in Wilson and Martinez (1997), many different matching methods exist and the technique applied greatly depends on the type of graphs, their sizes, and the relevant information (symbolic, numeric,  Wilson and Martinez (1997), and reiterated by Jouili et al. (2009), was used. The technique works for both numerical and symbolic attributes, although the attributes in this case are numerical only. By utilising the HEOM instead of just calculating the Euclidean distance the following aspects are addressed: • Should symbolic attributes be included in the future, the HEOM approach will be able to adequately handle the additional information. • The Euclidean distance function does not include any normalisation, therefore, according to Wilson and Martinez (1997), attributes with large ranges would diminish smaller attributes' inputs.

Methodology
This section details the methodology of applying graph matching as a means to fault detection and isolation. To ensure a repeatable procedure, the following steps were determined and applied: (1) An attributed graph, as depicted in Fig. 5, was constructed based on the GTL process flow diagram, where the: (a) nodes represent the process units (b) edges convey the flow direction and connection of the units (2) The attributes of the: (a) nodes are the changes in physical and chemical exergy (∆B) over each process unit (b) edges are the energy flows (q ιγ ) between connected process units ι and γ (3) Utilising the graph, a node signature matrix G is constructed in the form given in (6); describing the change in physical exergy (∆B ph ), chemical exergy (∆B ch ) and the energy flow (q ιγ ) of each node. Should there be no energy flowing between two nodes, a 0 is added to that entry. Matrices were developed for each fault in datasets F pq 4 , F pq R , and F pq 1 .
(4) Next a database was developed containing the graphs (G d ) of every fault of dataset F pq 4 . No graph information (G o ) pertaining to the operational faults to be evaluated (F pq R and F pq 1 ) are included in the database. (5) A cost matrix C od is used to determine how dissimilar two graphs, G o and G d , are when compared to one another. To calculate this is used, giving an (i × j) matrix. A is the number of columns of the graphs, j the number of rows in graph G d and i the number of rows in graph G o .
To normalise the data, the range α of each column of graph G o is obtained and calculated by: where max α is the largest numerical value and min α the smallest in column α.
(6) In order to determine a single distance (D C ) parameter between the two considered graphs, is utilised. The calculation basically comes down to summing the cost matrix's diagonal entries and dividing it by the number of rows, i, in the cost matrix. (7) The smaller the D C -value the smaller the dissimilarities are between the compared graphs.
The detection and isolation will therefore work on the premise that given a known fault type of unknown magnitude, the above described method should match the operational condition to the corresponding fault -or more specifically -the graph within the database, by means of the smallest D C -value.

RESULTS
The above-mentioned methodology was firstly applied to fault dataset F pq R . The D C -values of each one of the eleven faults as compared to the database stored graphs were recorded and summarised in Table 3 (a). The smallest value, shown in bold, indicates the likeliest match. When evaluating the D C -values it is seen that the proposed graph matching approach correctly matched all considered operational faults in dataset F pq R to their corresponding database faults. A confusion matrix was completed and is shown in Fig. 6 (a). The approach performed quite well as there were no false negatives (FN) or false positives (FP), with both the true positives (TP) and accuracy being 100 %. However, when the approach was applied to dataset F pq 1 the performance drastically deteriorated. The D C -values, shown in Table 3 (b), show poor matchings of the smaller magnitude faults. The confusion matrix for dataset F pq 1 is depicted in Fig. 6 (b). The fact that some faults graphs (F 141 , F 211 , F 231 , F 241 , and F 311 ) were matched to the normal graph seems to emphasise an issue regarding the sensitivity of the proposed approach. The false negative rate (r FN ) of 45.5 % and accuracy of 54.5 %, clearly indicate the poor performance.

CONCLUSION
As the fixed-threshold approach, proposed in the work of Greyling et al. (2019), failed to detect all the considered 3 % faults, a different detection and isolation method  Preprints of the 21st IFAC World Congress (Virtual) Berlin, Germany, July 12-17, 2020 was required. By developing an attributed graph of the GTL process, information regarding the physical structure as well as stream composition and physical properties (described by exergy), are encapsulated. Graph theory then provides an array of methods in which to detect and isolate faults. The proposed approach presumed that the graphs of the 10 % faults were available as a database. The graphs of unknown operational faults are then compared to the database faults and their dissimilarities quantified by means of a distance parameter (D C ). The most likely fault being identified by the smallest D C -value obtained. When evaluating the detection and isolation performance, all faults in dataset F pq R were successfully detected and isolated. Unfortunately, the performance declines when presented with the smaller faults as in dataset F pq 1 . This would suggest a similar issue with sensitivity such as the threshold approach displayed. One reason for this could be that the chosen D C metric discards useful information contained within the cost matrix, seeing as the 18 × 18 matrix is reduced to a single distance parameter. Hence, the positive performance of the F pq R dataset warrants further investigation into the benefits more degrees of freedom would bring about. Additionally, a next phase of the research would assess the proposed approach's performance when completely unanticipated faults are considered.