1. Math
  2. Advanced Math
  3. finitedifference approximation 6 let fx be a given function and...

Question: finitedifference approximation 6 let fx be a given function and...

Question details

Finite-Difference Approximation 6. Let f(x) be a given function and recall the forward difference approximation of f (x): where h>0 is the step size (a) Take f(x) = sin x, x = π/4, h = 2-n for n = 1, 2, . . . ,6. Following example in class, plot the error versus h (use command loglog instead of plot) and make a table with the following information: You may modify the Matlab code shown in class. Present at least eight decimal digits (type format long in Matlab to get the full 15 digits) (b) Repeat for central difference approximation Dof(x) = f(x + h)-f(x-h) 2h which also approximates f(x). Which approximation is more accurate? Explain why.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution