Question: Here we approximate f'(x) for a periodic function f(x) defined on (0,21] using a nodal Fourier method :. Define a grid of x values via

Here we approximate f'(x) for a periodic function f(x) defined on (0,21] using a nodal Fourier method :. Define a grid of x values via *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 fx = f(xk), and a derivative matrix DERNXN with entries 1(-1)+k-2 cot(T(j - k)/N) if j #k djk 0 if j = k. The kth component gk of g = Df then approximates the derivative value f'(xk). A MATLAB function FourierDerivativeMatrix which returns D (for N even) For f(x) = exp(sin x) use FourierDerivativeMatrix to approximate f'() as the component 9(1+N/2) = 91+N/2 That is, approximate f'(s) 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. ={}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
