MATH661 HW06 - Interpolation

Posted: 10/11/23

Due: 10/18/23, 11:59PM

Beginning with this assignment, homework tasks are described at a higher level. Apply your experience from previous assignments to cogently formulate a solution.

1Track 1 & 2

Study the convergence of polynomial interpolation, pn(xi)=f(xi), i=1,2,,n with increasing number of sample points n for the following functions:

  1. f:[-1,1], f(t)=cos(πt/2);

  2. f:[-1,1], f(t)=1/(1+25t2);

  3. f:[-1,1], f(t)=exp(-25t2).

For each case consider both equidistant and Chebyshev sample points, present plots of the function and interpolant, plots of the error as a function of n, and compare the observed error with that predicted by the formula

e(t)=f(t)-p(t)=f(n+1)(ξt)(n+1)!i=0n(t-xi).

Comment on what you observe.

Solution. Use functions from L19 to obtain results in Fig. 1.

Figure 1. Interpolation results for equidistant partitions of f(t){cos(πt/2),1/(1+25t2),exp(-25t2)}

Figure 2. Interpolation results for Chebyshev partitions of f(t){cos(πt/2),1/(1+25t2),exp(-25t2)}

Observations. For both equidistant and Chebyshev sampling interpolation converges with increasing n for f(t)=cos(πt/2). For both other functions the error grows without bound away from the interpolation data points, albeit slower for Chebyshev sampling. This is suggested from the error formula by bounding derivatives and |w(t)|=|i=0n(t-xi)|<2n+1 for t[-1,1].

  1. f(t)=cos(πt/2), has a readily determined derivative bound |f(n+1)(t)|(π/2)n+1,

    limn(π2)n+12n+1(n+1)!=0.
  2. f(t)=1/p(t)=1/(1+25t2)=1/(1+ct2). The first few derivatives are

    f'=-p'p2=-50t(1+25t2)2,f''=-p''p2+2(p')2p3=-50(1+25t2)2+2(50t)2(1+25t2)3,
    f'''=6p'p''p3-6(p')3p4=6(50t)50(1+25t2)3-6(50t)3(1+25t2)4,
    f(4)=6(p'')2p3+

    Notice that f(2k)(t) has a local extremum at t=0 for which f(2k+1)(0)=0, and

    f(2k)(0)𝒪(2k!)ck,

    gives a rapidly increasing error bound.

  3. As above, repeated differentiation suggests a rapidly increasing upper bound f(n)(0)𝒪(2k!).

2Track 1

For n=5 equidistant sample points, explicitly write the Lagrange and Newton forms of the interpolating polynomial.

Solution 1. Choose xi=i for i=0,1,,4 to obtain interpolations of data 𝒟={(xi,yi),i=0,1,,n-1}

0(t)=j=0,j04(t-i)(j-i)=t-11-0t-22-0t-33-0t-44-0

1(t)=j=0,j14(t-i)(j-i)=t0-1t-22-1t-33-1t-44-1

2(t)=j=0,j24(t-i)(j-i)=t-00-2t-11-2t-33-2t-44-2

3(t)=j=0,j34(t-i)(j-i)=t-00-3t-11-3t-22-3t-44-3

4(t)=j=0,j44(t-i)(j-i)=t-00-4t-11-4t-22-4t-33-4

p(t)=i=04yii(t)

Construct table of divided differenes for Newton form

i xi yi [yi,yi-1] [yi,yi-1,yi-2] [yi,yi-1,yi-2,yi-3] [yi,yi-1,yi-2,yi-3,yi-4] 0 0 y0 - - - - 1 1 y1 y1-y0 - - - 2 2 y2 y2-y1 12(y2-2y1+y0) - - 3 3 y3 y3-y2 12(y3-2y2+y1) 16(y3-3y2+3y1-y0) - 4 4 y4 y4-y3 12(y4-2y3+y2) 16(y4-3y3+3y2-y1) 124(y4-4y3+6y2-4y1+y0)

leading to

p(t)=y0+(y1-y0)t+12(y2-2y1+y0)t(t-1)+16(y3-3y2+3y1-y0)t(t-1)(t-2)+124(y4-4y3+6y2-4y1+y0)t(t-1)(t-2)(t-3)

3Track 2

Repeat the above convergence study for Hermite interpolation pn(xi)=f(xi), pn'(xi)=f'(xi), i=1,2,,n.

Solution. Modify functions from L19 to obtain results in Fig. 3. Overall behavior is as in regular interpolation in function values, but with more accurate results for the Chebyshev points for the Runge function.

Figure 3. Interpolation results for equidistant partitions of f(t){cos(πt/2),1/(1+25t2),exp(-25t2)}

Figure 4. Interpolation results for Chebyshev partitions of f(t){cos(πt/2),1/(1+25t2),exp(-25t2)}