Page 174 - Numerical Analysis Using MATLAB and Excel
P. 174

Using the Method of Undetermined Coefficients for the Forced Response


                                                               t –
                                          yt() =  y +  y =  k e +  k e – 3t – 3e – 2t                  (5.40)
                                                  N
                                                                   2
                                                      F
                                                            1
               The constants k 1  and k 2  are evaluated from the given initial conditions. For this example,
                                                               0
                                                                      0
                                                y0() =  1 =  k e +  k e –  3e 0
                                                             1
                                                                    2
               or
                                                      k +  k =  4                                      (5.41)
                                                           2
                                                       1
               Also,
                                                                   t –
                                                   ------
                                     y' 0() =  – 1 =  dy   =  –  k e –  3k e – 3t  +  6e – 2t
                                                   dt           1       2          t =  0
                                                      t =  0
               or
                                                    –  k – 3k =  – 7                                   (5.42)
                                                            2
                                                       1
               Simultaneous solution of (5.41) and (5.42) yields k =   2.5  and k =  1.5 . By substitution into
                                                                                 2
                                                                   1
               (5.40), we obtain
                                                               t –
                                         yt() =  y + y =  2.5e +  1.5e – 3t – 3e – 2t                  (5.43)
                                                      F
                                                 N
               Check with MATLAB:
               y=dsolve('D2y+4*Dy+3*y=3*exp(−2*t)', 'y(0)=1', 'Dy(0)=−1')

               y =
               (-3*exp(-2*t)*exp(t)+3/2*exp(-3*t)*exp(t)+5/2)/exp(t)
               pretty(y)

                    -3 exp(-2 t) exp(t) + 3/2 exp(-3 t) exp(t) + 5/2
                    ------------------------------------------------
                                    exp(t)
               The plot is shown in Figure 5.2 was produced with the MATLAB script


               y=dsolve('D2y+4*Dy+3*y=3*exp(−2*t)', 'y(0)=1', 'Dy(0)=−1'); ezplot(y,[0 8])

               Example 5.8

               Find the total solution of the ODE
                                                   2
                                                         dy
                                                  d y  +  6------ +  9y =  0                           (5.44)
                                                   t d  2  dt

               subject to the initial conditions y0() =  – 1  and y' 0() =  1





               Numerical Analysis Using MATLAB® and Excel®, Third Edition                              5−13

               Copyright © Orchard Publications
   169   170   171   172   173   174   175   176   177   178   179