Page 140 - Applied Numerical Methods Using MATLAB
P. 140

PADE APPROXIMATION BY RATIONAL FUNCTION  129
              We can apply this formula to get the polynomial approximation directly for
            a given function f(x), without having to resort to the Lagrange or Newton
            polynomial. Given a function, the degree of the approximate polynomial, and the
            left/right boundary points of the interval, the above MATLAB routine “cheby()”
            uses this formula to make the Chebyshev polynomial approximation.
              The following example illustrates that this formula gives the same approximate
            polynomial function as could be obtained by applying the Newton polynomial
            with the Chebyshev nodes.


            Example 3.1. Approximation by Chebyshev Polynomial. Consider the problem
            of finding the second-degree (N = 2) polynomial to approximate the function
                           2
            f(x) = 1/(1 + 8x ). We make the following program “do_cheby.m”, which uses
            the MATLAB routine “cheby()” for this job and uses Lagrange/Newton polyno-
            mial with the Chebyshev nodes to do the same job. Readers can run this program
            to check if the results are the same.

             %do_cheby.m
             N=2;a=-2;b=2;
             [c,x1,y1] = cheby(’f31’,N,a,b) %Chebyshev polynomial ftn
             %for comparison with Lagrange/Newton polynomial ftn
             k = [0:N]; xn = cos((2*N + 1 - 2*k)*pi/2/(N + 1));%Eq.(3.3.1a):Chebyshev nodes
             x = ((b-a)*xn +a + b)/2;  %Eq.(3.3.1b)
             y = f31(x); n = newtonp(x,y), l = lagranp(x,y)

              >>do_cheby
                  c = -0.3200  -0.0000    1.0000


            3.4  PADE APPROXIMATION BY RATIONAL FUNCTION

                                                                          o
            Pade approximation tries to approximate a function f(x) around a point x by a
            rational function
                                       o
                              Q M (x − x )
                          o
                p M,N (x − x ) =           with M = N or M = N + 1
                                       o
                              D N (x − x )
                                          o
                                                                       o M
                                                      o 2
                              q 0 + q 1 (x − x ) + q 2 (x − x ) +· · · + q M (x − x )
                            =
                                                                       o N
                                                     o 2
                                          o
                               1 + d 1 (x − x ) + d 2 (x − x ) +· · · + d N (x − x )
                                                                         (3.4.1)
                                                  o

                     o
                           o
                                   o
            where f(x ), f (x ), f  (2) (x ), . ..,f (M+N) (x ) are known.
              How do we find such a rational function? We write the Taylor series expansion
                                            o
            of f(x) up to degree M + N at x = x as
   135   136   137   138   139   140   141   142   143   144   145