Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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) - 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
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