Thompson - Computing for Scientists and Engineers (523188), страница 64
Текст из файла (страница 64)
For example, in Figure 9.16 (b) we see the discontinuity in dy/dxthat occurs for our generalized sawtooth at x = This discontinuity, of amountsR - sL, is independent of the discontinuity in y at the same point, namely D.Derivative discontinuities can be removed as follows. If instead of y in (9.42) wehad its nth derivative, then integration by parts n times would recover the integral asshown, with some k-dependent factors and additional endpoint values.
Therefore,there is no Wilbraham-Gibbs phenomenon arising merely from discontinuities ofslope, but only from discontinuities of y itself. We show this explicitly towards theend of this section for the wedge function, for which the slope discontinuity atbut for which there is no discontinuity in value (D = 0).With these preliminary remarks, we are ready to calculate the ck in (9.72). Fork = 0 we obtain, as always, that a0 = c0 /2, the average value of y in the interval ofintegration, namely(9.73)For k > 0 the integrals can be performed directly by the methods in Section 9.5.Upon taking real and imaginary parts of the resulting ck you will obtain352DISCRETE FOURIER TRANSFORMS AND FOURIER SERIES(9.74)(9.75)where the phase factor(9.76)has the property that(9.77)a result that is useful when manipulating expressions subsequently.Exercise 9.24Start from the generalized sawtooth (9.71) in the Fourier series formula (9.42) toderive formulas (9.74) and (9.75) for the Fourier coefficients.
nThe formulas for the Fourier amplitudes of the generalized sawtooth, (9.74) and(9.75), can be used directly to generate the amplitudes for the examples in Section 9.5. The appropriate slope and discontinuity values are given at the beginningof this section, or can be read off Figure 9.16 (a). Note that we have introduced aconsiderable labor-saving device by allowing all the exercises in Section 9.5 to becompósed in a single formula. (The purpose of exercises is not, however, to savelabor but, rather, to develop fitness and skill.)What is the value of the Fourier series right at the discontinuity, x = ? It isobtained directly by using x = in the Fourier expansion with the ak values from(9.74) and the sine terms not contributing. The result is simply(9.78)There are several interesting conclusions from this result:(1) The Fourier series prediction at the discontinuity depends on M independent ofthe extent of the discontinuity, D.(2) For any number of terms in the sum, M, if there is no change of slope across thediscontinuity (as for the square pulse and conventional sawtooth), the series value isjust the mean value of the function, a0.
For the square pulse the series value at thediscontinuity is just the average of the function values just to the left and right of thediscontinuity, namely zero.(3) The series in (9.78) is just twice the sum over the reciprocal squares of the oddintegers not exceeding M. It therefore increases uniformly as M increases. Thisconvergence is illustrated for the wedge function in Figure 9.10. The limiting value9.6 DIVERSION: THE WILBRAHAM-GIBBS OVERSHOOT353of the series can be obtained in terms of the Riemann zeta function, as(Abramowitz and Stegun, formulas 23.2.20, 23.2.24).
The Fourier series then approaches(9.79)Thus, independently of the slopes on each side of the discontinuity, the series tendsto the average value across the discontinuity -a commonsense result.Exercise 9.25(a) Derive the result for the Fourier series at the discontinuity, (9.79), by usingthe steps indicated above that equation.(b) Write a small program that calculates the sum in (9.78) for an input value ofM. Check it out for a few small values of M, then take increasingly larger valuesof M in order to verify the convergence to(c) Justify each of the conclusions (1) through (3) above.
nNotice that in the above we took the limit in x, then we examined the limit of theseries. The result is perfectly reasonable and well-behaved. The surprising factabout the Wilbraham-Gibbs phenomenon, which we now examine, is that taking thelimits in the opposite order produces quite a different result.The Wilbraham-Gibbs phenomenonNow that we have examined a function without a discontinuity in value but only inslope, we direct our steps to studying the discontinuity. Consider any x not at apoint of discontinuity of y.
The overshoot function, defined by(9.80)is then well-defined, because both the series representation and the function itself arewell-defined. As we derived at the end of the last subsection, if we let x approachthe point of discontinuity with M finite, we get a sensible result. Now, however,we stay near (but not at) the discontinuity. We will find that the value of 0M depends quite strongly on both x and M. In order to distinguish between the usual oscillations of the series approximation about the function and a Wilbraham-Gibbsphenomenon, one must consider the behavior of 0M for large M and identify whichparts (if any) persist in this limit.For the generalized sawtooth shown in Figure 9.16 (a) we can substitute for theseries the expressions (9.73), (9.74) and (9.75), and for the function (9.71), to derive the explicit formula for the overshoot function354DISCRETE FOURIER TRANSFORMS AND FOURIER SERIES(9.8 1)where the trigonometric sums are(9.82)(9.83)(9.84)The signs in the definitions of these sums are chosen so that the sums are positivefor x close to, but less than,Exercise 9.26Fill in the steps in deriving the overshoot function equation (9.81), including thetrigonometric series (9.82) - (9.84).
nYou may investigate the overshoot values directly as a function of the maximumharmonic in the Fourier series, M, and as a function of the values of x near the discontinuity at x =We first see what progress we can make analytically. In particular, for what value of x, say xM, does 0M(x) have a maximum for x nearTo investigate this, let us do the obvious and calculate the derivatives of the terms in(9.81), which requires the derivatives of the trigonometric series, (9.82) - (9.84).We have(9.85)(9.86)(9.87)9.6 DIVERSION: THE WILBRAHAM-GIBBS OVERSHOOT355Exercise 9.27Carry out the indicated derivatives of the trigonometric series in order to verify(9.85) - (9.87).
nTo evaluate the latter two series in closed form, we write the cosine as the real partof the complex-exponential function, then recognize that one has geometric series inpowers of exp (ix), which can be summed by elementary means then converted tosine form by using the formulas in Section 2.3. Thus(9.88)(9.89)In the second equation we assume that M is odd, else M + 1 is replaced by M. SinceSD is not known in closed form, there is probably no simple way to evaluate thederivative of S- in closed form. It turns out that we will not need it.Collecting the pieces together, we finally have the result for the derivative of theovershoot at any(9.90)It is worthwhile to check out these derivations yourself.Exercise 9.28(a) Sum the series (9.86) and (9.87) as indicated in order to verify (9.88) and(9.89).(b) Verify equation (9.90) for the derivative of the overshoot function.
nThe derivative in (9.90) is apparently a function of the independently chosen quantities sR, sL, D, and M. Therefore, the position of the overshoot extremum (positiveor negative) seems to depend upon all of these.The wedge was the only example that we considered in Section 9.5 that hadand it was well-behaved near x = because D = 0. Figure 9.17 showsthe overshoot function for the wedge, for three small values of M, namely, 1, 3, and15. Only the S- series, (9.82), is operative for 0M, and this series converges as1/k2 rather than as l/k for the other series. Note the very rapid convergence, whichimproves about an order of magnitude between each choice of M. Clearly, there isno persistent overshoot.356DISCRETE FOURIER TRANSFORMS AND FOURIER SERIESFIGURE 9.17 Oscillation of the Fourier series for the wedge function, (9.80).
shown forM = 1 (dotted curve), M = 3 (dashed curve), and M = 15 (solid curve). The overshoot functionfor M = 3 has been multiplied by 10. and that for M = 15 has been multiplied by 100. Thederivative of the wedge function, but not the wedge function itself, has a discontinuity at x =Exercise 9.29(a) Modify the program Fourier Series in Section 9.5 so that it can prepareoutput for a graphics program to make plots like those shown for the wedge series oscillations in Figure 9.17.
(I found it most convenient to write a file fromthe program, then to do the plotting from a separate application program. Thatway, it was not necessary to recalculate the Fourier series each time I modifiedthe display.)(b) Calculate 0M(x) for the wedge for a range of maximum k values, M, similarly to Figure 9.17. Note that the convergence goes as 1/k2, so you shouldfind a very rapid approach to zero overshoot.
Scaling of the function as M increases, as indicated in Figure 9.17, will probably be necessary. nNow that we have experience with the overshoot phenomenon, it is interesting toexplore the effects with functions that have discontinuities.Overshoot for the square pulse and sawtoothFor the square-pulse function, the common example for displaying the WilbrahamGibbs phenomenon, sR = sL = 0, so that in (9.90) the extremum closest to (but notexceeding) will occur at(9.91)9.6 DIVERSION: THE WILBRAHAM-GIBBS OVERSHOOT357By differentiating the last term in (9.90) once more, you will find that the secondderivative is negative at xM, so this x value produces a maximum of 0M.
Indeed,from (9.90) it is straightforward to predict that there are equally spaced maxima below x = with spacingThus, the area under each excursion abovethe line y = must decrease steadily as M increases.Exercise 9.30(a) Verify the statement that there are equally spaced maxima below x = bysuccessive differentiation of (9.90).(b) After (M + 1) such derivatives you will have maxima at negative x. Explainthis result. nThe square-pulse overshoot behavior is shown in Figure 9.18, in which we see thepositive overshoot position shrinking proportionally closer to as M increases, butreaching a uniform height that is eventually independent of M.