Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions