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

Using the Method of Undetermined Coefficients for the Forced Response


                             – 2t
               reduces to kte   . Therefore the forced response will have the form

                                                  y =   (  k t +  k )  4  e – 2t                       (5.63)
                                                   F
                                                          3
                               – 2t      – 2t                                                            2
               But the terms e     and te    are also present in (5.61); therefore, we multiply (5.62) by t   to
               obtain a suitable form for the forced response which now is
                                                          3
                                                 y =  (  k t +  k t )  4  2  e – 2t                    (5.64)
                                                  F
                                                        3
               Now, we need to evaluate the constants k  3  and k 4 . This is done by substituting (5.64) into the
               given ODE of (5.61) and equating with the right side. We use MATLAB do the computations as
               shown below.


               syms t k3 k4                        % Define symbolic variables
               f0=(k3*t^3+k4*t^2)*exp(−2*t);       % Forced response (5.64)
               f1=diff(f0); f1=simple(f1)          % Compute and simplify first derivative
               f1 =
               -t*exp(-2*t)*(-3*k3*t-2*k4+2*k3*t^2+2*k4*t)
               f2=diff(f0,2); f2=simple(f2)        % Compute and simplify second derivative

               f2 =
               2*exp(-2*t)*(3*k3*t+k4-6*k3*t^2-4*k4*t+2*k3*t^3+2*k4*t^2)
               f=f2+4*f1+4*f0; f=simple(f)         % Form and simplify the left side of the given ODE

               f = 2*(3*k3*t+k4)*exp(-2*t)
               Finally, we equate f above with the right side of the given ODE, that is

                                              (
                                             23k t +  k )  4  e – 2t  =  te – 2t  –  e – 2t            (5.65)
                                                  3
                                                  ⁄
                                  ⁄
               and we find k =   16   and k =  – 12  . By substitution of these values into (5.64) and combining
                             3
                                           4
               the forced response with the natural response, we obtain the total solution
                                                                        --t e
                                                                -
                                                               --t e
                                                                        -
                                        yt() =  k e – 2t  +  k te – 2t +  1 3 – 2t  –  1 2 – 2t        (5.66)
                                                        2
                                                1
                                                               6
                                                                        2
               We verify this solution with MATLAB as follows:
               z=dsolve('D2y+4*Dy+4*y=t*exp(−2*t)−exp(−2*t)')
               z =
               1/6*exp(-2*t)*t^3-1/2*exp(-2*t)*t^2
               +C1*exp(-2*t)+C2*t*exp(-2*t)




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

               Copyright © Orchard Publications
   175   176   177   178   179   180   181   182   183   184   185