COS 323, Fall 2010, Assignment 4 README.txt Name: NetID: General Questions ----------------- 1. Using Matlab, compute the value of each of the following functions, sampled at locations x = 0:15 y3 = cos(3/8*pi*x); y5 = cos(5/8*pi*x); y7 = cos(7/8*pi*x); y9 = cos(9/8*pi*x); Compute the DFT of each, and plot the complex magnitude of the components. (No need to hand in the plots. Use the Matlab fft, abs, and plot functions.) Explain the qualitative behavior of the plots. Comment on the reason behind the relationship between the FFTs of y7 and y9. [your answer here] 2. [Heath, exercise 8.2] (a) Using the midpoint method, compute (by hand) the approximate value for the integral from 0 to 1 of x^3, using h = 1 and also h = 0.5. (b) Based on the two approximate values computed in (a), use Richardson extrapolation to compute a more accurate approximation to the integral. (c) Would you expect the extrapolated result computed in (b) to be exact? Why or why not? [your answer here] 3. Implement the midpoint method, and use it, together with a suitable change of variables and subdivision into intervals, to compute the integral of the Gaussian function exp(-x*x/2) from 0 to positive infinity. Compare to the analytic value of this integral, sqrt(0.5*pi), as a function of the number of function evaluations. How does accuracy depend on the location you chose to subdivide the domain into a "standard" integral and one with the change of variables? (Use the same number of samples in both sub-domains.) [your answer here] Programming assignment: Chaos ----------------------------- 1) How do your results in part (a) compare to a graph of y=exp(t)? How does the size of the time steps and number of iterations affect the accuracy of your results? Similarly, for part (b), how do your results compare to y=sin(t), and what is the effect of varying the time step size and number of iterations? [your answer here] 4) Compare the results you found with Runge-Kutta to those you found with Euler's method in parts 1a, 1b, 3a, and 3b. [your answer here] Briefly describe the structure of your code, your method for finding unique peaks (parts 2a and 2b), and any other implementation notes. [your answer here]