Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In MATLAB 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

In MATLAB image text in transcribed

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 Ik = 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 3(-1);+k2 cot(7(j k)/N) ifj #k djk 0 if j=k. The kth component gk of g = Df then approximates the derivative value f'(tk). 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'(T) as the component g(1+N/2) = 91+N/2- That is, approximate f'(T) 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 Ik = 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 3(-1);+k2 cot(7(j k)/N) ifj #k djk 0 if j=k. The kth component gk of g = Df then approximates the derivative value f'(tk). 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'(T) as the component g(1+N/2) = 91+N/2- That is, approximate f'(T) 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions