{'fraction_non_alphanumeric': 0.030677545796336293, 'fraction_numerical': 0.008119350451963842, 'mean_word_length': 4.825489282385834, 'pattern_counts': {'":': 2, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 7, '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}}
Monitoring of Chemical Processes Using Model-Based Approach

Numerical Simulations of Physical and Engineering Process is an edited book divided into two parts. Part I devoted to Physical Processes contains 14 chapters, whereas Part II titled Engineering Processes has 13 contributions. The book handles the recent research devoted to numerical simulations of physical and engineering systems. It can be treated as a bridge linking various numerical approaches of two closely inter-related branches of science, i.e. physics and engineering. Since the numerical simulations play a key role in both theoretical and application oriented research, professional reference books are highly needed by pure research scientists, applied mathematicians, engineers as well post-graduate students. In other words, it is expected that the book will serve as an effective tool in training the mentioned groups of researchers and beyond.


Introduction
In a chemical plant, a faulty sensor or actuator may cause process performance degradation (e.g. lower product quality) or fatal accidents (e.g. temperature run-away). For complex systems (e.g. CSTR reactors), fault detection and isolation are more complicated for the reason that some sensors cannot be placed in a desirable place. Furthermore, for some variables (concentrations, moles …), no sensor exists. Therefore, the need for accurately monitoring process variables and interpreting their variations increases rapidly with the increase in the level of instrumentation in chemical plants. Supervision is a set of tools and methods used to operate a process in normal situation as well as in the presence of failures. Main activities concerned with supervision are real time Fault Detection and Isolation (FDI) and Fault Tolerant Control (FTC) to achieve safe operation of the system in the presence of faults. Supervision scheme is illustrated in two parts (see Fig. 1). The present paper deals with the FDI aspect using a model based approach. For reconfiguration or accommodation of the system, FTC methodology can be consulted in (Blanke M. & al., 2006). Many researchers tried to find new approaches for performing fault diagnosis (Venkatasubramanian V., 2005), (Samantaray A.K. & al, 2006), (El Harabi R. & al., 2010a) and (El Harabi R. & al., 2010b). Others used existing approaches such the classic ones to develop their performance for new complex systems (Sotomayor O.A.Z. & al., 2005), (Chetouani Y., 2004) and . Several fault diagnosis approaches have been proposed for processes operating mainly in steady-state conditions. The application of these techniques to batch chemical processes are usually challenging, because of their nonlinear dynamics and intrinsically unsteady operating conditions. In addition, complete state and parameters measurements (i.e. products composition) are usually not available (Levenspiel O., 1999). These approaches can be based on a mathematical model (e.g. analytical redundancy methods, observers based methods…) (Edwards C. & al., 2000), (Caccavale F. & al., 2009) or only on historical data (e.g. fuzzy methods, neural approach…) (De Miguela L.J. & al., 2005), (Evsukoffa A. & al., 2005). Model-based methods consist in the comparison between the measurements of variables set characterizing the behavior of the monitored system and the corresponding estimates predicted via the mathematical model of system. The deviations between measured and estimated process variables provide a set of residuals, sensitive to the occurrence of faults; then, by using the information carried by residuals, faults can be detected (i.e., the presence of one or more faults can be recognized) and isolated (i.e., the faulty components are determined). Among model-based analytical redundancy approaches, observer-based schemes have been successfully adopted in a variety of application fields (Sotomayor O.A.Z. & al., 2005), (Patton R.J & al., 1997), (Frank P.M. & al., 1990). Namely, a model of the system (often called diagnostic observer) is operated in parallel to the process to compute estimated process variables to be compared to their measured values. Application of approaches based on Luenberger and/or Kalman observers to chemical reactors diagnosis are usually designed by resorting to linearized models of the reactor. However, the adoption of linearized models has been proven to work properly for the Continuous Stirred Tank Reactors (CSTRs), mainly operating at steady state, due to their intrinsic unsteady behavior (Rajaraman S. & al., 2006), (Favache A. & al., 2009), (Hsoumi A. & al., 2009), (Han Z. & al., 2005). The basic idea of this paper concerns use of Luenberger and Kalman observers for modeling and monitoring nonlinear dynamic processes. Furthermore, the generated fault indicators are systematically associated to a specific (sensor, actuator) faults which may affect the system. A Continuous Stirred Tank Reactor with its environment has been selected as an application. The paper is organized as follows. Section 2 presents a brief review of Fault Detection and Isolation (FDI) in the chemical processes and basic proprieties of linear observers. In the third section, it is shown how the Luenberger and Kalman observers can be used for systematic generation of FDI algorithms. The methodology is applied for online diagnosis of a pilot chemical reactor. Finally, the fourth section concludes the work. line during the chemical reaction justifies the development of fault detection methods. Therefore, extensive reviews of different fault diagnosis methods of chemical process can be found in the literature. As cited above, according to the knowledge and the quality of data available for the process to be monitored, the FDI methods used are mainly based on two approaches: model-based and non-model-based. In this section are consulted only papers related to model based diagnosis applied to the chemical processes. Model-based methods explicitly use a dynamic model of the process. A pedagogical theory on model based FDI and FTC can be consulted in (Blanke M. & al., 2006). Those methods can be classified into two classes: namely, quantitative model based and qualitative model based. Qualitative model based methods include structural and functional analysis, fault tree analysis, temporal causal graphs, signed directed graphs, etc.. The models can be given under formal format. Quantitative model based methods such as observer based diagnosis, parity space, and extended Kalman filters, etc. strongly rely on the availability of an explicit analytical model to perform the FDI of the process. In (Chetouani Y., 2004) and (Chetouani Y. & al., 2002), the measurements of a set of process variables (from chemical reactor) are compared to the corresponding estimates, predicted via the mathematical model of the system. By comparing measured and estimated values, a set of variables sensitive to the occurrence of faults (residuals) are generated; by processing the residuals. Estimation of monitored process variables requires a model of the system (diagnostic observer) to be operated in parallel to the process. For this purpose, Luenberger observers, Unknown Input Observers and Extended Kalman Filters (UIOEKF) have been mostly used in fault detection and identification for chemical processes. A Luenberger observer is used for sensor fault detection and isolation in chemical batch reactors in (Chetouani Y., 2004), while in (Chetouani Y. & al., 2002), the robust approach is compared with an adaptive observer for actuator fault diagnosis. In (Paviglianiti G. & al., 2007), two different nonlinear observerbased methods have been developed for actuator Fault Diagnosis of a chemical batch reactor. An adaptive observer has been used to build a residual generator able to perform detection of incipient and abrupt faults. This scheme of observer-based diagnosis consists of a bank of two observers for residual generation which guarantees sensor fault detection and isolation in presence of external disturbances and model uncertainties. Since perfect knowledge of the model is rarely a reasonable assumption, soft computing methods, integrating quantitative and qualitative information, have been developed to improve the performance of FD observer-based schemes for uncertain systems. Observer FDI based is well suited for linear or a class of nonlinear dynamic models. Furthermore, such technique is more widely used for sensor and actuator faults detection. Their isolation needs a bank of observers. The extended Kalman filter (EKF) is employed to estimate both the parameters and states of chemical engineering processes. The basic idea of the adopted approach is to reconstruct the outputs of the system from the measurements by using observers or Kalman filters and using the residuals for fault detection. Two faults in a perfectly stirred semi-batch chemical reactor, occurring at an unknown moment, are experimentally realized. EKF is applied on a two-tank system and a fluid catalytic cracking (FCC) unit in (Huang Y. & al., 2003). In (Porru G. & al., 2000), the fault detection method is based on a test applied to the reaction mass temperature which represents the monitoring parameter. This parameter is considered essential because it is the result of all the faults effects and of the introduced experimental parameters (inlet flow, stirring rate, cooling flow, etc.). Indeed, the reaction mass temperature is the dynamic image in case of fault absence or fault presence. Moreover, this www.intechopen.com temperature is an accessible measurement in all chemical reactors. A significant number of applications of Kalman filter for fault diagnosis in chemical processes are developed in the literature. Nevertheless, previous knowledge of the process is necessary. Indeed, successful fault detection needs a judicious adjustment of the filter parameters, which expresses the response of the filter to anomalies. Among the model-based approaches, analytical redundancy methods have been mostly used in sensor and actuator fault detection and identification (Paviglianiti G. & al., 2006).

Linear observers
Fault diagnosis is usually performed to accomplish one or more of the following tasks: fault detection (or monitoring), indication of the fault occurrence; fault isolation, the determination of the exact location of fault and fault identification, estimation of the fault magnitude.

Fig. 2. Scheme of a linear observer
The observer-based diagnosis algorithm generally consists in comparing real measured information with that of nominal behavior as shown in Fig. 2. The difference between these types of information indicates if fault is present or not (detection). This scheme is called a residual generation which will be mentioned in the next paragraph.

Residual generation
Residual generation is the core element of a fault diagnosis system. It consists in estimating the process output by using either a Luenberger observer in a deterministic setting case or a Kalman filter in a stochastic one. Estimation error (or innovation in the stochastic case) is defined as the residual. The main concern of observer-based FDI is the generation of a set of residuals which detect and especially identify different faults. These residuals should be robust in the sense that the decisions are not corrupted by unknown www.intechopen.com inputs as unstructured uncertainties like process and measurement noise and modeling uncertainties. Observer based fault detection makes use of the disturbance decoupling principle, in which the residual is computed assuming the decoupling of the effects of faults on different inputs. The basic idea of a linear observer-based residual generator is illustrated in Fig. 2. () ut and () yt denote respectively the input and output vectors, () ft is the vector of faults to be detected and () dt is the vector of unknown inputs, to which detection system should be insensitive. Variable ˆ() y t corresponds to estimated outputs vector, () rt is residual vector and K is observer gain. The output estimation error is given by: To provide useful information for fault diagnosis, the residual should be defined as: (2)

Luenberger observer
An observer is defined as a dynamic system with state variables that are estimated from state variables of another system (Lie Q., 2001). A dynamic process can be described mathematically in several ways. It can be represented in the following form: where x is the state vector, u is the input, y is the output, d is the disturbances; s f and a f are respectively sensor and actuator faults , A , B , C and D are statistic matrix. Observer based residual generation is simple and reliable to implement in practical applications. In this subsection, the procedure for designing a dedicated observer and the associated residual generator is proposed. A Luenberger observer given by (Lie Q., 2001 and can be written as follows: where x is the state estimate, ŷ is the output estimate and ˆ(0) x the initial state estimate.

www.intechopen.com
The Luenberger can be considered for residual generator design; here L is the observer gain matrix such that () AL C  is stable. The state error is defined as: The matrices Â and B are chosen and the error goes to zero regardless of x and u . So e  becomes in the following form: The matrix L is to determine. However, if the error converges to zero; observer can be stable, the real part of all eigenvalues of () AL C  must be negative. The residual r is the difference between the output and its estimate denoted respectively y and ŷ : Hence e  and r expressions, for a system with sensor and actuator faults, are the following: Residual is influenced by the sensor fault; however e  depends on the actuator fault.

Kalman filter
Kalman filter is essentially an algorithm for revising the moments of stochastic components of a linear time series model to reflect information about them contained in time series data. A dynamic process can be described mathematically in several ways (Chetouani Y., 2004); let us consider the linear stochastic system; the model can be described with the following discrete form: where k x is the state vector, k u is the input, k y is the output, k w is a zero mean Gaussian noise vector and the corresponding covariance matrix is Q , k v is the measurement noise which is assumed to be normally distributed with zero mean where R is the covariance matrix associated. k A , k B , k C , k D are statistic matrices and k G is the disturbances matrix. Kalman filter based residual generation can be used with simplicity if the disturbances can be modeled. The following procedure is investigated for designing a simple Kalman filter and generating residuals. The discrete Kalman filter for the above system can be written in two steps:  Time update "predict": The object of this stage is the state estimation by using only the previous state. Filter application should start with state and state covariance matrix initialization.
In this step, there are two parts: (Part1) Project the state ahead The model of prediction step can be written in the following form: Measurement update "correct": This is the step of reactualization of state estimation with output measurements. In this step, three parts should be followed: (part 1) Compute the Kalman gain The discrete Kalman filter for the above system can be written as: Then priori and posteriori estimate errors are defined as: The posteriori estimate error is used in the present work and can be written in the following expression: or k A , k B , k C , k D and k G are statistic matrices, so the error expression is : The residual r is the difference between output and its estimate denoted respectively k y and ˆk y : So the error 1 k e  and residual r are given by: For a system with sensor and actuator faults is described as: www.intechopen.com The error and residual have the following forms: The residual is influenced by the sensor fault and the state error, however 1 k e  depends on the actuator fault.

Process description
The continuous reactor with heat exchange is defined as the most common type of process equipment to be found in manufacturing plants. It is used in many process operations such as fermentation, chemical synthesis, polymerisation, crystallisation …etc. The process to be supervised consists of a reaction vessel, a jacket vessel, an entry and exit feeding pipes, a coolant and products, valves, a stirring system and a heat exchange surface. Jacket is fitted to the reactor vessel by using an external heated transfer coil wrapped around the vessel surface. The reaction takes place within the reactor. A stirring system maintains the mixture among the reactants and products with a good homogeneous degree of physical and chemical properties. The reaction, occurring in the reactor vessel, is an irreversible and very exothermic oxidoreduction (Rajaraman S. & al., 2006), the oxidation of sodium thiosulfate by hydrogen peroxide is given by:  represent uncertainty respectively in the preexponential factor and in the activation energy and r T is the reactor temperature.
A mole balance for species A and energy balances for the reactor and the cooling jacket result in the following nonlinear process model with ( A B CC  ): This system (30) represents the dynamic reactor comportment. The three equations represent the evolution of three states ( A C : molar concentration of A , r T : reactor temperature and j T : cooling jacket temperature). So, state vector can be defined as: In this case, the state representation of the studied system is given as: where the initial state vector is:  Figure 4 and Figure 5 depict respectively the concentration evolution of reactant A C , conversion rate c x and the temperature profiles of reactor r T and jacket j T . The concentration evolution has two phases: a dynamic phase, when the reaction is taken place, and a permanent phase after the end of reaction; when mole number of component A becomes constant. Reaction perfectly takes place so the conversion rate converges rapidly to 1.  Figure 5 shows that the reactor temperature increases with time from 275 K to 385 K. This causes an increase of temperature in the jacket. In this case (exothermic reaction), the jacket presents a cooling coil around the reactor vessel. From equation (32), the system is a non linear. So, it should be linearized in order to obtain an observer with the form described in section 2.

Model linearization
The nominal nonlinear model exhibits multiple steady states, of which the upper steady state (i.e. A C =0.0192076 mol/l; r T =384.005 K; j T =271.272 K.), is stable and chosen as a normal operating point.

Lunberger-based FDI a. Fault detection
The purpose of fault detection is to determine whether a fault has occurred in the system. To accommodate the need to analyze the behavior of the residual signal in more detail, the behavior model is augmented with fault signals and transfer functions from faults to residuals are computed. Commonly, the fault signals are either added or multiplied to the model of the normal behavior and are therefore often referred to as additive and multiplicative faults. For linear systems also multiplicative faults appear as an additive signal after system linearization. System behavior without faults can be observed by a state estimation with the closed loop system and tests will be used to detect changing in the system outputs behaviors. If fault exists, detection must be achieved; thus, system must have the same behavior estimations.  Actuator fault detection This fault has been supposed to have the same form that the first sensor fault multiplies in amplitude by 1.5. Outputs and residuals trajectories illustrated in Fig.9 show the uncertainties and actuator fault effects on residual behaviors. Actuator fault is not detectable with the Lunberger observer both without and with uncertainties. The fault effect appears as small disturbances in the output behavior and Lunberger-based approach indicate the non detectability of actuator fault. The fault is detected when its energy is higher than that introduced by the whole uncertainties.  www.intechopen.com  Actuator and sensor faults detection Figure 10 shows the reaction of the residuals to actuator and sensor fault. Theses test results with two type of faults are similar to the first test results and the effect of actuator fault is always as small disturbances in output behavior. b. Fault isolation Generally, the isolation purpose is to pinpoint and determine the source or location of a fault. This is mainly done by generating an event consisting of collected pieces of information characterizing the error detected. But if the detection is not achieved, we cannot affirm that the fault does not exist. Hence, a fault can be detected by an approach and not by another; this is related to the approach robustness. Also, the detection can be achieved in spite of fault absence for the reason that some disturbances and measurements noises are detected. In order to distinguish between faults and disturbances, a threshold should be fixed to accept only detected faults which have a size more than double of this threshold.
(1) Choice of threshold: To fix this threshold, a test with a healthy system (without faults) should be achieved. The threshold is the error between an output and its estimate (residual). Fig.11 shows threshold size in the residuals evolution. The thresholds of normal operation are given with dot lines. Residuals variation for healthy system is about 2.5e-14. So, a fault can be detected if its size is more than 5e-14. This condition is achieved by proposed sensors and actuator faults. Hence, we can pass to residual evaluation step.
www.intechopen.com In this step, an incidence matrix from faults to residual can be constructed with residuals in columns and faults in rows. If residual is affected by fault the matrix element is equal to 1 and it is equal 0 otherwise. For our example, the residual vector is expressed as: We can conclude that two residuals are affected by two faults. So, a theoretical incidence matrix can be built as the following table: residual fault   Fig.15 shows outputs and residuals evolution. Figure 12 shows that Kalman filter detect the two sensor faults in spite of the presence of parameter uncertainties and residuals have the same forms and size as faults. www.intechopen.com

c. System with actuator and sensor faults
The last test is for system with two types of faults. Fig.17 shows outputs and residuals trajectories for this case.

Fig. 14. Residual evolution and estimated temperatures with actuator and sensor faults and without uncertainties
The last test is different from others; residuals are affected by two types of faults. The first residual has the same form of the first sensor fault and the size is an addition of two residuals sizes in previous tests. The same case is with the second residual but residual size is smaller with appearance of peaks because the second sensor fault and that of the actuator have different forms and size.

Comparison between two approaches
Simulation results demonstrate that Luenberger observer can successfully detect sensor faults for system without uncertainties but for system with uncertainties, generated residuals have the same form of faults with small size. Actuator fault is not detectable by this approach in two cases. These problems are resolved by Kalman filter; two sensors and actuator faults are detected for system with uncertainties. However, for this approach disturbances should be modeled to diagnosis system; this condition can cause problem for complex systems.

Conclusion
The fault diagnostic approach in this paper uses linear observers (Lunberger and Kalman filter) to detect and isolate sensors and actuator faults with satisfactory accuracy for chemical reactors with uncertainties. An application on a continuous stirred tank reactor is given to illustrate the proposed scheme. However, this type of observer is particularly unable to diagnosis the real model of complex processes. A generalised Lunberger can be used to resolve this problem. Using robust or adaptive observer, FDI for more general nonlinear systems with uncertainties can be investigated in the future. contributions. The book handles the recent research devoted to numerical simulations of physical and engineering systems. It can be treated as a bridge linking various numerical approaches of two closely interrelated branches of science, i.e. physics and engineering. Since the numerical simulations play a key role in both theoretical and application oriented research, professional reference books are highly needed by pure research scientists, applied mathematicians, engineers as well post-graduate students. In other words, it is expected that the book will serve as an effective tool in training the mentioned groups of researchers and beyond.