Disclosure of Invention
The invention aims to solve the main technical problems that: how to distinguish the characteristic variables and the characteristic components related to the polypropylene product in four production units from raw materials to final products in the production process of the polypropylene, thereby achieving the aim of indirectly detecting whether the quality of the polypropylene product is abnormal. Specifically, the method obtains characteristic variables and components related to the quality of the polypropylene product through a double-layer related characteristic analysis technology, and indirectly implements anomaly detection. The so-called double-layer characteristic analysis is to firstly distinguish characteristic variables directly related to the melt index of the polypropylene by means of neighbor component analysis and then distinguish characteristic components indirectly related to the melt index of the polypropylene by means of typical correlation analysis.
The technical scheme adopted by the method for solving the problems is as follows: a polypropylene product quality anomaly detection method based on double-layer correlation characteristic analysis comprises the following steps:
step (1): determining the measurement variables of the polypropylene production process, specifically comprising 28 measurement variables of four reactors; wherein the first reactor and the second reactor are liquid phase continuous stirred reactors, the third reactor and the fourth reactor are gas phase fluidized bed reactors, and the 7 measurement variables related to each reactor are sequentially: reactor temperature, reactor pressure, reactor liquid level, hydrogen feed flow, propylene feed flow, catalyst feed flow, and reflux flow.
Step (2): continuously collecting sample data at N sampling moments according to the determined measurement variable; meanwhile, sampling and analyzing every 2 hours to obtain the melt index of the polypropylene product in the fourth reactor; and then storing the sample data corresponding to the measurement variable into an Nx 28-dimensional data matrix X, and storing N data corresponding to the melt index into an N X1-dimensional data vector y.
And (3): element filling is carried out on the data vector Y according to the formula shown below, and then the column vector Y epsilon R is obtained N×1 :
Wherein, y 1 ,y 2 ,…,y n Representing the first to nth elements of a data vector y, f being equal to the ratio of the sampling frequency of the measured variable to the melt index, R N×1 Representing a vector of real numbers of dimension N × 1, R representing a set of real numbers, and the upper index T representing a transpose of a matrix or vector.
And (4): respectively aligning column vectors X in X according to the formula
1 ,x
2 ,…,x
28 And standardizing the column vector Y to obtain an input matrix
And outputting the vector
Wherein x is
k And
respectively represent X and
column vector of the kth column, k ∈ {1,2, \8230;, 28}, μ
k And delta
k Respectively represent column vectors x
k ∈R
N×1 Mean and standard deviation of all elements in (u)
Y And delta
Y Respectively representing the mean and standard deviation of all elements in the column vector Y.
And (5): the weight vector w is obtained by optimizing the steps (5.1) to (5.6) as shown below 0 ∈R 28×1 Thereby obtaining a direct correlation feature matrix X 1 ∈R N×m And uncorrelated feature matrix X 2 ∈R N×(28-m) (ii) a Wherein m represents the number of directly related characteristic variables, R N×(28-m) A matrix of real numbers representing dimensions N x (28-m), R N×m A matrix of real numbers in dimension N × m is represented.
Step (5.1): initializing iteration times g =1, and determining parameters of a differential evolution algorithm, specifically including: population number H, scaling factor c 1 Cross probability c 2 The maximum number of iterations G.
Step (5.2): randomly generating H weight vectors w of 1 x 28 dimensions 1 ,w 2 ,…,w H The elements in each weight vector are randomly distributed according to a uniform distributionValue in the interval [ -1,1]。
Step (5.3): separately calculating weight vectors w 1 ,w 2 ,…,w H Corresponding objective function value F 1 ,F 2 ,…,F H (ii) a Wherein the h-th weight vector w is calculated h Corresponding objective function F h Is carried out as shown in steps (A) to (D), and H is ∈ {1,2, \8230;, H }.
Step (A): calculating an input matrix according to the formula
Middle ith row vector beta
i And the jth row vector beta
j Weighted distance D therebetween
h (β
i ,β
j ):
D h (β i ,β j )=||(β i -β j )diag{w h }|| ③
Wherein i belongs to {1,2, \8230;, N }, j belongs to {1,2, \8230;, N }, diag { w;) h Denotes weighting vector w h And transforming the vector into a diagonal matrix, wherein the symbol | | | | represents the length of a calculation vector, and H belongs to {1,2, \8230;, H }.
Step (B): beta is calculated according to the formula shown below i And beta j The close probability p between ij :
In the above equation, exp () represents an exponential function with a natural constant e as a base.
Step (C): the output probability error p is calculated according to the formula shown below 1 ,p 2 ,…,p N :
In the above-mentioned formula, the compound has the following structure,
and
respectively representing output vectors
The ith element and the jth element in (c).
A step (D): computing the h-th weight vector w h Corresponding objective function value F h =p 1 +p 2 +…+p N 。
Step (5.4): f is to be 1 ,F 2 ,…,F H The weight vector corresponding to the minimum value in (1) is recorded as w 0 Then, executing the updating operation of the differential evolution algorithm to obtain H updated weight vectors w 1 ,w 2 ,…,w H And its corresponding objective function value F 1 ,F 2 ,…,F H (ii) a The specific implementation process of the updating operation of the differential evolution algorithm is shown in the steps (5.4-1) to (5.4-4).
Step (5.4-1): as a weight vector w according to the formula shown below h Generating a corresponding variation vector v h :
v h =w h +c 1 ×(w 0 -w h )+c 1 ×(w a -w b ) ⑥
In the above formula, subscripts a and b are 2 mutually unequal integers randomly generated from the interval [1, H ];
step (5.4-2): for the variation vector v according to the formula shown below h And (5) correcting:
in the above formula, v h (k) Representing a variation vector v h The kth element of (1), k ∈ {1,2, \8230;, 28};
step (5.4-3): the H trial vectors u are generated according to the formula shown below 1 ,u 2 ,…,u H :
Wherein u is h (k) And w h (k) Are each u h And w h The k-th element of (1), r k Represents a random number between 0 and 1;
step (5.4-4): respectively make u
1 ,u
2 ,…,u
H As weight vector, and executing the same implementation process as the steps (A) to (D), thereby calculating the corresponding objective function value
Step (5.4-5): the H weight vectors w are updated respectively according to the formula shown below 1 ,w 2 ,…,w H And its corresponding objective function value F 1 ,F 2 ,…,F H :
Step (5.5): judging whether the condition G is satisfied; if not, returning to the step (5.4) after setting g = g + 1; if yes, obtaining the optimal weight vector w 0 。
Step (5.6): determining a weight vector w
0 ∈R
1×28 M elements with the maximum number, and correspondingly inputting the m elements into the matrix according to the columns where the m elements are positioned
The column vectors of the same column are constructed into a direct correlation characteristic matrix X
1 ∈R
N×m To do so
The column vectors of the other 28-m columns are constructed into an uncorrelated feature matrix X
2 ∈R
N×(28-m) 。
And (6): firstly solving the problem of generalized eigenvalue
The feature vector beta corresponding to the middle maximum feature value eta is calculated according to
Calculating the related projection vector q ∈ R
(28-m)×1 Then according to the formula
Computing indirect correlation feature vectors
Step (7) of converting X
1 And
combined into an input correlation feature matrix
Thereafter, the determination of the upper limit D of the control of the abnormality detection index is performed as shown in the following steps (7.1) to (7.4)
lim 。
Step (7.1): initialization i =1.
Step (7.2): solving generalized eigenvalue problem
After the feature vector a corresponding to the medium maximum feature value lambda, performing normalization processing on a according to a formula a = a/| a |; wherein z is
i A row vector representing the ith row in Z, Z
i Is obtained by dividing Z by Z
i The outer row vectors form a matrix.
Step (7.3): according to the formula D (i) = (z) i a) 2 The i-th element D (i) in the abnormality detection index vector D is calculated.
Step (7.4): judging whether the conditions are met: i is less than N; if yes, setting i = i +1 and returning to the step (7.2); if not, then D is carried out lim Is arranged asEqual to the maximum of the elements in the anomaly detection index vector D.
And (8): at the latest sampling time t, sample data x corresponding to the measured variable is collected
t (1),x
t (2),…,x
t (28) And respectively carrying out standardization processing on the input vectors according to the following formulas to obtain input vectors
Wherein k ∈ {1,2, \8230;, 28},
representing input vectors
The kth element in (1).
And (9): according to the weight vector w
0 ∈R
1×28 The column where the maximum m elements are located corresponds to the input vector
Elements in the same column constitute the directly related feature vector y
1 ∈R
1×m Then will be
The remaining 28-m elements in the set constitute the uncorrelated feature vectors y
2 ∈R
1×(28-m) 。
Step (10): according to the formula s
t =y
2 q calculating an indirect correlation feature s
t Then, add y
1 And s
t Combined into an input-dependent feature vector
Step (11): according to the steps (11.1) to (11) shown below2) calculating an abnormality detection index D corresponding to the latest sampling time t t 。
Step (11.1): solving generalized eigenvalue problem
Medium maximum eigenvalue lambda
t Corresponding feature vector epsilon
t Then, according to the formula ∈
t =ε
t /||ε
t I to ε
t Carrying out normalization processing; wherein,
means for calculating ε
t Length of (d).
Step (11.2): calculating the abnormal detection index corresponding to the latest sampling time t
Step (12): judging whether the conditions are met: d t ≤D lim (ii) a If yes, the quality of the polypropylene product at the current sampling moment is not abnormal, and the step (8) is returned; if not, executing step (13) to decide whether to trigger an abnormal alarm.
Step (13): returning to the step (8) to continue to carry out the quality abnormity detection of the polypropylene product at the latest sampling time, if the abnormity detection indexes of the continuous 6 latest sampling times are all larger than D lim Triggering an abnormal alarm of the quality of the polypropylene product; otherwise, no exception alarm is triggered.
The implementation step (5) of the method is to optimize and solve the objective function of the neighbor component analysis algorithm by using a differential evolution algorithm. Consider that the nearest neighbor component analysis algorithm aims at finding the weight vector w 0 Thereby outputting a probability error p 1 ,p 2 ,…,p N The sum is minimized, and the effective solution of the optimization problem can be realized through a differential evolution algorithm. Compared with the traditional method of solving the minimization problem of the analysis of the neighboring components by using a gradient descent method, the global optimization can be better ensured by using a differential evolution algorithm.
The generalized characteristics are solved in the implementation step (6) of the methodValue problem
Is actually performing a typical Correlation Analysis (CCA) algorithm. The idea of the CCA algorithm is to do so by respectively
And
finding the corresponding projection vectors beta and sigma to make the correlation coefficient
Maximization; wherein, beta and sigma need to satisfy the condition:
and
the CCA maximization problem can be transformed into a typical generalized eigenvalue problem by the lagrange multiplier method:
due to the fact that
Is a real number vector whose corresponding projection vector σ is a real number of 1 × 1 dimension. Thus, the generalized eigenvalue problem is equivalent to:
if λ = λ/σ is set
2 And (5) obtaining the generalized eigenvalue problem in the step (6).
The implementation step (7) of the method is a specific implementation process of an online discriminant feature analysis algorithm. The algorithm starts from the angle of abnormal detection, and enables z to be detected by searching a transformation vector a on line in real time i a to allPossible distance from Z i a point in a. Thus, the problem can be quantified as an optimization problem as follows:
in the above formula, by
To limit Z
i a distance of the point from the origin of coordinate axis and simultaneously maximizing z
i a is the distance from the origin of the coordinate axes. Due to the fact that
The optimization problem can be directly converted into a typical generalized eigenvalue problem through a Lagrange multiplier method:
further, the feature vector is further constrained to be a unit length by a = a/| a | |, so that the feature vector or the transform vector a represents only a direction. It is worth noting that the algorithm used in step (11) of the method of the present invention is the same as that used in step (7).
By carrying out the steps described above, the advantages of the method of the invention are presented below.
When the method is used for detecting the quality abnormity of the polypropylene product, the technical means of directly measuring the melt index of the polypropylene, namely long and serious hysteresis, is not relied on, and the characteristic variable or component which is most relevant to the melt index of the polypropylene and is obtained by double-layer relevant characteristic analysis of a neighbor component analysis algorithm and a typical relevant analysis algorithm is used for indirectly detecting the abnormity. The method can detect whether the quality of the polypropylene product is abnormal in real time according to the sampling frequency of the measured variable, and overcomes the problem of hysteresis of the traditional method.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
Referring to fig. 1, the present invention discloses a method for detecting quality abnormality of polypropylene product based on double-layer correlation characteristic analysis, and the following describes a specific embodiment of the method according to a specific application example.
As shown in fig. 2, the production flow of a polypropylene process object comprises four reactors, respectively referred to as a first reactor, a second reactor, a third reactor, and a fourth reactor; wherein the first reactor and the second reactor are liquid phase continuous stirred reactors, and the third reactor and the fourth reactor are gas phase fluidized bed reactors. Each reactor had a feed of propylene and hydrogen and a feed of catalyst. In addition, the product at the outlet of the fourth reactor is a polypropylene product.
Step (1): the measured variables of the polypropylene production process are determined, and specifically comprise 28 measured variables of four reactors.
Step (2): continuously collecting sample data of N sampling moments by using a measuring instrument installed in the production process of polypropylene; meanwhile, the melt index of the polypropylene product in the fourth reactor is obtained by sampling and analyzing every 2 hours; and storing the sample data corresponding to the measurement variable into an Nx 28-dimensional data matrix X, and storing N data corresponding to the melt index into an N X1-dimensional data vector y.
And (3): element filling is carried out on the data vector Y according to the formula (1) so as to obtain a column vector Y epsilon R N×1 . In the present embodiment, the sampling period of the measured variable is 6 minutes, i.e. the sampling frequency is equal to 1/(6 × 60), while the sampling frequency of the melt index is equal to 1/(120 × 60). Therefore, f = (120 × 60)/(6 × 60) =20 in formula (1).
And (4): respectively aligning column vectors z in X according to the formula (2)
1 ,z
2 ,…,z
28 And in the column directionThe quantity Y is subjected to standardization processing, and an input matrix is obtained correspondingly
And outputting the vector
And (5): obtaining the weight vector w according to the optimization of the steps (5.1) to (5.6) 0 ∈R 28×1 To obtain a direct correlation characteristic matrix X 1 ∈R N×m And uncorrelated feature matrix X 2 ∈R N×(28-m) 。
And (6): firstly solving the problem of generalized eigenvalue
The feature vector beta corresponding to the middle maximum feature value eta is calculated according to
Calculating a correlation projection vector q ∈ R
(28-m)×1 Then according to the formula
Computing indirect correlation feature vectors
And (7): mixing X
1 And
are combined into an input correlation feature matrix
Then, the above steps (7.1) to (7.4) are executed to determine the upper limit D of the abnormality detection index
lim 。
And (8): at the latest sampling time t, sample data x corresponding to the measured variable is collected
t (1),x
t (2),…,x
t (28) And are respectively paired according to the above-mentioned formulaIt performs normalization processing to obtain an input vector
And (9): according to the weight vector w
0 ∈R
1×28 The column where the maximum m elements are located corresponds to the input vector
Elements of the same column constitute a directly related feature vector y
1 ∈R
1×m Then will be
The remaining 28-m elements form an uncorrelated feature vector y
2 ∈R
1×(28-m) 。
Step (10): according to the formula s
t =y
2 q calculating the indirectly related features s
t Then, y is added
1 And s
t Combined into an input-dependent feature vector
Step (11): calculating an abnormality detection index D according to the aforementioned steps (11.1) to (11.2) t 。
Step (12): judging whether the conditions are met: d t ≤D lim (ii) a If yes, the quality of the polypropylene product at the current sampling moment is not abnormal, and the step (8) is returned; if not, executing step (13) to decide whether to trigger an abnormal alarm.
Step (13): returning to the step (8) to continue to carry out the quality abnormity detection of the polypropylene product at the latest sampling time, if the abnormity detection indexes of the continuous 6 latest sampling times are all larger than D lim Triggering an abnormal alarm of the quality of the polypropylene product; otherwise, no abnormal alarm is triggered.
The above embodiments are merely illustrative of specific implementations of the present invention and are not intended to limit the present invention. Any modification of the present invention within the spirit of the present invention and the scope of the claims will fall within the scope of the present invention.