APP下载

Model identification of continuous stirred tank reactor based on QKLMS algorithm

2020-11-25LIJunLIXiangyue

LI Jun, LI Xiang-yue

(1. School of Automation & Electrical Engineering, Lanzhou Jiaotong University, Lanzhou 730070, China;2. Gansu Provincial Engineering Technology Center for Informatization of Logistics & Transport Equipment, Lanzhou 730070, China;3. Gansu Provincial Industry Technology Center of Logistics & Transport Equipment, Lanzhou 730070, China)

Abstract: The continuous stirred tank reactor (CSTR) is one of the typical chemical processes. Aiming at its strong nonlinear characteristics, a quantized kernel least mean square(QKLMS) algorithm is proposed. The QKLMS algorithm is based on a simple online vector quantization technology instead of sparsification, which can compress the input or feature space and suppress the growth of the radial basis function (RBF) structure in the kernel learning algorithm. To verify the effectiveness of the algorithm, it is applied to the model identification of CSTR process to construct a nonlinear mapping relationship between coolant flow rate and product concentration. In additiion, the proposed algorithm is further compared with least squares support vector machine (LS-SVM), echo state network (ESN), extreme learning machine with kernels (KELM), etc. The experimental results show that the proposed algorithm has higher identification accuracy and better online learning ability under the same conditions.

Key words: kernel learning algorithm; quantized kernel least mean square (QKLMS); continuous stirred tank reactor (CSTR); system identification

0 Introduction

The continuous stirred tank reactor (CSTR) is a highly nonlinear chemical reactor and is widely used in the chemical process industry including chemical reagents, fuels, synthetic materials, etc[1-3]. It is difficult to obtain an accurate mathematical model of the CSTR due to its features of nonlinearity and time-varying. In addition, if the system model is not accurate enough, the analysis, prediction and control of the system will be affected[4]. Hence, it is necessary to construct a nonlinear dynamic identification model based on the input-output data of the system, and further design a controller based on the identification model to realize the adjustment and control of the CSTR process[5-7].

In recent years, neural networks, as an effective artificial intelligence method, play an important role in the identification and control of chemical processes. In Refs.[8] and [9], Chen et al applied back propagation (BP)and generalized radial basis function (RBF) neural networks to CSTR system modeling, which effectively improved the identification accuracy. A dynamic recurrent neural network, echo state network (ESN), was used in CSTR process, and the identification effect was significantly improved[10]. In order to overcome the shortcomings of the feedforward neural network which is easy to fall into the local minimum, a nonlinear autoregressive exogenous input(NARX) identification method based on extrem learning machine with kernel (KELM) was proposed and applied to the modeling of CSTR, which obtained high identification accuracy[11]. However, when the training data increases, the computational complexity of the neural network also increases, which brings inconvenience to subsequent learning.

In order to further reduce the computational complexity and improve the online learning ability, relevant research in the field of online kernel learning algorithms has attracted wide attention of scholars[12-14]. In Ref.[15], Li et al proposed a kernel least mean square (KLMS) algorithm with low computational complexity and good robustness, which has been effectively used to the single-step and multi-step prediction of online traffic flow. Chen et al put forward a quantized kernel least mean square (QKLMS) algorithm[16], which is different from sparsification and uses the redundant data to update the coefficient of the closest centre. In Ref.[16], the algorithm was successfully applied to the prediction of chaotic time-series.

Therefore, for the identification of CSTR with strong nonlinearity features, we propose a novel identification method using QKLMS based on kernel learning algorithm to further improve the identification accuracy. In addition, to verify the effectiveness of the proposed algorithm, the identification experimental results are compared with the existing methods under the same conditions.

1 QKLMS

QKLMS is an online sequence estimation algorithm. Firstly, giving the training data {xi,yi}∈Rm×R1(i=1,2,…,N), we can defineX∈RN×mas the input matrix andY∈RN×1as the output matrix. When theith data set is obtained, the online update of the learning algorithm is performed on the basis of the estimation of the previous (i-1)th data (denoted asfi-1) to obtain the estimated value of the current nonlinear mapping relationshipf, recorded asfi. The nonlinear mapping between the input and output data is expressed as

(1)

where the nonlinear mapping relationship is built by the linear combination of the kernel function constructed by the corresponding support vectorxi.

Based on the QKLMS algorithm, firstly,xineeds to be mapped to the high-dimensional feature space, i.e.φ∶x→φ(x)∈F⊆RM, and the kernel function is defined as

k(xi,xj)=φ(xi)Tφ(xj).

(2)

Then the kernel matrixK=ΦTΦthat satisfies the Mercer condition can be obtained, whereΦ=[φ(x1)φ(x2) …φ(xN)].

In the experiment, the kernel learning algorithm will use three kernel functions as follows.

1) Polynomial kernel

k(xi,xj)=((xi·xj)+1)p,

(3)

wherepis the order of the kernel function.

2) Sigmoid kernel

k(xi,xj)=tanh(v(xi·xj)+c),

(4)

wherevis the input weight andcis the offset of the kernel function.

3) Gaussian kernel

(5)

whereσ(σ>0) is the kernel width.

The KLMS algorithm extends the linear LMS algorithm into the feature spaceF. The inputφ(xi) of the high-dimensional nonlinear feature space is denoted asφi. For the sequence data {φi,yi}, the LMS algorithm is applied, then

(6)

whereeiis the prediction error when theith data have been acquired,ηis the learning rate, andωiis the estimation value of weight vector in the feature space.

(7)

Eq.(7) shows that the KLMS algorithm is essentially equivalent to a growing RBF network, i.e., as each new data are acquired, a new core unit centred on inputxiis assigned, andηeiis its coefficient.

The QKLMS algorithm is obtained by quantifying the feature vectorφi, which is embodied in the weight update equation in Eq.(6). At this point, the KLMS algorithm on Eq.(7) is

(8)

whereQ[·] is the quantization operator in the original spaceU, and additionally, letxq(i)=Q[xi].

(9)

where ‖·‖Fis the norm in the feature spaceF. Eq.(9) indicates that the distance in the feature spaceFmonotonically increases as the distance ofUin the original space changes.

Therefore, the quantization threshold can be defined by Eq.(9), then

(10)

whereεU=‖xi-xj‖ is the quantization threshold in the original spaceUand ‖xq(i)-xj‖≤εU. In addition, whenεU=0, it is the KLMS algorithm.

In summary, the specific steps to implement the QKLMS algorithm are as follows:

Step 1: Give the data sets {xi∈U,yi},i=1,2,…

Step 2: Training phase. Letη>0,σ>0 andεU>0, wheni=1, let the initial value of the codebook vector matrix (the set of data centre)D1=[x1], and the coefficient vectorα1=[ηy1].

Step 3: Leti=i+1,L=size(Di-1), the model output is calculated by

(11)

Step 4: Calculation error is

(12)

and the minimum distance between the input vector and all codebook vectors is calculated by

(13)

Step 5: Ifd(xi,Di-1)≤εU, the codebook vector matrix remains unchanged, i.e.,Di=Di-1. Quantizingxito the nearest centre, by updating the coefficient vector of the nearest centre, that is

(14)

Otherwise, settingxito the new codebook vector and updating the coefficient vector, that is

(15)

Step 6: Iteratively calculate Step 3- Step 5 until all training data are learned in turn.

Step 7: Testing phase. Based on the trained model, given the testing data, the final model output is calculated by Eq.(11).

2 Experiment of CSTR process

2.1 CSTR process

CSTR is a typical nonlinear reaction process, and its basic structure is shown in Fig.1. In this paper, the CSTR chemical process with exothermic reaction feature is an irreversible reaction (A→B) process, and the producing heat will slow the reaction down. By introducing a coolant flow rateqc, the temperature can be varied and hence the product concentrationCBcan also be controlled.

Fig.1 Basic structure of CSTR

The dynamic nonlinear differential equations of the CSTR are expressed as

(16)

(17)

whereqis the process flow rate;CAis the inlet feed concentration;TfandTcfare the inlet feed and coolant temperatures, respectively;Tis the temperature of the product. In addition, the remaining chemical reaction parameters are detail listed in Ref.[17].

2.2 Data collection and model building

During the CSTR process, when the reaction reaches equilibrium, the product concentration isCB=8.36×10-2mol/L, simultaneously, the temperature of the product and the coolant flow rate areT=440.2 K andqc=103.4 L/min, respectively. On the basis that the coolant flow rateqcis a steady state value, the randomly distributed white noise in the interval [-0.002,0.002] is added to enhance the stability of the model training.

The coolant flow of the CSTR input is shown in Fig.2. Among the obtained 4 000 input-output data, the first half is used as the training set, and the remaining part is used as the test set. In addition, all data sets need to be normalized on the interval [0,1].

Fig.2 Coolant flow qc of CSTR input

Assuming that the CSTR system model is unknown, only the above input and output data being known, the identification model of the CSTR is selected as

CB(i-1),CB(i-2),CB(i-3)].

(18)

3 Experimental results and analysis

In the experiment, the mean square error(MSE)is selected as the performance indicator of the identification model, that is

(19)

In the experiment, QKLMS selects three common kernel functions according to Eqs.(3)-(5), and the corresponding parameters are set as follows: the order of Polynomial kernel function isp=2; the input weight and offset of Sigmoid kernel function arev=0.8 andc=1, respectively; and the kernel width of Gaussian kernel function isσ=1.

When the quantization thresholdεUvaries between (0,1), the identification performance on the test set can be obtained, and the experiment results are shown in Table 1.

Table 1 Comparison of identification performance of QKLMS based on three different kernel functions

It can be seen from Table 1 that the MSE changes with the change of quantization thresholdεU. The comparison shows that when the Gaussian kernel function is selected, the identification accuracy is the best and can reach 8.782 3×10-11. It can also be further observed that the training time is concentrated in 2.50 s-3.36 s.

Considering further experiment based on Gaussian kernel function, that is, when the learning rateηvaries between (0,1), the identification performance on the test set can be observed, and the results are shown in Table 2. It is observed from Table 2 that the MSE of QKLMS changes with the change ofη, and the training time is concentrated in 2.89 s-3.81 s. When the learning rate is 0.45, the identification accuracy is the highest and the MSE of the testing set is 3.850 9×10-11.

Table 2 Comparison of identification performance when learning rate changes

Whenη=0.45, the identification performance of the test set can be observed from Table 3 by changing the sizes ofεUandσ. It can be seen that the MSE changes with the changes ofεUandσ, and the training time is relatively concentrated in 2.72 s-3.61 s. WhenεU=0.60, andσ=6, the identification accuracy of QKLMS is the highest and the MSE of the test set is 1.232 8×10-14. Moreover, the identification accuracy of QKLMS is nearly one order of magnitude higher than that of KLMS (εU=0) under the same conditions.

Table 3 Comparison of identification performance of QKLMS

WhenεU=0.60,σ=6 andη=0.45, Fig.3 shows the error curve of each sample point on the test set. Fig.4 shows the comparison curve of the actual value and identification value of output concentration. The magnitude of the identification error is approximately 10-7. Combining with Figs.3-4, it can be seen that QKLMS can achieve excellent results in the modeling of CSTR.

Fig.3 Error curve of each sample point on test set

Fig.4 Comparison curve of the actual value and identification value of output concentration

To further verify the validity of the QKLMS algorithm, Table 4 shows the MSE of the QKLMS and the existing identification algorithm on the test set under the same conditions. The comparison shows that the identification accuracy of QKLMS is improved by one order of magnitude.

Table 4 Comparison of identification performance based on QKLMS and other algorithms

4 Conclusion

In this paper, based on the input and output data of the unknown nonlinear CSTR process, a novel identification method with the QKLMS algorithm is proposed. The online vector quantization method is used to quantize the input in the feature space and control the size of the kernel function structure.

Compared with existing feed-forward neural network method and ESN network as well as other kernel learning methods, under the same conditions, experimental results show that the identification method based on QKLMS algorithm can achieve good results, and improve the accuracy of identification effectively. Therefore, our research provides a new idea for the complex nonlinear process that is difficult to obtain accurate mathematical models.