Sale!

MATH/COSC 303 Assignment 4 solved

Original price was: $30.00.Current price is: $25.00. $21.25

Category:

Description

5/5 - (3 votes)

Computer Assisted Questions:
6. Three formulae for approximating f
0 are
DD(h) = f(¯x+h)−f(¯x)
h
CDh2 (h) = f(¯x+h)−f(¯x−h)
2h
CDh4 (h) = −f(¯x+2h)+8f(¯x+h)−8f(¯x−h)+f(¯x−2h)
12h
.
Consider f(x) = 1
2
e
2x at ¯x = 1.
a) Use each formula and h = {1, 10−1
, 10−2
, . . . , 10−16} to approximate f
0
(¯x).
b) Compute the relative error for each formula and value of h.
c) Which formula approximates f
0
(¯x) the ‘fastest’?
d) What value of h provides the highest accuracy for each formula?
7. Two formulae for approximating f
00 are
CD(2)
h2 (h) = f(¯x+h)−2f(¯x)+f(¯x−h)
h2
CD(2)
h4 (h) = −f(¯x+2h)+16f(¯x+h)−30f(¯x)+16f(¯x−h)−f(¯x−2h)
12h2 .
Consider f(x) = 1
2
e
2x at ¯x = 1.
a) Use each formula and h = {1, 10−1
, 10−2
, . . . , 10−16} to approximate f
00(¯x).
b) Compute the relative error for each formula and value of h.
c) Which formula approximates f
00(¯x) the ‘fastest’?
d) What value of h provides the highest accuracy for each formula?
8. Let f(x) = cos(x).
a) Write a MATLAB function that uses Lagrange or Newton Interpolation to create a
polynomial interpolation p(x) of degree d for f(x) = cos(x) over the interval [0, 1] (d
should be an input to the function).
c) Use (a) to approximate f(0.5) by using polynomials of degree d = {2, 3, 4, …10}. Compute
the relative error for each estimation.
MATH/COSC 303 Assignment 4