State Estimation of Linear and Nonlinear Dynamic Systems Part II: Observability and Stability James B. Rawlings and Fernando V. Lima Department of Chemical and Biological Engineering University of Wisconsin Madison AICES Regional School RWTH Aachen March 0, 2008 Rawlings and Lima (UW) Observability and Stability AICES / 25 Outline Observability and Detectability Illustrative Example 2 Stability of State Estimator 3 Obtaining Covariances from Data 4 Conclusions 5 Additional Reading Rawlings and Lima (UW) Observability and Stability AICES 2 / 25
Observability Property Consider the linear system (A, C) with n measurements Y (n ) x( + ) = Ax() y() =Cx() Y (n ) = {y(0), y(),..., y(n )} in which A R n n and C R p n Definition (Observability) (A, C) is observable if these n measurements uniquely determine the system s initial state x(0). Observability is a property of the deterministic model equations Rawlings and Lima (UW) Observability and Stability AICES 3 / 25 Observability Matrix For the n measurements, the system model gives y(0) C y() CA. y(n ) =. CA n } {{ } O x(0) in which O R np n is the Observability Matrix (A, C) is observable if and only if ran(o) =n Rawlings and Lima (UW) Observability and Stability AICES 4 / 25
Observability and Canonical Forms For the linear system x = A x + y = [ C ] x Find a similarity transformation T : [ ] [ ] z T [ ] = x à = TAT, C = CT z 2 T 2 Rawlings and Lima (UW) Observability and Stability AICES 5 / 25 Canonical Forms: Observable and Unobservable Modes So the transformed system has the following canonical form [ ] [ ] [ ] z à 0 z = z 2 + à 2 à 22 z 2 }{{} ea [ ] [ ] z y = C 0 }{{} z 2 ec where (Ã, C ) is observable In this structure z are the observable modes z 2 are the unobservable modes however, the system is still detectable if λ( e A 22 ) Rawlings and Lima (UW) Observability and Stability AICES 6 / 25
Detectability Property Definition (Detectability) A linear system is detectable when all the unobservable modes are stable This property is important for partially observable systems An observable system is also detectable The property of detectability is important for control because one may successfully design a control system for an unobservable but detectable system so as to estimate and control the unstable modes. Advanced Process Control. W.H. Ray, 98. Rawlings and Lima (UW) Observability and Stability AICES 7 / 25 Illustrative Example: CSTR Reactor (Ray, 98) Reaction: A B C Controlled variables: C A, C B A, B C Af, C Bf Manipulated variables: C Af, C Bf State variables: dimensionless concentrations - x (C A ), x 2 (C B ) Input variables: dimensionless feeds - u (C Af ), u 2 (C Bf ) A, B, C C A, C B A B C [ẋ ] [ ] A 0 = ẋ 2 A 2 A 3 }{{} A y = Cx [ x x 2 ] [ ] 0 + 0 }{{} B [ u u 2 ] in which A, A 2, A 3 0 are constants Rawlings and Lima (UW) Observability and Stability AICES 8 / 25
Solution for 2 Cases Only x is measured C = [ 0 ] O = [ ] 0 ran(o) = A 0 Unobservable system! But it is still detectable: λ(a) < 0 (continuous system) 2 Only x 2 is measured [ ] C = 0 [ ] 0 O = ran(o) =2 A 2 A 3 Completely observable system! Rawlings and Lima (UW) Observability and Stability AICES 9 / 25 Example Remars A B 2 C r = C A r 2 = 2 C B Physical Reasons CB depends on both C A and C B CA is independent of C B 2 Consequences By measuring x2 (C B ) and nowing u, x (C A ) can be determined By measuring x (C A ) and nowing u, x 2 (C B ) can tae any value Rawlings and Lima (UW) Observability and Stability AICES 0 / 25
Deterministic Stability of State Estimator Definition (Asymptotic Stability of the State Estimator) The estimator is asymptotically stable in sense of an observer if the estimator is able to recover from the incorrect initial value of state as data with no measurement noise are collected. x initial estimate Estimator System For example: assume an incorrect initial estimate the estimator converges (asymptotically) to the correct value Litmus Test Rawlings and Lima (UW) Observability and Stability AICES / 25 State estimation: probabilistic optimality versus stability Kalman filtering was first publicly presented (to somewhat more than polite applause) on April, 959. But please note: Kalman filtering is not a triumph of applied probability: the theory has only a slight inheritance from probability theory while it has become an important pillar of system theory. R. Kalman, 994 As Kalman has often stressed the major contribution of his wor is not perhaps the actual filter algorithm, elegant and useful as it no doubt is, but the proof that under certain technical conditions called controllability and observability, the optimum filter is stable in the sense that the effects of initial errors and round-off and other computational errors will die out asymptotically. T. Kailath, 974 Rawlings and Lima (UW) Observability and Stability AICES 2 / 25
State Estimation: Optimality does not Ensure Stability For the linear system x( + ) = Ax() y() =Cx() Consider the case when A = I, C =0 Optimal estimate is x() =x(0) (for a chosen initial condition) Estimator does not converge to the true state x(0) unless we have lucily chosen x(0) = x(0) Unobservable (and undetectable) system Rawlings and Lima (UW) Observability and Stability AICES 3 / 25 Cost Convergence and Stability Lemmas Lemma (Convergence of estimator cost) Given noise-free measurements Y (T ), the optimal estimator cost Φ 0 (Y (T )) converges as T increases, regardless of the system observability. Lemma (Estimator stability - convergence to the true state) For (A, C) observable and Q, R > 0 (positive definite), the optimal linear state estimator is asymptotically stable x(t ) x(t ) as T Rawlings and Lima (UW) Observability and Stability AICES 4 / 25
Obtaining Q and R from Data X D X X 2 Condenser v y Model discretized with t = t: x + = f (x, u )+g(x, u )w [ ] [ ] [ ] y 0 v y 2 = x 0 + v 2 X f, F f w v 2 y 2 X N X B Reboiler Measurements are only X D, X B at the discretization times Noise w affects all the states Noise v corrupts the measurements Rawlings and Lima (UW) Observability and Stability AICES 5 / 25 Motivation for Using Autocovariances X f, F f w X D X X 2 X N X B Condenser v y Idea of Autocovariances The state noise w gets propagated in time The measurement noise v appears only at the sampling times and is not propagated in time Taing autocovariances of data at different time lags gives covariances of w and v v 2 y 2 Reboiler Let w, v have zero means and covariances Q and R Rawlings and Lima (UW) Observability and Stability AICES 6 / 25
Mathematical Formulation of the ALS Linear State-Space Model: x + = Ax + Gw w N(0, Q) y = Cx + v v N(0, R) Model (A, C, G) nown from the linearization, finite set of measurements: {y 0,..., y } given. Only unnowns are noises w and v. y = Cx + v y + = CAx + CGw + v + y +2 = CA 2 x +CAGw +CGw + +v +2 E[y y T ]=R E[y +2 y T + ]=CAGQG T C T Rawlings and Lima (UW) Observability and Stability AICES 7 / 25 The Autocovariance Least-Squares (ALS) Problem Sipping a lot of algebra, we can write: Autocovariance Least Squares [ ] Φ = min Q,R A (Q)s N ˆb (R) s 2 A least-squares problem in a vector of unnowns, Q, R 2 Form A N from nown system matrices 3 ˆb is a vector containing the estimated correlations from data ˆb = y T y T T. = y +N y T s Rawlings and Lima (UW) Observability and Stability AICES 8 / 25
What about this idea? Our new proposal! Choose a suboptimal state estimator gain L and apply state estimation to {y } to obtain preliminary { x }. Obtain estimates of w and v from Gŵ = x + A x ˆv = y C x Obtain estimates of Q and R from sample variances! Q = T T = ŵ ŵ T R = T T T ˆv ˆv = Rawlings and Lima (UW) Observability and Stability AICES 9 / 25 The bad news... Unfortunately an estimate is not the same as the true noise G QG T = AL(CSC T + R)L T A T GQG T R = CSC T + R R in which S satisfies the Lyapunov equation S =(A ALC)S(A ALC) T + GQG T + ALRL T A T Rawlings and Lima (UW) Observability and Stability AICES 20 / 25
Maybe they are close? Example: 0.04 0.99 0.5 T.30 A = 0.3 0.6 0.48 C = 0.50 0.02 0.8 0.74 0.05 0.5 0.00 G = 0.00 0.92 Q =0.I R =0. 0.30 0.00 4 3 2 y() 0 - -2-3 -4 0 200 400 600 800 000 p(v) w 2.4.2 0.8 0.6 0.4 0.2 0 0.5 0-0.5 N(0, R) -.5 - -0.5 0 0.5.5 v 95% N(0, Q) - - -0.5 0 0.5 w ŵ ˆv Rawlings and Lima (UW) Observability and Stability AICES 2 / 25 Comparison of Results True values: [ ] 0.0 0.00 Q =, R =0.0 0.00 0.0 Using ŵ, ˆv samples: [ ] 0.07 0.04 Q =, 0.04 0.02 R =0.32 p(v).4.2 0.8 0.6 0.4 0.2 0 0.5 ALS Result (0000 points) R R als -.5 - -0.5 0 0.5.5 v ALS Result (0000 points) Using ALS: [ ] 0.08 0.00 Q als =, 0.00 0.3 R als =0.08 w 2 0-0.5 - Q als - -0.5 0 0.5 w Q Rawlings and Lima (UW) Observability and Stability AICES 22 / 25
Still more bad news If you were lucy and somehow guessed (or estimated) the optimal L for processing the data... Optimal Pre-filtering of the measurements Still incorrect Q, R G QG T = AL(CP C T + R)L T A T R = CP C T + R R GQG T in which P satisfies the filtering Riccati equation P = GQG T + AP A T AP C T (CP C T + R) CP A T Rawlings and Lima (UW) Observability and Stability AICES 23 / 25 Conclusions Today we have learned... Concepts of observability and detectability of linear systems Illustrated through chemical reactor example Introduction to State Estimator Stability Stability versus optimality Cost convergence and estimator stability lemmas Obtaining Covariances from Data Separating effects of Q and R in measurement y Autocovariance Least-Squares (ALS) technique to estimate Q and R Rawlings and Lima (UW) Observability and Stability AICES 24 / 25
Additional Reading C.-T. Chen. Linear System Theory and Design. Oxford University Press, 3rd edition, 999. A. H. Jazwinsi. Stochastic Processes and Filtering Theory. Academic Press, New Yor, 970. B. J. Odelson, A. Lutz, and J. B. Rawlings. The autocovariance least-squares methods for estimating covariances: Application to model-based control of chemical reactors. IEEE Ctl. Sys. Tech., 4(3):532 54, May 2006a. B. J. Odelson, M. R. Rajamani, and J. B. Rawlings. A new autocovariance least-squares method for estimating noise covariances. Automatica, 42(2):303 308, February 2006b. URL http://www.elsevier.com/locate/automatica. M. R. Rajamani and J. B. Rawlings. Estimation of the disturbance structure from data using semidefinite programming and optimal weighting. Accepted for publication in Automatica, September, 2007. M. R. Rajamani, J. B. Rawlings, and T. A. Soderstrom. Application of a new data-based covariance estimation technique to a nonlinear industrial blending drum. Submitted for publication in IEEE Transactions on Control Systems Technology, October, 2007. W. H. Ray. Advanced Process Control. McGraw-Hill, New Yor, 98. Rawlings and Lima (UW) Observability and Stability AICES 25 / 25