Page 256 -
P. 256

In-Class Exercise

                             Pb. 8.7 Verify the accuracy of truncating at the fifth element the following
                             Taylor series, in a domain that you need to specify, so the error is everywhere
                             less than one part in 10,000:
                                             ∞
                                a. ln(1+ x ) = ∑ ( 1−  ) n + 1 x n
                                             n = 1    n
                                           ∞
                                b. sin( )x = ∑ (−1 ) n  x 2 n+1
                                           n=0    ( n +2  1 )!
                                           ∞
                                c. cos( )x = ∑ (−1 ) n  x 2 n

                                           n=0    ( n2  )!




                             8.7.5  Reconstructing a Function from Its Fourier Components
                             From the results of Section 7.9, where we discussed the Fourier series, it is a
                             simple matter to show that any even periodic function with period 2π can be
                             written in the form of a cosine series, and that an odd periodic function can
                             be written in the form of a sine series of the fundamental frequency and its
                             higher harmonics.
                              Knowing the coefficients of its Fourier series, we would like to plot the
                             function over a period. The purpose of the following example is two-fold:

                                1. On the mechanistic side, to illustrate again the setting up of a two
                                   indices problem in a matrix form.
                                2. On the mathematical contents side, examining the effects of trun-
                                   cating a Fourier series on the resulting curve.

                             Example 8.8
                                        M
                                       ∑                    − ( 1 ) k
                             Plot  yx( ) =  C cos( kx),  if  C =  2  .   Choose successively for M the val-
                                                        k
                                           k
                                       k=1                 k + 1
                             ues 5, 20, and 40.
                             Solution: Edit and execute the following script M-file:

                                M= ;
                                p=500;
                                k=1:M;


                             © 2001 by CRC Press LLC
   251   252   253   254   255   256   257   258   259   260   261