Unscented Kalman Filter-Based Robust State and Parameter Estimation for Free Radical Polymerization of Styrene with Variable Parameters

The free radical polymerization of styrene (FRPS) is a complex process system with uncertain parameters in its mechanistic model. When the reaction conditions are switched, or the reaction process generates faults, the parameters will change. Therefore, state and parameter estimation (SPE) becomes an important part of the process monitoring and process control for free radical polymerization of styrene. The unscented Kalman filter (UKF) is widely used for nonlinear process systems, but it rarely considers the problem of model parameter uncertainty. UKF can be used for SPE, called UKF-based SPE (UKF-SPE), where the parameters are usually estimated simultaneously as an extension of the state space. However, when the parameters change with system switching, the traditional UKF-SPE cannot detect and track the parameter changes in time, and inaccurate parameters generate modeling errors. To deal with the problem, a UKF-based robust SPE method (UKF-RSPE) for the free radical polymerization of styrene with variable parameters is proposed, introducing a parameter testing criterion based on hypothesis testing and moving windows to directly detect whether the parameters have changed. Based on the detection results, a gradient descent method with adaptive learning rate is used to iteratively update the parameters to speed up the tracking of the parameters and to obtain more accurate parameters and states. Finally, the proposed UKF-based robust SPE is applied to free radical polymerization of styrene in a jacketed continuous stirred tank reactor. The experimental results verify the effectiveness and robustness of the method, which can track the parameters faster and obtain more accurate states.


Introduction
The output of the free radical polymerization of styrene is distributed, called distribution output, and the control of the distribution output is critical because it significantly affects product quality. Therefore, accurate estimation of states and parameters is important to monitor the process of free radical polymerization of styrene. Models of free radical polymerization of styrene usually generate modeling errors due to uncertain parameters. In order to obtain accurate states and parameters, state and parameter estimation (SPE) plays an important role in the free radical polymerization of styrene.
State estimation, also called filtering, uses the redundancy of a real-time measurement system to improve data accuracy, automatically eliminates error messages caused by random disturbances, and can estimate states. Kalman proposed the Kalman filter (KF) in 1960, which was restricted to linear systems [1,2]. Subsequently, Bucy et al. proposed the extended Kalman filter (EKF) by linearizing the nonlinear equations to first order through Taylor expansions, but it inevitably introduced approximation errors [3]. In 1999, Julier et al. been used in free radical polymerization of styrene with variable parameters. Most of the above studies used the method of state and parameter estimation, which is seen as an extension of the state by setting the parameters as time-varying parameters, and this method is called artificial evolution, and this strategy is widely used in SPE techniques [28,29].
The traditional SPE with slow tracking parameters will lead to slow convergence of the measurement error, making accurate parameter estimation difficult. Wang et al. proposed a new adaptive law to achieve optimal parameter estimation to maintain simultaneous convergence of the estimation error and tracking error [30]. To accomplish accurate and fast parameter estimation, gradient descent methods with adaptive learning rate are used to optimize filters. Common methods of adaptive learning rate include Delta-bar-delta [31], AdaGrad [32], RMSProp (Root-Mean-Square-Prop), Adam [33], etc. Long et al. proposed an adaptive online parameter identification method based on gradient descent optimization (GDO) and a variable iteration step search method based on the RMSProp gradient descent optimization (RMSprop-GDO) method to reduce the search time required for the optimal iteration step [34]. Long et al. proposed an online gradient learning algorithm with adaptive learning rate for identifying the parameters of a neuro-fuzzy system with a Gaussian fuzzy set representing the Mamdani fuzzy model [35]. Na et al. proposed an adaptive parameter estimation framework for the nonlinear systems with time-varying parameters [36].
Although the influence of parameters in the mechanistic model of free radical polymerization of styrene is taken into account, the state of the reaction process will change with the variation of parameters when the operating conditions of the reaction are changed, or some failure occurs in the reaction. Therefore, parameters and states need to be estimated together to obtain an accurate system model and estimated states. Because of the limitations of artificial evolution, these parameters cannot be tracked quickly and accurately by traditional SPE. In this paper, a UKF-based robust SPE method for free radical polymerization of styrene with variable parameters is proposed. A hypothesis test-based parameter testing criterion is introduced to directly identify whether the parameters change. Based on the identification results, the learning rate of the gradient descent method is adaptively modified, and the gradient descent method is used to accelerate the parameter tracking. Finally, accurate parameters and states are obtained simultaneously.
The remainder of the paper is organized as follows. The foundations of UKF-based SPE are reviewed in Section 2. Section 2.1 introduces the algorithm of standard UKF for state estimation, and Section 2.1 introduces UKF-based SPE. In Section 3, the UKF-based robust SPE scheme is proposed to improve parameter estimation performance, which combines moving window and adaptive learning rate gradient descent. The proposed UKF-based robust SPE is applied to free radical polymerization of styrene with variable parameters, and the results demonstrate the effectiveness the proposed UKF-based robust SPE in Section 4. Finally, the conclusions are drawn in Section 5.

Review of Standard UKF
KF is a model-based linear minimum variance estimation, which is widely used in stochastic signal processing, but it is only applicable to linear systems. EKF solves this problem, but it must do a Taylor expansion of the nonlinear system equations and retain only the linear term, so EKF is only applicable to weakly nonlinear systems, and the stronger the nonlinearity, the larger the estimation error. To solve the estimation problem of nonlinear systems, UKF is proposed. UKF is based on the minimum variance estimation of the model like KF, while the model of UKF is a nonlinear system. The standard state space model of nonlinear dynamic system containing state equation and measurement equation has a discrete form, which can be described as where k denotes the time step of the system operation. x k ∈ R N x ×1 is the process state of system, which is usually unknown during system operation; z k ∈ R N z ×1 is the vector of measurement; and u k−1 is the vector of input. f = [ f 1 ; f 2 ; · · · ; f N x ] and h = [h 1 ; h 2 ; · · · ; h N z ] are the state equations and measurement equations, respectively. w k−1 and v k are the vectors of uncorrelated zero-mean white noise, i.e., E w i v T j = 0, ∀i, j. The process noise w k−1 and the measurement noise v k are assumed to Gaussian distribution, i.e., w k−1 ∼ G(w k−1 ; 0, Q), and v k ∼ G(v k ; 0, R), the process noise covariance matrix Q and measurement noise covariance matrix R depend on the sensor accuracy and the interference of environmental factors in the system, respectively. Q and R are then set as diagonal matrices and are assumed to be constant in the present work. θ is the vector of constants parameters. For traditional state estimation, the parameters are known constants, but as the system becomes more complex, uncertain parameters may appear in the model. This is also the focus of this paper's research.

Unscented Transformation
The major difference between UKF and KF is the finding of the optimal gain array, which depends on the mean and covariance. The UKF uses the unscented transformation (UT) to deal with the nonlinear transfer problem of the mean and covariance [4]. In Figure 1, the UT generates Sigma points in the original state distribution based on certain rules, and the mean and covariance of these points are equal to the original state distribution, and then the nonlinear system equations are used for nonlinear transfer to obtain the set of nonlinear function values, which leads to the transformed mean and covariance. Suppose the random vector X is nonlinearly transformed by f(·) to obtain the random vector Y, i.e., Y = f(X). If the mean X and covariance matrix P XX of X is known, the mean Y and covariance matrix P YY of Y can be calculated by UT. The detailed steps are as follows.
The sigma points are transferred through f(·) to obtain the transformed sigma points Y (i) .
Then, the weights are determined according to the symmetric sampling rule as where N x donates Dimension of X. W c are the mean weight and covariance weight of the ith sigma point, respectively. In the above equation, λ is a scaling parameter used to reduce the total prediction error. α, κ, and β are the parameters to be selected, α is a small positive constant (10 −4 ≤ α ≤ 1); κ = 3 − N x has to ensure that the matrix (N x + λ)P XX is semi-positive definite; β is related to the form of the distribution of X, β = 2 is optimal for a Gaussian distribution. Finally, the mean and covariance matrix after the nonlinear mapping is calculated as 9) where x N donates Dimension of X .
(i) m W and (i) c W are the mean weight and covariance weight of the ith sigma point, respectively. In the above equation, λ is a scaling parameter used to reduce the total prediction error. α , κ , and β are the parameters to be selected, α is a small positive constant ( 4 10 1 − ≤ ≤ α ); x κ = 3 -N has to ensure that the matrix ( ) x XX N + λ P is semi-positive definite; β is related to the form of the distribution of X , β = 2 is optimal for a Gaussian distribution. Finally, the mean and covariance matrix after the nonlinear mapping is calculated as

UKF for State Estimation
Standard UKF is based on the UT, which takes the transformed mean and covariance and is used to calculate the optimal gain array. Generally, UKF performs two UTs, using the state equation and measurement equation for nonlinear transfer, which correspond to the time update phase and measurement update phase of UKF, respectively. For the standard nonlinear system, the steps of UKF are as follows [4,25].
Firstly, in order to make the state estimation value always unbiased in the filtering process, i.e., x , the initial condition of the UKF can be given by where 0 x is the initial state vector of UKF; 0 P is the initial covariance matrix; and 0 x is the initial true state vector. In the time update stage, according to the initial condition, the 2 1 can be obtained as

UKF for State Estimation
Standard UKF is based on the UT, which takes the transformed mean and covariance and is used to calculate the optimal gain array. Generally, UKF performs two UTs, using the state equation and measurement equation for nonlinear transfer, which correspond to the time update phase and measurement update phase of UKF, respectively. For the standard nonlinear system, the steps of UKF are as follows [4,25].
Firstly, in order to make the state estimation value always unbiased in the filtering process, i.e., E[x k ] = E[x k ], the initial condition of the UKF can be given bŷ wherex 0 is the initial state vector of UKF; P 0 is the initial covariance matrix; and x 0 is the initial true state vector.
In the time update stage, according to the initial condition, the 2N x + 1 sigma points x (i) k−1|k−1 can be obtained as where χ (i) k−1|k−1 is the ith sigma point ofx k−1 at time step k, p k−1,i is the ith column of (N x + λ)P k−1 or − (N x + λ)P k−1 , which donate the ith column of the square root of the lower triangular decomposition of (N x + λ)P k−1 .
Next, the nonlinear transfer is performed on the sigma points and the priori estimation is calculated as χ where χ (i) k|k−1 is the one-step prediction of sigma points,x k|k−1 is the priori estimation of the state vector, and P k|k−1 is the priori estimation of the covariance matrix.
In the measurement update stage, a new set of sigma points is generated as where χ * (i) k|k−1 is the ith new sigma point ofx k−1 at time step k, p k|k−1,i is the ith column of (N x + λ)P k|k−1 or − (N x + λ)P k|k−1 , which donate the ith column of the square root of the lower triangular decomposition of (N x + λ)P k|k−1 .
As in the time update stage, a nonlinear transfer of measurement equation is performed on the new sigma points and the priori estimation of measurement is calculated as where z (i) k|k−1 is the one-step prediction of measurements of sigma points,ẑ k|k−1 is the priori estimation of the measurement.
The covariance P zz,k and P xz,k can be obtained by the weighted summation of the sigma point set as Then, the Kalman gain matrix K k calculation is obtained as Finally, the estimated state and the covariance can be calculated aŝ According to the estimated state and measurement equation, measurement is reconciled asẑ The above process is the standard UKF for state estimation, which does not take into account the time-varying parameters in the system and is only applicable when the parameters are known.

UKF-Based SPE
Considering the problem of system parameter estimation, the complex system will contain several uncertain parameters, and assuming that the parameters are time-varying, define the time-varying parameter vector θ k at time step k, which is a random vector with Polymers 2022, 14, 973 7 of 24 zero mean. Therefore, SPE can be achieved by considering θ k as an extension of the state space, which is estimated together with the state vector [29].
where x k is augmented state vector, which considers the parameters as part of the state. The nonlinear dynamic system model can be rewritten with the augmented state x as where f (·) = f f θ is augmented state equation and w k−1 = w k−1 ς k−1 is augmented process noise vector with covariance matrix Q .
The state equation f θ for parameter vector can be expressed as where ς k−1 ∼ G(0, S) is the white noise with zero mean satisfying Gaussian distribution, S is covariance matrix of parameters, the value of which is assumed to be small. Q combined with S yields the augmented covariance matrix Q .
Therefore, standard UKF can also be extended for the application of SPE. The process of UKF-based SPE is shown in Figure 2 and its algorithm is derived as follows.
The estimated states and parameters are calculated as Finally, the measurements are reconciled as Polymers 2022, 14, x FOR PEER REVIEW 9 of 28 This strategy is known as artificial evolution, which treats fixed model parameters θ as stochastic time-varying model parameters k θ [29]. The ability of SPE to track the variation of parameters depends heavily on the covariance matrix S . In the practical case, the parameters are fixed and S should be zero, but then UKF will lose the ability of parameter estimation and the estimated parameters will remain time-invariant. If S is large, the stochastic wander implies an increase in covariance as the number of iterations increases, which will cause the parameters k θ to gradually deviate from the fixed parameters θ . Therefore, S is usually set to a matrix of small values. This strategy is known as artificial evolution, which treats fixed model parameters θ as stochastic time-varying model parameters θ k [29]. The ability of SPE to track the variation of parameters depends heavily on the covariance matrix S. In the practical case, the parameters are fixed and S should be zero, but then UKF will lose the ability of parameter Polymers 2022, 14, 973 9 of 24 estimation and the estimated parameters will remain time-invariant. If S is large, the stochastic wander implies an increase in covariance as the number of iterations increases, which will cause the parameters θ k to gradually deviate from the fixed parameters θ. Therefore, S is usually set to a matrix of small values.

UKF-Based Robust SPE for System with Variable Parameters
UKF-SPE fixes the variance of each system parameter to a small value, and when the parameters are fixed, UKF-SPE gives good estimates. However, the values of parameters can change when the operating conditions switch or when certain faults occur. Due to the limitations of traditional UKF-SPE, changes in the parameters cannot be tracked quickly. Since the covariance matrix S in UKF-SPE is small and fixed, the parameters change slowly during the UKF-SPE tracking iterations, which will produce large estimation errors. This section proposes a reliable method to solve the problem.
At the time step k, the parameters of the process model change, which will result in a corresponding change in the estimated parameters. If the parameters are fixed, the estimated parameters will not change accordingly and converge to a fixed value. Parameter testing based on the trend of parameter changes can be used to identify parameter changes. Once changes in parameters are detected, a gradient descent method is used to speed up the tracking of the parameter, and the learning rate is adaptively adjusted to stabilize the estimated parameters.

Parameters Test
Assuming that UKF-SPE correctly estimates the augmented state, the parameters and states estimated by Equation (41) can be split from this vector. If the parameters do not change, the values of estimated parameters satisfy normal distribution in the vicinity of the correct parameters. Once the system has switched and the parameters have changed, the estimated parameters will deviate from their original values with certain rules. Therefore, based on the corresponding characteristics of parameters, for diagnosing whether the estimated parameters are true or not, a moving window containing information about the estimated parameters in the time series is used to calculate the mean θ n,k and variance s 2 n,k of each parameter in the window, as shown in Figure 3.
where W is the size of the move window. Regarding the choice of W, W is a hyperparameter, which is usually obtained according to the empirical method. W needs to be set to an appropriate size. If W is too small, the parameters within the window will have a certain size of variance due to random noise. Conversely, if W is too large, the window contains too much historical information, which can lead to misclassification of the correct parameters.
In order to distinguish whether the parameters are true or not based on their means and variances, statistical methods based on hypothesis testing are used. Firstly, the null hypothesis (H 0 ) and the alternative hypothesis (H 1 ) can be defined as whereθ i,k and θ i is the ith estimated parameter and true parameter, respectively. Due to the parameter noise ς k is related to S, the test statistic for the χ 2 distribution can be established as Based on the quantified variance set for parameters, statistics determined χ 2 α (W − 1) by the significance level α can be set and the probability event can be described as Based on the threshold s 2 th , s 2 n,k can be tested with the equivalent null hypothesis (H 0 ) and alternative hypothesis (H 1 ): Since the parameters estimated by UKF-SPE fluctuate within a small range of the correct parameters, the variance of the latest correct parameters is much smaller than the variance of the incorrect parameters, which is close to zero. If the variance of the estimated parameters in the moving window is below the defined threshold (s 2 th ), then the estimated parametersθ k is identified as the true parameters; otherwise, they are the false parameters. Once an estimated parameter is judged to be false, then the RMSProp gradient descent method is used to modify the parameters. parameters ˆk θ is identified as the true parameters; otherwise, they are the false parameters. Once an estimated parameter is judged to be false, then the RMSProp gradient descent method is used to modify the parameters.

RMSProp Gradient Descent
Once the system has switched, the parameter test results will judge that the parameters have changed and the estimated parameters will deviate from their original values, showing a trend towards the true parameters, which can be defined as gradient. With the gradient descent method, the information of the loss function k E is used to calculate the gradient [8], and the parameters are corrected along the direction of the gradient. The gradient descent method is to modify the parameters by iterations to minimize the loss.
Assuming that the measurement is desired, the loss function is set to squared error, expressed as According to the rule of back propagation, the gradient can be calculated as The observation error k r can be obtained by Equation (27).
Equation (51) can be approximated as a first-order Taylor expansion as follows

RMSProp Gradient Descent
Once the system has switched, the parameter test results will judge that the parameters have changed and the estimated parameters will deviate from their original values, showing a trend towards the true parameters, which can be defined as gradient. With the gradient descent method, the information of the loss function E k is used to calculate the gradient [8], and the parameters are corrected along the direction of the gradient. The gradient descent method is to modify the parameters by iterations to minimize the loss. Assuming that the measurement is desired, the loss function is set to squared error, expressed as According to the rule of back propagation, the gradient can be calculated as The observation error r k can be obtained by Equation (27).
Equation (51) can be approximated as a first-order Taylor expansion as follows The gradient Γ k−1 is approximated as , T is the interval time between two samples. It can be found that the gradient is related to the trend of the parameters. The gradient is also a modification quantity for the parameters, assuming that the learning rate is η, and the parameters can be modified asθ * whereθ * k−1 is the vector of modified parameters, η is a fixed constant which will lead to large fluctuations of parameter estimation results. The ideal learning rate is set large at the beginning, with a fast convergence rate, and then decays slowly to ensure stable arrival at the optimal point, as shown in Figure 4. η can be turned into a time-varying learning rate vector η k−1 . The learning rate adaptive algorithm often uses RMSProp, which uses exponentially decaying averaged gradients to discard past historical information, allowing it to converge quickly after finding the gradient minimum, solving the problem of large oscillations in optimization.
RMSProp needs to calculate the cumulative squared gradient as where ρ ∈ [0, 1) is the rate of reduction. The learning rate of each parameter is then updated to where ε is the global learning rate, δ is a small constant that makes the value stable when divided by a decimal, usually set to 10 −6 . η i,k−1 A is the learning rate of the ith parameter, RMSProp chooses a different learning rate for each parameter. Equation (54) can be rewritten asθ * Finally, with the modified parameter vectorθ * k−1 , the UKF-SPE is re-conducted to obtain newx k andθ k , the measurements are also reconciled to newẑ k .
Polymers 2022, 14, x FOR PEER REVIEW 12 of 28 where * 1 k − θ is the vector of modified parameters, η is a fixed constant which will lead to large fluctuations of parameter estimation results. The ideal learning rate is set large at the beginning, with a fast convergence rate, and then decays slowly to ensure stable arrival at the optimal point, as shown in Figure 4. η can be turned into a time-varying learning rate vector 1 k − η . The learning rate adaptive algorithm often uses RMSProp, which uses exponentially decaying averaged gradients to discard past historical information, allowing it to converge quickly after finding the gradient minimum, solving the problem of large oscillations in optimization.
RMSProp needs to calculate the cumulative squared gradient as where [0,1) ∈ ρ is the rate of reduction. The learning rate of each parameter is then updated to where ε is the global learning rate, δ is a small constant that makes the value stable when divided by a decimal, usually set to 10 −6 . , 1 A is the learning rate of the ith parameter, RMSProp chooses a different learning rate for each parameter. Equation (54) can be rewritten as Finally, with the modified parameter vector * 1 k − θ , the UKF-SPE is re-conducted to obtain new ˆk x and ˆk θ , the measurements are also reconciled to new ˆk z . The proposed UKF-based robust SPE considers the effect of parameter changes and is applicable to nonlinear dynamic systems with variable parameters. When the system is switched, or a failure occurs, the system parameters change, and the parameter testing based on hypothesis testing and moving windows is introduced to detect whether the system parameters have changed. Based on the detection results, the RMSProp gradient descent method that adaptively modifies the learning rate is used to fast track the changed parameters. The proposed UKF-based robust SPE algorithm is shown as follows (Algorithm 1). The proposed UKF-based robust SPE considers the effect of parameter changes and is applicable to nonlinear dynamic systems with variable parameters. When the system is switched, or a failure occurs, the system parameters change, and the parameter testing based on hypothesis testing and moving windows is introduced to detect whether the system parameters have changed. Based on the detection results, the RMSProp gradient descent method that adaptively modifies the learning rate is used to fast track the changed parameters. The proposed UKF-based robust SPE algorithm is shown as follows (Algorithm 1).
Step 3. Conduct parameters test: 1. Calculate the mean θ n,k and variance s 2 n,k of each estimated parameter in the window using Equations (43)  Step 5. Re-conduct UKF-SPE based on the modified parameters to estimatex k ,θ k , and reconcilê z k . End Output:x k ;θ k ;ẑ k

Case Studies
To verify the effectiveness of the proposed UKF-RSPE, the UKF-RSPE was applied to a typical nonlinear dynamic process system and the free radical polymerization of styrene. All case studies were performed by using MATLAB 2016a.

Case Study 1: Typical Nonlinear Dynamic System
In order to simply show the effect of the proposed UKF-RSPE, the proposed UKF-RSPE is applied to a typical nonlinear dynamic process system, which is commonly used in filter testing [29,37]. Its mathematical model can be expressed as where v k−1 and v z,k−1 are the process noise and the measurement noise with standard deviations of 0.1, respectively. θ is the model parameter. Under normal conditions, the value of the parameter θ is set to be 25. If a fault occurs, the parameter changes to be 12.5. To keep track of the changed parameter, the state vector and the state equations are expanded to be where ς θ,k−1 is the parameter noise with the standard deviation of 0.01. In this simulation, W is set to be 5, α is set to be 0.05. The simulation time step is set to be 500 and the value of parameter changes at time step 200. The initial state is set to be x(0) = [0, 25]. The comparison results of SPE are shown in Figures 5-7. The comparison of the estimated results of the state in Figure 5 shows that the distribution of system state changes at time step 200. Since the random noise in the simulation is small, it can be clearly seen that the state error of the traditional UKF-SPE estimation increases significantly after the fault occurs in Figure 5b. Compared with the traditional UKF-SPE, the proposed UKF-RSPE can achieve more accurate state estimation. In Figure 6, the comparison of the estimated results of parameter directly shows that the parameter changes from 25 to 12.5. The traditional UKF-SPE cannot track the true parameter quickly, while UKF-RSPE can track the parameters quickly and accurately and reduce the error of parameter estimation. Due to the presence of the learning rate in UKF-RSPE, there is a small fluctuation after the estimated parameter reaches the true value. With the learning rate continuously updating, the parameter is finally stabilized around the true value. Finally, the measurements are reconciled according to the estimated states and parameters. The comparison of the reconciled results of measurements shows that the UKF-RSPE can reconcile measurements, and the measurement error of the UKF-RSPE is smaller than that of UKF-SPE, as shown in Figure 7.
of the estimated results of the state in Figure 5 shows that the distribution of system state changes at time step 200. Since the random noise in the simulation is small, it can be clearly seen that the state error of the traditional UKF-SPE estimation increases significantly after the fault occurs in Figure 5b. Compared with the traditional UKF-SPE, the proposed UKF-RSPE can achieve more accurate state estimation. In Figure 6, the comparison of the estimated results of parameter directly shows that the parameter changes from 25 to 12.5. The traditional UKF-SPE cannot track the true parameter quickly, while UKF-RSPE can track the parameters quickly and accurately and reduce the error of parameter estimation. Due to the presence of the learning rate in UKF-RSPE, there is a small fluctuation after the estimated parameter reaches the true value. With the learning rate continuously updating, the parameter is finally stabilized around the true value. Finally, the measurements are reconciled according to the estimated states and parameters. The comparison of the reconciled results of measurements shows that the UKF-RSPE can reconcile measurements, and the measurement error of the UKF-RSPE is smaller than that of UKF-SPE, as shown in Figure 7.
To further quantify the effect of UKF-RSPE, the statistical information of estimated results is listed in Table 1. Compared with the traditional UKF-SPE, the MSE of state estimation is reduced from 20.4359 to 0.8509; and the MSE of parameter estimation is reduced from 26.4655 to 1.3346. The MSE of the measurement data is 0.0106; due to the failure, the traditional UKF-SPE cannot accurately estimate the status, resulting in the MSE of measurements increasing to be 4.3588, but the UKF-RSPE can reduce the MSE to be 0.3375. Therefore, the proposed UKF-RSPE can be applied to the general nonlinear dynamic system with variable parameter and achieve more accurate state and parameter estimation.

Case Study 2: Free Radical Polymerization of Styrene
To verify the effectiveness of the proposed UKF-RSPE, the UKF-RSPE was applied to the free radical polymerization of styrene. This paper uses the mathematical model of dynamics of polymerization in a jacketed continuous stirred tank reactor proposed by Schmidt and Ray [5]. The reaction mechanism of free radical polymerization of styrene is divided into decomposition reaction of initiator, initiator reaction to form monomer radi- To further quantify the effect of UKF-RSPE, the statistical information of estimated results is listed in Table 1. Compared with the traditional UKF-SPE, the MSE of state estimation is reduced from 20.4359 to 0.8509; and the MSE of parameter estimation is reduced from 26.4655 to 1.3346. The MSE of the measurement data is 0.0106; due to the failure, the traditional UKF-SPE cannot accurately estimate the status, resulting in the MSE of measurements increasing to be 4.3588, but the UKF-RSPE can reduce the MSE to be 0.3375. Therefore, the proposed UKF-RSPE can be applied to the general nonlinear dynamic system with variable parameter and achieve more accurate state and parameter estimation.

Case Study 2: Free Radical Polymerization of Styrene
To verify the effectiveness of the proposed UKF-RSPE, the UKF-RSPE was applied to the free radical polymerization of styrene. This paper uses the mathematical model of dynamics of polymerization in a jacketed continuous stirred tank reactor proposed by Schmidt and Ray [5]. The reaction mechanism of free radical polymerization of styrene is divided into decomposition reaction of initiator, initiator reaction to form monomer radical, chain propagation reaction, and termination reaction. First of all, the reaction mechanisms start with the decomposition reaction of an initiator such as azodiisobutyronitrile (AIBN) [38] which can be represented as where I is the initiator involved in the decomposition reaction that produces the radical R * . k d,0 and E d are the specific reaction rate constant and energy of activation of the decomposition reaction.
Hereafter, the radical R * reacts with the monomer M in the initiation reaction to produce P 1 which is a live polymer of the unit chain length.
where k i,0 and E i are the specific reaction rate constant and energy of activation of the initiation reaction. The propagation reaction for P n , alive polymer of n units of monomer to produce P n+1 , starting with P 1 is given by where k p,0 and E p are the corresponding specific reaction rate constant and energy of activation of the propagation reaction Afterwards, the polymer product is obtained from the dead polymer product M n+m with chain lengths of n + m units of monomer formed by the termination reaction.
where k t,0 and E t are the corresponding specific reaction rate constant and energy of activation of the termination reaction. The above reaction conditions are listed in Table 2.
The feed and output flow rates and the feed solvent concentration do not change with time throughout the reaction. It is assumed that the feed is equal to the output and there is no solvent build-up in the reactor.

Process Parameters Value
The reaction rate constant of the decomposition reaction k d,0 5.95 × 10 13  The mechanistic model describes the actual dynamic process of free radical polymerization of styrene, in which the products have distributional properties, such as the concentrations of the polymers. The estimation of the distribution output is critical as it significantly affects the product quality and process efficiency. The polymer concentration is considered as the process state, and the output of this process is the distribution of polystyrene concentration as a function of polystyrene chain length at the reactor outlet. Simulations of real scenarios revealed that the estimated error in polystyrene concentration for chain lengths longer than 1000 units of monomer is 10 −4 or less; therefore, the maximum chain length estimated for this process was set to 1000.
The concentration of the initiator C I,k , concentration of the monomer C M,k and the temperature of reactor T k are taken as the process states. The equations of states in the nonlinear dynamic model are given by where f 1 , f 2 , and f 3 are state equations of C I,k , C M,k , and T k , respectively. w 1,k−1 , w 2,k−1 , and w 3,k−1 are process noise of C I,k , C M,k , and T k , respectively. The information of C I,k , C M,k , and T k is listed in Table 3. At a steady state set-point reactor temperature T ss of 310 K, the following values are obtained.
where ss represents the steady state. At set-point conditions, the steady-state concentration range of the polymer is zero. The magnitudes of changes in the states C I,k , C M,k , and T k are large, therefore, the states must be redefined in terms of dimensionless variables so that when the system reaches the set-point condition, they are scaled to one.
The state equations f 1 , f 2 , and f 3 can be obtained from the differential equations, which, rewritten in terms of scaled dimensionless variables, are listed as follows.
where the information of parameters in the above equations is listed in Tables 2 and 4. The total concentration of live polymers C P is expressed in terms of dimensionless variables C I and T by where f = 0.6 is an initiator efficiency factor which accounts for the fraction of initiator participating in the chain initiation reaction. Considering the state vector and C P , the measurement vector is set to z k = [y 1,k ; y 2,k ; y 3,k ; y 4,k ] = C I,k ; C M,k ; T k ; C P , the measurement equations can be expressed as where v 1,k , v 2,k , v 2,k , and v 3,k are the measurement noise with standard deviations of 0.001, 0.001, 0.001, and 1, respectively

Process Parameters Value
The volumetric flow rates of inlet solvent F s 6.3750 × 10 −5 kmol·mol −3 The volumetric flow rates of inlet monomer F m 5.250 × 10 −5 kmol·mol −3 The volumetric flow rates of inlet initiator F i 1.55 × 10 −5 kmol·mol −3 The volumetric flow rates outlet streams F t The measured density ρ Obtained from simultaneous online measurements The volumetric heat capacity of reacting mixture ρc p 1506.24 kJ·K −1 ·m −3 The heat of reaction due to the propagation reaction −∆H p 69, 872 kJ·kmol −3 The amount of reaction mixture γ −∆H p ρc p The heating rate at the steady state Q ss −0.6659 kJ·s −2 The inlet feed temperature T i 330 K To verify the performance of the proposed UKF-based robust SPE, it was applied to the simulations of free radical polymerization of styrene and compared with traditional UKF-SPE. Two independent cases were considered, in which there are different combinations of uncertain parameters that change when failure occurs. Case Study 2.1 has only a single uncertain parameter, while Case Study 2.2 contains multiple uncertain parameters. The other parameters are the same in the two cases. W is set to be 5, α is set to be 0.05. The simulation time step is set to be 800 and the parameters are changed at time step 300.

Case Study 2.1: Robust SPE with Single Parameter
The initiator efficiency factor f is a constant which is assumed to be an uncertain parameter. With this parameter included, the state vector and the state equations are expanded to where ς f ,k−1 is the parameter noise with the standard deviation of 10 −6 , f is 0.6 under normal conditions. When a fault occurs, the parameter f changes to 0.3 at time step 300.
The comparison results of SPE are shown in Figures 8-11. The effect of parameter f change on states C I,k and C M,k is not significant, the parameter f mainly affects the temperature of reactor T k . Figure 8 shows the comparison of the estimated results of the state T k , it can be clearly seen that starting from time step 300, estimated state T k of the traditional UKF-SPE deviates from the theoretical true state. The UKF-SPE can only slowly track the true state, while the proposed UKF-RSPE can maintain accurate state estimation. In Figure 9, from the comparison of the estimated results of parameter f , it is clear that the traditional UKF-SPE tracks the parameter slowly, while the UKF-RSPE can track the true parameter much faster. Due to the presence of the learning rate in UKF-RSPE, there is a certain fluctuation when the true parameter is first tracked, which leads to misdetection as a false parameter, but with iteration, the learning rate is continuously updated, accompanied by past information being forgotten until the parameter f is finally stabilized as the true parameter through parameter testing. It can also be observed in Figure 9 that the fluctuations appear at the beginning of the parameter estimation due to the adjustment of the covariance P k from the initial unit matrix with iterations. Finally, the measurements are reconciled according to the estimated states and parameter. The comparison of the reconciled results of measurement T k is the same as the estimated results of the state T k as shown in Figure 10. The proposed UKF-RSPE can reconcile measurements, and the errors of the measurements are smaller than the measurements, indicating that the UKF-RSPE still has the ability to reconcile the data in the event of a fault. The change of f not only affects T k , but also the measurement of the total concentration of live polymers C p . The comparison of the reconciled results of measurement C p is shown in Figure 11; C p undergoes a direct change when s fault occurs indicating that f has a large effect on C p . The UKF-RSPE can reconcile the measurements quickly, while the traditional UKF-SPE can only track the measurements slowly. The measurement error of the UKF-RSPE is smaller than the measurement and the measurement of UKF-SPE, as shown in Figure 11b. of the state k T  as shown in Figure 10. The proposed UKF-RSPE can reconcile measurements, and the errors of the measurements are smaller than the measurements, indicating that the UKF-RSPE still has the ability to reconcile the data in the event of a fault. The change of f not only affects k T  , but also the measurement of the total concentration of live polymers p C . The comparison of the reconciled results of measurement p C is shown in Figure 11; p C undergoes a direct change when s fault occurs indicating that f has a large effect on p C . The UKF-RSPE can reconcile the measurements quickly, while the traditional UKF-SPE can only track the measurements slowly. The measurement error of the UKF-RSPE is smaller than the measurement and the measurement of UKF-SPE, as shown in Figure 11b.
To further quantify the effect of UKF-RSPE, the statistical information of estimated results is listed in Table 5. Compared with the traditional UKF-SPE, the mean square error (MSE) of state estimation is reduced from 1.51 × 10 −6 to 8.67 × 10 −7 ; and the MSE of parameter estimation is reduced from 7.09 × 10 −3 to 2.08 × 10 −4 . The MSE of the measurement data is 2.49 × 10 −1 , and the traditional UKF-SPE not only fails to correct the measurements, but also increases the MSE to 1.03. The UKF-RSPE can reconcile the measurements and reduce the MSE to 8.58 × 10 −2 . Therefore, the proposed UKF-RSPE tracks the parameter change faster and can achieve more accurate state and parameter estimation.      To further quantify the effect of UKF-RSPE, the statistical information of estimated results is listed in Table 5. Compared with the traditional UKF-SPE, the mean square error (MSE) of state estimation is reduced from 1.51 × 10 −6 to 8.67 × 10 −7 ; and the MSE of parameter estimation is reduced from 7.09 × 10 −3 to 2.08 × 10 −4 . The MSE of the measurement data is 2.49 × 10 −1 , and the traditional UKF-SPE not only fails to correct the measurements, but also increases the MSE to 1.03. The UKF-RSPE can reconcile the measurements and reduce the MSE to 8.58 × 10 −2 . Therefore, the proposed UKF-RSPE tracks the parameter change faster and can achieve more accurate state and parameter estimation. The reaction rate constant of the propagation reaction k p,0 and the termination reaction k t,0 are assumed to be uncertain parameters. With the parameters included, the state vector and the state equations are expanded to where ς p,k−1 and ς t,k−1 are the parameter noises with the standard deviation of 10 −6 . Under normal conditions, the parameter values are set to be k p,0 = 1.00 × 10 7 kmol·m −3 ·s −1 , k t,0 = 1.25 × 10 7 kmol·m −3 ·s −1 . When a fault occurs, the parameters change to be k p,0 = 1.50 × 10 7 kmol·m −3 ·s −1 , k t,0 = 0.6 × 10 7 kmol·m −3 ·s −1 at time step 300.
The comparison results of SPE are shown in Figures 12-16. In this case, the simultaneous change of both parameters has a dramatic effect on the state estimation. In Figure 12, the temperature of the reactor T k estimated by traditional UKF-SPE changes abruptly and UKF-SPE takes longer time to track the true state. The proposed UKF-RSPE can rapidly estimate the true state and improve the accuracy of state estimation. Figures 13 and 14 compare the estimated results of parameters k p,0 and k t,0 , respectively. For k t,0 , UKF-RSPE maintains its excellent performance in the case with single parameter, as shown in Figure 14a. However, for k p,0 , although UKF-RSPE tracks the true parameter faster compared to UKF-SPE, it still takes more than 150 time steps due to the interplay between multiple parameters when they are estimated simultaneously. There is also some fluctuation after tracking the true parameters until the parameter detection is judged to be true. Fluctuations in the vicinity of the true parameters have small effects on the state estimation and measurement reconciliation, so they can be ignored and the estimated parameters can be considered as true parameters. Figure 15 shows the comparison of the reconciled results of measurement T k ; UKF-RSPE can reconcile the measurements and reduce the errors of measurements, which greatly improves on the accuracy of traditional UKF-SPE. Figure 16 shows the comparison of the reconciled results of measurement C p , a sudden change occurred at the time of the fault, both the traditional UKF-SPE and UKF-RSPE are able to reconcile the measurements, the errors of UKF-RSPE are smaller.
To further quantify the effect of UKF-RSPE, the statistical information of estimated results is listed in Table 6. Compared with the traditional UKF-SPE, the MSEs of state estimation and parameter estimation are reduced from 7.17 × 10 −6 and 4.53 × 10 −2 , respectively, to 9.20 × 10 −7 and 6.04 × 10 −3 . The MSE of the measurement data is 2.59 × 10 −1 and the MSE of the measurements reconciled by UKF-RSPE is reduced to 2.35 × 10 −1 . In summary, the proposed UKF-RSPE can track all the parameters changes faster not only in the case with single parameter but also in the case with different combinations of multiple parameters changes. The proposed UKF-RSPE can achieve more accurate state and parameter estimates and has stronger robustness. tively, to 9.20 × 10 −7 and 6.04 × 10 −3 . The MSE of the measurement data is 2.59 × 10 −1 and the MSE of the measurements reconciled by UKF-RSPE is reduced to 2.35 × 10 −1 . In summary, the proposed UKF-RSPE can track all the parameters changes faster not only in the case with single parameter but also in the case with different combinations of multiple parameters changes. The proposed UKF-RSPE can achieve more accurate state and parameter estimates and has stronger robustness.     The proposed UKF-based robust SPE is not limited to free radical polymerization of styrene, it can be applied to other radical polymerization processes. The free radical polymerization of styrene described in this section is just one case of the application of UKF-based robust SPE. UKF is a model-based approach, and by changing the mathematical model, it can be applied in the case of other radical polymerization processes. How-  The proposed UKF-based robust SPE is not limited to free radical polymerization of styrene, it can be applied to other radical polymerization processes. The free radical polymerization of styrene described in this section is just one case of the application of UKF-based robust SPE. UKF is a model-based approach, and by changing the mathematical model, it can be applied in the case of other radical polymerization processes. How-  The proposed UKF-based robust SPE is not limited to free radical polymerization of styrene, it can be applied to other radical polymerization processes. The free radical polymerization of styrene described in this section is just one case of the application of UKF-based robust SPE. UKF is a model-based approach, and by changing the mathematical model, it can be applied in the case of other radical polymerization processes. However, when the UKF-based robust SPE is applied to other radical polymerization processes, the mathematical models of other radical polymerization processes need to be obtained firstly. In general, the chemical reaction is complicated, and it may be difficult to derive the accurate mathematical model of the chemical reaction. Therefore, a characteristic of UKF is model-driven. Based on being model-driven, it can be used in other radical polymerization processes.

Conclusions
In this work, the SPE problem of the free radical polymerization of styrene with variable parameters was studied, given that there are uncertain parameters in the mechanistic model. When the reaction conditions are switched, or the reaction process generates faults, the parameters will change. Due to the limitation of traditional UKF-SPE in detecting and fast-tracking changes in model parameters, this paper proposed a UKF-based robust SPE method, which establishes a moving window and introduces a hypothesis-test-based parameter testing criterion within the window to detect whether the parameters have changed. Based on the detection results, the gradient descent method which adaptively modifies the learning rate is used to modify the parameters to accelerate the tracking of the parameters, and to obtain more accurate parameters and states. The proposed UKF-based robust SPE is applied to the simulation study of the free radical polymerization of styrene using the mathematical model of dynamics of polymerization in a jacketed continuous stirred tank reactor. The model is based on the reaction mechanism and describes the dynamics of the actual free radical polymerization of styrene. The experimental results show that the proposed UKF-based robust SPE can quickly track the parameter changes and achieve more accurate state and parameter estimation with stronger robustness.