Chapter 3 Controllability and Observability In this chapter, we study the controllability and observability concepts. Controllability is concerned with whether one can design control input to steer the state to arbitrarily values. Observability is concerned with whether without knowing the initial state, one can determine the state of a system given the input and the output. 3.1 Some linear mapping concepts The study of controllability and observability for linear systems essentially boils down to studying two linear maps: the reachability map Lr which maps, for zero initial state, the control input u(·) to the final state x(t1 ); and the observability map, Lo which maps, for zero input, from the initial state x(t0 ) to the output trajectory y(·). The range and the null spaces of these maps respectively are critical for their studies. Let L : X (= ℜp ) → Y(= ℜq ) be a linear map: i.e. L(αx1 + βx2 ) = α(Lx1 ) + β · (Lx2 ) R(L) ⊂ Y denotes the range of L, given by: R(L) = {y ∈ Y|y = Lx for some x ∈ X } N (L) ⊂ X denotes the null space of L, given by: N (L) = {x ∈ X |Lx = 00} Note: Both R(L) and N (L) are linear subspaces, i.e. for scalar α, β, y1 , y2 ∈ R(L) ⇒ (αy1 + βy2 ) ∈ R(L) x1 , x2 ∈ N (L) ⇒ (αx1 + βx2 ) ∈ R(L) • L is called onto or surjective if R(L) = Y (everything is within range). • L is called into or one-to-one (cf. many-to-one) if N (L) = {0}. Thus, Lx1 = Lx2 ⇔ x1 = x2 27 c Perry Y.Li 28 3.1.1 The Finite Rank Theorem Proposition 3.1.1 : Let L ∈ ℜn×m , so that L : u ∈ ℜm 7→ y ∈ ℜn . 1. R(L) = R(LLT ) 2. N (L) = N (LT L) 3. Any point u ∈ ℜn can be written as u = LT y1 + un ∈ ℜn ; where y1 ∈ ℜn , Lun = 0. In other words, u can always be written as a sum of u1 ∈ R(LT ) and un ∈ N (L). 4. Similarly, any point u ∈ ℜn can be written as y = Lu1 + yn ∈ ℜn ; where u1 ∈ ℜm , LT yn = 0. In other words, u can always be written as a sum of y1 ∈ R(L) and yn ∈ N (LT ). Note: • If L ∈ ℜn×m and m > n (short and fat), then LLT ∈ ℜn×n is both short and thin. • To check whether the system is controllable we need to check if LLT is full rank - e.g. check its determinant. • If m < n (tall and thin), then LT L ∈ ℜn×n is also both short and thin. • Checking N (LT L) will be useful when we talk about observerability. 3.2 Controllability Consider a state determined dynamical system with a transition map s(t1 , t0 , x0 , u(·)) such that x(t1 ) = s(t1 , t0 , x(t0 ), u(·)). This can be continuous time or discrete time. Definition 3.2.1 (Controllability) : The dynamical system is controllable on [t0 , t1 ] if ∀ initial and final states x0 , x1 , ∃u(·) so that s(t1 , t0 , x0 , u) = x1 . It is said to controllable at t0 if ∀x0 , x1 , ∃t1 ≥ t0 and u(·) ∈ U so that s(t1 , t0 , x0 , u) = x1 A system that is not controllable probably means the followings: • If state space system is realized from input-output data, then the realization is redundant. i.e. some states have no relationship to either the input or the output. • If states are meaningful (physical) variables that need to be controlled, then the design of the actuators are deficient. • The effect of control is limited. There is also a possibililty of instability ME 8281:Advanced Control Systems, F01, F02, S06, S08 29 Remarks: • The followings are equivalent: 1. A system is controllable at t = t0 . 2. The system can be transferred from any state at t = t0 to any other state in finite time. 3. For each x0 ∈ Σ, s(·, t0 , x0 , ·) : [t0 , ∞) × u(·) 7→ s(t1 , t0 , x0 , u(·)) is surjective (onto). • Controllability does not say that x(t) remains at x1 . e.g. for ẋ = Ax + Bu to make x(t) = x1 ∀t ≥ t0 , it is necessary that Ax1 ∈ Range(B). This is generally not true. Example - An Uncontrollable System • An linear actuator pushing 2 masses on each end of the actuator in space. m1 ẍ1 = u; m2 ẍ2 = −u • State: X = [x1 , ẋ1 , x2 , ẋ2 ]T . • Action and reaction are equal and opposite, and act on different bodies. • Momentum is conserved: m1 ẋ1 + m2 ẋ2 = constant = m1 ẋ1 (t0 ) + m2 ẋ2 (t0 ) • E.g. if both masses are initially at rest: it is not possible to choose u(·) to make ẋ1 = 0, ẋ2 = 1. 3.2.1 Effects of feedback on controllability Consider a system ẋ = f (t, x(t), u(t)). Suppose that the system is under memoryless (static) state feedback: u(t) = v(t) − g(t, x(t)) with v(t) being the new input. • A system is controllable if and only if the system under memoryless feedback with v(t) as the input is controllable. c Perry Y.Li 30 Proof: Suppose that the original system is controllable. Given a pair of initial and final states, x0 and x1 , suppose that the control u(·) transfers the state from x0 at t0 to x1 at t1 . For the new system, which has also x(t) as the state variables, we can use the control v(t) = u(t) + g(t, x(t)) to transfer the state from x0 at t0 to x1 at t1 . Therefore, the new system is also controllable. Suppose that the feedback system is controllable, and v(·) is the control that can achieve the desired state transfer. Then for the original system, we can use the control u(t) = v(t) − g(t, x(t)) to achieve the same state transfer. Thus, the original system is also controllable. ⋄ Consider now the system under dynamic state feedback: ż(t) = α(t, x(t), z(t)) u(t) = v(t) − g(t, x(t), z(t)) where v(t) is the new input and z(t) is the state of the controller. • If a system under dynamic feedback is controllable then the original system is. • The converse is not true, i.e. the original system is controllable does not necessarily imply that the system under dynamic state feedback is. Proof: The same proof for the memoryless state feedback works for the first statement. For the second statement, we give an example of the controller: u(t) = v(t) − g(t, x(t), z(t)). ż = z; The state of the new system is (x, z) but no control can affect z(t). Thus, the new system is not controllable. ⋄ These results show that feedback control cannot make a uncontrollable system become controllable, but can even make a controllable system, uncontrollable. To make a system controllable, one must redesign the actuators. 3.3 Controllability of Linear Systems Continuous time system: ẋ(t) = A(t)x(t) + B(t)u(t) x ∈ ℜn Z t1 Φ(t1 , t)B(t)u(t)dt. x(t1 ) = Φ(t1 , t0 )x0 + t0 The reachability map on [t0 , t1 ] is defined to be: Z t1 Lr,[t0 ,t1 ] (u(·)) = Φ(t1 , t)B(t)u(t)dt t0 Thus, it is controllable on [t0 , t1 ] if and only if Lr,[t0 ,t1 ] (u(·)) is surjective (onto). Notice that Lr,[t0 ,t1 ] determines the set of states that can be reached from the origin at t = t1 . The study of the range space of the linear map: Lr,[t0 ,t1 ] : {u(·)} → ℜn is central to the study of controllability. 31 ME 8281:Advanced Control Systems, F01, F02, S06, S08 Proposition 3.3.1 If a continuous time, possibly time varying, linear system is controllable on [t0 , t1 ] then it is controllable on [t0 , t2 ] where t2 ≥ t1 . Proof: To transfer from x(t0 ) = x0 to x(t2 ) = x2 , define x1 = Φ(t1 , t2 )x2 Suppose that u∗[t0 ,t1 ] transfers x(t0 ) = x0 to x(t1 ) = x1 . Choose ( u∗ (t) t ∈ [t0 , t1 ] u(t) = 0 t ∈ (t1 , t2 ] ⋄. ⋄ This result does not hold for t0 < t2 < t1 . e.g. The system ( 0 t ∈ [t0 , t2 ] ẋ(t) = B(t)u(t) B(t) = . In t ∈ (t2 , t1 ] is controllable on [t0 , t1 ] but x(t2 ) = x(t0 ) for any control u(·). 3.3.1 Discrete time system x(k + 1) = A(k)x(k) + B(k)u(k), x(k1 ) = Φ(k1 , k0 )x(k0 ) + kX 1 −1 x ∈ ℜn , u ∈ ℜm Φ(k1 , k + 1)B(k)u(k) k=k0 The transition function of the discrete time system is given by: x(k1 ) = s(k0 , k1 , x(k0 ), u(·)) = Φ(k1 , k0 )x(k0 ) + Φ(kf , ki ) = kX 1 −1 Φ(k1 , k + 1)B(k)u(k) k=k0 kf −1 Πk=ki A(k) (3.1) (3.2) The reachability map of the discrete time system can be written as: Lr,[k0 ,k1 ] (u(k0 ), . . . , u(k1 − 1)) = kX 1 −1 Φ(k1 , k + 1)B(k)u(k) = Lr (k0 , k1 )U k=k0 u(k0 ) .. where Lr (k0 , k1 ) ∈ ℜn×(k1 −k0 )m , U = . . u(k1 − 1) Thus, the system is controllable on [k0 , k1 ] if and only if Lr,[k0 ,k1 ] is surjective, which is true if and only if Lr (k0 , k1 ) has rank n Proposition 3.3.2 Suppose that A(k) is nonsingular for each k1 ≤ k < k2 , then the discrete time linear system is controllable on [k0 , k1 ] implies that it is controllable on [k0 , k2 ] where k2 ≥ k1 . Proof: : The proof is similar to the continuous case. However for a discrete time system, we need A(k) nonsingular for k1 ≤ k < k2 to ensure that Φ(k2 , k1 ) is invertible. Q.E.D. ⋄ c Perry Y.Li 32 Example Consider a unit point mass under control of a force: d x 0 1 x 0 = + u 0 0 ẋ 1 dt ẋ This is the same as ẍ = u. Suppose that x(0) = ẋ(0) = 0, we would like to translate the mass to x(T ) = 1, ẋ(T ) = 0. The reachability map L : u(·) → x(T ) is Z T x(T ) = Φ(T, t)B(t)u(t)dt 0 Let use try to solve this problem using piecewise constant control: u0 0 ≤ t < T /10 u1 T /10 ≤ t < 2T /10 u(t) = . .. u10 9T /10 ≤ t ≤ T and find U = [u1 , u2 , . . . , u10 ]T . The reachability map becomes: x(T ) = L1 | where "Z u1 u2 L2 . . . L10 . {z } .. Lr u10 # T T Φ(T, t)B(t)dt = L1 = , 10 1 0 # "Z 2T /10 T 0.9T Φ(T, t)B(t)dt = L2 = , 1 10 T /10 T /10 .. . L10 T 0.1T = 1 10 Whether the matrix denoted by Lr ∈ ℜ2×10 whether we can achieve our task using piecewise In our case, let T = 10 for convenience, 10 Lr = 1 and Lr LTr is surjective (onto) (i.e. R(Lr ) = ℜ2 determines constant control. 9 ... 1 1 ... 1 385 55 = 55 10 33 ME 8281:Advanced Control Systems, F01, F02, S06, S08 which is non-singular (full rank). Thus, from the finite rank theorem R(Lr ) = R(Lr LTr ), the particle transfer problem is solvable using piecewise constant control. If we make the number of pieces in the piecewise constant control larger and larger, then the multiplication of Lr by LTr becomes an integral: Lr LTr → Z t1 Φ(t1 , t)B(t)B(t)T Φ(t1 , t)T dt. t0 Therefore for the continuous time linear system is controllable over the interval [t0 , t1 ] if and only if the matrix, Z t1 Φ(t1 , t)B(t)B(t)T Φ(t1 , t)T dt (3.3) t0 is full rank. 3.4 Reachability Grammian The matrix Wr = Lr LTr ∈ ℜn×n is called the Reachability Grammian for the interval that Lr is defined. For the continuous time system ẋ = A(t)x + B(t)u the Reachability Grammian on the time interval [t0 , t1 ] is defined to be: Wr,[t0 ,t1 ] = Z t1 Φ(t1 , t)B(t)B(t)T Φ(t1 , t)T dt t0 For time invariant systems, Wr ([t1 , t0 ]) = = Z t1 Lr L∗r = Z eAτ BB T eA 0 eA(t1 −t) BB T eA T (t −t) 1 dt t0 Tτ dτ. t1 −t0 For the discrete time system, x(k + 1) = A(k)x(k) + B(k)u(k), the Reachability Grammian on the interval [k0 , k1 ] is kX 1 −1 Φ(k1 , k + 1)B(k)B(k)T Φ(k1 , k + 1)T . k=k0 From the finite rank theorem, we know that the controllability of a system on [t0 , t1 ] (or on [k0 , k1 ]) is equivalent to Reachability Grammian on the same time interval being full rank. c Perry Y.Li 34 3.4.1 Reduction theorem: Controllability in terms of Controllability to Zero Thus far, we have been deciding controllability by considering the reachability map Lr which concerns what states we are able to steer to from x(t0 ) = 0. The reduction theorem allows us to formulate the question in terms of whether a state can be steered to x(tf ) = 0 in finite time. Theorem 3.4.1 The followings are equivalent for a linear time varying differential system: ẋ = A(t)x + B(t)u 1. It is controllable on [t0 , t1 ]. 2. It is controllable to 0 on [t0 , t1 ], i.e. ∀x(t0 ) = x0 , there exists u(τ ), τ ∈ [t0 , t1 ) such that final state is x(t1 ) = 0. 3. It is reachable from x(t0 ) = 0, i.e. ∀ x(t1 ) = xf , there exists u(τ ), τ ∈ [t0 , t1 ) such that for x(t0 ) = 0, the final state is x(t1 ) = xf . Proof: • Clearly, (1) ⇒ (2) and (3). • To prove (2) ⇒ (1) and (3) ⇒ (1), use x(t1 ) = Φ(t1 , t0 )x(t0 ) + Z t1 Φ(t1 , τ )B(τ )u(τ )dτ. t0 and Φ(t1 , t0 ) is invertible, to construct the appropriate x(t0 ) and x(tf ). Controllability map: Lc,[t0 ,t1 ] The controllability (to zero) map on [t0 , t1 ] is the map between u(·) to the initial state x0 such that x(t1 ) = 0. Z t1 Lc,[t0 ,t1 ] (u(·)) = − Φ(t0 , t)B(t)u(t)dt t0 Proof: 0 = x(t1 ) = Φ(t1 , t0 )x0 + Z t1 Φ(t1 , τ )B(τ )u(τ )dτ t0 −1 x0 = −Φ(t1 , t0 ) x0 = − x0 = − Z t1 t0 Z t1 Z t1 Φ(t1 , τ )B(τ )u(τ )dτ t0 Φ(t0 , t1 )Φ(t1 , τ )B(τ )u(τ )dτ Φ(t0 , τ )B(τ )u(τ )dτ t0 Notice that R(Lc,[t0 ,t1 ] ) = Φ(t1 , t0 )R(Lr,[t0 ,t1 ] ) These two ranges are typically not the same for time varying systems. However, one is full rank if and only if the other is, since Φ(t1 , t0 ) is invertible. 35 ME 8281:Advanced Control Systems, F01, F02, S06, S08 For time invariant continuous time systems, R(Lc,[t0 ,t1 ] ) = R(Lr,[t0 ,t1 ] ). The above two statements are not true for time invariant discrete time systems. Can you find counter-examples? Because of the reduction theorem, the linear continuous time system is controllable on the interval [t0 , tf ] if R(Lc,[t0 ,t1 ] ) = ℜn . From the finite rank theorem, R(Lc,[t0 ,t1 ] ) = R(Lc,[t0 ,t1 ] L∗c,[t0 ,t1 ] ) = ℜn . The controllability-to-zero grammian on the time interval [t0 , t1 ] is defined to be: Z t1 Wc = Lc L∗c = Φ(t0 , t)B(t)B(t)T Φ(t0 , t)T dt t0 For time invariant system, Wc = Lc L∗c =− Z Z = 0 t1 eA(t0 −t) BB T eA T (t −t) 0 dt t0 e−Aτ BB T e−A Tτ dτ. t1 −t0 Since controllability of a system on [t0 , t1 ] is equivalent to controllability to 0 which is determined by the controllability map being surjective, it is also equivalent to controllability grammian on the same time interval [t0 , t1 ] being full rank. 3.5 3.5.1 Minimum norm control Formulation The Controllability Grammian is related to the cost of control. Given x(t0 ) = x0 , find a control function or sequence u(·) so that x(t1 ) = x1 . Let xd = x1 − Φ(t1 , t0 )x0 . Then we must have xd = Lr,[t0 ,t1 ] (u) where Lr,[t0 ,t1 ] : {u(·)} → ℜ is the reachability map which, for continuous time system is: Z t1 Lr,[t0 ,t1 ] (u) = Φ(t1 , t)B(t)u(t)dt. t0 and for discrete time system: Lr,[k0 ,k1 ] (u(·)) = kX 1 −1 Φ(k1 , k + 1)B(k)u(k) = C(k0 , k1 )U k=k0 u(k0 ) .. where C ∈ ℜn×(k1 −k0 )m , U = . . u(k1 − 1) Let us focus on the discrete time system. Since xd ∈ Range(Lr,[k0 ,k1 ] ) for solutions to exist, we assume Range(Lr,[k0 ,k1 ] ) = ℜn . This implies that Wr,[k0 ,k1 ] is invertible. Generally there are multiple solutions. To resolve the non-uniqueness, we find the solution so that k1 −1 1 X J(U ) = u(k)T u(k) = U T U 2 k=k0 is minimized. Here U = [u(k0 ); u(k0 + 1); . . . ; u(k1 − 1)]. c Perry Y.Li 36 3.5.2 Least norm control solution This is a constrained optimization problem (with J(U ) as the cost to be minimized, and Lr U −xd = 0 as the constraint). It can be solved using the Lagrange Multiplier method of converting a constrained optimization problem into an unconstrained optimization. Define an augmented cost function, with the Lagrange multipliers λ ∈ ℜn J ′ (U, λ) = J(U ) + λT (Lr U − xd ) The optimal given by (U ∗ , λ∗ ) must satisfy: ∂J ′ ∗ ∗ ∂J ′ ∗ ∗ (U , λ ) = 0; (U , λ ) = 0 ∂U ∂λ The second condition is just the constraint: Lr U = xd . This means that LTr λ∗ + U ∗ = 0; Lr U ∗ = xd Solving, we get: λ∗ = −(Lr LTr )−1 xd = −Wr−1 xd U ∗ = −LTr λ∗ = LTr Wr−1 xd . The optimal cost of control is: J(U ∗ ) = xTd Wr−1 Lr LTr Wr−1 xd = xTd Wr−1 xd Thus, the inverse of the Reachability Grammian tells us how difficult it is to perform a state transfer from x = 0 to xd . In particular, if Wr is not invertible, for some xd , the cost is infinite. 3.5.3 Geometric interpretation of least norm solution Geometrically, we can think of the cost as J = U T U , i.e. the inner product of U with itself. In notation of inner product, J =< U, U >R The advantage of the notation is that we can change the definition of inner product, e.g. < U, V >R = U T RV where R is a positive definite matrix. The usual inner (dot) product has R = I. We say that U and V are normal to each other if < U, V >R = 0. Any solution that satisfies the constraint must be of the form (U − U p ) ∈ N ull(Lr ) where Lr U p = xf is any particular solution. Claim: Let U ∗ be the optimal solution, and U is any solution that satisfies the constraint. Then, (U − U ∗ ) ⊥ U ∗ , i.e. < (U − U ∗ ), U ∗ >R = 0 which is the normal equation for the least norm solution problem. Proof: Direct substitution. −1 T −1 −1 T −1 −1 T xf = 0. xf = (Lr (U − U ∗ ))T Lr RU Lr Lr (U − U ∗ )T RU RU Lpc Lr RU ⋄ ME 8281:Advanced Control Systems, F01, F02, S06, S08 3.5.4 37 Open-loop least norm control Applying the above result to linear continuous time system using standard norms, i.e. J= Z t1 uT (τ )u(τ )dτ. t0 (Lr,[t0 ,t1 ] )∗ (t) = B T (t)Φ(t, t1 )T Z t1 T T ∗ Φ(t1 , τ )B(τ )B (τ )Φ(t1 , τ ) dτ Wr,[t0 ,t1 ] = Lr Lr = t0 −1 uopt (t) = B(t)T Φ(t, t1 )T Wr,[t (x1 − Φ(t1 , t0 )x0 ) 0 ,t1 ] (3.4) Eq, (3.4) solves uopt (·) in a batch form given x0 , i.e. it is openloop. 3.5.5 Recursive formulation • Openloop control does not make use of feedback. It is not robust to disturbances or model unceratinty. Suppose now that x(t) is measured. Conceptually, we can solve (3.4) for uopt (t) and let t0 = t. • Computing Wr,[t,t1 ] is expensive. Try recursion: −1 uopt (t) = B(t)T Φ(t, t1 )T Wr,[t,t (x1 − Φ(t1 , t)x(t)) 1] −1 −1 T T = B(t)T Φ(t, t1 )T Wr,[t,t x − B(t) Φ(t, t ) W Φ(t , t) x(t) 1 1 1 r,[t,t1 ] 1] For any invertible matrix Q(t) ∈ ℜn×n , Q(t)Q−1 (t) = I, therefore d −1 Q (t) = −Q−1 (t)Q̇(t)Q−1 (t) dt Since Wr,[t,t1 ] = Z t1 Φ(t1 , τ )B(τ )B(τ )∗ Φ(t1 , τ )∗ dτ t d W = −Φ(t1 , t)B(t)B(t)∗ Φ(t1 , t)∗ dt r,[t,t1 ] −1 • Thus we can solve for Wr,[t,t dynamically by integrating on-line 1] d −1 −1 −1 W = −Wr,[t,t Φ(t1 , t)B(t)B(t)∗ Φ(t1 , t)∗ Wr,[t,t 1] 1] dt r,[t,t1 ] • Issue: Does not work well when t → t1 because Wr,[t,t1 ] can be close to singular. c Perry Y.Li 38 3.5.6 Optimal cost Optimal cost as a function of initial time t0 Since Wr,[t0 ,tf ] = Z tf Φ(tf , τ )B(τ )B(τ )∗ Φ(tf , τ )∗ dτ t0 −1 and the integrand is a positive semi-definite term, for each v ∈ ℜn , v T Wr,[t v decreases as t0 0 ,tf ] decreases, i.e. given more time, the cost of control decreases. To see this, fix the final time tf , and consider the minimum cost function, −1 Emin (xf , t0 ) = xTf Wr,[t xf 0 ,tf ] and consider d d Emin (xf , tf ) = v T W −1 xf dt0 dtf r,[t0 ,tf ] Since d d −1 −1 W −1 = −Wr,[t Wr,[t0 ,tf ] Wr,[t 0 ,tf ] dt 0 ,tf ] dtf r,[t0 ,tf ] f n o −1 −1 ∗ ∗ = − Wr,[t Φ(t , t )B(t )B(t ) Φ(t , t ) W 0 0 f 0 f 0 r,[t0 ,tf ] 0 ,tf ] is negative semi-definite, dtd0 Emin (v, tf ) ≤ 0. Hence, the optimal control increases as the initial time decreases, increasing the allowable time interval. In other words, the set of states reachable with a cost less than a given value grows as t0 decreases. If the system is unstable, in that, Φ(tf , t0 ) becomes unbounded as t0 → −∞, then one can see that Wr,[t0 ,tf ] also becomes unbounded. This means that for some xf , Emin (xf , t0 ) → 0 and tf → ∞. This means that some directions do not require any cost of control. Which direction do these correspond to? For time invariant system, decreasing t0 is equivalent to increasing tf . Thus for time-invariant system, increasing the time interval increases Wr , thus decreasing cost. Optimal cost as a function final state xf Since Wr,[t0 ,tf ] is symmetric and positive semi-definite, has n orthogonal eigenvectors, V = [v1 , . . . , vn ], and associated eigenvalues Λ = diag(λ1 , . . . , λn ), such that V V T = I. Then −1 −1 T = V diag(λ−1 Wr,[t0 ,tf ] = V ΛV T ⇒ Wr,[t 1 , . . . , λn )V 0 ,tf ] This shows that most expensive direction to transfer to is the eigenvector associated with the minimum λi , and the least expensive direction is the eigenvector associated with the maximum λi 3.6 Linear Time Invariant (LTI) Continuous Time Systems Consider first the LTI continuous time system: ẋ = Ax + Bu y = Cx (3.5) 39 ME 8281:Advanced Control Systems, F01, F02, S06, S08 Note: Because of time invariance, the system is controllable (observable) at t0 means that it is controllable (observable) at any time. We will develop tests for controllability and observability by using directly the matrices A and B. The three tests for controllability of system (3.5) is given by the following theorem. Theorem For the continuous time system (3.5), the followings are equivalent: 1. The system is controllable over the interval [0, T ], for some T > 0. 2. The system is controllable over any interval [t0 , t1 ] with t1 > t0 . 3. The reachability grammian, Z T Φ(T, t)B(t)B(t)T Φ(T, t)T dt Wr,T := 0 Z T ∗ eAt BB ∗ eA t dt = 0 is full rank n. (This test works for time varying systems also) 4. The controllability matrix C := B AB A2 B · · · An−1 B has rank n. Notice that the controllability matrix has dimension n × nm where m is the dimension of the control vector u. 5. (Belovich-Popov-Hautus test) For each s ∈ C, the matrix, sI − A B has rank n. Note that rank of (sI − A, B) is less than n only if s is an eigenvalue of A. We need the Cayley-Hamilton Theorm to prove this result: Theorem 3.6.1 (Cayley Hamilton) Let A ∈ ℜn×n . Consider the polynomial ∆(s) = det(sI − A) Then ∆(A) = 0. Notice that if λi is an eigenvalue of A, then ∆(λi ) = 0. Proof: This is true for any A, but is easy to see using the eigen decomposition of A when A is semi-simple. A = T ΛT −1 where Λ is diagonal with eigenvalues on its diagonal. Since ψ(λi ) = 0 by definition, ∆(A) = T ψ(Λ)T −1 = 0. c Perry Y.Li 40 Proof: Controllability test (1) ⇐⇒ (3): We have already seen before that controllability over the interval [0, T ] means that the range space of the reachability map, Lr (u) = Z T eA(T −τ ) Bu(τ )dτ 0 must be the whole state space, ℜn . Notice that Wr,T := Z T 0 eAt BB ∗ eA t dt = Lr L∗r ∗ where L∗r is the adjoint (think transpose) of Lr . From the finite rank linear map theorem, R(Lr ) = R(Lr L∗r ) but, Lr L∗r is nothing but Wr,T . (3) ⇒ (4): We will show this by showing “not (4) ⇒ not (3)”. Suppose that (4) is not true. Then, there exists a 1 × n vector v T so that, v T B = v T AB = v T A2 B · · · = v T An−1 B = 0. Consider now, T v Wr,T v = Z 0 Since eAt = I + At + T kv T eAt Bk22 dt. A2 t2 An−1 tn−1 + + ··· 2 n − 1! and by the Cayley Hamilton Theorem, Ak is a linear combination of I, A, ... An−1 , therefore, v T eAt B = 0 for all t. Hence, v T Wr,T v = 0 or Wr,T is not full rank. (3) ⇒ (2): We will show this by showing “not (2) ⇒ not (3)”. If (2) is not true, then there exists 1 × n vector v T so that Z T T v Wr,T v = kv T eAt Bk22 dt = 0. 0 Because eAt is continuous in t, this implies that v T eAt B = 0 for all t ∈ [0, T ] . Hence, the all time derivatives of v T eAt B = 0 for all t ∈ [0, T ]. In particular, at t = 0, v T eAt B |t=0 = v T B = 0 d v T eAt B |t=0 = v T AB = 0 dt 2 d v T 2 eAt B |t=0 = v T A2 B = 0 dt .. . vT dn−1 At e B |t=0 = v T An−1 B = 0 dtn−1 ME 8281:Advanced Control Systems, F01, F02, S06, S08 Hence, v T B AB A2 B · · · 41 An−1 B = 0 0 · · · 0 i.e. the controllability matrix of (A, B) is not full rank. (4) ⇒ (5): We will show “ not (5) implies not (4)”. Suppose (5) is not true so that there exists a 1 × n vector v, and λ ∈ C, v T (λI − A) = 0, v T B = 0. for some λ. Then v T A = λv T , v T A2 = λ2 v T etc. Because v T B = 0 by assumption, we have v T AB = λv T B = 0, v T A2 B = λ2 v T B = 0 etc. Hence, v T B = v T AB = v T A2 B = · · · v T An−1 B = 0. Therefore the controllability is not full rank. The proof of (4) ⇒ (3) requires the 2nd representation theorem, and we shall leave it afterward. Note that (2) ⇒ (1) is obvious. To see that (1) ⇒ (2), notice that the controllability matrix C does not depend on T , so controllability does not depend on duration of time interval. Since the system is time invariant, it does not depend on the initial time (t0 ). ⋄ Proof of (4) ⇒ (3) - Optional To prove (4) ⇒ (3), we need the so called 2nd Representation Theorem. It is included here for completeness. We will not go through this part. Definition Let A : ℜn → ℜn and W ⊂ ℜn a subspace with the property that for each w ∈ W , Aw ∈ W . We say that W is A−invariant. Theorem (2nd Representation theorem) Let • A : ℜn → ℜn is a linear map (i.e. a matrix) • W ⊂ ℜn be an A−invariant k− dimensional subspace of ℜn . There exists a nonsingular T = e1 e2 · · · en s.t. • e1 , · · · , ek form a basis of W , • in the basis of e1 , e2 , · · · , en , A is represented by: T −1 AT = Ã11 Ã12 0 Ã22 Ã11 ∈ ℜk×k where k = dim W . • For any vector B ∈ W , the representation of B is given by B̃ B=T . 0 c Perry Y.Li 42 The point of the theorem is that A can be put in a form with 0 in strategic locations (Ã21 are zeros), similarly for any vector B ∈ W (B̃2 are zeros). Proof: Take e1 , · · · , ek to be a basis of W , and choose ek+1 , · · · en to complete the basis of ℜn . Because Aei ∈ W for each i = 1, · · · k, Aei = k X αli el . l=1 Therefore, αli are the coefficients of Ã11 and the coefficients of Ã21 are all zero. Let B ∈ W , then k X βl el B= l=1 so that βl are simply the coefficients in B̃1 and the coefficients of B̃2 are zeros. ⋄ Proof of (4) ⇒ (3) in controllability test: Notice that A B AB A2 B · · · = AB A2 B · · · An−1 B An−1 B An B therefore, by the Cayley Hamilton Theorem, the range space of the controllability matrix is A− invariant. Suppose that (3) is not true, so that the rank of B AB A2 B · · · An−1 B is less than n. Since the controllability matrix is A-invariant, by the 2nd representation theorem, there is an invertible matrix T so that in the new coordinates, z = T −1 x, Ã11 Ã12 B̃ ż = z+ u (3.6) 0 0 Ã22 B̃ where B = T , and 0 Ã11 Ã12 A=T T −1 . 0 Ã22 and the dim of Ã22 is non-zero (it is n - rank(C) ). Let v2T be a left eigenvector of Ã22 so that v2T (λI − Ã22 ) = 0 for some λ ∈ C. Define v T := 0 v2T T −1 . Evaluating v T B, v T (λI − A) gives −1 B̃ T T =0 v B = 0 v2 T T 0 v T (λI − A) = λ 0 v2T T −1 (λT T −1 − T ÃT −1 ) = 0 v2T (λI − Ã)T −1 = 0. This shows that [λI − A, B] has rank less than n. Remarks: 43 ME 8281:Advanced Control Systems, F01, F02, S06, S08 1. Notice that the controllability matrix is not a function of the time interval. Hence, if a LTI system is controllable over some interval, it is controllable over any (non-zero) interval. c.f. with result of linear time varying system. 2. Because of the above fact, we often say that the pair (A, B) is controllable. 3. Controllability test can be done by just examining A and B without computing the grammian. The test in (4) is attractive in that it enumerates the vectors in the controllability subspace. However, numerically, since it involves power of A, numerical stability needs to be considered. 4. The PBH Test in (5), or the Hautus test for short, involves simply checking the condition at the eigenvalues. It is because for (sI −A, B) to have rank less than n, s must be an eigenvalue. 5. The range space of the controllability matrix is of special interests. It is called the controllable subspace and is the set of all states that can be reached from zero-initial condition. This is A− invariant. 6. Using the basis for the controllable subspace as part of the basis for ℜn , the controllability property can be easily seen in (3.6). 3.7 Linear Time Invariant (LTI) discrete time system For the discrete time system (3.7), x(k + 1) = Ax(k) + Bu(k) y(k) = Cx(k) (3.7) where x ∈ ℜn , u ∈ ℜm , the conditions for controllability is fairly similar except that we need to consider controllability over period of length greater than n. First, recall that the reachability map for a linear discrete time system Lr,[k,k1 ] : u(·) → 7 s(k, k0 , x = 0, u(·)) is given by: Lr,[k0 ,k1 ] [u(·)] = k−1 X k−1 Πj=i+1 A(j)B(i)u(i) (3.8) i=k0 Theorem For the discrete time system (3.7), the followings are equivalent: 1. The system is controllable over the interval [0, T ], with T ≥ n (i.e. it can transfer from any arbitrary state at k = 0 to any other arbitrary state at k = T ). 2. The system is controllable over the interval [k0 , k1 ], with k1 − k0 ≥ n 3. The controllability grammian, Wr,T := T −1 X Al BB ∗ A∗l l=0 is full rank n. 4. The controllability matrix B AB A2 B · · · An−1 B has rank n. Notice that the controllability matrix has dimension n × nm where m is the dimension of the control vector u. c Perry Y.Li 44 5. For each z ∈ C, the matrix, zI − A B has rank n. Proof: The proof of this theorem is exactly analogous to the continuous time case. However, in the case of the equivalence of (2) and (3), we can notice that u(k − 1) u(k − 2) x(k) = Ak x(0) + [B, AB, A2 B, · · · An−1 B] .. . u(0) so clearly one can transfer to arbitrary states at k = n iff the controllability matrix is full rank. Controllability does not improve for T > n is again the consequence of Cayley-Hamilton Theorem. ⋄ 3.8 Observability The observability question deals with the question of while not knowing the initial state, whether one can determine the state from the input and output. This is equivalent to the question of whether one can determine the initial state x(0) when given the input u(t), t ∈ [0, T ] and the output y(t), t ∈ [0, T ]. Definition 3.8.1 A state determined dynamical system is called observable on [t0 , t1 ] if for all inputs, u(τ ), and outputs y(τ ), τ ∈ [t0 , t1 ], the state x(t0 ) = x0 can be uniquely determined. For observability, the null space of the observability map on the interval [t0 , t1 ], given by: Lo : x0 7→ y(·) = C(·)Φ(·, t0 )x0 , y(τ ) = C(τ )Φ(τ, t0 )x0 Φ(τ, 0)x, ∀τ ∈ [t0 , t1 ] must be trivial (i.e. only contains 0). Otherwise, if Lo (xn )(t) = y(t) = 0, for all t ∈ [0, T ], then for any α ∈ ℜ, y(t) = C(t)Φ(t, 0)x = Φ(t, 0)(x + αxn ). Recall from the finite rank theorem that if the observability map Lo is a matrix, then the null space of Lo , N (Lo ) = N (LTo Lo ). For continuous time system, Lo can be thought of as an infinitely long matrix, then the matrix product operation in LTo Lo becomes an integral, and is written as L∗o Lo where L∗ denotes the adjoint of the L. The observability Grammian is given by: Wo,[t0 ,t1 ] = L∗o Lo = Z t1 Φ(t, t0 )T C T (t)C(t)Φ(t, t0 ) ∈ ℜn×n t0 where L∗o is the adjoint (think transpose) of the observability map. ME 8281:Advanced Control Systems, F01, F02, S06, S08 3.9 3.9.1 45 Least square estimation Formulation and solution Consider the continuous time varying system: ẋ(t) = A(t)x(t) y(t) = C(t)x(t). The observability map on [0, t1 ] is given by: ∀τ ∈ [0, t1 ] Lo : x(0) 7→ y(τ ) = C(τ )Φ(τ, 0)x(0) (3.9) The so-called Least squares estimate of x(0) given the output y(τ ), τ ∈ [0, t1 ] is: x̂(0|t1 ) = arg minx0 Z t1 eT (τ )e(τ )dτ. 0 The least squares estimation problem can be cast into a set of linear equations. For example, we can stack all the outputs y(t), t ∈ [0, t1 ] into a vector Y = [Y (0), . . . , Y (0.1), . . . , Y (0.2), . . . , Y (t1 )]T ∈ ℜpp , and represent Lo as a matrix ∈ ℜpp×n , then, Y = Lo x0 + E; x∗o = argminx0 E T E = (LTo Lo )−1 LTo Y Here, E = [E(0), . . . , E(t1 )]T = ℜpp is the modeling error or noise. The optimal estimate x∗0 uses the minimum amount of noise E to explain the data Y . Notice that the resulting E satisfies E T Lo = 0, i.e. E is normal to Range(Lo ). Using the observability map for the LTI continuous time system (3.9) as Lo , x̂(0|t1 ) = Wo (t1 ) = Wo−1 (t1 ) L∗o Lo = Z Z t1 0 t1 ΦT (τ, 0)C T (τ )y(τ )dτ ΦT (τ, 0)C T (τ )C(τ )Φ(τ, 0)dτ. 0 One can also find estimates of the states at time t2 given data up to time t1 : x̂(t2 |t1 ) = Φ(t2 , 0)x̂(0|t1 ) This refers to three classes of esimation problems: • t2 < t1 : Filtering problem • t2 > t1 : Prediction problem • t2 = t1 : Observer problem The estimate x̂(t|t) is especially useful for control systems as it allows us to effective do state feedback control. c Perry Y.Li 46 3.9.2 Recursive Least Squares Observer The least squares solution computed above is expensive to compute: Z t −1 ΦT (τ, 0)C T (τ )y(τ )dτ x̂(t|t) = Φ(t, 0)Wo (t) 0 Z t ΦT (τ, 0)C T (τ )C(τ )Φ(τ, 0)dτ. Wo (t) = L∗o Lo = 0 It is desirable if the estimate x̂(t|t) can be obtained recursively via a differential equation. Z t d ΦT (τ, 0)C T (τ )y(τ )dτ x̂(t|t) = A(t) Φ(t, 0)Wo−1 (t) dt 0 {z } | x̂(t|t) Z t d −1 ΦT (τ, 0)C T (τ )y(τ )dτ W (t) dt o 0 + Φ(t, 0)Wo−1 (t)ΦT (t, 0)C T (t)y(t) + Φ(t, 0) Now by differentiating Wo (t)Wo−1 (t) = I, we have: dWo d −1 W (t) = −Wo−1 (t) (t)Wo−1 (t) dt o dt where d Wo (t) = ΦT (t, 0)C T (t)C(t)Φ(t, 0) dt d x̂(t|t) = A(t)x̂(t|t) − Φ(t, 0)Wo−1 (t)ΦT (t, 0)C T (t)C(t)x̂(t|t) + Φ(t, 0)Wo−1 (t)ΦT (t, 0)C T (t)y(t) dt = A(t)x̂(t|t) − Φ(t, 0)Wo−1 (t)ΦT (t, 0) C T (t)[C(t)x̂(t|t) −y(t)] (3.10) | {z } | {z } P (t) ŷ(t|t) P (t) satisfies: Ṗ (t) = A(t)P (t) + P (t)AT (t) − P (t)C T (t)C(t)P (t) Typically, we would initialize P (0) to be a large non-singular matrix, e.g. P (0) = α · I, where α is large. In the recursive least squares observer in (3.10), the first term is an openloop prediction term, and the second term is called an output injection where an output prediction error is used to correct the estimation error. We can think of the observer feedback gain as: L(t) = P (t)C T (t) 3.9.3 Covariance Windup Let us rewrite P (t) as follows: P (t) = Φ(t, 0) Z t T T Φ (τ, 0)C (τ )C(τ )Φ(τ, 0)dτ 0 = Z t 0 ΦT (τ, t)C T (τ )C(τ )Φ(τ, t)dτ −1 −1 ΦT (t, 0) =: K −1 (t) 47 ME 8281:Advanced Control Systems, F01, F02, S06, S08 The matrix K(t) := P −1 (t) is known as the Information Matrix and satisfies: K̇ = C T (t)C(t) − AT (t)K(t) − K(t)A(t) Notice that Wo (t) increases with time. Thus, Wo −1(t) decreases with time, as would K −1 (t). This means that the observer gain L(t) will decrease. The observer will asymptotically rely more and more on open loop estimation: d x̂(t|t) = A(t)x̂(t|t) dt Forgetting factor Forget old information (τ far away from current time): Choose λ > 0: K(t) = Z t ΦT (τ, t)C T (τ )C(τ )Φ(τ, t)e−λ(t−τ ) dτ ; 0 K̇ = C T (t)C(t) − AT (t)K(t) − K(t)A(t) − λK Covariance reset If K(t) becomes large, reset it to small number. • Check maximum singular value of K(t), σ̄K(t). • If σ̄K(t) ≥ λmax , K(t) = ǫI, i.e. P (t) = I/ǫ. 3.10 Observability Tests The observability question deals with the question of whether one can determine what the initial state x(0) is, given the input u(t), t ∈ [0, T ] and the output y(t), t ∈ [0, T ]. For observability, the null space of the observability map, Lo : x 7→ y(·) = Φ(·, 0)x, τ ∈ [0, T ], must be trivial (i.e. only contains 0). Otherwise, if Lo (xn )(t) = y(t) = 0, for all t ∈ [0, T ], then for any α ∈ ℜ, y(t) = Φ(t, 0)x = Φ(t, 0)(x + αxn ). Hence, one cannot distinguish the various initial conditions from the output. Just like for controllability, it is inconvenient to check the rank (and the null space) of the Lo which is tall and thin. We can instead check the rank and the null space of the observability grammian given by: Wo,T = L∗o Lo where L∗o is the adjoint (think transpose) of the observability map. Proposition 3.10.1 Null(Lo ) = Null(L∗o Lo ). Proof: c Perry Y.Li 48 • Let x ∈ Nul(Lo ) so, Lo x = 0. Then, clearly, LTo Lo x = LT 0. Therefore, Null(Lo ) ⊂ Null(L∗o Lo ). • Let x ∈ Nul(L∗o Lo ). Then, xT L∗o Lo x = 0. Or, (Lo x)T (Lo x) = 0. This can only be true if Lo x = 0. Therefore, Null(L∗o Lo ) ⊂ Null(Lo ). ⋄ 3.11 Observability Tests for Continuous time LTI systems Theorem For the LTI continuous time system (3.5), the followings are equivalent: 1. The system is observable over the interval [0, T ] 2. The observability grammian, Wo,T := Z T eA t C ∗ CeAt dt ∗ 0 is full rank n. C CA CA2 .. . 3. The observability matrix has rank n. Notice that the observability matrix has n−1 CA dimension np × n where p is the dimension of the output vector y. 4. For each s ∈ C, the matrix, sI − A C has rank n. Proof: The proof is similar to the ones as in the controllable case and will not be repeated here. Some differences are that instead of considering 1 × n vector v T multiplying on the left hand sides of the controllability matrix and the grammians, we consider n × 1 vector multiplying on the RHS of the observability matrix and the grammian etc. Also instead of considering the range space of the controllability matrix, we consider the NULL space of the observability matrix. Its null space is also A-invariant. Hence if the observability matrix is not full rank, then using basis for its null space as the last k basis vectors of ℜn , the system can be represented as: Ã11 0 B̃1 ż = z+ u Ã21 Ã22 B̃2 y = C̃ 0 z where C = C̃ 0 T −1 , and A=T Ã11 Ã12 T −1 . 0 Ã22 49 ME 8281:Advanced Control Systems, F01, F02, S06, S08 and the dim of Ã22 is non-zero (and is the dim of the null space of the observability matrix). ⋄ Remark 1. Again, observability of a LTI system does not depend on the time interval. So, theoretically speaking, if observing the output and input for an arbitrary amount of time will be sufficient to figure out x(0). In reality, when more data is available, one can do more averaging to eliminate effects of noise (e.g. using the Least square ie. Kalman Filter approach). 2. The subspace of particular interest is the null space of the controllability matrix. An initial state lying in this set will generate identically 0 zero-input response. This subspace is called the unobservable subspace. 3. Using the basis of the unobservable subspace as part of the basis of ℜn , the observability property can be easily seen. 3.12 Observability Tests for Discrete time LTI systems The tests for observability of the discrete time system (3.7) is given similarly by the following theorem. Theorem 3.12.1 For the discrete time system (3.7), the followings are equivalent: 1. The system is observable over the interval [0, T ], for some T ≥ n. 2. The observability grammian, Wo,T := T −1 X A∗k C ∗ CAk k=0 is full rank n. C CA CA2 .. . 3. The observability matrix has rank n. Notice that the observability matrix has n−1 CA dimension np × n where p is the dimension of the output vector y. 4. For each z ∈ C, the matrix, zI − A C has rank n. The controllability matrix can have the following interpretation: zero-input response is given by: y(0) y(1) y(2) .. . y(n − 1) = C CA CA2 .. . CAn−1 x(0). c Perry Y.Li 50 Thus, clearly if the observability matrix is full rank, one can reconstruct x(0) from measurements of y(0), · · · , y(n − 1). One might think that by increasing the number of output measurement times (e.g. y(n)) the system can become P observable. However, because of Cayley-Hamilton theorem, n−1 n y(n) = CA x(0) can be expressed as i=0 ai CAi x(0) consisting of rows already in the observability matrix. 3.13 PHB test and Eigen/Jordan Forms Consider ẋ = Ax + Bu, y = Cx Suppose first that A is semi-simple, then A = T DT −1 and D = diag λ1 , . . . , λn where λi might be repeating. The PBH test in the transformed eigen-coordinates is to check rank(λi D, T −1 B) for each i if it is n. This shows that T −1 B must be non-zero in each row. Also, if λi = λj for some i 6= j, then a single input system cannot be controllable. Now suppose that A = T JT −1 and J is in Jordan form, λ1 1 0 0 0 λ1 0 0 J = 0 0 λ1 0 0 0 0 λ2 This Jordan form has 3 generalized eigenvector chains. Controllability • From homework, we saw that if the entries of B ∈ ℜ4 at the beginning of some chain is 0, i.e.. b1 b1 b1 b b 2 2 , T −1 B = , T −1 B = 0 T −1 B = b3 0 b3 b4 b4 0 then the system is uncontrollable. • Thus, T −1 B being nonzero at the beginning of each chain is a necessary condition for controllability. • PBH test shows that it is in fact a sufficient condition. Observability • Similarly, if C · T ∈ ℜ1×n is a zero entry at the end of any chain (these correspond to the coordinates for the eigenvector), i.e. CT = 0 c2 c3 c4 , CT = c1 c2 0 c4 , or, CT = c1 c2 c3 0 then we saw from the homework that the system is not observable. 51 ME 8281:Advanced Control Systems, F01, F02, S06, S08 • Hence, CT having non-zero entries at the end of each chain is necessary for observability. • PHB test shows that it is also sufficient. Note If the system is either uncontrollable or unobservable, then the order of the transfer function will be less than the order of A. However, for a multi-input-multi-output system, the fact that the order of each transfer function in the transfer function matrix has order less than the order of A, does NOT imply that the system is uncontrollable or unobservable. e.g. −1 0 1 0 A= B=C= 0 −2 0 1 gives, Y (s) = 1 s+1 0 0 1 s+2 U (s). 3.14 Kalman Decomposition 3.14.1 Controllable / uncontrollable decomposition Suppose that the controllability matrix C ∈ ℜn×n of a system has rank n1 < n. Then there exists an invertible transformation, T ∈ ℜn×n such that: z = T −1 x, Ã11 Ã12 B̃ z+ ż = u 0 0 Ã22 B̃ where B = T , and 0 (3.11) Ã11 Ã12 A=T T −1 . 0 Ã22 and the dim of Ã22 is n − n1 . 3.14.2 Observable / unobservable decomposition Hence if the observability matrix is not full rank, then using basis for its null space as the last k basis vectors of ℜn , the system can be represented as: Ã11 0 B̃1 ż = z+ u Ã21 Ã22 B̃2 y = C̃ 0 z where C = C̃ 0 T −1 , and Ã11 Ã12 A=T T −1 . 0 Ã22 and the dim of Ã22 is non-zero (and is the dim of the null space of the observability matrix). c Perry Y.Li 52 3.14.3 Kalman decomposition The Kalamn decomposition is just the combination of the observable/unobservable, and the controllable/uncontrollable decomposition. Theorem 3.14.1 There exists a coordinate transformation z = T −1 x ∈ ℜn such that Ã13 0 B̃1 B̃2 A23 A24 z + u 0 Ã33 0 0 Ã43 Ã44 y = C̃1 0 C̃2 0 z Ã11 0 Ã21 Ã22 ż = 0 0 0 0 Let T = T1 T2 T3 T4 (with compatible block sizes), then • T2 → (C − Ō): T2 = basis for Range(C) ∩ Null(O). • T1 → (C − O): T1 ∪ T2 = basis for Range(C) • T4 → (C̄ − Ō): T2 ∪ T4 = basis for Null(O). • T3 → (C̄ − O): T1 ∪ T2 ∪ T3 ∪ T4 = basis for ℜn . Note: Only T2 is uniquely defined. Proof: This is just combination of the obs/unobs and cont/uncont decomposition. 3.14.4 ⋄ Stabilizability and Detectability If the uncontrollable modes Ā33 , Ā44 are stable (have eigenvalues on the Left Half Plane), then, system is called stabilizable. • One can use feedback to make the system stable; • Uncontrollable modes decay, so not an issue. If the unobservable modes Ā22 , Ā44 are stable (have eigenvalues on the Left Half Plane), then, system is called detectable. • The states z2 , z4 decay to 0 • Eventually, they will have no effect on the output • State can be reconstructed by ignoring the unobservable states (eventually). The PBH tests can be modified to check if the system is stabilizable or detectable, namely, check sI − A rank sI − A B rank C for all s with non-negative real parts if they lose rank. Specifically, one needs to check only s which are the unstable eigenvalues of A. ME 8281:Advanced Control Systems, F01, F02, S06, S08 3.15 Realization 3.15.1 Degree of controllability / observability 53 Formal definitions for controllability and observability are black and white. In reality, some states are very costly to control to, or have little effect on the outputs. They are therefore, effectively uncontrollable or unobservable. Degree of controllability and observability can be evaluated by the sizes of Wr and Wo with infinite time horizon: Z T T eA(T −τ ) BB T eA (T −τ ) dτ Wr (0, ∞) = lim T →∞ 0 Z ∞ T eAt BB T eA t dt = 0 Z T T eA τ C T CeAτ dτ Wo (0, ∞) = lim T →∞ 0 Notice that Wr satisfies differential equation: d Wr (0, t) = AWr (0, t) + Wr (0, t)AT + BB T dt Thus, if all the eigenvalues of A have strictly negative real parts (i.e. A is stable), then, as T → ∞, 0 = AWr + Wr AT + BB T which is a set of linear equations in the entries of Wr , and can be solved effectively. The equation is called a Lyapunov equation. Matlab can solve for Wr using gram. Similarly, if A is stable, as T → ∞, Wo satisfies the Lyapunov equation 0 = AT Wo + Wo A + C T C which can be solved using linear method (or using Matlab via gram). Wr is related to the minimum norm control. To reach x(0) = x0 from x(−∞) = 0 in infinite time, u = LTr Wc−1 x0 Z 0 uT (τ )u(τ )dτ = xT0 Wc−1 x0 . minu(·) J(u) = minu(·) −∞ If state x0 is difficult to reach, then xT0 Wc−1 x0 is large meaning that x0 is practically uncontrollable. Similarly, if the initial state is x(0) = x0 , then, with u(τ ) ≡ 0 Z ∞ y T (τ )y(τ )dτ = xT0 Wo x0 . 0 Thus, xT0 Wo x0 measures the effect of the initial condition on the output. If it is small, the effect of x0 in the output y(·) is small, thus, it is hard to observe, or practically unobservable. Generally, one can look at the smallest eigenvalues Wc and Wo , the span of the associated eigenvectors will be difficult to control, or difficult to observe. c Perry Y.Li 54 3.15.2 Relation to Transfer Function For the system ẋ = Ax + Bu y = Cx + Du The transfer function from U (s) → Y (s) is given by: G(s) = C(sI − A)−1 B + D Cadj(sI − A)B + D. = det(sI − A) Note that transfer function is not affected by similarity transform. From Kalman decomposition, it is obvious that G(s) = C̃1 (sI − Ã11 )−1 B̃1 + D where Ã11 , B̃1 , C̃1 correspond to the controllable and observable component. Poles • they are values of s ∈ C s.t. G(s) becomes infinite. • poles of G(s) are clearly the eigenvalues of Ã11 . Zeros • For the SISO case, z ∈ C (complex numbers) is a zero if it makes G(z) = 0. • Thus, zeros satisfy Cadj(zI − A)B + Ddet(zI − A) = 0 assuming system is controllable and observable, otherwise, need to apply Kalman decomposition first. • In the general MIMO case, a zero implies that there can be non-zero inputs U (s) that produce output Y (s) that is identically zero. Therefore, there exists X(z), U (z) such that: zI − A X(z) = B U (z) 0 = C X(z) + D U (z) This will be true if and only if at s = z sI − A −B rank −C −D is less than the normal rank of the matrix at other s. We shall return to the multi-variable zeros when we discuss the effect of state feedback on the zero of the system. 55 ME 8281:Advanced Control Systems, F01, F02, S06, S08 3.15.3 Pole-zero cancellation Cascade system with input/output (u1 , y2 ): • System 1 with input/output (u1 , y1 ) has a zero at α and a pole at β. ẋ1 = A1 x1 + B1 u1 y1 = C1 x1 • System 2 with input/output (u2 , y2 )has a pole at α and a zero at β. ẋ2 = A2 x2 + B2 u2 y2 = C2 x2 • Cascade interconnection: u2 = y1 . Then 1. The system pole at β is not observable from y2 2. The system pole at α is not controllable from u1 . Combined system: A= Consider x = A1 0 ; B2 C1 A2 B= B1 ; 0 C= 0 C2 x1 . x2 • Use PBH test with λ = β. βI − A1 0 −B2 C1 βI − A2 x1 = 0??? x2 0 C2 • Let x1 be eigenvector associated with β for A1 . • Let x2 = (βI − A2 )−1 B2 C2 x1 (i.e. solve second row in PBH test). • Then since Cx = C2 x2 = (C2 (βI − A2 )−1 B2 )C2 x1 and β is a zero of system 2, PHB test shows that the mode β is not observable. Similar for the case when α mode in system 2 not controllable by u. These example shows that when cascading systems, it is important not to do unstable pole/zero cancellation. c Perry Y.Li 56 3.16 Balanced Realization The objective is to reduce the number of states while minimizing effect on I/O response (transfer function). This is especially useful when the state equations are obtained from distributed parameters system, P.D.E. via finite elements methods, etc. which generate many states. If states are unobservable or uncontrollable, they can be removed. The issue at hand is if some states are lightly controllable while others are lightly observable. Do we cancel them? In particular, • Some states can be lightly controllable, but heavily observable. • Some states can be lightly observable, but heavily controllable. • Both contribute to significant component to input/output (transfer function) response. Idea: Exhibit states so that they are simultaneously lightly (heavily) controllable and observable. Consider a stable system: ẋ = Ax + Bu y = Cx + Du If A is stable, reachability and observability grammians can be computed by solving the Lyapunov equations: 0 = AWr + Wr AT + BB T 0 = AT Wo + Wo A + C T C • If state x0 is difficult to reach, then xT0 Wr−1 x0 is large ⇒ practically uncontrollable. • If xT0 Wo x0 is small, the signal of x0 in the output y(·) is small, thus, it is hard to observe ⇒ practically unobservable. • Generally, one can look at the smallest eigenvalues Wr and Wo , the span of the associated eigenvectors will be difficult to control, or difficult to observe. Transformation of grammians: (beware of which side T goes !): z = Tx Minimum norm control should be invariant to coordinate transformation: −1 −1 xT0 Wr−1 x0 = z T Wr,z z = xT T T Wr,z Tx Therefore −1 Wr−1 = T T Wr,z T ⇒ Wr,z = T · Wr T T . Similarly, the energy in a state transmitted to output should be invariant: xT Wo x = zWo,z z ⇒ Wo,z = T −T Wo T −1 . Theorem 3.16.1 (Balanced realization) If the linear time invariant system is controllable and observable, then, there exists an invertible transformation T ∈ ℜn×n s.t. Wo,z = Wr,z . ME 8281:Advanced Control Systems, F01, F02, S06, S08 57 The balanced realization algorithm: 1. Compute controllability and observability grammians: >> Wr = gram(sys, ’c’); >> Wo = gram(sys, ’o’) 2. Write Wo = RT R [One can use SVD] >> [U,S,V]=svd(Wo ); >> R = sqrtm(S)*V’; 3. Diagonalize RWr RT [via SVD again]: RWr RT = U Σ2 U T , where U U T = I and Σ is diagonal. >> [U1 ,S1 ,V1 ]=svd(R*Wr *R’); >> Σ = sqrtm(S1 ’; 1 4. Take T = Σ− 2 U T R >> T = inv(sqrtm(Σ))*U1 ’*R; 5. This gives Wr,z = Wo,z = Σ. >> Wr,z = T ∗ Wr ∗ T ′ , >> Wo,z = inv(T )′ ∗ Wo ∗ inv(T ) Proof: Direct substitution! • Once Wr,z and Wo,z are diagonal, and equal, one can decide to eliminate states that correspond to the smallest few entries. • Do not remove unstable states from the realization since these states need to be controlled (stabilized) • It is also possible to maintain some D.C. performance. Consider the system in the balanced realization form: d z1 A11 A12 z1 B1 = + u A21 A22 z2 B2 dt z2 y = C1 z2 + C2 z2 + Du where z1 ∈ ℜn1 and z2 ∈ ℜn2 , and n1 + n2 = n. Suppose that the z1 are associated with the simultaneously lightly controllable and light observable mode. The naive truncation approach is to remove z2 to form the reduced system: ż1 = A11 z1 + B1 u y = C1 z1 + Du c Perry Y.Li 58 However, this does not retain the D.C. (steady state) gain from u to y (which is important from a regulation application point of view). To maintain the steady state response, instead of eliminating z2 completely, replace z2 by its steady state value: In steady state: ż2 = 0 = A21 z1 + A22 z2∗ + B2 u ⇒z2∗ = −A−1 22 (A21 z1 + B2 u) This is feasible if A22 is invertible (0 is not an eigenvalue). A truncation approach that maintains the steady state gain is to replace z2 by its steady state value: ż1 = A11 z1 + A12 z2∗ + B1 u y = C1 z1 + C2 z2∗ + Du so that, −1 ż1 = A11 − A12 A−1 22 A21 + B1 − A12 A22 B2 u | {z } | {z } Ar Br −1 y = C1 − C2 A−1 22 A21 z1 + D − C2 A22 B2 u {z } {z } | | Cr Dr The truncated system with state z1 ∈ ℜn1 is ż1 = Ar z1 + Br u y = Cr z1 + Dr u which with have the same steady state response as the original system.