First Semester in Numerical Analysis with Julia, 2020a
First Semester in Numerical Analysis with Julia, 2020a
First Semester in Numerical Analysis with Julia, 2020a
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
CHAPTER 3. INTERPOLATION 113<br />
We seek a polynomial that fits the y and y ′ values, that is, we seek a polynomial H(x) such<br />
that H(x i )=y i and H ′ (x i )=y i, ′ i =0, 1, ..., n. This makes 2n +2equations, and if we let<br />
H(x) =a 0 + a 1 x + ... + a 2n+1 x 2n+1 ,<br />
then there are 2n +2 unknowns, a 0 , ..., a 2n+1 , to solve for. The follow<strong>in</strong>g theorem shows<br />
that there is a unique solution to this system of equations; a proof can be found <strong>in</strong> Burden,<br />
Faires, Burden [4].<br />
Theorem 61. If f ∈ C 1 [a, b] and x 0 , ..., x n ∈ [a, b] are dist<strong>in</strong>ct, then there is a unique<br />
polynomial H 2n+1 (x), of degree at most 2n +1, agree<strong>in</strong>g <strong>with</strong> f and f ′ at x 0 , ..., x n . The<br />
polynomial can be written as:<br />
H 2n+1 (x) =<br />
n∑<br />
y i h i (x)+<br />
i=0<br />
n∑<br />
y i ′ ˜h i (x)<br />
i=0<br />
where<br />
h i (x) =(1− 2(x − x i )l ′ i(x i )) (l i (x)) 2<br />
˜hi (x) =(x − x i )(l i (x)) 2 .<br />
Here l i (x) is the ith Lagrange basis function for the nodes x 0 , ..., x n , and l i(x) ′ is its derivative.<br />
H 2n+1 (x) is called the Hermite <strong>in</strong>terpolat<strong>in</strong>g polynomial.<br />
The only difference between Hermite <strong>in</strong>terpolation and polynomial <strong>in</strong>terpolation is that<br />
<strong>in</strong> the former, we have the derivative <strong>in</strong>formation, which can go a long way <strong>in</strong> captur<strong>in</strong>g the<br />
shape of the underly<strong>in</strong>g function.<br />
Example 62. We want to <strong>in</strong>terpolate the follow<strong>in</strong>g data:<br />
x-coord<strong>in</strong>ates : −1.5, 1.6, 4.7<br />
y-coord<strong>in</strong>ates :0.071, −0.029, −0.012.<br />
The underly<strong>in</strong>g function the data comes from is cos x, but we pretend we do not know this.<br />
Figure (3.2) plots the underly<strong>in</strong>g function, the data, and the polynomial <strong>in</strong>terpolant for the<br />
data. Clearly, the polynomial <strong>in</strong>terpolant does not come close to giv<strong>in</strong>g a good approximation<br />
to the underly<strong>in</strong>g function cos x.