epartment of Biochemical and Chemical Engineering Process ynamics Group () onlinear State Estimation Methods Overview and Polymerization Paul Appelhaus Ralf Gesthuisen Stefan Krämer Sebastian Engell The first author is now CEO of Appelhaus Miniplants Lindewerra the second and the third authors are with IEOS Köln Germany PSE Summer School Salvador da Bahia 20 Process ynamics
Outline Introduction Approaches to nonlinear state estimation polycondensation Multirate estimation Conclusions onlinear state estimation: Process ynamics
Introduction Important product qualities are not measureable online but they are needed for control purposes. Measurements are often available at different sampling intervals. Analytic measurements cause time delays. State estimation can provide additional online information. umerous approaches are available: Which one should be applied? How can offline analyses be incorporated in state estimation? Blac Bo Modelling (eural ets ) Etended approaches are necessary to consider measurements with different sampling intervals. onlinear state estimation: Process ynamics
Introduction: Application of State Estimation sampled measurements manipulated variables Process? Sensors noise infrequent measurements noise frequent measurements Estimator delay state and parameter estimates onlinear state estimation: Process ynamics
onlinear State Estimation Basic principle of state estimation manipulated variables disturbances? Process disturbances Sensors measurements depends on the design method ( u t) f correction process model estimated states sensor model - y h( ) state estimator onlinear state estimation: Process ynamics
Approaches to onlinear State Estimation Process model is given as OE-system or system of difference equations f u t y F u t y y h ( ) ( ) ( ) y H ( ) The estimator must fulfill: Simulation condition: if ( t t0 ) ( t t 0 ) then Convergence condition: ( ) ( ) 0 ( ( t) ( t) ) 0 lim t for all inputs u(t) and for all inital errors. t t t > t onlinear state estimation: Process ynamics
Theory: Assume a linear system: Observability A Bu y C with R n The state variables of the system (A C) can be divided into two groups: - Observable states: The error dynamics can be prescribed arbitrarily by choice of the observer gains and are independent of the states and the nown inputs. - Unobservable states: the error dynamics are given by the (unobservable) eigenvalues of the system. efinition: A linear system is said to be observable if the matri Q [C T A T C T (A T ) 2 C T... (A T ) n- C T ] has ran n. In this case all states are observable. y R p onlinear state estimation: Process ynamics
Observability of onlinear Systems Theory: Assume a nonlinear system: ( u) y h( ) f efinition: A nonlinear system is said to be globally observable if all initial states 0 X 0 can be computed from observations of the output y(t) over an arbitrary interval of time. The states are then called observable. efinition: A nonlinear system is said to be locally observable at X 0 if initial states 0 X 0 in the neighborhood of are observable. To chec global observability a unique solution for the nonlinear observability map has to be found. Local observability can be checed using the linearized model (see conditions for linear models). onlinear state estimation: Process ynamics
State and Parameter Estimation Observers can be etended to the estimation of unnown process parameters. The parameters are assumed to be additional state variables with dummy dynamics. f ( u p ) p 0 Observability in general becomes worse if more parameters must be estimated. The number of unnown parameters which can be estimated is restricted by the number of measurements! onlinear state estimation: Process ynamics
Approaches to onlinear State Estimation Gain Scheduled Observer (Luenberger observer with gains that depend on the estimated states and the inputs) Observer equations: ~ f ( u) f ( u) K( u) ( y h( )) K( u) calculated by eigenvalue placement for linearized error dynamics f h λ i I K λidesired u u Low effort for design Performance and stability only are guaranteed close to a fied (slowly varying) operating point. onlinear state estimation: Process ynamics
Approaches to onlinear State Estimation Sliding Mode Observer: For nonlinear systems of the form: Ψ A α( y u) EΨ( u) ( 0) w ( u) R with Ψ( u) ρ( u) y C and 0 y R m Measured nonlinearity R Bounded nonlinearities not measured umber of measurements number of unmeasured nonlinearities Ψ( u) Observer equation: ( ) ( ) ( y C ) A α y u ρ u E G y C 0 y C PG are weighting matrices which have to be determined in an iterative manner (an implicit Lapunov equation has to be solved). n ( ) ( ) 0 onlinear state estimation: Process ynamics
Sliding Mode Observer Properties of the SMO: Large effort for design Guaranteed global stability Convergence in 2 steps: y C 0. Movement to the switching plane:. 2. Sliding on the switching plane until the desired state is reached. switching line is reached in finite time ~ 2 sliding mode on switching line with eponential convergence ~2 0 ~ ~ t 0 ( t ) onlinear state estimation: switching line y ~ 0 Process ynamics
Etended Kalman Filter Etension of the model equations by stochastic errors (zero mean and given variance) f ( u t) y h( ) ω Filter minimizes the variance of the estimation error: {( ) ( )} T T E E{ ~ ~ } Min For nonlinear time discrete (sampled) systems the solution is a 2-step-algorithm: Correction of the predicted states and estimated covariance matri {( )( ) } T T P E i i i i E{ ~ ~ ii } after a new measurement was obtained Prediction of the states and the covariance matri of the estimation error up to the net time step by nonlinear forward simulation onlinear state estimation: Process ynamics
onlinear state estimation: Process ynamics EKF Algorithm otation: Estimated state at tt based on measurements up to tt Correction: Prediction: Constraints on states and disturbances cannot be considered. Only (at best) local stability! The critical part is the update of the covariance matri based on the linearized state equations. ( ) ( ) ( ) ( ) T T P H K I P h y K R H P H H P K ( ) T h H f A Q A P A P u F and with
onlinear state estimation: Process ynamics Batch Estimation Suppose values of the process inputs and of the measured variables are available. Then the estimation of the corresponding states can be formulated as an optimization problem: In this formulation there are no assumptions on the statistics of the errors. o linearization is performed! onlinear optimization problem! Computational effort increases with reduce to a finite horizon! ϕ ϕ Ψ ϕ T T T R Q P 0 0 0 min ( ) ( ) h y u F 0 00 0 ϕ GB: Subect to
Moving Horizon State Estimation Further motivation for a deterministic observer based on numerical optimization: Possiblity of imposing constraints on states and disturbances Moving Horizon Estimator (MHE): Taes measurements over a finite horizon in the past into account o approimation of the nonlinear system within this horizon Model: iscrete-time nonlinear system y F h ( u ) ( ) ϕ onlinear state estimation: Process ynamics
onlinear state estimation: Process ynamics Moving Horizon State Estimator The Moving Horizon Estimator can be formulated as: ( ) ( ) ma min ma min ma min.:. min h y u F R Q P Ψ T T T s t ϕ ϕ ϕ ϕ ϕ ϕ ϕ ϕ Minimize the error Model equations Physical or other constraints
onlinear state estimation: Process ynamics Constrained Etended Kalman Filter (CEKF) ( ) T T R P 0 min ϕ ϕ Ψ ϕ For a horizon of 0 the MHE becomes the Constrained EKF CEKF equations: Quadratic problem for linear measurement function ( ) h y ϕ equal. constr. subect to ( ) T h H f A Q A P A P u F and with plus additional constraints on errors and states
Case-Study: Polycondensation of PET Polycondensation of polyethylenterephtalate (PET) The mass transfer of a reaction byproduct from the melt to the gas phase determines the progress of the polycondensation process. o measurements of mass transfer coefficients under industrial process conditions available Process realized in a aceted 0 l stainless steel reactor controlled by a CS (Contronic-P ABB) nitrogen wa ter water reactor sample heatingsystem vacuumsystem onlinear state estimation: Process ynamics
PET Polycondensation Batch process polymerization in the melt Main chemical reaction: 2 2 2 2 2 2 2 2 2 2 2 2 The reverse reaction is 8 times faster than the forward reaction The removal of ethyleneglycol (EG) determines the speed of the polymerization onlinear state estimation: Process ynamics
Main and side reactions: PET Polycondensation -[OH] -[OH] -[E]- EG (polymerisation) -[E]- -[COOH] -[CO 2 C 2 H 3 ] (thermal degradation) -[COOH] EG -[OH] H 2 O -[COOH] -[OH] -[E]- H 2 O -[OH] -[COOH] CH 3 CHO -[CO 2 C 2 H 3 ] -[OH] -[E]- CH 3 CHO Mathematical modelling yields a system of differential equations for the concentrations of hydroy group -[OH] ethylene glycol EG carboyl group -[COOH] acetaldehyde CH 3 CHO vinyl group -[CO 2 C 2 H 3 ] ester group -[E] and water H 2 O onlinear state estimation: Process ynamics
Model Reduction Model of 7 th order too comple several unnown mass transfer parameters Simplification by: eglecting the side reactions Estimation of the thermal degradation by steady state assumption as this reaction has slow dynamics compared to the main reaction Resulting model of 3 rd order includes dynamics of Concentrations of hydroygroup -[OH] and ethylene glycol EG and A parameter which characterizes the mass transfer of EG: β a onlinear state estimation: Process ynamics
Estimation Problem Available data: Measurements of temperature stirrer torque stirrer speed pressure Problems: Online measurement of the degree of polymerisation not possible Removal of the volatile reactionproduct ethylene glycol crucial but no infomation on the mass transfer coefficient is available Solution Computation of the degree of polymerisation based on available process data esign of an estimator based on a simple reaction model for - concentration of the most important end groups - mass transfer coefficient for the removal of ethylene glycol onlinear state estimation: Process ynamics
Eample: PET-Poly-Condensation Computation of the degree of polymerization Inputs: Temperature stirrer torque stirrer speed a) Semi-empirical model 2 M 7000 Pn C ep a n T Parameters C C 2 and a calculated by nonlinear regression from data of analysis of samples b) eural net Inputs: Ratio of stirrer torque and stirrer speed temperature Output: egree of polymerisation Training data: Laboratory analysis of samples C onlinear state estimation: Process ynamics
Estimation of the egree of Polymerization 00 90 80 70 P n [-] 60 50 40 30 20 0 measurements (offline) semi empirical model neural net 0 0 50 00 50 time [min] onlinear state estimation: Process ynamics
Simplified model: EG OH PET Polycondensation Model βa( 2 OH EG 8 * EG EG ) 2 Ema 2 OH 2 8 OH EG Ema 2 OH βa 0 Measurement equation: OH where f P M M y ( ) OH n EG E Goal: Estimation of the mass transfer coefficient in order to find dependencies on process conditions (stirrer speed temperature) onlinear state estimation: Process ynamics
Thesis by Paul Appelhaus Results after careful tuning EKF Parameters: onlinear state estimation: Process ynamics
Comparison EKF-MHE Simulation 20 % initial error in all states Constraints: EG 0 OH 0 βa 0 better convergence of the MHE onlinear state estimation: Process ynamics
Comparison EKF-MHE MHE (3) eperimental data constraints EG 0 OH 0 βa 0 onlinear state estimation: Process ynamics
Results PET Polycondensation Comparison EKF - MHE (3) eperimental data onlinear state estimation: Process ynamics
Estimation of the Mass Transfer Coefficient ifferent estimation methods gave similar results. Additional information about the process is provided. Estimation results enabled to improve process operation. evelopment of improved traectories of stirrer speed and reaction temperature Result: reduction of batch time by 0-5 % onlinear state estimation: Process ynamics
Summary EKF vs. MHE vs. CEKF EKF: Simple Often good results Tuning is not straightforward requires insight and trialand-error Instability may occur MHE: Uses full nonlinear model better convergence Constraints on states and disturbances can be imposed umerically demanding Tuning also an issue CEKF: Good compromise between performance and effort onlinear state estimation: Process ynamics