Вы находитесь на странице: 1из 17

Interpolation

• Estimation of intermediate values between precise data


points. The most common method is:

f ( x) a0 a1 x a2 x 2  an x n

• Although there is one and only one nth-order polynomial


that fits n+1 points, there are a variety of mathematical
formats in which this polynomial can be expressed:
– The Newton polynomial
– The Lagrange polynomial

1
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure 18.1

2
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure
18.2

A
a

B
Newton’s Divided-Difference
Interpolating Polynomials
Linear Interpolation/
• Is the simplest form of interpolation, connecting two data
points with a straight line.
=A
Slope and a
=a finite divided
f1 ( x) f ( x0 ) f ( x1 ) f ( x0 ) difference
approximation to
x x0 x1 x0 1st derivative
=b
f ( x1 ) f ( x0 )
f1 ( x) f ( x0 ) ( x x0 ) Linear-interpolation
x1 x0 formula

• f1(x) designates that this is a first-order interpolating


polynomial.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Quadratic Interpolation
• If three data points are available, the estimate is
improved by introducing some curvature into the line
connecting the points.

f 2 ( x) b0 b1 ( x x0 ) b2 ( x x0 )( x x1 )

• A simple procedure can be used to determine the values


of the coefficients.
x x0 b0 f ( x0 ) Represents slope
between points
f ( x1 ) f ( x0 ) xo and x1
x x1 b1
= slope
x1 x0
between points f ( x2 ) f ( x1 ) f ( x1 ) f ( x0 )
x1 and x2
x2 x1 x1 x0
x x2 b2 = b1 = slope
x2 x0 between first two
points
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
See Example 18.1 (pg 490)

Prob. 18.2 (pg 522)


Fit a second order to estimate log10 at x =
8, 9 and 11.
x0 = 8 , f(x0) = log 8 = 0.9030900 = b0
x1 = 9, f(x1) = log 9 = 0.954243
x2 = 11, f(x2) = log 11 = 1.041393

Chapter 18 6
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
x x0 b0 f ( x0 )
f ( x1 ) f ( x0 ) 0.954243 0.9030900
b1 0.051153
x1 x0 9 8
f ( x2 ) f ( x1 ) f ( x1 ) f ( x0 )
= b1
x2 x1 x1 x0
b2
x2 x0

1.041393 0.954243
0.051153
11 9
0.0025258
11 8

7
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
f 2 ( x) b0 b1 ( x x0 ) b2 ( x x0 )( x x1 )
Substitute;

f2(10) = 0.9030900 + 0.051153 (10 -8) –


0.0025258 (10-8)(10-9)
= 1.0003444

Chapter 18 8
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
General Form of Newton’s Interpolating Polynomials/
f n ( x) f ( x0 ) (x x0 ) f [ x1 , x0 ] (x x0 )( x x1 ) f [ x2 , x1 , x0 ]
 (x x0 )( x x1 )  ( x xn 1 ) f [ xn , xn 1 ,  , x0 ]
b0 f ( x0 )
b1 f [ x1 , x0 ]
b2 f [ x2 , x1 , x0 ]

bn f [ xn , xn 1 ,  , x1 , x0 ]
f ( xi ) f (x j )
f [ xi , x j ] Bracketed function
xi xj
evaluations are finite
f [ xi , x j ] f [ x j , xk ] divided differences
f [ xi , x j , xk ]
xi xk

f [ xn , xn 1 ,  , x1 ] f [ xn 1 , xn 2 ,  , x0 ]
f [ xn , xn 1 ,  , x1 , x0 ]
xn x0
9
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
10
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
11
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Slopes or
gradient

12
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
f [x2, x1, x0]

f [x1, x0]
f [ x 3 , x2 , x 1 , x 0 ]

13
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Problem
Given data:
Calculate f(2.8) using Newton’s interpolating
polynomial of order 1 through 2.

x 1.6 2 2.5 3.2 4 4.5

f(x) 2 8 14 15 8 2

14
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
First, order the points so that they are as
close to and as centered about the unknown
as possible

• x0 = 2.5 f(x0) = 14
• x1 = 3.2 f(x1) = 15
• x2 = 2 f(x2) = 8
• x3 = 4 f(x3) = 8
• x4 = 1.6 f(x4) = 2

15
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Next, the divided differences can be computed and displayed.
The first through third-order interpolations can then be implemented as:

i xi f(xi) f[xi+1,xi] f[xi+2,xi+1,xi] f[xi+3,xi+2,xi+1,xi] f[xi+4,xi+3,xi+2,xi+1,xi]


0 2.5 14 1.428571 -8.809524 1.011905 1.847718
1 3.2 15 5.833333 -7.291667 -0.651042
2 2 8 0 -6.25
3 4 8 2.5
4 1.6 2

f 2 (2.8) 14 1.428571(2.8 2.5) 8.809524(2.8 2.5)(2.8 3.2) 15.485714


f 3 (2.8) 14 1.428571 (2.8 2.5) 8.809524 (2.8 2.5)(2.8 3.2)
1.011905 (2.8 2.5)(2.8 3.2)(2.8 2.) 15.388571
f1 (2.8) 14 1.428571(2.8 2.5) 14.428571
16
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Exercise

• Do Qn. 18.9, 18.10 and 18.28 (a & b)

17
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Вам также может понравиться