Question: 3. Here we approximate f'(x) for a periodic function f(x) defined on [0, 27] using a nodal Fourier method (please don't worry if you have

 3. Here we approximate f'(x) for a periodic function f(x) defined

3. Here we approximate f'(x) for a periodic function f(x) defined on [0, 27] using a nodal Fourier method (please don't worry if you have never heard of such). Define a grid of x values via X k = 27 (k 1)/N, for k = 1, 2, ...,N. Assume throughout that N is an even integer. Define a column vector f with components fk f(xk), and a derivative matrix DERNXN with entries djk={ (-1)3+k2 cot(r(j k)/N) if j #k if j = k. 0 The kth component gk of g = Df then approximates the derivative value f'(xk). A MATLAB function FourierDerivativeMatrix which returns D (for N even) is posted on UNM Learn. For f(x) = exp(sin x) use FourierDerivativeMatrix to approximate f'(7) as the component g(1 + N/2) = 91+N/2: That is, approximate f'(7) as the (1+N/2)st component of Df. For N = - 4,8, 12, 16, 20, 24, 28, 32, 36 compute the error (in absolute value) between the approximation and the exact answer (still 1). Plot the set of errors versus N. What do you observe? 3. Here we approximate f'(x) for a periodic function f(x) defined on [0, 27] using a nodal Fourier method (please don't worry if you have never heard of such). Define a grid of x values via X k = 27 (k 1)/N, for k = 1, 2, ...,N. Assume throughout that N is an even integer. Define a column vector f with components fk f(xk), and a derivative matrix DERNXN with entries djk={ (-1)3+k2 cot(r(j k)/N) if j #k if j = k. 0 The kth component gk of g = Df then approximates the derivative value f'(xk). A MATLAB function FourierDerivativeMatrix which returns D (for N even) is posted on UNM Learn. For f(x) = exp(sin x) use FourierDerivativeMatrix to approximate f'(7) as the component g(1 + N/2) = 91+N/2: That is, approximate f'(7) as the (1+N/2)st component of Df. For N = - 4,8, 12, 16, 20, 24, 28, 32, 36 compute the error (in absolute value) between the approximation and the exact answer (still 1). Plot the set of errors versus N. What do you observe

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!