Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with matlab homework 1 Numerical Differentiation The second and fourth order central difference formulas approximating f(x0) are given by (D02f)(x0;h)=h2f(x0+h)2f(x0)+f(x0h) and (D04f)(x0;h)=12h2f(x0+2h)+16f(x0+h)30f(x0)+16f(x0h)f(x02h),
I need help with matlab homework
1 Numerical Differentiation The second and fourth order central difference formulas approximating f(x0) are given by (D02f)(x0;h)=h2f(x0+h)2f(x0)+f(x0h) and (D04f)(x0;h)=12h2f(x0+2h)+16f(x0+h)30f(x0)+16f(x0h)f(x02h), respectively. (a) Show that the truncation errors in the approximations (1) and (2) are O(h2) and O(h4), respectively. (b) Consider the function f(x)=xx. Approximate f(2) by using the central difference formulas (1) and (2) with h=hk=2k,k=1,2,,16. Calculate the absolute errors in these two approximations for each stepsize hk=2k,k=1,2,,16 and then plot in one frame the errors against the stepsizes {hk}k=116 in log-log scale. What do you observe from the plots? Does this confirm the theory for order of convergence? If not, then explain whyStep 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