Starting from:

$20

MA322-Lab 2 Solved

1.    Let f(x) = ex, for 0 ≤ x ≤ 2.

i.          Approximate f(0.25) using linear Lagrange interpolation with x0 = 0 and x1 = 0.5. ii. Approximate f(0.75) using linear Lagrange interpolation with x0 = 0.5 and x1 = 1.

iii. Approximate f(0.25) and f(0.75) by using the second Lagrange interpolating polynomial with x0 = 0, x1 = 1, and x2 = 2. iv. Which approximations are better and why?

2.    Use appropriate Lagrange interpolating polynomials of degrees one, two, and three toapproximate each of the following:

i.          f(8.4) if f(8.1) = 16.94410, f(8.3) = 17.56492, f(8.6) = 18.50515, f(8.7) =

18.82091

ii.        

 
 
 

 33493750,

3.    Find the Lagrange form of interpolating polynomial P2(x) that interpolates the function f(x) = e−x2 at the nodes x0 = −1,x1 = 0 and x2 = 1. Further, find the value of P2(0.9) (use 6-digit rounding). Compare the value with the true value f(0.9) (use 6digit rounding). Find the max error in this calculation.

4.    Use the following values and four-digit rounding arithmetic to construct a third Lagrange polynomial approximation to f(1.09). The function being approximated is f(x) = log10(tanx). Use this knowledge to find a bound for the error in the approximation. f(1.00) = 0.1924, f(1.05) = 0.2414, f(1.10) = 0.2933, f(1.15) = 0.3492.

5.    Write three programs that accept as inputs (x1,...,xn), (f1,...,fn), z ∈R and return P(f[x1,...,xn])(z), where the interpolating polynomial P(f[x1,...,xn]) is computed using

i.          the monomial basis.ii. the Lagrange basis.

iii. the Newton basis.

Use your program to interpolate the error function erf, which is defined by

and which can be evaluated using the Matlab function erf, at the points 1,1.2,1.4,...,3 (or you can compute it in other way also). Plot the error between erf and the interpolating polynomial P(f[x1,...,xn]) computed with each of your three programs at z = (0 : 0.01 : 4) (here, 0.01 is step size). Based on your results, would you recommend using polynomial interpolation to approximate erf at points outside [1 3]?



 
 
 

Plot the error between the interpolation polynomial computed using the monomial basis and the Newton basis and plot the error between the interpolation polynomial computed using the Lagrange basis and the Newton basis. Which method introduces the largest error in computing the interpolation polynomial.

More products