project
project
CA-2 Assignmen
Figure 1: Interpolating polynomial for data at three abscissas (x0,x1,x2) and two possible
functions f(x). Given three points, p(x) may not be a good estimate of f (right)- the interpolant
cannot know what f does between the data points. but the nature of the function f(x) may be
unknown. The goal of interpolation is to construction a simple function p that passes through
(interpolates) the data (x0,y0) (x1,y1) (xn,yn) and produces a useful approximation to the
function f(x). There are a number of different simple functions to try; here we focus on the
simplest choice (polynomials).
(or for a function f through points x0, . . . , xn) is the unique polynomial p ∈ Pn such that
p(xi) = yi, i = 0, 1, . . . , n.
General Consideration:
Given some basis φ0, · · · φn for Pn, we may represent p in the form
p = c0φ0 + · · · + cnφn.
Finding the interpolant then amounts to finding ci’s such that
yi = c0φ0(xi) + · · · + cnφn(xi), i = 0, . . . , n
which is a set of n + 1 linear equations for n + 1 unknowns. To be of practical use, we
should choose the basis so that the expression for p has nice properties, such as
• The φi’s are easy to construct
• The ci’s are easy to compute
• The computations are numerically stable (safe against round off errors)
• p(x) is easy to evaluate once the ci’s and φi’s have been found
• The approximation is ‘flexible’ (it can be adjusted if the data
changes). The simplest choice for a basis is the set of monomials:
p(x) = c0 + c1x + · · · + cnxn.
Writing out the equations (see textbook for details), we obtain a system that is solvable
but not in any way nice. For small values of n, things are not too bad. However, the
formula is a bit of a mess, and is not useful for developing theory and of limited use in
practice.
Newton’s Forward Interpolation Formula:
Let the function y = f(x) take the values y0 , y1 , …, yn
corresponding to the values x0, x1, …, xn of x. Let these values of x be equispaced such that
i = x0 + ih (i = 0, 1, …). Assuming y(x) to be a polynomial of the nth degree in x such that
y(x0) = y0, y(x1) = y1, …. , y(xn) = yn .We can write
Y(x) = a0 + a1(x-x0) + a2(x-x0) (x-x1) + a3(x-x0) (x-x1) (x-x2)
+ …. + an(x-x0) (x-x1) (x-xn-1). (1)
Putting x = x0 , x1 , …, xn successively in (1), we get,
Y0 = a0, y1 = a0 + a1(x1-x0), y2 = a0 + a1(x2-x0) + a2(x2-x1) and so on.
From these, we find that a0 = y0, Δy0 = y1 – y0 = a1 (x1 – x0) = a1h.
∴ a1 = (1/h) Δy0.
Newton’s Backward Interpolation Formula:
Lagrange form of Interpolant:
Suppose we want the ci’s to be as simple as possible. Then, at best, we would have
p(x) = y0L0(x) + · · · + ynLn(x)
for basis functions L0, , Ln. That is, the coefficient of the i-th basis function is just the
·
i- th function value. This is the Lagrange form of the interpolating polynomial.
·
To construct it, observe that·it suffices to find polynomials Li such that
(i) Li has degree n
(ii) Li(xi) = 1
(iii) Li(xj) = 0 for j /= i.
/ are n of
Property (iii) can be satisfied by constructing a polynomial with roots at xj for j = i (there
them, so (i) is not a concern):
Then, the constant c is chosen to satisfy (ii), which gives
Divide
d
Differ
ence
Metho
d of
Polyn
omial Interpolation:
The divided differences method is a numerical procedure for interpolating a polynomial given a set of points.
Unlike Neville’s method, which is used to approximate the value of an interpolating polynomial at a given
point, the divided differences method constructs the interpolating polynomial in Newton form.
Consider a table of values of xx and corresponding values of a function f(x) at those points:
x y
x0 f(x0)
x1 f(x1)
. .
. .
. .