انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة

Polynomial Approximation and Interpolation

الكلية كلية العلوم للبنات     القسم قسم فيزياء الليزر     المرحلة 3
أستاذ المادة نزار سالم شنان الزبيدي       4/27/2011 7:07:41 AM

Polynomial Approximation and Interpolation Chapter 4

Nizar Salim 1 lecture 1

4.1. Introduction:

Figure 4.1 illustrates a set of tabular data in the form of a set of [x,f(x)]

pairs. The function f(x) is known at a finite set (actually eight) of discrete

values of x. The value of the function can be determined at any of the eight

values of x simply by a table lookup. However, a problem arises when the

value of the function is needed at any value of x between the discrete

values in the table. The actual function is not known and cannot be

determined from the tabular values. However, the actual function can be

approximated by some known function, and the value of the approximating

function can be determined at any desired value of x. This process, which is

called interpolation, is the subject of Chapter 4. The discrete data in Figure

4.1 are actually values of the function f(x) = 1/x, which is used as the

example problem in this chapter.

In many problems in engineering and science, the data being considered

are known only at a set of discrete points, not as a continuous function. For

example, the continuous function

y = f(x) (4.1)

may be known only at n discrete values of x:

yi=y(xi) (i=1,2, ,n) (4.2)

Polynomial Approximation and Interpolation Chapter 4

Nizar Salim 2 lecture 1

Polynomial Approximation and Interpolation Chapter 4

Nizar Salim 3 lecture 1

In many applications, the values of the discrete data at the specific points

are not all that is needed. Values of the function at points other than the

known discrete points may be needed (i.e., interpolation). The derivative of

the function may be required (i.e., differentiation). The integral of the

function may be of interest (i.e., integration). Thus, the processes of

interpolation, differentiation, and integration of a set of discrete data are of

interest. These processes are illustrated in Figure 4.2. These processes are

performed by fitting an approximating function to the set of discrete data

and performing the desired process on the approximating function.

Many types of approximating functions exist. In fact, any analytical

function can be used as an approximating function. Three of the more

common approximating functions are:

1. Polynomials

2. Trigonometric functions

3. Exponential functions

Approximating functions should have the following properties:

1. The approximating function should be easy to determine.

2. It should be easy to evaluate.

3. It should be easy to differentiate.

4. It should be easy to integrate.

Polynomials satisfy all four of these properties. Consequently,

polynomial approximating functions are used in this book to fit sets of

discrete data for interpolation, differentiation, and integration. There are two

fundamentally different ways to fit a polynomial to a set of discrete data:

1. Exact fits

2. Approximate fits

An exact fit yields a polynomial that passes exactly through all of the

discrete points, as illustrated in Figure 4.3a. This type of fit is useful for

small sets of smooth data.

An approximate fit yields a polynomial that passes through the set of

data in the best manner possible, without being required to pass exactly

through any of the data points, as illustrated in Figure 4.3b. Several

definitions of best manner possible exist. Approximate fits are useful for

Polynomial Approximation and Interpolation Chapter 4

Nizar Salim 4 lecture 1

large sets of smooth data and small or large sets of rough data. In this book,

the least squares method is used for approximate fits.

4.2DIRECT FIT POLYNOMIALS

First let s consider a completely general procedure for fitting a

polynomial to a set of equally spaced or unequally spaced data. Given n + 1

sets of data [ ,f( )],

[x1, f(x1)] . [xn, f(xn)] which will be written as (xo, fo), (x1,f1) . (xn,fn),

determine the unique nth-degree polynomial Pn(x) that passes exactly

through the n + 1 points:

n( ) = ao+ a1x + a2x2 + ..+ anxn (4.3)

For simplicity of notation, let f(xi) = fi Substituting each data point into Eq.

(3.3) yields n + 1 equations:

f0 = a0 + a1xo + a2xo

2 +......+ anxo

n (4.4.0)

f0 = a0 + a1x1 + a2x1

2 +......+ anx1

n (4.4.1)

.....................................................

f0 = a0 + a1xn + a2xn

2 +......+ anxn

n (4.4.n)

Polynomial Approximation and Interpolation Chapter 4

Nizar Salim 5 lecture 1

There are n + 1 linear equations containing the n + 1 coefficients ao to

an. Equation (3.4) can be solved for a0 to an by Gauss elimination.

The resulting polynomial is the unique nth-degree polynomial that

passes exactly through the n + 1 data points. The direct fit polynomial

procedure works for both equally spaced data and unequally spaced data.

Example 4.1. Direct fit polynomials.

To illustrate interpolation by a direct fit polynomial, consider the simple

function =f(x) = 1/x, and construct the following set of six significant

figure data:

x f(x)

3.35 0.298507

3.40 0.294118

3.50 0.285714

3.60 0.277778

Let s interpolate for at x = 3.44 using linear, quadratic, and cubic

interpolation. The exact value is

y(3.44) =f(3.44) =1/3.44 = 0.290698... (4.5)

Let s illustrate the procedure in detail for a quadratic polynomial:

P2(x) = a + bx + cx2 (4.6)

To center the data around x = 3.44, the first three points are used. Applying

P2(x) at each of these data points gives the following three equations:

0.298507 = a + b(3.35) + c(3.35)2 (4.7.1)

0.294118 = a + b(3.40) + c(3.40)2 (4.7.2)

0.285714 = a + b(3.50) + c(3.50)2 (4.7.3)

Solving Eqs. (4.7) for a, b, and by Gauss elimination without scaling or

pivoting yields

P2(x) = 0.876561 - 0.256080 x + 0.0249333 x2 (4.8)

Substituting x = 3.44 into Eq. (3.8) gives

Polynomial Approximation and Interpolation Chapter 4

Nizar Salim 6 lecture 1

P2(3.44) = 0.876561 - 0.256080(3.44) + 0.0249333(3.44)2 = 0.290697 (4.9)

The error is Error (3.44)

P2(3.44) f(3.44) = 0.290697 - 0.290698 = -0.000001.

For a linear polynomial, use x = 3.40 and 3.50 to center that data around

x =3.44. The resulting linear polynomial is

P1(x) = 0.579854 -0.0840400 x (4.10)

Substituting x = 3.44 into Eq. (3.10) gives P1(3.44) = 0.290756.

For a cubic polynomial, all four points must be used. The resulting cubic

polynomial is

P3(x) = 1.121066 - 0.470839 x + 0.0878000 x2 0.00613333 x3 (4.11)

Substituting x = 3.44 into Eq. (4.11) gives P3(3.44) = 0.290698.

The results are summarized below, where the results of linear, quadratic,

and cubic interpolation, and the errors, Error(3.44) = P(3.44) - 0.290698, are

tabulated. The advantages of higher-degree interpolation are obvious.

P(3.44) = 0.290756 linear interpolation Error = 0.000058

= 0.290697 quadratic interpolation = -0.000001

= 0.290698 cubic interpolation = 0.000000

The main advantage of direct fit polynomials is that the explicit form of

the approximating function is obtained, and interpolation at several values of

x can be accomplished simply by evaluating the polynomial at each value of

x. The work required to obtain the polynomial does not have to be redone for

each value of x. A second advantage is that the data can be unequally

spaced.

The main disadvantage of direct fit polynomials is that each time the

degree of the polynomial is changed, all of the work required to fit the new

polynomial must be redone.

The results obtained from fitting other degree polynomials is of no help

in fitting the next polynomial. One approach for deciding when polynomial

interpolation is accurate enough is to interpolate with successively higherPolynomial

Approximation and Interpolation Chapter 4

Nizar Salim 7 lecture 1

degree polynomials until the change in the result is within an acceptable

range. This procedure is quite laborious using direct fit poly- polynomials.

This document was created with Win2PDF available at http://www.daneprairie.com.

The unregistered version of Win2PDF is for evaluation or non-commercial use only.


المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .