MATH 4446 Homework: Numerical Analysis and Interpolation - Prof. Lizette Zietsman, Assignments of Mathematical Methods for Numerical Analysis and Optimization

A homework assignment for a math 4446 course focused on numerical analysis. The assignment covers topics such as plotting data points using matlab, converting polynomials to nested form, interpolating functions using linear and quadratic polynomials, and understanding the properties of lagrange interpolating polynomials. Students are expected to complete various calculations and graphical comparisons to understand the concepts.

Typology: Assignments

Pre 2010

Uploaded on 02/13/2009

koofers-user-76q
koofers-user-76q 🇺🇸

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Homework MATH 4446
Introduction to Numerical Analysis: Spring 2009
1. Plot the following data points using MATLAB.
x3 1 2 5
f(x)23 11 23 1
2. Plot f(x) = sin(2x) on the interval [0, π] using MATLAB.
3. Convert P(x) = 4x5+5x43x3+ 7x28x+ 10 to nested form (by hand) and evaluate
P(3). How many fewer multiplications are required for the function evaluation if Pis
in nested form? Horner’s method is often used to obtain the nested representation of a
polynomial. Use Horner’s method in MATLAB to obtain the nested form of P. (Use
the MATLAB help-function to obtain more information about horner.) To evaluate
the function at x= 3, use the MATLAB command subs.
Chapter 3
Section 3.1
1. Section 3.1 #1 (a)
2. Consider the following interpolating points for the function f(x) = ln x.
xi2 2.5 3
f(xi) 0.69315 0.91625 1.09861
2.1 Construct a linear, P1, and a quadratic, P2, interpolating polynomial to the func-
tion f(x) = ln xto approximate f(2.2). Compute Pn(2.2), n = 1,2.
2.2 Graph the Lagrange interpolating polynomials, Ln,j(x), n = 1,2, on the interval
[2,3].
2.3 Compare, by graphing, the two interpolants in 2.1 to fon the interval [2,3].
Which interpolant would you say is the most accurate and why?
2.4 Compute the absolute error, |f(2.2) Pn(2.2)|, for n= 1,2.
2.5 Find an error bound for the two approximations. (Theorem 3.3.)
3. Let xi=i. Compute and plot L2, L3, and L5on the intervals [0,4],[0,6],and [0,10]
respectively.
Based on your results, comment on the following statement:
At each of the points xithere is only one non-zero Lagrange polynomial, Li, and one
expect that Liwill have the most influence on the shape of the curve near xi. This will
be the case if Litakes its maximum value at xiand decays in magnitude further away
from xi.
pf3
pf4

Partial preview of the text

Download MATH 4446 Homework: Numerical Analysis and Interpolation - Prof. Lizette Zietsman and more Assignments Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Homework MATH 4446

Introduction to Numerical Analysis: Spring 2009

  1. Plot the following data points using MATLAB. x − 3 1 2 5 f (x) − 23 − 11 − 23 1
  2. Plot f (x) = sin(2x) on the interval [0, π] using MATLAB.
  3. Convert P (x) = 4x^5 + 5x^4 − 3 x^3 + 7x^2 − 8 x + 10 to nested form (by hand) and evaluate P (3). How many fewer multiplications are required for the function evaluation if P is in nested form? Horner’s method is often used to obtain the nested representation of a polynomial. Use Horner’s method in MATLAB to obtain the nested form of P. (Use the MATLAB help-function to obtain more information about horner.) To evaluate the function at x = 3, use the MATLAB command subs.

Chapter 3

Section 3.

  1. Section 3.1 #1 (a)
  2. Consider the following interpolating points for the function f (x) = ln x. xi 2 2.5 3 f (xi) 0.69315 0.91625 1.

2.1 Construct a linear, P 1 , and a quadratic, P 2 , interpolating polynomial to the func- tion f (x) = ln x to approximate f (2.2). Compute Pn(2.2), n = 1, 2. 2.2 Graph the Lagrange interpolating polynomials, Ln,j (x), n = 1, 2, on the interval [2, 3]. 2.3 Compare, by graphing, the two interpolants in 2.1 to f on the interval [2, 3]. Which interpolant would you say is the most accurate and why? 2.4 Compute the absolute error, |f (2.2) − Pn(2.2)|, for n = 1, 2. 2.5 Find an error bound for the two approximations. (Theorem 3.3.)

  1. Let xi = i. Compute and plot L 2 , L 3 , and L 5 on the intervals [0, 4], [0, 6], and [0, 10] respectively. Based on your results, comment on the following statement: At each of the points xi there is only one non-zero Lagrange polynomial, Li, and one expect that Li will have the most influence on the shape of the curve near xi. This will be the case if Li takes its maximum value at xi and decays in magnitude further away from xi.
  1. Consider the data set

x − 3 1 2 5 f (xi) − 23 − 11 − 23 1

4.1 Show that the polynomials

P (x) = x^3 − 3 x^2 − 10 x + 1

and

Q(x) = −23 + 3(x + 3) − 3(x + 3)(x − 1) + (x + 3)(x − 1)(x − 2)

both interpolate the data. 4.2 Why does this not contradict the uniqueness part of Theorem 3.2 on the existence and uniqueness of polynomial interpolation? 4.3 Are P and Q computationally equivalent if used to approximate f (ˆx) where xˆ 6 = xi, i = 0, 1 , 2 , 3 and ˆx ∈ (− 3 , 5)?

  1. From the result of Theorem 3.3 it is observed that the interpolation points influence the interpolation error through

∏n i=0(x^ −^ xi^ ). Suppose we interpolate a function^ f^ over the interval [− 1 , 1] using linear interpolation.

5.1 Let x 0 = −1 and x 1 = 1. Determine the maximum value of the expression |(x − x 0 )(x − x 1 )| for − 1 ≤ x ≤ 1. 5.2 Let x 0 = −

2 /2 and x 1 =

2 /2. Determine the maximum value of the expression |(x − x 0 )(x − x 1 )| for − 1 ≤ x ≤ 1. How does this compare to the maximum found in 5.1? 5.3 Select any two numbers from the interval [− 1 , 1] to serve as interpolation points x 0 and x 1. Determine the maximum value of the expression |(x − x 0 )(x − x 1 )| for − 1 ≤ x ≤ 1. How does this compare to the maxima found in 5.1 and 5.2?

  1. Interpolate f (x) =

1 + 12x^2

at evenly-spaced points in [− 1 , 1].

6.1 Use 15 equally spaced nodes and plot the data points and the interpolant on the same axis. 6.2 Use 25 equally spaced nodes and plot the data and the interpolant on the same axis. 6.3 Discuss the accuracy of the interpolants in 6.1 and 6.2 near the ends of the inter- polation interval. How can this phenomenon be explained? Is there a way to fix (minimize) this problem?

  1. Section 3.1 #21. (See Example 2.)
  1. Redo problem # 6 (6.1 and 6.2) using Chebyschev interpolation. How does the accu- racy near the ends of the interval compare to the case where evenly-spaced nodes were used in #6?