• Nem Talált Eredményt

Monitoring Process Transitions by State Estimation

Historical process data alone usually may not sufficient for monitoring complex processes.The current measured input-output data pairs are often not in casu-ality relationship because of the dead time and the dynamical behavior of the system. In practice, the state variables happen to be not measurable, or rarely measured only by off-line laboratory tests. To solve these problems, different methods can be applied that happen to force the usage of delayed measured data besides the current data, e.g. the method proposed in [120] which is based on Dynamic Principal Component Analysis. The main idea of this section is to apply nonlinear state-estimation algorithm to detect changes in the estimated state-variables and the correlation of their modelling error.

Covariance based Similarity Measure

Time-series segmentation is often used to extractinternally homogeneous seg-mentsfrom a given time-series. Usually, the cost function describing the internal homogeneity of the individual segments is defined based on the distances be-tween the actual values of the time-series and the values given by a simple univariate function fitted to the data of each segment.

Due to the hidden nature of the process the measured variables are corre-lated. In some cases the hidden process, so the correlation among the vari-ables, vary in time. This phenomena can occur at process transitions or when there is a significant process fault, etc. The segmentation of only one measured variable is not able to detect such changes. Hence, the segmentation algorithm should be based on multivariate statistical tools as it was seen in Chapter 2.

Covariance matrices, Pk, describe the relationship between the variables around thekth data point and they can also be used to calculate the cost function based on a covariance matrix similarity measure:

cost(Si(ai, bi)) = 1 bi−ai+ 1

bi

X

k=ai

Scov(Pk,PSi) (A.7) wherePSi is the covariance matrix of theith segment with the bordersai andbi which can be calculated by the averaging of the matrices Pk|ai k bi, and Scov is the PCA similarity factor introduced by Krzanowski [121, 71], which can be seen as a measure of the similarity between the two covariance matrices.

The similarity of the found segments can be displayed as a dendrogram.

A dendrogram is a tree-shaped map of the similarities that shows the merging of segments into clusters at various stages of the analysis. The interpretation of the results is intuitive, which is the major reason of these methods used to illustrate the results of hierarchical clustering (see Figure A.14).

Covariance of the Monitored Variables

In the previous subsection it has been shown that the covariance of the mon-itored process variables can be used to measure the homogeneity of the seg-ments of multivariate time-series. The main problem of the application of this approach is how we can estimate covariance matrices that contain useful infor-mation about the operation of the monitored process.

The most straightforward approach is the recursive estimation of thePk co-variances:

Pk = 1 αj,k

·

Pk−1 Pk−1exkexTkPk−1 αj,k +xeTkPk−1exk

¸

(A.8) where Pk is a matrix proportional to the covariance matrix, and αj is a scalar forgetting factor of thejth rule adaptation.

This tool can be directly used to analyze the measured input-output data, exk = [uT,y]T, which approach is considered as the basis of the first algorithm proposed in this section (Algorithm 1). Historical input-output process data alone may be not sufficient for the monitoring of complex processes. Hence, the main idea of this section is to apply nonlinear state-estimation algorithm to detect changes in the estimated state-variables (Algorithm 2) and the correlation of their modelling error (Algorithm 3).

The proposed algorithms have been developed for the general nonlinear model of a dynamical system:

xk+1 =f(xk,uk,vk), yk = g(xk,wk) (A.9) wherevkandwkare noise variables assumed to be independent of the current and past states,vk ∼ N(vk,Qk),wk ∼ N(wk,Rk).

The developed algorithm is based on the results of standard state-estimation algorithms, i.e. the estimated state-variables,

ˆ

xk =xk+Kk[ykyk] (A.10) and theira posteriori covariance matrix,

k =E[(xkk)(xkk)T] (A.11) In these expressions

xk =E[xk|Yk−1], yk =E[yk|Yk−1],

whereYk−1is a matrix containing the past measurements, andKkis the Kalman gain:

Kk =Pxy,kP−1y,k, where

Pxy,k =E[(xkxk)(ykyk)T|Yk−1],

Py,k =E[(ykyk)(ykyk)T|Yk−1]. (A.12)

By selecting the update of the estimated variables and their covariance so that the covariance for the estimation error is minimized, we can obtain the fol-lowing update-rule of the covariance matrix

k =PkKkPy,kKTk, (A.13) where

Pk =E[(xkxk)(xkxk)T|Yk−1]. (A.14) As the various expectations used in these equations in general are intractable, some kind of approximation is commonly used. The Extended Kalman Filter (EKF) is based on Taylor linearization of the state transition and output equa-tions. Although the developed algorithm can be applied to any state-estimation algorithms, the effectiveness of the selected filter has an effect on the results of the segmentation. The utilized DD2 filter is based on approximations obtained with a multivariable extension of Stirling’s interpolation formula. This filter is simple to implement as no derivatives of the model equations are needed, yet it provides excellent accuracy [122].

Based on the result of this nonlinear state estimation two different algorithms can be defined. Algorithm 2 is based on the direct analysis of the estimated state variables, ex = ˆxin (A.8), while Algorithm 3, which is the main contribu-tion of this seccontribu-tion, uses the a posteriori covariance matrices,Pˆk, given by the nonlinear state estimation algorithm (Pk= ˆPkin (A.8)).

The proposed process monitoring tool has been implemented independently from the DCS; the database of the historical process data is stored by a MySQL SQL-server. Most of the measurements are available in every 15 seconds on process variables which consist of input and output variables: the comonomer hexene, the monomer ethylene, the solvent isobutene and the chain trans-fer agent hydrogen inlet flowrates and temperatures (u1,...,4 = FCin6,C2,C4,H2 and u5,...,8 = TCin6,C2,C4,H2), the flowrate of the catalyst (u9 = Fcatin), and the flowrate, the inlet and the outlet temperatures of the cooling water (u10,...,12=Fwin, Twin, Twout).

The prototype of the proposed process monitoring tool has been imple-mented in MATLAB with the use of the Database and Kalman filter Toolboxes.

The Model of the Process

The model used in the state-estimation algorithm contains the mass, compo-nents and energy balance equations to estimate the mass of the fluid and the formulated polymer in the reactor, the concentrations of the main components (ethylene, hexene, hydrogen and catalyst) and the reactor temperature. Hence, the state-variables of this detailed first-principles model are the mass of the fluid and the polymer in the reactor (x1 =GF andx2 =GP E), the chain transfer agent concentration (x3 = cH2), monomer, comonomer and catalyst concentration in the loop reactor (x4 = cC2, x5 = cC6 and x6 = ccat), and reactor temperature (x7 = TR). Since there are some unknown parameters related to the reaction rates of the different catalysts applied to produce the different products, there are additional state-variables: the reaction rate coefficientsx8 =kC2,x9 =kC6, x10=kH .

With the use of these state variables the main model equations are component, and∆Hi represents the heat of theith reaction.

For the feedback to the filter, measurements are available on the chain trans-fer agent, monomer and comonomer concentration(y1,2,3 =x3,4,5), reactor tem-perature (y4 = x7) and the density of the slurry in the reactor ( y5 = ρslurry, which is related tox1 and x2). The concentration measurements are available only in every 8 minutes.

The dimensionless state variables are obtained by the normalizing of the variables,

xn = x−xmin xint ,

where xmin is a minimal value and xintis the interval of the variable (based on a priori knowledge, e.g. the operators’ experiences if available). The values of the input and state variables have not been depicted in the figures presented in the next sections because they are secret so not publishable.

Parameters of the Segmentation Algorithms

The results studied in the next sections have been obtained by setting the initial process noise covariance matrix to Q = diag(10−4), the measurement noise covariance matrix to R = diag(10−8), and the initial state covariance matrix to P0 = diag(10−8). The values of these parameters heavily depends on the analyzed dataset. That is why the proper normalization method has an influence on the results. However, the parameters above can be used to estimate the state variables not only the datasets presented in the next sections, but also other datasets that contain data from production of other products in different operation conditions but in the same reactor and produced by the same type

1 2 3 4 5 6 7 8 9 10

Figure A.10: Screeplot for determining the proper number of principal compo-nents in case of datasets presented in (a) Example A.2 and (b) Example A.3, respectively.

of catalyst. In these cases the state estimation algorithm was robust enough related to the parameters above, they can be varied in the range of two orders of magnitude around the values above.

For the segmentation algorithm some parameters have to be chosen in ad-vance, one of them isthe number of principal components. This can be done by the analysis of the eigenvalues of the covariance matrices of some initial seg-ments. This method was used in Section 3.2. The datasets shown in Figure A.12 and in Figure A.13 were initially partitioned into ten segments. As Figure A.10 illustrates, the cumulative rate of the sum of the eigenvalues shows that five PCs are sufficient to approximate the distribution of the data with 97% accuracy in both cases.

Another important parameter is the number of segments. Unlike the seg-mentation method presented in Section 3.2, the number of segments should be defined before the segmentation because the hierarchical clustering applied in this section is not able to determine this value. One of the applicable methods is presented by Vasko et al in [49]. This method is based on permutation test so as to determine whether the increase of the model accuracy with the increase of the number of segments is due to the underlying structure of the data or due to the noise. In this section the simplified version of this method has been used. It is based on the relative reduction of the modelling error (see (3.42) and (A.7)):

RR(c|T) = cost(STc−1)−cost(STc)

cost(STc−1) (A.20)

where RR(c|T) is the relative reduction of error when c segments are used instead ofc−1segments.

0 2 4 6 8 10 12 14 16 18 20

Figure A.11: Determining the number of segments by Algorithm 3 in case of datasets presented in (a) Example A.2 and (b) Example A.3, respectively.

As it can be seen in Figure A.11, significant reductions are not achieved by using more than 5 or 6 segments in case of both datasets. Similar figures can be obtained byAlgorithm 2.

Example A.2. Monitoring of process transitions]

In this study a set of historical process data covered 100 hours period of operation has been analyzed. These datasets include at least three segments because of a prod-uct transition around the45th hour (see Figure A.12). Based on the relative reduction of error in Figure A.11 (a), the algorithm searched for five segments (c= 5).

The results depicted in Figure A.12 show that the most reasonable segmentation has been obtained based on the covariance matrices of state estimation algorithm (Al-gorithm 3). The segmentation obtained based on the estimated state variables is simi-lar: the boundaries of the segment that contains the transition around the45th hour are nearly the same, and the other segments contain parts of the analyzed dataset with sim-ilar properties. Contrary to these nice results, when only the measured input-output data were used for the segmentation the algorithm was not able to detect even the process transition.

It has to be noted thatAlgorithm 3can be found more reasonable thanAlgorithm 2, because one additional parameter has to be chosen in the last case: the forgetting factor, α in the recursive estimation of the covariance matrices in (A.8). The result obtained byAlgorithm 2is very sensitive to its choice. Theα = 0.95 seemed to be a good trade-off between robustness and flexibility.

¤

0 20 40 60 80 100

Figure A.12: a., b.: Segmentation based Algorithm 1; c., d.: Segmentation based on Algorithm 2,; e., f.: Segmentation based on Algorithm 3; a., c., e.:

Input variables: FCin2, FCin4, FCin6, FHin2, Fcatin, Twin, Twout; b., d., f.: Process outputs and states: TR, cC2, cC4, cC6, ρslurry, kC2, kC6, kH2

Example A.3. Detection of changes in the catalyst productivity

Beside the analysis of the process transitions, the time-series of "stable" operations have also been segmented to detect interesting patterns of relatively homogeneous data. For this purpose Algorithm 3was chosen from the methods presented above, because it gives good results in case of product changes. One of these results can be seen in Figure A.13, which shows a 120-hour long production period without any product changes. Based on the relative reduction of error in Figure A.11 (b), the number of segments was chosen to be equal to six (c= 6).

0 20 40 60 80 100

Time (hour)

Ethylene and isobutane

0 20 40 60 80 100

Time (hour)

Hexene

0 20 40 60 80 100

Time (hour)

Hydrogen and catalyst

0 20 40 60 80 100

Time (hour)

Temperature of cooling water

0 20 40 60 80 100

Time (hour)

Reactor temperature

0 20 40 60 80 100

Time (hour)

Concentrations

0 20 40 60 80 100

Time (hour)

Density of slurry

0 20 40 60 80 100

Time (hour)

Reaction rates

Figure A.13: Segmentation based on the error covariance matrices.

The homogeneity of a historical process data set can be characterized by the simi-larity of the segments that can be illustrated as a dendrogram (see Figure A.14).

1 5 2 4 6 3

0 1 2 3 4

x 10−4

Level

Figure A.14: Similarity of the found segments.

This dendrogram and the border of the segments give a chance to analyze and to understand the hidden processes of complex systems. E.g. in this example these results confirm that the quality of the catalyst has an important influence in productivity.

During the 20, 47, 75, 90th hours of the presented period of operation changes between the catalyst feeder bins happened. The segmentation algorithm based on the estimated state variables was able to detect these changes that had an effect to the catalysis productivity, but when only the input-output variables were used segments without any useful information were detected.

It has to be noted that the borders of the segments given byAlgorithm 2and Algo-rithm 3are similar also in this case, but the dendrograms are different. This is because that the segments without product transition are much more similar to each other than in case of the time-series which contains a product transition. So it is a more difficult problem to differentiate segments of operations related to the minor changes of the technology, like the changes of the catalyst productivity. This phenomena can also be seen in the dendrogram: the values that belong to the axis of ordinates are smaller with one or two order(s) of magnitude in case of a time-series without product transition. In case of product transition not only the borders of the segments are similar but also the shape of the dendrograms are nearly the same. This shows that both algorithms are applicable for similar purposes.

¤ This section presented the synergistic combination of state-estimation and advanced statistical tools for the analysis of multivariate historical process data.

The key idea of the presented segmentation algorithm is to detect changes in the correlation among the state-variables based on theira posteriori covariance matrices estimated by a state-estimation algorithm. PCA similarity factor can be used to analyze these covariance matrices. Although the developed algorithm can be applied to any state-estimation algorithms, the performance of the filter has huge effect on the segmentation. The applied DD2 filter has been proven to be accurate, and it was straightforward to include a varying number of pa-rameters in the state vector for simultaneous state and parameter estimation, which was really useful for the analysis of the reaction kinetic parameters dur-ing process transitions. The application example showed the benefits of the incorporation of state estimation tools into segmentation algorithms.

A.3 Semi-mechanistic Models for Product Quality