Question: engineering help pls m-file MATLAB 1. Total Numerical Error (L01, LO2) Consider the function f(x)=sin(x) defined over the interval [0,21]. a) How small do you

engineering help pls

m-file MATLAB

engineering help pls m-file MATLAB 1. Total Numerical Error (L01, LO2) Consider

1. Total Numerical Error (L01, LO2) Consider the function f(x)=sin(x) defined over the interval [0,21]. a) How small do you have to make the distance h between xo and its neighboring points to compute the first derivative f (x=xo) at xo=1/4 with an O(h) forward finite difference formula and a relative error of 10-6 ? Start with a value of h=0.2 and progressively reduce it by a factor of 10 each time until you fall below the desired error threshold. Plot on a log-log diagram the relative error as a function of distance h. b) In a similar spirit to what we discussed in class, for the above choice of finite difference formula, the truncation error is bounded by Mh/2 where M = max {lf"(5))} and } is a point in the neighborhood of xo (Hint: see Example 4.5 of textbook on how to estimate M). The round-off error is bounded by 2/h where is the machine epsilon. If you are working with a computer that is limited to single-precision do you expect the same level of accuracy from the numerical differentiation in part (a) of this problem (even with the sufficiently small h you have identified) ? Explain your answer with explicitly repeating the computations of part (a) in single-precision. 1. Total Numerical Error (L01, LO2) Consider the function f(x)=sin(x) defined over the interval [0,21]. a) How small do you have to make the distance h between xo and its neighboring points to compute the first derivative f (x=xo) at xo=1/4 with an O(h) forward finite difference formula and a relative error of 10-6 ? Start with a value of h=0.2 and progressively reduce it by a factor of 10 each time until you fall below the desired error threshold. Plot on a log-log diagram the relative error as a function of distance h. b) In a similar spirit to what we discussed in class, for the above choice of finite difference formula, the truncation error is bounded by Mh/2 where M = max {lf"(5))} and } is a point in the neighborhood of xo (Hint: see Example 4.5 of textbook on how to estimate M). The round-off error is bounded by 2/h where is the machine epsilon. If you are working with a computer that is limited to single-precision do you expect the same level of accuracy from the numerical differentiation in part (a) of this problem (even with the sufficiently small h you have identified) ? Explain your answer with explicitly repeating the computations of part (a) in single-precision

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