Interpolation, Extrapolations and Difference Operators

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

Interpolation

and
Extrapolation

By
Muhammad Mujtaba Shaikh,
Lecturer Mathematics (BPS-18),
Department of B.S. and R.S, MUET, Jamshoro.
Introduction
• We generally write y = f(x) when “y” is a function of “x”. Where “x” and
“y” are respectively the independent and dependent variables.
• If function is known explicitly then one can easily find its value at any
point of its domain.
Following table shows values of f (x) = x2+1 at some discrete values of
“x”:
x 0 1 2 3
f(x) 1 2 5 10
• Similarly in some situations we can guess the function when its
tabulated values are given. For instance:

x 0 1 2 3 4
f(x) 1 2 4 8 16
 f ( x)  2 x
Need of Interpolation and
Extrapolation
• Now consider a case when form of the function is neither explicitly
known nor can we guess it. For example:

x 3 5 7 9
f ( x)  ??
f(x) 293 508 585 764

• Since we don’t know form of the function, so we are unable to find


f (2), f (4), f (6), etc. That is we can’t directly find functional values
which are within or outside the range of known values in above table.
• Instead of directly finding exact functional values at some points “x”
which are not in table , one can find approximations to them by some
Indirect (Numerical) methods; known as Interpolation and
Extrapolation.
Introduction (continued)
• Let’s consider a practical example.
Suppose, speed “V” of a car after “t” hours is known, i.e.

t 0 2 4 5 6
V(t) 0 70 65 80 95
• Now, To predict speed of the car after 1 hour, 3 hours, 4 and half hours,
8 hours, etc, one has to use the techniques of Interpolation and
Extrapolation.
Definitions
INTERPOLATION
• It is the art of reading between the lines of a table.
• It is a process of estimating values between precise data points.
• It is a method of constructing new data points from a discrete set of
known data points.
• An art of constructing a function which closely fits to the given
data points, which are obtained through sampling or
experiments.
• A method of approximating missing functional values from a set of
given values of function.
• A technique to estimate unknown values of the dependent variable at
some values of independent variable within a range of given
tabulated data points.
Definitions (continued)
INTERPOLATION

A technique to estimate unknown values of the dependent


variable at some values of independent variable within a
range of given tabulated data points.

EXTRAPOLATION

A technique to estimate unknown values of the dependent


variable at some values of independent variable outside
the range of given tabulated data points.
Example
If tabulated values of a function are given as:
x 3 5 7 9
f (x) 293 508 585 764
• Then we can find f(4), f(5.2), f(6), f(6.9) and f(8) by
“Interpolation”, because these are within the given range,
i.e. between 3 and 9.

• Similarly the functional values that are outside the given


range, such as f(1), f(1.5), f(9.01), f(13), etc can be
determined by “Extrapolation”.
Why should we be interested in interpolation
or Extrapolation?

• Interpolation methods are the basis for other


procedures that we will deal with:
– Numerical differentiation
– Numerical integration
– Solution of ODEs (ordinary differential equations) and PDEs (partial
differential equations)

• These methods demonstrate some important


theory about polynomials and the accuracy of
numerical methods.
Types of Tabulated Data
• EQUALLY SPACED DATA
 A set of tabulated data is said to be Equally spaced, if sequence of the
values of independent variable is Arithmetic.
 Values of the independent variable have a common spacing.
 In this type of data the difference between every two successive values
of independent variable is always same (or constant).
 Such common difference is often termed as “spacing” or “step size”.
 Examples

x 3 5 7 9 x 0 1 2 3 4
Y 29 50 58 76 f(x) 1 2 4 8 16
Types of Tabulated Data (continued)
• UNEQUALLY SPACED DATA
 A set of tabulated data is said to be Unequally spaced if values of the
independent variable are not in arithmetic sequence.
 Values of the independent variable don’t have common spacing.
 In this type of data the difference between every two successive values
of independent variable is not same (or fixed).
Examples
t 0 2 4 5 6
V(t) 0 70 65 80 95

x -1 2 6 7
Y 29 50 58 76
Finite Difference Operators
• To derive schemes for Interpolation, Extrapolation,
Numerical Differentiation, Numerical Integration,
Solution of ODEs and PDEs, one must have adequate
knowledge of Difference Operators and their relations.
• We have been using differences in many of applied
problems. For Instance:
Change in Time is often described as difference
between final time and initial time:
t  t f  ti  t1  t0 , where  is a difference
operator.
Some Linear Operators
• Shifting Operator ( E )
• Forward Difference Operator ()
• Backward Difference Operator ()
• Central Difference Operator ( )
• Mean Value or Average Difference Operator(  )
• Derivative Operator ( D)
Shifting Operator ( E )
• If y = f(x) then:
E yp = yp+1 It is used to increase or lower the
E2 yp = yp+2 subscripts of “y”. When it operates
E3 yp = yp+3 on “y” then power of “E” is added
……… to subscript of “y”
. En yp = yp+n

For example: E y0 = y0+1 = y1


E2 y0 = y0+2 = y2
E-2 y3 = y3-2 = y1
Forward Difference Operator ()
• If y = f(x) then:
y...  (Next value of “y”)– (Current value of “y”)

If y0 , y1 , y2 , y3 ,..., y p ,..., yn are equally


spaced values of “y”, then first order forward
differences are defined as:
y0  y1  y0 y1  y2  y1
y2  y3  y2 ,..., y p  y p1  y p
where p= 0,1,2,…,n
Forward Differences (continued)
• Likewise derivatives, one can define higher
order differences. For instance second order
forward difference in y0 will be:
 y0  (y0 )  ( y1  y0 )
2

 y0  y1  y0  ( y2  y1 )  ( y1  y0 )
2

 y0  y2  2 y1  y0
2

Similarly  2 y1  y3  2 y2  y1 , thus:
2 y p  y p2  2 y p 1  y p , p  0,1,2,..., n
Forward Differences (continued)
 3 y0  ( 2 y0 )   ( y2  2 y1  y0 )
 y0  y3  3 y2  3 y1  y0
3

 y0  y4  4 y3  6 y2  4 y1  y0
4

 y0  y5  5 y4  10 y3  10 y2  5 y1  y0
5

• One can observe that coefficients of higher


differences in a value of “y” are similar to the
binomial coefficients of:
( y  1) , p  0,1,2,..., n
p

You might also like