Sunteți pe pagina 1din 31

Wuhan University of

Technology

NUMERICAL
CALCULATION
Interpolation and Polynomial Approximation

By ,

Pierre Guy ATANGANA NJOCK ()

March2014

Main Content

Divided Differences (part1)


Hermite Interpolation (part2)

Review
Interpolation :

Estimation of intermediate values


between precise data points.
Interpolation is important concept
in numerical analysis.

Because,

Lagrange polynomial: (Theorem)


If x0, x1, ... , xn are n + 1 distinct numbers and f is a

function whose values are given at these numbers, then a


unique polynomial P(x) of degree at most n exists with

This polynomial is given by:

Quite often functions may not be


available explicitly but only the
values of the function at a set of
points.
The most common method is
polynomial interpolation:
3

DIVIDED DIFFERENCES

Part1: DIVIDED DIFFERENCE (1/11)


Introduction to divided difference (1/3)
Definition
Suppose that Pn(x) is the nth Lagrange polynomial that agrees with the function f at the
distinct numbers x0, x1,..., xn.

Although this polynomial is unique, there are alternate algebraic representations that
are useful in certain situations.
for appropriate constants a0, a1,..., an , The divided differences of f with respect to x0,

x1,..., xn are used to express Pn(x) in the form:


P(x) = a0+a1(x-x0)+a2(x-x0)(x-x1) + +an(x-x0) (x-xn-1)

(1)

How to find the constants a0, a1,..., an ?


5

Part1: DIVIDED DIFFERENCE (2/11)


Introduction to divided difference (2/3)
Note
To determine the first of these constants, a0, note that if Pn(x) is written in the form
of the above equation, then evaluating Pn(x) at x0 leaves only the constant term a0;
Similarly, when P(x) is evaluated at x1 , the only nonzero terms in the evaluation of

Pn(x1) are the constant and linear terms,


i.e.
= 0 , (1) a0 Pn ( x0 ) f ( x0 ) f x0

Part1: DIVIDED DIFFERENCE (3/11)


Introduction to divided difference (3/3)
Note
i.e.
= 0 , (1)
= 1

, (1)

a0 Pn ( x0 ) f ( x0 ) f x0

f ( x0 ) a 1 ( x1 x0 ) Pn ( x0 ) f ( x1 )
a1

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

(2)

In general, ak = [0 , 1 , ,k ] for k= 0, 1, 2, , n

Part1: DIVIDED DIFFERENCE (4/11)


The divided difference notation (1/4)
We now introduce the divided-difference notation
Previously (P.5)we said that: the divided of f with respect to x0, x1,..., xn are used to
express Pn(x) in the form: P(x) = a0+a1(x-x0)+a2(x-x0)(x-x1) + +an(x-x0) (x-xn-1)
The zeroth divided difference of the function f with respect to xi ,denoted f [xi], is
simply the value of f at xi :

f [xi ] = f (xi)

(3)

The remaining divided differences are defined recursively.


The first divided difference of f with respect to xi and xi +1 is denoted f [xi ,xi +1 ] and
defined as:
f [ xi 1 ] f [ xi ]
(4)
f [ xi , xi 1 ]
xi 1 xi
8

Part1: DIVIDED DIFFERENCE (5/11)


The divided difference notation (2/4)
The second divided difference f [xi ,xi +1 , xi +2], is defined as:

f [ xi 1 , xi 2 ] f [ xi , xi 1 ]
f [ xi , xi 1 , xi 2 ]
xi 2 xi 1

(5)

The K th divided difference

f [ xi 1 , xi 2 ,..., xi k ] f [ xi , xi 1 ,..., xi k 1 ]
f [ xi , xi 1 ,..., xi k 1 , xi k 1 ]
xi k xi

(6)

The process end with the single nth divided difference,

f [ x1 , x2 ,..., xn ] f [ x0 , x1 ,..., xn 1 ]
f [ x0 , x1 ,..., xn ]
xn x0
9

Part1: DIVIDED DIFFERENCE (6/11)


The divided difference notation (3/4)
Because of Eq. (2) we can write a1 = f [x0, x1], just as a0 can be expressed as
a0 =f(x0) = f [x0]. Hence the interpolating polynomial in Eq. (1) is
Pn(x) = f [x0]+ f [x0, x1](x x0) + a2(x x0)(x x1)++ an(x x0)(x x1) (x xn1).
We saw that ak = f [x0, x1, x2, ... , xk ], for each k = 0, 1, ... , n. (P.7)
So Pn(x) can be rewritten in a form called Newtons Divided-Difference:
n

Pn(x) = f [x0]+

k 1

f [x0, x1, ... , xk ](x x0) (x xk1).

(7)

10

Part1: DIVIDED DIFFERENCE (7/11)


The divided difference notation (4/4)
Table1: The generation of the divided differences

11

Part1: DIVIDED DIFFERENCE (8/11)


Newton's Divided Difference Interpolating Polynomial (1/1)
To obtain the divided-difference coefcients of the interpolatory polynomial P on the (n+1) distinct
numbers x0, x1, ... , xn for the function f :
INPUT numbers x0, x1, ... , xn ; values f(x0), f(x1), ... , f(xn) as F0,0, F1,0, ... , Fn,0.
OUTPUT the numbers F0,0, F1,1, ... , Fn,n where
Pn(x) = F0,0 +

i 1

F ( x x .)
i 1

i ,i

(Fi,i is f [x0, x1, ... , xi].)

j 0

Step 1 For i = 1, 2, ... , n


For j = 1, 2, ... , i
set Fi,j =

Fi,j1 Fi1,j1
, (Fi,j = f [xij , ... , xi ].)
xi xij

Step 2 OUTPUT (F0,0, F1,1, ... , Fn,n);


STOP.
12

Part1: DIVIDED DIFFERENCE (9/11)


Example (1/3)
Example 1
Given:

x0=1

f(x0)=ln(1)=0

x1=4

f(x1)=ln(4)=1.386

x2=6

f(x2)=ln(6)=1.791

Estimate ln(2) = ? using divided difference interpolation

13

Part1: DIVIDED DIFFERENCE (10/11)

Example (2/3)
Solution 1

form : P(x) = a0+a1(x-x0)+a2(x-x0)(x-x1) +


+an(x-x0) (x-xn-1)
(1)

a1

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

a1

We can write
ln (2) = a0+a1(2-x0)+a2(2-x0)(2-x1)
So lets find a1 and a2,

f[xi,xj]

a1

f ( x2 ) f ( x1 )
f [ x1 , x2 ]
x2 x1

a1

xi

f(xi)

f[xi,xj xk]

x0=1

x1=4

1.386

0.462

x2=6

1.79

0.2025 -0.0519

a2

1.386 0
0.462
4 1

1.79 1.386
0.2025
64

f [ x1 , x2 ] f [ x0 , x1 ]
f [ x0 , x1 , x2 ]
x2 x0

f [ x0 , x1 , x2 ]

0.2025 0.462
0.0519
6 1

14

Part1: DIVIDED DIFFERENCE (11/11)

Example (3/3)
Solution 1
We have:

f(x) = 0 + 0.462 (x-1) - 0.0519 (x-1)(x-4)

Nota: The coefcients of the Newton forward


divided-difference form of the interpolating
polynomial are along the diagonal in the table.

Then calculate

xi

f(xi)

f(2) = 0.462(2-1) - 0.0519 (2-1)(2-4)


= 0.5658

x0=1

x1=4

1.386

0.462

x2=6

1.79

0.2025

[ TRUE

ln(2) = 0.6931 ]

f[xi,xj]

f[xi,xj xk]

-0.0519

15

HERMITE INTERPOLATION

16

Part2: HERMITE INTERPOLATION (1/14)


Overview (1/1)
Hermite interpolation problem:
To be specific, we want to find a polynomial p(x) that interpolates f(x) in the sense that:
p(xi)=f(xi),

p(xi)=f(xi),

1 i n.

Can we do that? Yes!


Theorem 1(Hermite interpolation Theorem)
Given the n points xi , 1 i n, and a differentiable function f(x), if the points are distinct,
then there exists a unique polynomial Hn of degree less than or equal to 2n-1, such that:
Hn(xi) = f(xi),

Hn(xi) = f(xi), 1 i n.

17

Part2: HERMITE INTERPOLATION (2/14)


Hermite Polynomials (1/6)
Definition:
Let x0, x1, ... , xn be n+1 distinct numbers in [a, b] and for i = 0, 1, ... , n ; let mi be a non
negative integer. Suppose that f Cm[a, b], where m = max0in mi .
The osculating polynomial approximating f is the polynomial P(x) of least degree such
that:
k
k

d P ( xi ) d f ( xi )

k
dx
dx k

, for each i=1, 2, , n and k= 1, 2, , mi

Note that when n = 0, the osculating polynomial approximating f is the m0th Taylor
polynomial for f at x0. When mi = 0 for each i, the osculating polynomial is the nth
Lagrange polynomial interpolating f on x0, x1, ... , xn.
The case when mi = 1, for each i = 0, 1, ... , n, gives the Hermite polynomials. For a
given function f , these polynomials agree with f at x0, x1, ... , xn .
18

Part2: HERMITE INTERPOLATION (3/14)


Hermite Polynomials (2/6)
Theorem: If f C1 [a, b] and x0,..., xn [a, b] are distinct, the unique polynomial of
least degree agreeing with f and f' at x0,...,xn is the Hermite polynomial of degree at
most 2n + 1 given by:
n
n

H 2n 1 (x) f ( x j )H n, j (x) f ( x j )H n, j (x)


j 0

j 0

where, for Ln, j (x) denoting the j th Lagrange coefcient polynomial of degree n, we
have

j ( x j )]L ( x )
H n, j (x) [1 - 2(x - x j ) Ln,
2
n, j

and

H n, j (x) (x - x j ) L2n, j ( x )

Moreover, if f C2n+2 [a, b], then

(x - x 0 ) 2 ...(x - x n ) 2 (2n 2)
f(x) H 2n 1 (x)
f
( (x))
(2n 2)!
for some (generally unknown) (x) in the interval (a, b).
19

Part2: HERMITE INTERPOLATION (4/14)


Hermite Polynomials(3/6)
Example 2: Use the Hermite polynomial that agrees with the data listed in the following Table
to nd an approximation of f(1.5).

xk

f(xk )

f (xk )

1.3

0.6200860

0.5220232

1.6

0.4554022

0.5698959

1.9

0.2818186

0.5811571

20

Part2: HERMITE INTERPOLATION (5/14)


Hermite Polynomials(4/6)
and:

21

Part2: HERMITE INTERPOLATION (6/14)


Hermite Polynomials (5/6)

22

Part2: HERMITE INTERPOLATION (7/14)


Hermite Polynomials (6/6)
And:

Finally,

So,

23

Part2: HERMITE INTERPOLATION (8/14)


Hermite Polynomials using divided difference (1/7)
There is an alternative method for generating Hermite approximations that has its basis in the
Newton interpolatory
divided-difference formula (7) (p.10 ) at x0, x1, ... , xn, that is,
n
Pn(x) = f [x0]+

f [x , x , ... , x
k 1

](x x0) (x xk1).

The alternative method uses the connection between the nth divided difference and the nth
derivative of f , as outlined in the following theorem:
Theorem: Suppose that f Cn[a, b] and x0, x1, ... , xn are distinct numbers in [a, b]. Then a number
exists in (a, b) with
()

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

Suppose that the distinct numbers x0, x1, ... , xn are given together with the values of f and f at
these numbers. Dene a new sequence z0, z1, ... , z2n+1 by
z2i = z2i+1 = xi , for each i = 0, 1, ... , n,
and construct the divided difference table in the form of Table 1 (P.11) that uses z0, z1, ..., z2n+1.

24

Part2: HERMITE INTERPOLATION (9/14)


Hermite Polynomials using divided difference (2/7)
Since z2i = z2i+1= xi for each i, we cannot dene f [z2i , z2i+1] by the divided
difference formula.
However, if we assume, based on equation (2) (p.7), that the reasonable
substitution in this situation is f [z2i , z2i+1]= f (z2i) = f (xi),
we can use the entries
f (x0), f (x1), ... , f (xn),
in place of the undened rst divided differences f[z0, z1], f [z2, z3], ... , f [z2n, z2n+1].
The remaining divided differences are produced as usual, and the appropriate
divided differences are employed in Newtons interpolatory divided-difference
formula.

25

Part2: HERMITE INTERPOLATION (10/14)


Hermite Polynomials using divided difference (3/7)
The following Table 2 shows the entries that are used for the rst three divided-difference
columns when determining the Hermite polynomial H5(x) for x0, x1, and x2.

26

Part2: HERMITE INTERPOLATION (11/14)


Hermite Polynomials using divided difference (4/7)
The remaining entries are generated in the same manner as in Table 1.
The Hermite polynomial is then given by
n

H2n+1(x) = f [z0] +

k 1

f [z0, z1, ... , zk ] (x z0) (x z1) (x zk1).

27

Part2: HERMITE INTERPOLATION (12/14)


Hermite Polynomials using divided difference (5/7)
Example 3: Use the data given in Example 2 and the divided difference method to
determine the Hermite polynomial approximation at x = 1.5.
Solution :
The underlined entries in the rst three columns of Table 3 are the data given in
Example 2. The remaining entries in this table are generated by the standard
divided-difference formula (6) p.9.
For example, for the second entry in the third column we use the second 1.3 entry
in the second column and the rst 1.6 entry in that column to obtain

28

Part2: HERMITE INTERPOLATION (13/14)


Hermite Polynomials using divided difference (6/7)
Table 3:

29

Part2: HERMITE INTERPOLATION (14/14)


Hermite Polynomials using divided difference (7/7)
The value of hermite polynomial at 1.5 is

30

THANK YOU!!

31

S-ar putea să vă placă și