Page 409 - Applied Numerical Methods Using MATLAB
P. 409

398    MATRICES AND EIGENVALUES

                   %nm8p08a
                   syms a0 a1 a2 s
                   A =[0 1 0;0 0 1;-a0 -a1 -a2]; %(P8.8.2a)
                   det(s*eye(size(A))- A) %characteristic polynomial
                   ch_eq = poly(A) %or, equivalently

               (b) Let the input u(t) in the state equation (P8.8.2) be dependent on the state
                  as
                         u(t) = K x(t) = [ K 0 x 1 (t)  K 1 x 2 (t)  K 2 x 3 (t) ]  (P8.8.4)

                  Then, the state equation can be written as

                                                              

                       x 1 (t)       0        1        0       x 1 (t)

                              =      0        0        1                (P8.8.5)
                      x 2 (t)                             x 2 (t) 
                       x 3 (t)    K 0 − a 0  K 1 − a 1  K 2 − a 2  x 3 (t)

                  If the parameters of the original system matrix are a 0 = 1,a 1 =−2, and
                  a 2 = 3, what are the values of the gain matrix K = [K 0 K 1 K 2 ] you
                  will fix so that the virtual system matrix in the state equation (P8.8.5)
                  has the eigenvalues of λ =−1, −2, and −3? Note that the character-
                  istic equation of the system whose behavior is described by the state
                  equation (P8.8.5) is

                                       2
                          3
                          s + (a 2 − K 2 )s + (a 1 − K 1 )s + a 0 − K 0 = 0  (P8.8.6)
                  and the equation having the roots of λ =−1, −2, and −3is

                                              3
                                                    2
                         (s + 1)(s + 2)(s + 3) = s + 6s + 11s + 6 = 0   (P8.8.7)
           8.9 A Homogeneous Differential Equation—An Eigenvalue Equation
               Consider the undamped mass-spring system depicted in Fig. 8.3, where the
               masses and the spring constants are m 1 = 1,m 2 = 1[kg] and k 1 = 5,k 2 = 10
               [N/m], respectively. Complete the following program “nm8p09.m” whose
               objective is to solve the second-order differential equation (8.6.1) with the


               initial conditions [x 1 (0), x 2 (0), x (0), x (0)] = [1, −0.5, 0, 0] for the time
                                           1    2
               interval [0,10] in two ways—that is, by using the ODE-solver “ode45()”
               (Section 6.5.1) and by using the eigenvalue method (Section 8.6) and plot
               the two solutions. Run the completed program to obtain the solution graphs
               for x 1 (t) and x 2 (t).
               (cf) Note that the second-order vector differential equation (8.6.1) can be written as
                   the following state equation:


                                      x (t)    O    I   x(t)

                                           =                            (P8.9.1)

                                      x (t)    −AO      x (t)
   404   405   406   407   408   409   410   411   412   413   414