# 3-interp - Chapter 3 Interpolation Interpolation is the...

This preview shows pages 1–3. Sign up to view the full content.

Chapter 3 Interpolation Interpolation is the process of deﬁning a function that takes on speciﬁed values at speciﬁed points. This chapter concentrates on two closely related interpolants: the piecewise cubic spline and the shape-preserving piecewise cubic named “pchip.” 3.1 The Interpolating Polynomial We all know that two points determine a straight line. More precisely, any two points in the plane, ( x 1 ,y 1 ) and ( x 2 ,y 2 ), with x 1 6 = x 2 , determine a unique ﬁrst- degree polynomial in x whose graph passes through the two points. There are many diﬀerent formulas for the polynomial, but they all lead to the same straight line graph. This generalizes to more than two points. Given n points in the plane, ( x k ,y k ) ,k = 1 ,...,n , with distinct x k ’s, there is a unique polynomial in x of degree less than n whose graph passes through the points. It is easiest to remember that n , the number of data points, is also the number of coeﬃcients, although some of the leading coeﬃcients might be zero, so the degree might actually be less than n - 1. Again, there are many diﬀerent formulas for the polynomial, but they all deﬁne the same function. This polynomial is called the interpolating polynomial because it exactly re- produces the given data: P ( x k ) = y k , k = 1 ,...,n. Later, we examine other polynomials, of lower degree, that only approximate the data. They are not interpolating polynomials. The most compact representation of the interpolating polynomial is the La- grange form P ( x ) = X k Y j 6 = k x - x j x k - x j y k . February 15, 2008 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 Chapter 3. Interpolation There are n terms in the sum and n - 1 terms in each product, so this expression deﬁnes a polynomial of degree at most n - 1. If P ( x ) is evaluated at x = x k , all the products except the k th are zero. Furthermore, the k th product is equal to one, so the sum is equal to y k and the interpolation conditions are satisﬁed. For example, consider the following data set. x = 0:3; y = [-5 -6 -1 16]; The command disp([x; y]) displays 0 1 2 3 -5 -6 -1 16 The Lagrangian form of the polynomial interpolating these data is P ( x ) = ( x - 1)( x - 2)( x - 3) ( - 6) ( - 5) + x ( x - 2)( x - 3) (2) ( - 6) + x ( x - 1)( x - 3) ( - 2) ( - 1) + x ( x - 1)( x - 2) (6) (16) . We can see that each term is of degree three, so the entire sum has degree at most three. Because the leading term does not vanish, the degree is actually three. Moreover, if we plug in x = 0 , 1 , 2, or 3, three of the terms vanish and the fourth produces the corresponding value from the data set. Polynomials are not usually represented in their Lagrangian form. More fre- quently, they are written as something like x 3 - 2 x - 5 .
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/20/2012 for the course ECON 101 taught by Professor Burkhauser during the Spring '08 term at Cornell University (Engineering School).

### Page1 / 27

3-interp - Chapter 3 Interpolation Interpolation is the...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online