Introductory Numerical Analysis I (MATH 450) Final Project

advertisement
Introductory Numerical Analysis I (MATH 450) Final Project
Comparison of Interpolation Methods and Runge’s Phenomenon
Due 5:00pm of Friday, Dec 19, 2008
1
Background
In the mathematical field of numerical analysis, Runge’s phenomenon is a problem that occurs
when using polynomial interpolation with polynomials of high degree. The interpolation oscillates
towards the end of the interval, and the interpolation error tends towards infinity when the degree of the polynomial increases. The phenomenon was discovered by Carl David Tolm Runge
when exploring the behavior of errors when using polynomial interpolation to approximate certain
functions (wiki:Rounge’s Phenomenon). The oscillation can be minimized by using nodes that are
gradually dense towards the ends of the interval.
2
Problems
Find Lagrange interpolating polynomial and cubic spline interpolating polynomial for function
f (x) = √
1
1 + 25x2
on interval [−10, 10] using
1. equally spaced nodes.
2. Chebyshev nodes
The number of nodes varies from 5, 10, 15 to 20. For each interpolating polynomial pn (x), compute
the error vector
~e = f (xi ) − qn (xi )
where {xi } are 300 equally distributed points in [−10, 10].
3
Requirements
A. Using MATLAB for numerical computation and plotting. Make use of your MATLAB codes
for solving linear system in a homework assignment if needed.
B. For each type of interpolation and each type of interpolation nodes
1. Choose various numbers of nodes to get different interpolating polynomials.
2. Plot the interpolating polynomial and the f (x) to appreciate the interpolation error.
3. Compute the l2 norm of the error vectors defined by
v
u n
uX
k~ek2 = t |ei |2 .
i
1
4. Plot the l2 norm against the number of interpolation nodes.
C. Based on your data and figures, draw conclusions on
1. Lagrange interpolation VS cubic spline interpolation
2. Equally spaced nodes VS Chebyshev nodes
3. If Chebyshev nodes help improve accuracy of Lagrange interpolation.
4. If Chebyshev nodes help improve accuracy of cubic spline interpolation.
D. Write a short report to present your numerical methods, data, figure and conclusions. Explain
your data and figures.
4
An Example
√
For f (x) = 1/ 1 + x2 in interval [−5, 5] and data points {xi , f (xi )} at xi = {−5, −3, −1, 1, 3, 5},
the Newton’s interpolation polynomial reads
q5 (x) = 0.1961 + 0.0601x + 0.0338x2 − 0.0138x3 + 0.0017x4 .
The l2 norm of the error vector ~e at 100 equally spaced nodes ti = {−5 : 0.1 : 5} is
v
u 99
uX
k~ek2 = t |f (ti ) − q5 (ti )|2 = 0.8869.
i=0
l2 error of Newton’s interpolation
1
f(x)
q5(x)
0.8
0.6
0.4
0.2
0
−5
0
x
5
40
30
20
10
0
5
10
15
20
# of nodes
Figure 1: Left: f (x) and its Newton’s interpolation on 5 nodes. Right: Error of Newton’s interpolation increases with the number of interpolation nodes.
2
Download