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

SMA 2471 Numerical Analysis Notes

1. Interpolation
1.1 Introduction
Definition: Method of constructing new data points within the range of a discrete set of
known data points.
Interpolation methods are the basis for many other procedures that we will study: numerical
differentiation and integration and solution methods for ordinary and partial differential
equations,
Illustration.
Let be a function which takes the values, , , , , .
If the form of the function is known, the values of corresponding to any value of can be
calculated. In most practical problems, the exact form of the function is not known.
In such cases the function is replaced by a singular function which has the same values as
for . The function is called an interpolating function or smoothing function
or interpolating formula.
This process is called interpolation. If is outside the range of , its extrapolation and not
interpolation.
Considerations in selecting with a suitable interpolation:
a) Are the given points equidistant?
b) Has a difference scheme been constructed?
c) Is a table of interpolation coefficients available?
d) Is interpolation to be performed at the beginning or at the end of the table?
We will deal with polynomial interpolation. Polynomial interpolation is preferred because
polynomials are:
a) easy to determine,
b) easy to evaluate ,
c) easy to differentiate and Integrate,
d) free from singularirities.
Ways of fitting a polynomial
1. Exact fits – yields polynomials passing through all the points.
2. Approximate fits – yields polynomials passing through the set of data in the best possible
manner without the requirement of passing through any data point (least square methods).

1.2 Methods of interpolation


1.1.1 Linear and Quadratic interpolation
Linear Interpolation
The simplest form of interpolation is to connect two data points with a straight line. The
technique is called linear interpolation.
Consider the data points and with . Linear interpolating
polynomial, , is given by the formula

1
SMA 2471 Numerical Analysis Notes

Examples
1) Fit a linear polynomial from the points given in the table below to .

Solution
Using the formula for linear interpolation, with , ,

The polynomial yields


2) The table below gives square roots of positive integers.

Use linear interpolation to determine the square root of .


Solution
lies between and 4.
While and

3) A function is defined by the following table

Use linear interpolation to estimate. (a) and (b) .


4) Use values in the table below to get an interpolated value at using linear
interpolation.

2
SMA 2471 Numerical Analysis Notes

Quadratic Interpolation
If three data points are available, a quadratic polynomial or a parabola can be used to
interpolate. Such a polynomial takes the

where

Examples
5) Fit a second order polynomial to the three points given in the table below then use the
polynomial to evaluate .

Solution
Applying the following equations

, , , then

Substituting these values into the equation yields the quadratic formula

The polynomial can be evaluated at for

1.1.2 Lagrange Interpolation


The Lagrange interpolating polynomial is given by the formula:

3
SMA 2471 Numerical Analysis Notes

This polynomial is called the Lagrange interpolating polynomial and for


and for . For example the linear formula is

and the second-order formula is

Merits of Lagrange’s formula


a) The formula is simple and easy to remember.
b) There’s no need to construct the divided difference table and we can directly interpolate the
unknown value with the help of given observations.
Demerits of Lagrange’s formula
a) The calculations in the formula are more complicated than in the divided difference formula.
b) The application of the formula is not speedy.
c) There’s always a chance of committing some error due to a number of positive and negative
sign in the denominator and numerator of each term.
d) The calculations provide no check whether the functional values used are taken correctly or
not whereas the differences used in a difference formula provide a check on the functional
values.
Exercises
1) Obtain the missing term in the data given below using Lagrange’s formula.

2) Use a Lagrange interpolating polynomial of the first and second order to evaluate on the
basis of the data given below.

3) Given the following table of values, estimate the value of by Lagrange’s


interpolation. What is the order of the polynomial equation?.

4
SMA 2471 Numerical Analysis Notes

Inverse interpolation using Lagrange Interpolating Formula


The process of estimating the value of for the value of not in the table is called Inverse
Interpolation.
When the values of are unevenly spaced, Lagrange’s method is used by interchanging and .
Thus

Exercises
1) Apply Lagrange’s formula to obtain the root of the function given that
, , and .
2) From the table
20 25 30 35
0.342 0.423 0.5 0.65
Find the value of for .
3) Determine from the following data
1 3 4
4 12 19

4) Apply Lagrange’s Interpolation formula to find a polynomial which passes through the points
, , and .
5) Find the Lagrange’s interpolating polynomial corresponding to the data points:
a) , , and
b) , , and

Examples

1) Express the function as a sum of partial fractions, using Lagrange’s


interpolating formula.
Solution
Let . The zeros of the denominator are , and
. Evaluate at these points.
, , .
We fit a polynomial using Lagrange’s formula

Dividing both sides by we obtain

5
SMA 2471 Numerical Analysis Notes

2) Using numerical method, express the rational function as a sum of partial fractions.
(using Lagrange’s interpolation)

Exercises
1) Use Lagrange’s formula to express the following functions as the sums of partial fractions.

2) Estimate the value of applying Lagrange’s formula to the following data


0 2 3 6
707 819 866 966

3) From the table, find for , using Lagrange’s inverse formula.


0.4 0.5 0.7 0.8
-0.916 -0.693 -0.357 -0.223

4) Using Lagrange’s formula, express the following function as a sum of partial fractions.

1.1.3 Interpolation based on Finite differences


Consider a tabulated function i.e. given in tabular form as

Table 1+++++++

If we let Then If we let Then

are called tabular points or base points, are called tabular values and , is
called the interval or step – length

6
SMA 2471 Numerical Analysis Notes

Finite difference operators


Note: An operator acts on a function to yield another function.
1) Identity Operator,
Is defined as or . e.g in the table .
2) Shifting Operator,
is defined as o , and
Now

In general then,

3) Forward difference Operator,


Defined as
is referred to as the 1st forward difference.

Where the index does not denote power but indicates the second difference and in
general the differences are denoted as

Forward difference layout

A forward difference table is also called a Diagonal difference table


4) Backward difference Operator,
Defined as

7
SMA 2471 Numerical Analysis Notes

Backward difference layout

The entries along the backward diagonal are the backward differences of various orders at
the corresponding source point in the table.
5) Central Difference Operator,
Is defined as

Central difference layout

6) Averaging Operator,
Defined as

8
SMA 2471 Numerical Analysis Notes

i) Interpolation with equal intervals


1. Newton’s Forward difference Interpolating Formula/Polynomial
Let a function be given by a set of tabular values
where , i.e. ’s are equally spaced.
The Newton’s forward difference interpolation formula (NFDIF) is given by

Exercises
1) A second degree polynomial passes through the points and .
Find the polynomial.
2) Find for using the following table.

3) Given that , , ,
. find the value of .
4) Using Newton’s forward interpolation formula find the value of from the following
data. Estimate the error.

Newton’s Backward difference Interpolating Formula/Polynomial


For interpolating near the end of a set of equally spaced tabular values ,
we can derive a suitable polynomial of degree .
The Newton’s Backward Difference Interpolation formula (NBDIF) formula is given by

9
SMA 2471 Numerical Analysis Notes

Exercises
1) From the following data obtain a backward difference interpolation polynomial and use it to
interpolate as .

2) Use NBDIF to interpolate at from the following data

3) qq
Central difference interpolation formulae
Appropriate/preferable for interpolating near the middle of a difference table.
Let be given for equispaced values of arguments , , ,
, and the corresponding values of be . If
denote the central ordinate corresponding to , the central difference table is given as

Note: several formulas are derived i.e.


1) Gauss’s forward interpolation formula :- best when the interpolated
value lies near to the right of the central values in the table.
2) Gauss’s backward interpolation formula :- best when the interpolated
value lies near to the left of the central values in the table.
3) Bessel’s formula . gives the best result when we interpolate the middle
of an interval.
4) Stirling’s interpolation formula

10
SMA 2471 Numerical Analysis Notes

The Stirling’s Formula

It gives the most accurate results for .


Therefore, must be choosen such that satisfies this inequality. Stirling’s formula is
applicable when the value of in the expression is very near to zero.
Exercises
1. From the following table, find the value of

2. Use Stirling’s formula to compute from the following table

3. Use Stirling’s formula to compute from the following table

4. From the following table, find the value of by Newton’s, and Stirling formula.

5. Apply (a) Stirling’s formula and (b) Newton’s foward difference formula to find the value of
from the following table which gives the values of

at intervals of from to : { }

11
SMA 2471 Numerical Analysis Notes

ii) Interpolation with unequal intervals


Divided differences
Denoted by by
The 1st divided difference of for the arguments , , or , defined as

Therefore, , , and so on.


nd
The 2 divided differences for the arguments , , , or is defined as

and the third differences by,

The divided difference table can be represented as

Note:
1) Divided differences are symmetrical in their arguments.
Thus ,

2) The order divided differences of a polynomial of the degree are constant,.

Newton’s General divided differences formula


Let be values of a function corresponding to the arguments
with intervals not necessarily equispaced. Then,

Which is called Newton’s General divided difference formula or (Newton’s Fundamental (divided
difference) Formula).
Exercises

12
SMA 2471 Numerical Analysis Notes

1. Find a polynomial satisfied by and . Use it to


evaluate .
2. Using divided differences, construct and recursively and use the to interpolate .

3. By means of Newton’s divided difference formula, find the value of and form the
following table.

4. Find from the following data using divided difference formula: , ,


and .

Combined Exercises
1. Given the data

Calculate using:
i) Lagrange polynomial of order and ,
ii) Newton’s interpolating polynomial of order through .
2. Given the data

Calculate using:
i) Lagrange polynomial of order and ,
ii) Newton’s interpolating polynomial of order through .
3. Find the interpolating polynomial by Lagrange’s interpolation and Newton’s divided
difference formula for the following data and hence show that they represent the same
polynomial
a) , , and .
b) , , and .

13

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