Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(c) (Optional) The following is a MATLAB code for the Richardson extrapolation algorithm on Page 510 of Kincaid&Chenney for ap- proximating the derivative of f()Inr
(c) (Optional) The following is a MATLAB code for the Richardson extrapolation algorithm on Page 510 of Kincaid&Chenney for ap- proximating the derivative of f()Inr at 3. First copy the code to a M-file and try it in MATLAB. Make a copy of the code and then modify the new version to approximate the derivative of f(x) = sin(x2 + ) at x = 0, From a nicely displayed table of the error, estimate the order of the finite difference approximation you just coded, by repeatedly changing the value of Ih % implemention of the Richardson extrapolation algorithm % on Page 510 of Kincaid&Cheney D = zeros (M , M); % Set D to be an M by M matrix with % all zero entries % In MATLAB, index has to start from 1 % Adapt the index in subsequent places for n1:M hn-h/2 (n-1); D(n,1) - ( log(xthn) log(x-hn)) / (2*hn); end for k-2: M for n-k M D(n,k) - D(n,k-1)D(n,k-1) D(n-1,k-1) end (4 (k-1) - 1); end format long; disp(D)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started