interpolation produces a function that matches the given data exactly. the function then can be...

Post on 20-Jan-2016

217 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Interpolation produces a function that matches the given data exactly. The function then can be utilized to approximate the data values at intermediate points.

Interpolation may also be used to produce a smooth graph of a function for which values are known only at discrete points, either from measurements or calculations.

Given data points

Obtain a function, P(x)

P(x) goes through the data points

Use P(x)

To estimate values at intermediate points

Given data points:

At x0 = 2, y0 = 3 and at x1 = 5, y1 = 8

Find the following:

At x = 4, y = ?

x

y

2 5

3

8

?

4

P(x)

P(x) should satisfy the following conditions:

P(x = 2) = 3 and P(x = 5) = 8

xLxLxP 10 83

P(x) can satisfy the above conditions if

at x = x0 = 2, L0(x) = 1 and L1(x) = 0 and

at x = x1= 5, L0(x) = 0 and L1(x) = 1

The conditions can be satisfied if L0(x) and L1(x) are defined in the following way.

25

2and

52

510

x

xLx

xL

At x = x0 = 2, L0(x) = 1 and L1(x) = 0 and

at x = x1= 5, L0(x) = 0 and L1(x) = 1

01

01

10

10 and

xx

xxxL

xx

xxxL

xLxLxP 10 83

1100 yxLyxLxP

1100 xfxLxfxLxP

Lagrange Interpolating Polynomial

1100 xfxLxfxLxP

825

23

52

5

xx

xP

3

15 x

xP

33363

1454 .P

The Lagrange interpolating polynomial passing through three given points; (x0, y0), (x1, y1) and (x2, y2) is:

22

1100

xfxL

xfxLxfxLxP

221100 yxLyxLyxLxP

2010

210 xxxx

xxxxxL

At x0, L0(x) becomes 1. At all other given data points L0(x) is 0.

2101

201 xxxx

xxxxxL

At x1, L1(x) becomes 1. At all other given data points L1(x) is 0.

1202

102 xxxx

xxxxxL

At x2, L2(x) becomes 1. At all other given data points L2(x) is 0.

nn yxL...........

yxLyxLyxLxP

221100

nn xfxL...........xfxL

xfxLxfxLxP

22

1100

General form of the Lagrange Interpolating Polynomial

))...()()...()((

))...()()...()(()(

nkkkkkkk

nkkk xxxxxxxxxx

xxxxxxxxxxxL

1110

1110

n

kii ik

ik xx

xxxL

0 )(

)()(

0 1 2

1 1

1

k k

n n

x x x x x x

x x x x

x x x x

Numerator of kL x

Denominator of

0 1 2

1 1

1

k k k

k k k k

k n k n

x x x x x x

x x x x

x x x x

kL x

Find the Lagrange Interpolating Polynomial using the three given points.

2504

4052

502

22

11

00

.,y,x

.,.y,x

.,y,x

2010

210 xxxx

xxxxxL

1056

42522

452

2

0

x.x

.

x.xxL

750

86

452252

42

2

1

.

xx

..

xxxL

2101

201 xxxx

xxxxxL

3

554

52424

522

2

2

x.x

.

.xxxL

1202

102 xxxx

xxxxxL

22

1100

xfxL

xfxLxfxLxP

2503

554

40750

86

501056

2

2

2

.x.x

..

xx

.x.xxP

1514250050 2 .x.x.xP

The three given points were taken from the function

x

xf1

325.0

15.13425.0305.032

P

333.03

13 f

An approximation can be obtained from the Lagrange Interpolating Polynomial as:

Newton’s Interpolating Polynomials

Newton’s equation of a function that passes through two points

00 y,x and 11 y,x is

010 xxaaxP

Set0xx

0 0 0P x y a

Set1x x

1 1 0 1 1 0P x y a a x x

010 xxaaxP

01

011 xx

yya

Newton’s equation of a function that passes through three points

00 y,x and 11 y,xis

2 2x , y

0 1 0

2 0 1

P x a a x x

a x x x x

To find

2a , set2xx

2 0 1 2 0

2 2 0 2 1

P x a a x x

a x x x x

1 02 1

2 1 1 02

2 0

y yy yx x x x

ax x

Newton’s equation of a function that passes through four points can be written by adding a fourth term .

0 1 0

2 0 1

P x a a x x

a x x x x

3 0 1 2 a x x x x x x

0 1 0

2 0 1

3 0 1 2

P x a a x x

a x x x x

a x x x x x x

The fourth term will vanish at all three previous points and, therefore, leaving all three previous coefficients intact.

Divided differences and the coefficientsf

ix if xThe divided difference of a function,

with respect to is denoted as

It is called as zeroth divided difference and is simply the value of the function, fat ix

ii xfxf

1i if x , x

fThe divided difference of a function,

called as the first divided difference, is denoted ixwith respect to and 1ix

11

1

i ii i

i i

f x f xf x , x

x x

fThe divided difference of a function,

called as the second divided difference, is denoted as

ixwith respect to and1ix , 2ix

1 2i i if x , x , x

1 2 11 2

2

i i i ii i i

i i

f x , x f x , xf x , x , x

x x

1 2 3

1 2 3 1 2

3

i i i i

i i i i i i

i i

f x , x , x , x

f x , x , x f x , x , x

x x

The third divided difference with respect to

ix 1ix 2ix 3ix , and ,

The coefficients of Newton’s interpolating polynomial are:

00 xfa

101 x,xfa

2102 x,x,xfa

32103 x,x,x,xfa

432104 x,x,x,x,xfa and so on.

x xf First

divided differences

Second

divided differences

Third

divided differences

0x 0xf

01

0110 xx

xfxfx,xf

1x 1xf 02

1021210 xx

x,xfx,xfx,x,xf

12

1221 xx

xfxfx,xf

03

2103213210 xx

x,x,xfx,x,xfx,x,x,xf

2x 2xf 13

2132321 xx

x,xfx,xfx,x,xf

23

2332 xx

xfxfx,xf

14

3214324321 xx

x,x,xfx,x,xfx,x,x,xf

3x 3xf 24

3243432 xx

x,xfx,xfx,x,xf

34

3443 xx

xfxfx,xf

25

4325435432 xx

x,x,xfx,x,xfx,x,x,xf

4x 4xf 35

4354543 xx

x,xfx,xfx,x,xf

45

4554 xx

xfxfx,xf

5x 5xf

ExampleFind Newton’s interpolating polynomial to approximate a function whose 5 data points are given below.

f x

2.0 0.85467

2.3 0.75682

2.6 0.43126

2.9 0.22364

3.2 0.08567

x

i ix ixf ii x,xf 1 iii x,x,xf 12 ii x,,xf 3 ii x,,xf 4

0 2.0 0.85467

-0.32617

1 2.3 0.75682 -1.26505

-1.08520 2.13363

2 2.6 0.43126 0.65522 -2.02642

-0.69207 -0.29808

3 2.9 0.22364 0.38695

-0.45990

4 3.2 0.08567

The 5 coefficients of the Newton’s interpolating polynomial are:

0 0 0 85467a f x .

1 0 1 0 32617a f x , x .

2 0 1 2 1 26505a f x , x , x .

3 0 1 2 3 2 13363a f x , x , x , x .

4 0 1 2 3 4 2 02642a f x , x , x , x , x .

0 1 0

2 0 1

3 0 1 2

4 0 1 2 3

P x a a x x

a x x x x

a x x x x x x

a x x x x x x x x

0 85467 0 32617 2 0

-1.26505 2 0 2 3

2 13363 2 0 2 3 2 6

2 02642 2 0 2 3 2 6 2 9

P x . . x .

x . x .

. x . x . x .

. x . x . x . x .

P(x) can now be used to estimate the value of the function f(x) say at x = 2.8.

2 8 0 85467 0 32617 2 8 2 0

-1.26505 2 8 2 0 2 8 2 3

2 13363 2 8 2 0 2 8 2 3 2 8 2 6

2 02642 2 8 2 0 2 8 2 3 2 8 2 6 2 8 2 9

P . . . . .

. . . .

. . . . . . .

. . . . . . . . .

2 8 2 8 0 275f . P . .

top related