Extrapolation and Interpolation
Extrapolation and Interpolation
Extrapolation and Interpolation
Extrapolation
• In many engineering practice, data are available at discrete points and
we are required to fit a smooth and continuous function or curve to
this data.
• There are two ways of doing this: by collocation and by use of least
squares
• Collocation: the curve is made to pass through all the data points. This
is used when the data are known to be accurate or when they are
generated by evaluating a complicated function at a discrete set of
points.
• Least-squares: the curve is made to represent the general trend of the
data. This mean the curve does not necessarily pass through all the
data points.
• Interpolation is the process of estimating the value of a function f
corresponding to a particular value of the independent variable x,
when f(x) is described by a set of tabular data.
Collocation-Polynomial Fit
• Consider a polynomial of order n, passing through (n+1) data points
with no restriction on the spacing of data: i.e.
etc.
• Let the polynomial be of the form,
(1)
where x is the independent variable, y is the dependent variable and ,
are the unknown coefficients.
• Now let the data points be given by .
• If the polynomial passes through the point , then Eq. (1) will be
become
(2)
• Eq. (2) represents (n+1) algebraic equations linear in term of the
coefficients . These equations can be written in matrix form as:
(3)
where
This is known as a Vandermonde matrix.
• Since the assumed polynomial Eqn. (1) is applied to every point ,
fitting the polynomial to the data implies solving Eq. (3) for the ,s that
satisfy this equation.
(5)
• In compact form, Eq. (5) can be written as
0.53571
Note:
• The error in Lagrange interpolation is given by
Some disadvantages
• If the number of data points is to be increased or decreased, the
results of the previous calculations cannot be used
• Computation effort required is more for a single interpolation
• Estimation of error is not easy
Newton’s Divided-Difference Interpolation
This procedure overcomes the limitations of the Lagrange interpolating
polynomial listed above.
a) Linear interpolation:
Consider two data points on a f(x) vrs x graph, and
𝑥 0 𝑥 𝑥1
Now,
i.e.
Hence,
For and
(finite difference approx. of 1st
derivative)
Quadratic Interpolation
• Consider three data points , and to be fit by a quadratic polynomial of the
from
• For
• For
Substituting for and , can be solved for as:
becomes,
In general,
… (1)
Eq. (1) is known as the Gregory-Newton forward interpolation formula.
There is also the backward interpolation formula which can be written
as
… (2)
The choice of formula depends on the value of x at which the function
value f(x) is to be determined and its closeness to the known data.
1) Forward difference of f at j:
0 -7 4 5 5 3 1
1 -3 9 10 8 4
2 6 19 18 12
3 25 37 30
4 62 67
5 129
2) Backward difference of f at j:
0 -7
1 -3 4
2 6 9 5
3 25 19 10 5
4 62 37 18 8 3
5 129 67 30 12 4 1
Chebyshev Interpolation
• Instead of choosing equi-spaced values on the abscissa of a polynomial
interpolation formula like the Lagrange polynomial, the roots of a known
polynomial are taken as interpolating points. Such a polynomial which is known to
have a better minimization.
• The Chebyshev polynomial are defined by
(1)
• In power series, these polynomials are defined by :
and
In general
Now, where ;
so,
• Due to the cosine nature of the function, their values lie within
• The zeros of the function are those values of that make the cosine
zero, i.e.
c) Quadratic spline
The second-order spline represents a quadratic equation between
any two consecutive data points or knots. The equation between two
consecutive points is given by
,
and
and
No. of equations: 2
3) First derivative or slope at each interior knot must be continuous:
=
i.e.
No. of equations: n-1
4) Several options can be used for the last remaining equation. For
example, assume that 2nd derivative (curvature) to be zero at the
final point. i.e.
c) Cubic splines
Here, intervals are fitted with cubic polynomials:
(B)
Giving n+1 unknown derivatives at n+1 points. Eq. (B) gives n-1
conditions and so two more are needed. Several options exists. The
most common is
natural cubic spine