Lectures on Dynamic Systems and ontrol Mohammed Dahleh Munther Dahleh George Verghese Department of Electrical Engineering and omputer Science Massachuasetts Institute of Technology c
hapter 8 Simulation/Realization 8 Introduction Given an nth-order state-space description of the form x_ (t) = f (x(t) u(t) t) (state evolution equations) (8) y(t) = g (x(t) u(t) t) (instantaneous output equations) : (8) (which may be T or DT, depending on how we interpret the symbol x_), how do we simulate the model, ie, how do we implement it or realize it in hardware or software In the DT case, where x_(t) = x(t ), this is easy if we have available: (i) storage registers that can be updated at each time step (or \clock cycle") these will store the state variables and (ii) a means of evaluating the functions f( ) and g( ) that appear in the state-space description in the linear case, all that we need for this are multipliers and adders straightforward realization is then obtained as shown in the gure below The storage registers are labeled D for (one-step) delay, because the output of the block represents the data currently stored in the register while the input of such a block represents the data waiting to be read into the register at the next clock pulse In the T case, where x_(t) = dx(t)=dt, the only dierence is that the delay elements are replaced by integrators The outputs of the integrators are then the state variables 8 Realization from I/O Representations In this section, we will describe how a state space realization can be obtained for a causal input-output dynamic system described in terms of convolution 8 onvolution with an Exponential onsider a causal DT LTI system with impulse response h[n] (which is for n < ):
u[t] - x[t ] x[t] f(: :) - D - g(: :) y[t] - Figure 8: Simulation Diagram The rst term above, namely nx y[n] = h[n ; k]u[k] ; n; X = h[n ; k]u[k] h[]u[n] (8) ; n; X x[n] = h[n ; k]u[k] (84) ; represents the eect of the past on the present This expression shows that, in general (ie if h[n] has no special form), the number x[n] has to be recomputed from scratch for each n When we move from n to n, none of the past input, ie u[k] for k n, can be discarded, because all of the past will again be needed to compute x[n ] In other words, the memory of the system is innite Now look at an instance where special structure in h[n] makes the situation much better Suppose h[n] = n for n, and otherwise (85) Then and n; X x[n] = n;k u[k] (8) ; nx x[n ] = n;k u[k] ; n; X = n;k u[k] u[n] ; = x[n] u[n] (8)
y[n] (You will nd it instructive to graphically represent the convolutions that are involved here, in order to understand more visually why the relationship (8) holds) Gathering (8) and (8) with (8), we obtain a pair of equations that together constitute a state-space description for this system: x[n ] = x[n] u[n] (88) y[n] = x[n] u[n] (89) To realize this model in hardware, or to simulate it, we can use a delay-adder-gain system that is obtained as follows We start with a delay element, whose output will be x[n] when its input is x[n ] Now the state evolution equation tells us how to combine the present output of the delay element, x[n], with the present input to the system, u[n], in order to obtain the present input to the delay element, x[n ] This leads to the following block diagram, in which we have used the output equation to determine how to obtain y[n] from the present state and input of the system: u[n] m - - - y[n] x[n] x[n ] D 8 onvolution with a Sum of Exponentials onsider a more complicated causal impulse response than the previous example, namely n h[n] = [n] ( n L n L ) (8) with the i being constants The following block diagram shows that this system can be considered as being obtained through the parallel interconnection of causal subsystems that are as simple as the one treated earlier, plus a direct feedthrough of the input through the gain (each block is labeled with its impulse response, with causality implying that these responses are for n < ): u[n] - [n] - - - n - - N i - - L n - L
Motivated by the above structure and the treatment of the earlier, let us dene a state variable for each of the L subsystems: x i [n] = n; X ; n ;k i u[k] i = : : : L (8) With this, we immediately obtain the following state-evolution equations for the subsystems: lso, after a little algebra, we directly nd x i [n ] = i x i [n] i u[n] i = : : : L (8) LX y[n] = x [n] x [n] L x L [n] ( i ) u[n] (8) We have thus arrived at an Lth-order state-space description of the given system To write the above state-space description in matrix form, dene the state vector at time n to be x[n] = x [n] x [n] x L [n] (84) lso dene the diagonal matrix, column vector b, and row vector c as follows: = c b = L L = L (85) (8) Then our state-space model takes the desired matrix form, as you can easily verify: x[n ] = x[n] bu[n] (8) y[n] = cx[n] du[n] (88) where LX d = i (89)
u[n y[n u[n = y[n u[n 8 Realization from an LTI Dierential/Dierence equation In this section, we describe how a realization can be obtained from a dierence or a dierential equation We begin with an example Example 8 (State-Space Models for an LTI Dierence Equation) Let us examine some ways of representing the following input-output dierence equation in state-space form: y[n] a y[n ; ] a y[n ; ] = b u[n ; ] b u[n ; ] (8) For a rst attempt, consider using as state vector the quantity x[n] = y[n ; ] y[n ; ] ; ] u[n ; ] (8) The corresponding 4th-order state-space model would take the form y[n] ;a ;a b b y[n ; ] = u[n] y[n ; ] ; ] x[n ] = u[n] ; ] u[n ; ] u[n ; ] y[n] = ;a ;a b b y[n ; ] y[n ; ] ; ] u[n ; ] ( ) u[n] (8) If we are somewhat more careful about our choice of state variables, it is possible to get more economical models For a rd-order model, suppose we pick as state vector y[n] x[n] = y[n ; (8) ] u[n ; ] The corresponding rd-order state-space model takes the form y[n ] ;a ;a b y[n] b x[n ] = y[n] y[n ; ] u[n] u[n ; ] u[n] y[n] y[n] = ; ] ( ) u[n] (84) u[n ; ]
still more clever/devious choice of state variables yields a nd-order state-space model For this, pick! y[n] x[n] = (85) ;a y[n ; ] b u[n ; ] The corresponding nd-order state-space model takes the form!!!! y[n ] ;a = y[n] b ;a y[n] b u[n] ;a ;a y[n ; ] b u[n ; ] b! u[n] y[n] y[n] = ( ) u[n] (8) ;a y[n ; ] b u[n ; ] It turns out to be impossible in general to get a state-space description of order lower than in this case This should not be surprising, in view of the fact that we started with a nd-order dierence equation, which we know (from earlier courses!) requires two initial conditions in order to solve forwards in time Notice how, in each of the above cases, we have incorporated the information contained in the original dierence equation that we started with This example was built around a second-order dierence equation, but has natural generalizations to the nth-order case, and natural parallels in the case of T dierential equations Next, we will present two realizations of an nth-order LTI dierential equation While realizations are not unique, these two have certain nice properties that will be discussed in the future 8 Observability anonical Form Suppose we are given the LTI dierential equation y (n) which can be rearranged as a n; y (n;) a y = b u b u_ b n; u (n;) y (n) = ( b n; u (n;) ; b n; y (n;) ) ( b n; u (n;) ; a n; y (n;) ) (b u ; a y): Integrated n times, this becomes Z Z Z Z Z y = (b n; u ; a n; y) (b n; u ; a n; y) (b u ; a y): (8) n The block diagram given in Figure 8 then follows directly from (8) This particular realization is called the observability canonical form realization \canonical" in the sense of
Z 4 Z 5 Z 4 5 Z u b b b n; b n; x_ ṉ x ṉ x_ n; - x n; - - x_ x - x_ - x y - ;a ;a ;a n; ;a n; Figure 8: Observability anonical Form \simple" (but there is actually a strict mathematical denition as well), and \observability" for reasons that will emerge later in the course We can now read the state equations directly from Figure 8, once we recognize that the natural state variables are the outputs of the integrators: x_ = ;a n; x x b n; u x_ = ;a n; x x b n; u x_ n = ;a x b u y = x : If this is written in our usual matrix form, we would have ;a n; ;a n; = b = b n; b n; ;a b h i c = : The matrix is said to be in companion form, a term used to refer to any one of four matrices whose pattern of 's and 's is, or resembles, the pattern seen above The characteristic polynomial of such a matrix can be directly read o from the remaining coecients, as we shall
4 x 5 = 4 dt 5 : 5 4 4 5 5 4 5 4 i 4 : 5 see when we talk about these polynomials, so this matrix is a \companion" to its characteristic polynomial 8 Reachability anonical Form There is a \dual" realization to the one presented in the previous section for the LTI dierential equation y (n) a n; y (n;) a y = c u c u_ c n; u (n;) : (88) First, consider a special case of this, namely the dierential equation w (n) a n; w (n;) a w = u (89) To obtain an nth-order state-space realization of the system in 89, dene x = x x x n; x n w w_ w d n; n; d n; dt n; Then it is easy to verify that the following state-space description represents the given model: d dt x : : : x x : : : x x x : : : x n; x n w = = u h w w : : : x n; ;a (t) ;a (t) ;a (t) : : : ;a n; (t) ;a n; (t) x n : : : x x x x n; x n (The matrix here is again in one of the companion forms the two remaining companion forms are the transposes of the one here and the transpose of the one in the previous section) Suppose now that we want to realize another special case, namely the dierential equation r (n) a n; r (n;) a r = u_ (8)
- which is the same equation as (89), except that the RHS is u_ rather than u y linearity, the response of (8) will r = w_ (t), and this response can be obtained from the above realization by simply taking the output to be x rather than x, since x = w_ = r Superposing special cases of the preceding form, we see that if we have the dierential equation (88), with an RHS of c u c u_ c n; u (n;) then the above realization suces, provided we take the output to be ie, we just change the output equation to have y = c x c x c n; x n : (8) h i c = c c c c n; : (8) block diagram of the nal realization is shown below in 8 This is called the reachability or controllability canonical form u x n - - c n; c c - - y Z Z Z Z _ x n - x n;- x_ x x_ - x M I ;a n; ;a n; ;a ;a Figure 8: Reachability anonical Form Finally, for the obvious DT dierence equation that is analogous to the T dierential equation that we used in this example, the same scheme will work, with derivatives replaced by dierences
Exercises Exercise 8 Suppose we wish to realize a two-input dierential equation of the form y (n) a n; y (n;) a y = b u b u_ b n; u ( n;) (n;) b u b u_ b n; u Show how you would modify the observability canonical realization to accomplish this, still using only n integrators Exercise 8 How would reachability canonical realization be modied if the linear dierential equation that we started with was time varying rather than time invariant Exercise 8 Show how to modify the reachability canonical realization but still using only n integrators to obtain a realization of a two-output system of the form (n) y (n) y (n;) a n; y a y = c u c u_ c n; u (n;) a n; y (n;) a y = c u c u_ c n; u (n;) : Exercise 84 onsider the two-input two-output system: y_ = y u u y_ = y u u (a) Find a realization with the minimum number of states when = (b) Find a realization with the minimum number of states when =
MIT OpenourseWare http://ocwmitedu 4J / 8J Dynamic Systems and ontrol Spring For information about citing these materials or our Terms of Use, visit: http://ocwmitedu/terms