Answered step by step
Verified Expert Solution
Link Copied!

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 image text in transcribed

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 why

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

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

6. Have you used solid reasoning in your argument?

Answered: 1 week ago