We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 27
CSC475: Numerical Computing
Tanveer Ahmed Siddiqui
Department of Computer Science
COMSATS University, Islamabad Lecture 14
Interpolation
Department of Computer Science 2
Recap ,
In previous lectures, we discussed following
difference operators:
Department of Computer Science
Today Covered ,
After completing this lecture you should be able to
know What is Interpolation? Interpolation Formula (Equi-spaced data points) Newton’s Forward Difference Interpolation Formula Newton’s Backward Difference Interpolation Formula
Department of Computer Science
Motivation
When a function is known explicitly, it is easy to
calculate the value (or values) of f(x), corresponding to a fixed given value. Example: Let f(x) = 3x3+9x2-7. Calculate functional value at x =3 If the explicit form of the function is not known, is it is possible to obtain an approximate value of the function up to a desired level of accuracy? Suppose that the functional values are given in tabular form such as:
How can we determine functional value at x =8?
Department of Computer Science 5 Interpolation
This question leads to the interpolation which plays an
important role in solving practical problems that occurs in engineering and science where e will frequently have occasion to estimate values between data points.
Department of Computer Science 6
Interpolation
Interpolation is the technique of estimating the
value of a function for any intermediate value of the independent variable. Hence, if (xi, yi), i = 0, 1, 2, …., n are the set of (n + 1) given data points of the function y = f (x), then the process of finding the value of y corresponding to any value of x = xi between x0 and xn, is called interpolation.
Department of Computer Science 7
Interpolation
Department of Computer Science 8
Interpolation
Department of Computer Science 9
Assumption for Interpolation
In the study of interpolation, we make the
following assumptions: The value of the function under consideration should be either in increasing order or in decreasing order. There are no sudden jumps in the values of the dependent variable for the period under consideration The rise or fall of the function should be uniform. i.e. rate of change of figures from one period to another is uniform.
Department of Computer Science 10
Polynomial Interpolation(Approximation of a function by polynomial)
Department of Computer Science 11
Choice of suitable Interpolation formula
The following points are considered in choosing
a method for the interpolating polynomial: Whether the given points xi are equally spaced or unequally spaced. Whether the interpolation is desired towards the beginning, center or end of the difference table.
Department of Computer Science 12
Types of interpolation formulas for equally spaced data points
Types of interpolation formulas for equally
spaced data points Newton’s Forward difference Interpolation Formula. Newton’s Backward difference Interpolation Formula. Central difference interpolation formula.
Department of Computer Science 14
Types of interpolation formulas for unequally spaced data points
The following formulas may be used for
unequally spaced data points: Newton’s Divided difference interpolation formula Langrage's formula
Department of Computer Science 15
Types of interpolation formulas for equally spaced data points
Department of Computer Science 16
Newton’s forward difference formula for interpolation
Let y = f (x) be a function which takes values
f(x0), f(x0+ h), f(x0+2h), …, corresponding to various equi-spaced values of x with spacing h, say x0, x0 + h, x0 + 2h, … . Suppose, we wish to evaluate the function f (x) for a value x = x0 + ph, where p=(x-x0)/h is any real number, then for any real number p the Newton’s forward difference formula for interpolation gives the value of f(x0 + ph) in terms of f(x0) and its leading differences as follows: Department of Computer Science 17 Newton’s forward difference formula for interpolation
Department of Computer Science 18
Example
Evaluate f (15), given the following table of
values:
Solution: The forward differences are tabulated
as
Department of Computer Science 19
Example
Department of Computer Science 20
Example
Department of Computer Science 21
Your Turn
Find the cubic polynomial in x for the given data
below:
Department of Computer Science 22
Newton’s backward difference formula for interpolation
Department of Computer Science 23
Newton’s backward difference formula for interpolation (Equi-spaced)
Department of Computer Science 24
Newton’s backward difference formula for interpolation
Department of Computer Science 25
Example
For the following table of values, estimate
f (7.5).
Solution: The backward differences are tabulated