CASE STUDY SUNSPOTS Applied Numerical Methods with MATLAB fo

plotf,pow xlabelFrequency cyclesyear; ylabelPower titlePower versus frequency The result, as shown in Fig. 16.14, indicates a peak at a frequency of about 0.0915 Hz. This corresponds to a period of 10.0915 = 10.93 years. Thus, the Fourier analysis is consistent with Wolf’s estimate of 11 years.

16.7 CASE STUDY continued

FIGURE 16.14 Power spectrum for Wolf sunspot number versus year. 0.05 0.5 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 2000 3000 4000 5000 Power spectrum Power Cyclesyear 1000 PROBLEMS

16.1 The pH in a reactor varies sinusoidally over the course

of a day. Use least-squares regression to fit Eq. 16.11 to the following data. Use your fit to determine the mean, amplitude, and time of maximum pH. Note that the period is 24 hr Time, hr 2 4 5 7 9 pH 7.6 7.2 7 6.5 7.5 7.2 Time, hr 12 15 20 22 24 pH 8.9 9.1 8.9 7.9 7

16.2 The solar radiation for Tucson, Arizona, has been tab-

ulated as Time, mo J F M A M J Radiation, Wm 2 144 188 245 311 351 359 Time, mo J A S O N D Radiation, Wm 2 308 287 260 211 159 131 Assuming each month is 30 days long, fit a sinusoid to these data. Use the resulting equation to predict the radiation in mid-August. PROBLEMS 403

16.3 The average values of a function can be determined by

¯f = t f t dt t Use this relationship to verify the results of Eq. 16.13. 16.4 In electric circuits, it is common to see current behavior in the form of a square wave as shown in Fig. P16.4 notice that square wave differs from the one described in Example 16.2. Solving for the Fourier series from f t = A 0 ≤ t ≤ T2 −A T 2 ≤ t ≤ T the Fourier series can be represented as f t = ∞ n =1 4 A 2n − 1π sin 2π2n − 1t T Develop a MATLAB function to generate a plot of the first n terms of the Fourier series individually, as well as the sum of these six terms. Design your function so that it plots the curves from t = 0 to 4T. Use thin dotted red lines for the in- dividual terms and a bold black solid line for the summation i.e., k-,linewidth,2 . The function’s first line should be function [t,f] = FourierSquareA0,T,n Let A = 1 and T = 0.25 s. 16.5 Use a continuous Fourier series to approximate the sawtooth wave in Fig. P16.5. Plot the first four terms along with the summation. In addition, construct amplitude and phase line spectra for the first four terms. 16.6 Use a continuous Fourier series to approximate the tri- angular wave form in Fig. P16.6. Plot the first four terms along with the summation. In addition, construct amplitude and phase line spectra for the first four terms.

16.7 Use the Maclaurin series expansions for e

x , cos x and sin x to prove Euler’s formula Eq. 16.21.

16.8 A half-wave rectifier can be characterized by

C 1 = 1 π + 1 2 sin t − 2 3π cos 2t − 2 15π cos 4t − 2 35π cos 6t − · · · where C 1 is the amplitude of the wave. a Plot the first four terms along with the summation. b Construct amplitude and phase line spectra for the first four terms.

16.9 Duplicate Example 16.3, but for 64 points sampled at a

rate of t = 0.01 s from the function f t = cos[2π12.5t] + cos[2π25t] Use fft to generate a DFT of these values and plot the results.

16.10 Use MATLAB to generate 64 points from the function

f t = cos10t + sin3t 0.25 0.5 0.75 1 f t t ⫺1 1 FIGURE P16.4 T ⫺ 1 ⫺ 1 1 t FIGURE P16.5 A sawtooth wave. 2 ⫺ 2 1 t FIGURE P16.6 A triangular wave.