Question: lectures/notes that the forward difference quotient Dr[f; x, h]:= = f(x+h) - f(x) h converges linearly, and the central difference quotient Dc[f; x,h] =

lectures/notes that the forward difference quotient Dr[f; x, h]:= = f(x+h) -

 

lectures/notes that the forward difference quotient Dr[f; x, h]:= = f(x+h) - f(x) h converges linearly, and the central difference quotient Dc[f; x,h] = f(xh) f(xh) - 2h 4 converges quadratically to f'(t) as h0 if f is smooth enough and no round-off errors occur. a) Write a function d=D_F(f,x,h) in Matlab that computes the forward difference quotient of f with step-size h at the point x. b) Write a function d-D_C(f,x,h) in Matlab that computes the central difference quotient of f with step-size h at the point x. c) Write a script diff_test in Matlab which uses the functions from tasks a) and b) to plot the errors ep(h)|sin'(1) Dr[sin; 1, h], ec(h) = | sin'(1) Dc[sin; 1, h]| = for h; 10/4, i = 0, 1,..., 50 into a loglog plot. Add a proper title, axis labels and a legend to your figure.

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 Programming Questions!