introduction to numerical analysis i math/cmpsc 455 interpolation

Download Introduction to Numerical Analysis I MATH/CMPSC 455 Interpolation

Post on 03-Jan-2016

216 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

Slide 1

Introduction to Numerical Analysis I

MATH/CMPSC 455

Interpolation

1

Chapter 3. Interpolation

A function is said to interpolate a set of data points if it passes through those points

Definition: The function interpolates the data sets if

Note that is required to be a function!

Restriction on the data set:

Main theorem of Polynomial interpolation:

If are distinct, there is a unique polynomial of degree such that

How to find this polynomial?

Interpolation Polynomial

Mathematical Problem: (Interpolate points)

Given n+1 points , we seek a polynomial of degree such that

Mathematical Problem: (Interpolate a function)

A function , assuming its values are known or computable at a set of n+1 points. we seek a polynomial of degree such that ,

Lagrange Interpolation

For a data set , the Lagrange form of the interpolation polynomial is

Example:

x5-7y1-23

Example:

xy

How To?

Method 1: Solving a linear system

Determine coefficients

Method 2: Lagrange Form of Interpolation

Determine basis

Method 3: Newton Form of Interpolation

Use another basis which is easy to get, and has similar property as the basis for Lagrange form, and determine the coefficient easily.

7

forms a basis of

Newton form of interpolation polynomial:

Determine the coefficients

Newtons Divided Differences

Definition:

Example:

Newton Form of the Interpolation Polynomial

Nested Form:

Definition:

Example:

Example:

x023f(x)124

y = P (x)

{(xi, yi)}

P (xi) = yi, 0 i n

P

xi 6= xj , i 6= j

f (x)

f(x)

Pn (xi ) = f (xi )

P

n

(x

i

)=f(x

i

)

0 i n

0in

{xi}

n

Pn(xi) = yi, 0 i n

{(xi, yi)}

y = Pn(x) =n

j=0

yj lj(x)

lj(x) =(x x0)(x x1) (xj1)(x xj+1) (x xn)

(xj x0)(xj x1) (xjj1)(xj xj+1) (xj xn)

x0

x1

y0

y1

Pn (x) = a0 + a1x + a2x2 ++ anx

n

P

n

(x)=a

0

+a

1

x+a

2

x

2

++a

n

x

n

a0,a1,,an

a

0

,a

1,

,a

n

Pn (x) = y0l0 (x)+ y1l1(x)++ ynln (x)

P

n

(x)=y

0

l

0

(x)+y

1

l

1

(x)++y

n

l

n

(x)

l0, l1,, ln

l

0

,l

1,

,l

n

li (xi ) =1, li (x j ) = 0, i j

l

i

(x

i

)=1,l

i

(x

j

)=0,ij

q0 (x ) =1q1(x ) = x x0q2 (x ) = (x x0 )(x x1)

qn (x ) = (x x0 )(x x1)(x xn1),

q

0

(x)=1

q

1

(x)=x-x

0

q

2

(x)=(x-x

0

)(x-x

1

)

q

n

(x)=(x-x

0

)(x-x

1

)(x-x

n-1

),

q0 (x ),q1(x ),,qn (x )

q

0

(x),q

1

(x),,q

n

(x)

span{1,x ,x 2 ,,x n}

span{1,x,x

2

,,x

n

}

Nn (x ) = c0q0 (x ) +c1q1(x ) ++cnqn (x ).

N

n

(x)=c

0

q

0

(x)+c

1

q

1

(x)++c

n

q

n

(x).

c0 ,c1,,cn

c

0

,c

1,

,c

n

f [x0 ] = f (x0 )

f[x

0

]=f(x

0

)

f [x0 ,x1,x 2 ,,xn ] =f [x0 ,x1,,xn1] f [x1,x 2 ,,xn ]

x0 xn.

f[x

0

,x

1

,x

2

,,x

n

]=

f[x

0

,x

1

,,x

n-1

]-f[x

1

,x

2

,,x

n

]

x

0

-x

n

.

f [x0 ,x1] =f (x0 ) f (x1)x0 x1

f [x0 ,x1,x 2 ] =f [x0 ,x1] f [x1,x 2 ]

x0 x 2

f [x0 ,x1,x 2 ,x3] =f [x0 ,x1,x 2 ] f [x1,x 2 ,x3]

x0 x3

f[x

0

,x

1

]=

f(x

0

)-f(x

1

)

x

0

-x

1

f[x

0

,x

1

,x

2

]=

f[x

0

,x

1

]-f[x

1

,x

2

]

x

0

-x

2

f[x

0

,x

1

,x

2

,x

3

]=

f[x

0

,x

1

,x

2

]-f[x

1

,x

2

,x

3

]

x

0

-x

3

c0 = f [x0 ],c1 = f [x0 ,x1],

cn = f [x0 ,x1,,xn ].

c

0

=f[x

0

],

c

1

=f[x

0

,x

1

],

c

n

=f[x

0

,x

1

,,x

n

].

N n (x ) = f [x0 ]+ f [x0 ,x1](x x0 ) ++ f [x0 ,,xn ](x x0 )(x xn1)

N

n

(x)=f[x

0

]+f[x

0

,x

1

](x-x

0

)++f[x

0

,,x

n

](x-x

0

)(x-x

n-1

)

N n (x ) = c0 +c1(x x0 ) +c2 (x x0 )(x x1) ++cn (x x0 )(x xn1)= c0 + (x x0 )(c1 + (x x1)(c2 + (x x 2 )(c3 ++ (cn1 +cn (x xn1)))))

N

n

(x)=c

0

+c

1

(x-x

0

)+c

2

(x-x

0

)(x-x

1

)++c

n

(x-x

0

)(x-x

n-1

)

=c

0

+(x-x

0

)(c

1

+(x-x

1

)(c

2

+(x-x

2

)(c

3

++(c

n-1

+c

n

(x-x

n-1

)))))

x 3 1 5 6( )f x 1 3 2 4

x

3156

()fx

1324