Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help writing Matlab code and please comment on the work so I could understand thank you Consider the function f(r) = (r2-31+2) arctan r.

Need help writing Matlab code and please comment on the work so I could understand thank you

image text in transcribed

Consider the function f(r) = (r2-31+2) arctan r. Estimate the derivative of the function at the point 0 using each of the three formulas listed below for all of the following values of h: h = 10- 1, 3, 6. Make a log log plot of your error verses h (use the same plot for both methods). n (forward difference) (3 pt centered difference) (5 pt centered difference) 2h f'(o) 12h For n = 1,3,6 call FDI, FD3, FD6 the result obtain with the forward difference, CD31, CD33, CD36 the result obtain with the 3 point centered difference, and CD51, CD53, CD56 the result obtain with the 5 point centered difference. Plot your error for all three methods on the same graph. Explain your findings. Is the error decreasing with h? Why or why not? Which method has the largest error? Which method has the smallest error? Why? Write those answers in comment using

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

Students also viewed these Databases questions