49
Chapter 4 Chapter 4 Interpolation and Interpolation and Approximation Approximation

Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

Embed Size (px)

Citation preview

Page 1: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

Chapter 4 Chapter 4 Interpolation and Interpolation and ApproximationApproximation

Page 2: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

4.1 Lagrange Interpolation4.1 Lagrange Interpolation

The basic interpolation problem can be The basic interpolation problem can be posed in one of two ways:posed in one of two ways:

Page 3: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation
Page 4: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation
Page 5: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation
Page 6: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

Example 4.1Example 4.1

e-1/2

Page 7: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation
Page 8: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

Discussion Discussion

The construction presented in this The construction presented in this section is called Lagrange interpolation.section is called Lagrange interpolation.

How good is interpolation at How good is interpolation at approximating a function? (Sections 4.3, approximating a function? (Sections 4.3, 4.11)4.11)

Consider another example:Consider another example: If we use a fourth-degree interpolating If we use a fourth-degree interpolating

polynomial to approximate this function, the polynomial to approximate this function, the results are as shown in Figure 4.3 (a).results are as shown in Figure 4.3 (a).

Page 9: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

Error for n=8

Page 10: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

DiscussionDiscussion

There are circumstances in which There are circumstances in which polynomial interpolation as approximation polynomial interpolation as approximation will work very well, and other will work very well, and other circumstances in which it will not.circumstances in which it will not.

The Lagrange form of the interpolating The Lagrange form of the interpolating polynomial is not well suited for actual polynomial is not well suited for actual computations, and there is an alternative computations, and there is an alternative construction that is far superior to it.construction that is far superior to it.

Page 11: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

4.2 Newton Interpolation and 4.2 Newton Interpolation and Divided DifferencesDivided Differences

The disadvantage of the Lagrange formThe disadvantage of the Lagrange form If we decide to add a point to the set of nodes, If we decide to add a point to the set of nodes,

we have to completely recompute all of the fuwe have to completely recompute all of the functions.nctions.

Here we introduce an alternative form of thHere we introduce an alternative form of the polynomial: the Newton form.e polynomial: the Newton form. It can allow us to easily write in terms of It can allow us to easily write in terms of

Page 12: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation
Page 13: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

=0

Page 14: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

Example 4.2Example 4.2

)2

(

x

Page 15: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

DiscussionDiscussion The coefficients are called divided The coefficients are called divided

differences.differences. We can use divided-difference table to find We can use divided-difference table to find

them.them.

Page 16: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

Example 4.3Example 4.3

Page 17: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation
Page 18: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

Example 4.3 (Con.)Example 4.3 (Con.)

Page 19: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

Table 4.5

Page 20: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

4.3 Interpolation Error4.3 Interpolation Error

Page 21: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

NormsNorms

The infinity norm of pointwise norm:The infinity norm of pointwise norm:

The 2-norm:The 2-norm:

Page 22: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

The interpolation error of linear The interpolation error of linear interpolationinterpolation

Page 23: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation
Page 24: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

Example 4.5Example 4.5

Page 25: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

Example 4.5 (Con.)Example 4.5 (Con.)

Page 26: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

4.4 Application: Muller’s Method 4.4 Application: Muller’s Method and Inverse Quadratic Interpolationand Inverse Quadratic Interpolation

We can use the idea of interpolation to develop We can use the idea of interpolation to develop more sophisticated root-finding methods.more sophisticated root-finding methods.

For example: Muller’s Method For example: Muller’s Method Given three points we find the Given three points we find the

quadratic polynomial such that quadratic polynomial such that 0,1,2; and then define as the root of that is 0,1,2; and then define as the root of that is closest to .closest to .

Page 27: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation
Page 28: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation
Page 29: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

compare

Page 30: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

An Alternative to Muller’s MethodAn Alternative to Muller’s Method

Inverse quadratic interpolation:Inverse quadratic interpolation:

Page 31: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation
Page 32: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation
Page 33: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

DiscussionDiscussion One great utility of Muller’s method is that it is able tOne great utility of Muller’s method is that it is able t

o find complex roots of real-valued functions, because o find complex roots of real-valued functions, because of the square root in the computation.of the square root in the computation.

Inverse quadratic interpolation is used as part of BrenInverse quadratic interpolation is used as part of Brent-Dekker root-finding algorithm, which is a commonly t-Dekker root-finding algorithm, which is a commonly implemented automatic root-finding program.implemented automatic root-finding program.

Page 34: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

4.5 Application: More 4.5 Application: More Approximations to the DerivativeApproximations to the Derivative

depends

on x

Page 35: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

4.5 Application: More 4.5 Application: More Approximations to the DerivativeApproximations to the Derivative

The interpolating polynomial in Lagrange The interpolating polynomial in Lagrange form isform is

The error is given as in (4.20), thusThe error is given as in (4.20), thus

We getWe get

Page 36: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

We can use above equations to get:

Page 37: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

4.6 Hermite Interpolation4.6 Hermite Interpolation

Hermite interpolation problem:Hermite interpolation problem:

Can we do this? Yes.Can we do this? Yes.

Page 38: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation
Page 39: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

Divided-Difference TableDivided-Difference Table

Page 40: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

An exampleAn example

Page 41: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

error

Page 42: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

Hermite Interpolation Error TheoreHermite Interpolation Error Theoremm

Page 43: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

4.7 Piecewise Polynomial 4.7 Piecewise Polynomial InterpolationInterpolation

If we keep the order of the polynomial fixed If we keep the order of the polynomial fixed and use different polynomials over different and use different polynomials over different intervals, with the length of the intervals intervals, with the length of the intervals getting smaller and smaller, then getting smaller and smaller, then interpolation can be a very accurate and interpolation can be a very accurate and powerful approximation tool.powerful approximation tool.

For example:For example:

Page 44: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation
Page 45: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation
Page 46: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation
Page 47: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation

Example 4.6Example 4.6

Page 48: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation
Page 49: Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation