SlideShare a Scribd company logo
Interpolation Techniques
Background and implementation in C++
Pedagogical notes
2016
Quasar Chunawala
Introduction
Say that, in the study of some phenomenon, there is an established functional
relationship between the quantities y and x; but the function f(x) is unknown.
The experiment has established the values of the function y0, y1, . . . , yN for cer-
tain values of the argument x0, x1, . . . , xN in the interval [x0, xN ]. We don't
have an analytic expression for f(x). The problem is then to nd a function (as
simple as possible from the computational stand-point; for example a polyno-
mial) which will represent the unknown function y = f(x).
In more abstract fashion, the problem may be formulated as follows: given on
the interval [x0, xN ], the values of an unknown function y = f(x) at N + 1
distinct points x0, x1, . . . , xN , such that,
y0 = f(x0), y1 = f(x1), . . . , yN = f(xN )
It is required to nd a polynomial P(x) of degree≤ n that approximately
expresses the function f(x). Further, the task is to estimate f(x) for some
target value of x.
Interpolating polynomial given one data point and
its higher order derivatives
Say that, we are required to t a polynomial P(x), at a point x = x0, where
the value of the function and the value of its rst n derivatives at that point
f(x0), f (x), f(2)
(x), . . . , f(n)
(x) are given. Then, the Taylor's series expansion
of the function in terms of a polynomial of degree n over the interval [x0, x] is
the interpolating polynomial. This is intuitive, because the Taylor's series
polynomial and its higher order derivatives have the same values as the function
and its derivatives.
The Taylor's series expansion of a function f(x) over the interval [x0, x], such
that Pn(x0) = f(x0), Pn(x0) = f (x0), Pn (x0) = f (x0), . . . , P
(n)
n (x0) = f(n)
(x0)
is given as
Pn(x) = f(x0) + (x−x0)
1! f (x0) + (x−x0)2
2! f (x0) + . . . + (x−x0)n
n! f(n)
(x) + Rn(x)
Rn(x) is called the remainder. For those values of x, for which the Rn(x) is small,
the polynomial Pn(x) yields an approximate representation of the function f(x).
On interpolating any value using the polynomial Pn(x), it is necessary to know,
the degree of accuracy of the estimate, or the error. The remainder term can
be expressed in the form
Rn(x) = (x−x0)(n+1)
(n+1)! f(n+1)
(ξ), where x0  ξ  x
1
Error term
The error in an interpolation is of prime importance. For example, we may be
given N = 1000 data points. To construct an interpolating polynomial, we may
use only M = 4 points. What will be the error in that approximation. Further,
is there an upper bound on the error - what is the largest possible error in that
interpolation. The answers to these questions will be known through the error
term.
We have,
Rn(x) =
1
(n + 1)!
· |(x − x0)|n+1
· |fn+1
(ξ)|
≤
1
(n + 1)!
· |(x − x0)|n+1
· Mn+1
where Mn+1 is the maximum value of fn+1
(ξ) over an interval [x0, x].
Assume that an estimate of Mn+1is available. Suppose, we are asked to con-
struct a 5-term Taylor's series. Say, we desire have an error no more than an
acceptable tolerance, that is|Rn(x)|  . To fulll this condition, we must have,
|Rn(x)| = 1
(n+1)! · |(x − x0)|n+1
· Mn+1 

Conclusions:
1. If the tolerance and the number of terms in the Taylor's series n are given
to us, then we can easily nd out the distance h from the point x0, so that the
accuracy is retained.
2
2. If the distance h and the tolerance are given, we can solve for n, the number
of terms required in the Taylor's series, so that the accuracy is retained.

Example. Obtain the polynomial approximation to f(x) =
√
1 + x over the
interval [0, 1] by means of Taylor's series, about the point x0 = 0.
(i) Estimate the error of the approximate equation
√
1 + x ≈ 1+ 1
2 x− 1
8 x2
when
x = 0.2.
(ii) Find the number of terms required in the expansion to obtain results correct
to 5 × 10−6
for 0  x  1
2 .

Solution.

i f(i)
(x) f(i)
(0)
0 (1 + x)1/2
1
1 1
2 (1 + x)−1/2 1
2
2 − 1
22 (1 + x)−3/2
− 1
22
3 1·3
23 (1 + x)−5/2 1·3
23
n (−1)n−1
· 1·3·...·(2n−3)
2n (1 + x)−(2n−1)/2
(−1)n 1·3·...·(2n−3)
2n
n + 1 (−1)n
· 1·3·...·(2n−1)
2n+1 (1 + x)−(2n+1)/2

Therefore, our polynomial approximation is,
P(x) = 1 +
1
2
x −
1
2!
1
22
x2
+
1
3!
1 · 3
23
x3
+ . . . +
(−1)n−1
xn
n!
·
1 · 3 · . . . · (2n − 3)
2n
+ Rn(x)
= 1 +
x
2
−
x2
8
+
x3
16
+ . . . +
(−1)n−1
xn
n!
·
1 · 3 · . . . · (2n − 3)
2n
+ Rn(x)

(i) The maximum of f(n+1)
(x) in the interval [0, 1
2 ] is as follows.
f(n+1)
(x) = 1·3·...·(2n−1)
2n+1 · 1
(1+x)(2n+1)/2
This will be maximum when (1 + x) is minimum, or x is minimum. Thus,
f(n+1)
(x) will be maximum at x = 0.
Mn+1 = 1·3·...·(2n−1)
2n+1 = (2n)!
2nn! · 1
2n+1 = 1
22n+1 · (2n)!
n!
Rn(x) ≤ 1
(n+1)! · |x|n
· Mn+1 = 1
(n+1)! · |x|n+1
· 1
22n+1 · (2n)!
n!
At x = 0.2, n = 2,
3
Rn(0.2) ≤ 1
(3)! · | 2
10 |3
· 1
25 · (4)!
2! = 5 × 10−4

(ii) We must have,
= 1
(n+1)! · |x|n+1
· 1
22n+1 · (2n)!
n!
Rn(0.5) = 1
(n+1)! · |1
2 |n+1
· 1
22n+1 · (2n)!
n! = (2n)!
n!(n+1)! · 1
23n+2
We must have, Rn(0.5) ≤ 5 × 10−6
.
Solving for n, we get n = 10.
Interpolating polynomial for a table of data points
Suppose, we are given N + 1 data points.
x x0 x1 . . . xi . . . xn
f(x) f(x0) f(x1) . . . f(xi) . . . f(xn)

In the rectangular plane,
• given N = 2 distinct points, we can always construct a straight line; a
polynomial P1(x) of order 1 that passes through these two points.
• given N = 3 distinct points, we can always construct a quadratic, a poly-
nomial P2(x) of order 2 that passes through these two points. In an ex-
treme case, if all the 3 points lie on a straight line, then it will degenerate
into a polynomial of order 1. Hence, through N = 3 points, a polynomial
P2(x) of order ≤ 2 can be constructed.
• given N = 4 distinct points, we can always construct a cubic, a polynomial
P3(x) of order ≤ 3 that passes through these three points.
• given N +1 distinct points, we can always construct a polynomial of order
≤ N that passes through these two points.
The existence of this fact can also be proved mathematically.
4
Theorem. Given N + 1 data points, there exists a unique interpolating poly-
nomial Pn(x) of order N, which ts these points. 
Proof.
Suppose the interpolating polynomial is of the form
Pn(x) = C0 + C1x + C2x2
+ . . . + Cnxn
This polynomial ts the N + 1 data points, (xi, f(xi)) : i = 0, 1, . . . , N. There-
fore, these points must satisfy the equation of the polynomial. We have,
f(x0) = C0 + C1x0 + C2x2
0 + C3x3
0 + . . . + Cixi
0 + . . . + CN xN
0
f(x1) = C0 + C1x1 + C2x2
1 + C3x3
1 + . . . + Cixi
1 + . . . + CN xN
1
...
f(xN ) = C0 + C1xN + C2x2
N + C3x3
N + . . . + Cixi
N + . . . + CN xN
N
This is a system of N + 1 equations in N + 1 unknowns C0, C1, . . . , CN . We
are to determine C0, C1, . . . , CN . If a unique solution for C0, C1, . . . , CN exists,
then the interpolating polynomial exists uniquely. A unique solution exists if
and only if, the determinant of the coecients of these variables must not be
equal to 0.
D =
1 x0 x2
0 . . . xr
0 . . . xN
0
1 x1 x2
1 . . . xr
1 . . . xN
1
...
1 xi x2
i . . . xr
i . . . xN
i
...
1 xN x2
N . . . xr
N . . . xN
N
This determinant is called the Vandermonde's determinant. If we subtract the
rst row from the second, the rst row from the third and so forth, we have
5
D =
1 x0 x2
0 . . . xr
0 . . . xN
0
0 (x1 − x0) (x2
1 − x2
0) . . . (xr
1 − xr
0) . . . (xN
1 − xN
0 )
0 (x2 − x0) (x2
2 − x2
0) . . . (xr
2 − xr
0) . . . (xN
2 − xN
0 )
...
0 (xi − x0) (x2
i − x2
0) . . . (xr
i − xr
0) . . . (xN
i − xN
0 )
...
0 (xN − x0) (x2
N − x2
0) . . . (xr
N − xr
0) . . . (xN
N − xN
0 )
=
1 x0 x2
0 . . . xr
0 . . . xN
0
0 (x1 − x0) (x2
1 − x2
0) . . . (xr
1 − xr
0) . . . (xN
1 − xN
0 )
0 (x2 − x0) (x2
2 − x2
0) . . . (xr
2 − xr
0) . . . (xN
2 − xN
0 )
...
0 (xi − x0) (x2
i − x2
0) . . . (xr
i − xr
0) . . . (xN
i − xN
0 )
...
0 (xN − x0) (x2
N − x2
0) . . . (xr
N − xr
0) . . . (xN
N − xN
0 )
= (x1 − x0)(x2 − x0) . . . (xi − x0) . . . (xN − x0)·
1 (x1 − x0) (x2
1 − x2
0) . . . (xr−1
1 − xr−1
0 ) . . . (xN−1
1 − xN−1
0 )
1 (x2 − x0) (x2
2 − x2
0) . . . (xr−1
2 − xr−1
0 ) . . . (xN−1
2 − xN−1
0 )
...
1 (xi − x0) (x2
i − x2
0) . . . (xr−1
i − xr−1
0 ) . . . (xN−1
i − xN−1
0 )
...
1 (xN − x0) (x2
N − x2
0) . . . (xr−1
N − xr−1
0 ) . . . (xN−1
N − xN−1
0 )
Continuing in this fashion, we get,
D = (x1 − x0)(x2 − x0) . . . (xi − x0) . . . (xN − x0)(x2 − x1)(x3 − x1) . . . (xi −
x1) . . . (xN − x1) . . . (xN − xN−1)
D is the product of all possible factors xi − xj. Hence, it can be expressed as :
D =
n
i, j = 0
i  j
(xi − xj)
Since, these are N +1 distinct points, xi = xj for all i, j. Thus, the value of the
Vandermonde's determinant is non-zero. Hence, a unique solution C0, C1, . . . , CN
exists.
We can further prove that the interpolating polynomial is also unique.
Let P∗
n(x) be another polynomial which ts the given data. This means, P∗
n(xi) =
f(xi) for all i.
Let us dene an auxiliary function,
Q(x) = Pn(x) − P∗
n(x)
Since, both Pn(x) and P∗
n(x) are polynomials of degree ≤ n, the auxiliary func-
tion Q(x) must be a polynomial of degree ≤ n.
6
Now,
Q(xi) = Pn(xi) − P∗
n(xi) = 0, for all i = 0, 1, . . . , n
Observe that Q(x) vanishes at n+1 points, and thus has n+1 roots. But, Q(x)
is a polynomial of degree ≤ n. This is possible if and only if, Q(x) is identically
equal to 0.
Q(x) ≡ 0
Pn(x) ≡ P∗
n(x)
Thus, the interpolating polynomial Pn(x) is unique.
Lagrange's interpolating polynomial
Given N + 1 data points, we are asked to nd the interpolating polynomial
Pn(x) that ts these points.
x x0 x1 . . . xi . . . xn
f(x) f(x0) f(x1) . . . f(xi) . . . f(xn)
Since, the polynomial satises all of these points, it must be a linear combination
of all f(xi)'s.
Let
Pn(x) = l0(x)f(x0)+l1(x)f(x1)+l2(x)f(x2)+. . .+li(x)f(xi)+. . .+ln(x)f(xn)
As noted in the previous section Pn(x) is a polynomial of degree n. f(x0), f(x1),
f(x2), . . ., f(xn) are all numbers. Therefore, the only possibility is that li(x)
for all i = 0, 1, 2, . . . , n should be polynomials of degree n. Since, Pn(x) ts all
the data points, we must have,
f(x0) = Pn(x0) = l0(x0)f(x0) + l1(x0)f(x1) + l2(x0)f(x2) + . . . + li(x0)f(xi) + . . . + ln(x0)f(xn)
f(x1) = Pn(x1) = l0(x1)f(x0) + l1(x1)f(x1) + l2(x1)f(x2) + . . . + li(x1)f(xi) + . . . + ln(x1)f(xn)
...
f(xj) = Pn(xj) = l0(xj)f(x0) + l1(xj)f(x1) + l2(xj)f(x2) + . . . + li(xj)f(xi) + . . . + ln(xj)f(xn)
...
f(xn) = Pn(xn) = l0(xn)f(x0) + l1(xn)f(x1) + l2(xn)f(x2) + . . . + li(xn)f(xi) + . . . + ln(xn)f(xn)
The above conditions are satised, if and only if, the polynomial functions l(x)
are such that,
li(xj) =
1, i = j
0, i = j
These polynomials are called Lagrange fundamental polynomials. Let us
dene li(x) therefore in the following way:
7
li(x) =
(x − x0)(x − x1)(x − x2) . . . (x − xi−1)(x − xi+1) . . . (x − xn)
(xi − x0)(xi − x1)(xi − x2) . . . (xi − xi−1)(xi − xi+1) . . . (xi − xn)
This satises the property that li(xj) = 0 for i = j, and li(xj) = 1 for i = j.
Also, note that li(x) is a polynomial of degree n.
We can express li(x) in the below form.
Let w(x) = (x − x0)(x − x1)(x − x2) . . . (x − xi−1)(x − xi)(x − xi+1) . . . (x − xn).
Then,
w (xi) = (xi − x0)(xi − x1)(xi − x2) . . . (xi − xi−1)(xi − xi+1) . . . (xi − xn)
Li(x) =
w(x)
(x − xi)w (x)
Linear Interpolation
In linear interpolation, we are interested to nd a straight-line passing through
the two points (x0, f(x0)) and (x1, f(x1)). Then,
l0(x) =
x − x1
(x0 − x1)
l1(x) =
x − x0
(x1 − x0)
P1(x) =
x − x1
(x0 − x1)
· f(x0) +
x − x0
(x0 − x1)
· f(x1) 
Example. Construct the linear polynomial which ts the data (1, 2) and (2, 5).
Predict the value at x = 1.5.
P1(x) =
x − 2
(1 − 2)
· 2 +
x − 1
(2 − 1)
· 5 = −2(x − 2) + 5(x − 1) = 3x − 1
P1(1.5) = 3(1.5) − 1 = 3.5
Quadratic Interpolation
In quadratic interpolation, we are interested to nd a quadratic curve passing
through the two points (x0, f(x0)), (x1, f(x1)) and (x2, f(x2)). Then,
l0(x) =
(x − x1)(x − x2)
(x0 − x1)(x0 − x2)
8
l1(x) =
(x − x0)(x − x2)
(x1 − x0)(x1 − x2)
l2(x) =
(x − x0)(x − x1)
(x2 − x0)(x2 − x1)
P2(x) = l0(x) · f(x0) + l1(x) · f(x1) + l2(x)f(x2) 
Example. Construct the quadratic polynomial which ts the data (1, 2), (2, 5),
(4, 17) . Predict the value at x = 3.
l0(x) =
(x − 2)(x − 4)
(1 − 2)(1 − 4)
=
1
3
(x2
− 6x + 8)
l1(x) =
(x − 1)(x − 4)
(2 − 1)(2 − 4)
= −
1
2
(x2
− 5x + 4)
l2(x) =
(x − 1)(x − 2)
(4 − 1)(4 − 2)
=
1
6
(x2
− 3x + 2)
P2(x) = 2
3 (x2
− 6x + 8) − 5
2 (x2
− 5x + 4) + 17
6 (x2
− 3x + 2) = x2
+ 1
P2(3) = 32
+ 1 = 10
Neville's method
Conceptually, the interpolation process has two stages: (1) Fit (once) an inter-
polating function to the data points provided. (2) Evaluate as many times as
you wish that interpolating function at a target point x. However, this two-
stage method is usually not the best way to proceed in practice. Typically, it
is computationally less ecient, than methods that construct and estimate of
f(x) directly from the N tabulated values, every time one is desired. Neville's
method is one such method.
For concreteness, we shall consider three distinct points (x0, f(x0)), (x1, f(x1))
and (x2, f(x2)). Also, suppose that, we would like to approximate the value of
the function at x = p.
From each of these three points, we can construct a constant, zero-order
polynomial to approximate f(p).
f(p) ≈ P0(p) = f(x0)
9
f(p) ≈ P1(p) = f(x1)
f(p) ≈ P2(p) = f(x2)
Of course, this isn't a very good approximation, so we turn to the rst order
Lagrange polynomials.
LetP01(x) be a linear interpolation of the points (x0, f(x0)) and (x1, f(x1)).
Thus, P01(x) is a linear interpolation of P0(x) and P1(x).
LetP12(x) be a linear interpolation of the points (x1, f(x1)) and (x2, f(x2)).
Thus, P12(x) is a linear interpolation of P1(x) and P2(x).
P01(x) = (x−x1)
(x0−x1) f(x0) + (x−x0)
(x1−x0) f(x1) = (x−x1)
(x0−x1) · P0(x) − (x−x0)
(x0−x1) · P1(x)
P12(x) = (x−x2)
(x1−x2) f(x1) + (x−x1)
(x2−x1) f(x2) = (x−x2)
(x1−x2) · P0(x) − (x−x0)
(x1−x2) · P2(x)
In general, we are applying linear interpolation toPi(x) and Pi+1(x). The result
are polynomials of one degree higher then either of the two used to construct
and that interpolates all of the points of the individual polynomials combined.
Further, let P012(x) be a linear interpolation of the points P01(x), P12(x).
P012(x) = (x−x2)
(x0−x2) · P01(x) − (x−x0)
(x0−x2) · P12(x)
This can be expressed in the form of a table, whose columns are evaluated from
left-to-right. The polynomials for N = 4 are shown below.
i xi m = 0 m = 1 m = 2 m = 3
0 x0 P0
P01
1 x1 P1 P012
P12 P0123
2 x2 P2 P123
P23
3 x3 P3
In general we have,
Pi...(i+m)(x) =
(x − x(i+m))Pi...(i+m−1) − (x − xi)P(i+1)...(i+m)
(xi − x(i+m))
An implementation of the Neville's algorithm in C++ is shown next.
10
Program listing. Neville's method 
/∗ Polynomial interpolation f i t t i n g a set of data points
xx [ 0 . . . n−1], yy [ 0 . . . n−1]. This r e s u l t s in a polynomial
approximation of order (n−1). ∗/
void poly_interp ( f l o a t ∗xx , f l o a t ∗yy , f l o a t x , i n t n , f l o a t ∗y) {
f l o a t ∗P = new f l o a t [ n ] ;
i n t m, i ;
f o r (m = 0; m  n ; m++) {
f o r ( i = 0; i  n − m; i++) {
i f (m  0) {
P[ i ] = (( x − xx [ i + m])∗ (P[ i ] ) −
(x − xx [ i ])∗ (P[ i + 1])) / (xx [ i ] − xx [ i + m] ) ;
}
e l s e {
P[ i ] = yy [ i ] ;
}
}
}
∗y = P[ 0 ] ;
}
Error of interpolation
Let us denote the error of interpolation as,
En(f; x) = f(x) − Pn(x)
We are also given the N + 1 data points.
x x0 x1 . . . xi . . . xn
f(x) f(x0) f(x1) . . . f(xi) . . . f(xn)
Since, the interpolating polynomial ts the above data points, there is no error
at the nodal points.
En(f; xi) = f(xi) − P(xi) = 0
Let us denote the rst point x0 = a and the last point xn = b. Let us choose
an arbitrary point x at which we are interpolating f(x). Therefore, x ∈ [a, b].
Let us dene an auxiliary function,
g(t) = [f(t) − P(t)] − [f(x) − P(x)] (t−x0)(t−x1)...(t−xn)
(x−x0)(x−x1)...(x−xn)
g(t) is a continuous function.
11
(i) At t = x,g(x) = 0.
(ii) At t = xi, g(xi) = f(xi) − P(xi) = 0
Thus, the function g(t) vanishes at N + 2 points, x0, x1, x2, . . . , xn. Also, g(t)
is dierentiable on each of the sub-intervals [x0, x1], [x1, x2], . . . , [xn−1, xn].
Applying Rolle's theorem, there must be atleast one point c1, c2, . . . , ci, . . . , cn
in each of these sub-intervals such that g (ci) = 0.
Now, if we apply Rolle's theorem to the function g (t) over the sub-intervals
[c1, c2], [c2, c3], . . . , [cn−1, cn], then there exist points di : i = 1, 2, . . . , n − 1 in
each of these sub-intervals where the second derivative g (t) = 0.
Continuing in this fashion and applying Rolle's theorem iteratively n + 1 times
(since there are N + 2 points), there must be atleast one point in the interval
ξ ∈ [x0, xn], such that g(n+1)
(ξ) = 0.
Let us now dierentiate g(t), n + 1 times. Note that P(t) is a polynomial of
degree n. Hence, its (n + 1)'th derivative is zero.
g(n+1)
(ξ) = f(n+1)
(ξ) − 0 − [f(x)−P (x)](n+1)!
(x−x0)(x−x1)...(x−xn)
But, g(n+1)
(ξ) = 0.
Therefore, En(f; x) = f(x) − P(x) = f(n+1)
(ξ) · w(x)
(n+1)!
The magnitude of f(x) − P(x), would be:
|f(x) − P(x)| = 1
(n+1)! · |w(x)| · |f(n+1)
(ξ)|
Since ξ is unknown to us, we don't know, what is the exact value of f(n+1)
(ξ)
is. But, we can establish an upper bound on the error. We take the maximum
possible value of f(n+1)
(x). Therefore,
|f(x) − P(x)| ≤ 1
(n+1)! · max |w(x)| · max |f(n+1)
(x)|
Error in linear interpolation
We can express E1(f; x) as,
E1(f; x) = f (ξ) · (x−x0)(x−x1)
2!
|E1(f; x)| ≤ 1
2 max |f (x)| · max |(x − x0)(x − x1)|
The maximum of the expression (x − x0)(x − x1) is found by setting the rst
derivative to zero.
h(x) = x2
− (x0 + x1)x + x0x1
h (x) = 2x − (x0 + x1)
The function h(x) has a maximum at x = x0+x1
2 . The maximum value of h(x)
is, h x0+x1
2 = x1
2 − x0
2
x0
2 − x1
2 = −(x1−x0)2
4 .
12
Let us further denote the distance between the two points x0and x1, that is
x1 − x0 = h. Then, max |(x − x0)(x − x1)| = h2
4 . Therefore,
|E1(f; x)| ≤ 1
2 max |f (x)| · h2
4 .
Let us denote max |f (x)| by M2. Then,
|E1(f; x)| ≤ h2
8 · M2
Error in quadratic interpolation
We can write,
|E2(f; x)| ≤ 1
3! · max |(x − x0)(x − x1)(x − x3)| · M3
In the special case, that the data is equispaced, then we can nd a simple
expression for maximum error. If x0, x1, x2 are equispaced, then we can call the
distance x − x1 = t, x − x0 = t − h and x − x2 = t + h.
Let us call represent the function y(x) as,
y(x) = (x − x0)(x − x1)(x − x3)
= (t − h)t(t + h)
= (t3
− th2
)
y (x) = 3t2
− h2
y(x) has a maximum at the point t = h√
3
. The maximum value is, − 2h3
3
√
3
. Thus,
|E2(f; x)| ≤ 1
6 · 2
3
√
3
h3
· M3 = 2h3
9
√
3
M3
13

More Related Content

What's hot

Interp lagrange
Interp lagrangeInterp lagrange
Interp lagrange
Pradeep Deepu
 
Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (slides)Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (slides)
Matthew Leingang
 
Numarical values highlighted
Numarical values highlightedNumarical values highlighted
Numarical values highlighted
AmanSaeed11
 
Newton-Raphson Method
Newton-Raphson MethodNewton-Raphson Method
Newton-Raphson Method
Jigisha Dabhi
 
Finite difference & interpolation
Finite difference & interpolationFinite difference & interpolation
Finite difference & interpolation
Daffodil International University
 
2.1 limits i
2.1 limits i2.1 limits i
2.1 limits i
math265
 
Mit18 330 s12_chapter4
Mit18 330 s12_chapter4Mit18 330 s12_chapter4
Mit18 330 s12_chapter4
CAALAAA
 
Multivriada ppt ms
Multivriada   ppt msMultivriada   ppt ms
Multivriada ppt ms
Faeco Bot
 
Matrix calculus
Matrix calculusMatrix calculus
Matrix calculus
Sungbin Lim
 
Interpolation of Cubic Splines
Interpolation of Cubic SplinesInterpolation of Cubic Splines
Interpolation of Cubic Splines
Sohaib H. Khan
 
Contribution of Fixed Point Theorem in Quasi Metric Spaces
Contribution of Fixed Point Theorem in Quasi Metric SpacesContribution of Fixed Point Theorem in Quasi Metric Spaces
Contribution of Fixed Point Theorem in Quasi Metric Spaces
AM Publications,India
 
Doe02 statistics
Doe02 statisticsDoe02 statistics
Doe02 statistics
Arif Rahman
 
27 power series x
27 power series x27 power series x
27 power series x
math266
 
Linear approximations and_differentials
Linear approximations and_differentialsLinear approximations and_differentials
Linear approximations and_differentials
Tarun Gehlot
 
Calculus ebook
Calculus ebookCalculus ebook
Calculus ebook
Allan Mabele Nambafu
 
Newton's forward difference
Newton's forward differenceNewton's forward difference
Newton's forward difference
Raj Parekh
 
Harmonic Analysis and Deep Learning
Harmonic Analysis and Deep LearningHarmonic Analysis and Deep Learning
Harmonic Analysis and Deep Learning
Sungbin Lim
 
Eigenvalue eigenvector slides
Eigenvalue eigenvector slidesEigenvalue eigenvector slides
Eigenvalue eigenvector slides
AmanSaeed11
 
Lesson 27: Integration by Substitution (slides)
Lesson 27: Integration by Substitution (slides)Lesson 27: Integration by Substitution (slides)
Lesson 27: Integration by Substitution (slides)
Matthew Leingang
 

What's hot (19)

Interp lagrange
Interp lagrangeInterp lagrange
Interp lagrange
 
Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (slides)Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (slides)
 
Numarical values highlighted
Numarical values highlightedNumarical values highlighted
Numarical values highlighted
 
Newton-Raphson Method
Newton-Raphson MethodNewton-Raphson Method
Newton-Raphson Method
 
Finite difference & interpolation
Finite difference & interpolationFinite difference & interpolation
Finite difference & interpolation
 
2.1 limits i
2.1 limits i2.1 limits i
2.1 limits i
 
Mit18 330 s12_chapter4
Mit18 330 s12_chapter4Mit18 330 s12_chapter4
Mit18 330 s12_chapter4
 
Multivriada ppt ms
Multivriada   ppt msMultivriada   ppt ms
Multivriada ppt ms
 
Matrix calculus
Matrix calculusMatrix calculus
Matrix calculus
 
Interpolation of Cubic Splines
Interpolation of Cubic SplinesInterpolation of Cubic Splines
Interpolation of Cubic Splines
 
Contribution of Fixed Point Theorem in Quasi Metric Spaces
Contribution of Fixed Point Theorem in Quasi Metric SpacesContribution of Fixed Point Theorem in Quasi Metric Spaces
Contribution of Fixed Point Theorem in Quasi Metric Spaces
 
Doe02 statistics
Doe02 statisticsDoe02 statistics
Doe02 statistics
 
27 power series x
27 power series x27 power series x
27 power series x
 
Linear approximations and_differentials
Linear approximations and_differentialsLinear approximations and_differentials
Linear approximations and_differentials
 
Calculus ebook
Calculus ebookCalculus ebook
Calculus ebook
 
Newton's forward difference
Newton's forward differenceNewton's forward difference
Newton's forward difference
 
Harmonic Analysis and Deep Learning
Harmonic Analysis and Deep LearningHarmonic Analysis and Deep Learning
Harmonic Analysis and Deep Learning
 
Eigenvalue eigenvector slides
Eigenvalue eigenvector slidesEigenvalue eigenvector slides
Eigenvalue eigenvector slides
 
Lesson 27: Integration by Substitution (slides)
Lesson 27: Integration by Substitution (slides)Lesson 27: Integration by Substitution (slides)
Lesson 27: Integration by Substitution (slides)
 

Viewers also liked

Keluarga mahasiswa garut 16 mei
Keluarga mahasiswa garut 16 meiKeluarga mahasiswa garut 16 mei
Keluarga mahasiswa garut 16 mei
MAC Co. Ltd.
 
Kenapa allah merahasiakan mati
Kenapa allah merahasiakan matiKenapa allah merahasiakan mati
Kenapa allah merahasiakan matiMAC Co. Ltd.
 
Keluarga mahasiswa garut
Keluarga mahasiswa garutKeluarga mahasiswa garut
Keluarga mahasiswa garut
MAC Co. Ltd.
 
Hapus dtc
Hapus dtcHapus dtc
Hapus dtc
MAC Co. Ltd.
 
How to become an effective tutor
How to become an effective tutorHow to become an effective tutor
How to become an effective tutor
Jasper Catan
 
Dasar dasar-islambyabu-ala-al-maududi
Dasar dasar-islambyabu-ala-al-maududiDasar dasar-islambyabu-ala-al-maududi
Dasar dasar-islambyabu-ala-al-maududi
MAC Co. Ltd.
 
Besaran dan satuan
Besaran dan satuanBesaran dan satuan
Besaran dan satuan
MAC Co. Ltd.
 
Bab 2. limit
Bab 2. limitBab 2. limit
Bab 2. limit
MAC Co. Ltd.
 
Susunan mpo & bpo
Susunan mpo & bpoSusunan mpo & bpo
Susunan mpo & bpo
MAC Co. Ltd.
 
Cara mempercepat laju motor
Cara mempercepat laju motorCara mempercepat laju motor
Cara mempercepat laju motor
MAC Co. Ltd.
 
Momo-taro
Momo-taroMomo-taro
Momo-taro
chiemima
 
UU NO 20 Tahun 2003
UU NO 20 Tahun 2003UU NO 20 Tahun 2003
UU NO 20 Tahun 2003
MAC Co. Ltd.
 
Bahan ujipublik kurikulum2013
Bahan ujipublik kurikulum2013Bahan ujipublik kurikulum2013
Bahan ujipublik kurikulum2013
MAC Co. Ltd.
 
Cara meningkatkan kecerdasan
Cara meningkatkan kecerdasanCara meningkatkan kecerdasan
Cara meningkatkan kecerdasan
MAC Co. Ltd.
 
Mengucapkan 2 kalimat syahadat
Mengucapkan 2 kalimat syahadatMengucapkan 2 kalimat syahadat
Mengucapkan 2 kalimat syahadat
MAC Co. Ltd.
 
Buku panduan program mahasiswa wirausaha
Buku panduan program mahasiswa wirausahaBuku panduan program mahasiswa wirausaha
Buku panduan program mahasiswa wirausaha
MAC Co. Ltd.
 
Offensive Line Drills`
Offensive Line Drills`Offensive Line Drills`
Offensive Line Drills`
Tom Neuman
 
Exames complementares cardiovasculares
Exames complementares cardiovascularesExames complementares cardiovasculares
Exames complementares cardiovasculares
Jucie Vasconcelos
 
Сезонни промени - 2 клас - В. П.
Сезонни промени - 2 клас - В. П.Сезонни промени - 2 клас - В. П.
Сезонни промени - 2 клас - В. П.Veska Petrova
 

Viewers also liked (20)

Keluarga mahasiswa garut 16 mei
Keluarga mahasiswa garut 16 meiKeluarga mahasiswa garut 16 mei
Keluarga mahasiswa garut 16 mei
 
Kenapa allah merahasiakan mati
Kenapa allah merahasiakan matiKenapa allah merahasiakan mati
Kenapa allah merahasiakan mati
 
Keluarga mahasiswa garut
Keluarga mahasiswa garutKeluarga mahasiswa garut
Keluarga mahasiswa garut
 
Hapus dtc
Hapus dtcHapus dtc
Hapus dtc
 
How to become an effective tutor
How to become an effective tutorHow to become an effective tutor
How to become an effective tutor
 
Dasar dasar-islambyabu-ala-al-maududi
Dasar dasar-islambyabu-ala-al-maududiDasar dasar-islambyabu-ala-al-maududi
Dasar dasar-islambyabu-ala-al-maududi
 
Besaran dan satuan
Besaran dan satuanBesaran dan satuan
Besaran dan satuan
 
Bab 2. limit
Bab 2. limitBab 2. limit
Bab 2. limit
 
Syahadatain
SyahadatainSyahadatain
Syahadatain
 
Susunan mpo & bpo
Susunan mpo & bpoSusunan mpo & bpo
Susunan mpo & bpo
 
Cara mempercepat laju motor
Cara mempercepat laju motorCara mempercepat laju motor
Cara mempercepat laju motor
 
Momo-taro
Momo-taroMomo-taro
Momo-taro
 
UU NO 20 Tahun 2003
UU NO 20 Tahun 2003UU NO 20 Tahun 2003
UU NO 20 Tahun 2003
 
Bahan ujipublik kurikulum2013
Bahan ujipublik kurikulum2013Bahan ujipublik kurikulum2013
Bahan ujipublik kurikulum2013
 
Cara meningkatkan kecerdasan
Cara meningkatkan kecerdasanCara meningkatkan kecerdasan
Cara meningkatkan kecerdasan
 
Mengucapkan 2 kalimat syahadat
Mengucapkan 2 kalimat syahadatMengucapkan 2 kalimat syahadat
Mengucapkan 2 kalimat syahadat
 
Buku panduan program mahasiswa wirausaha
Buku panduan program mahasiswa wirausahaBuku panduan program mahasiswa wirausaha
Buku panduan program mahasiswa wirausaha
 
Offensive Line Drills`
Offensive Line Drills`Offensive Line Drills`
Offensive Line Drills`
 
Exames complementares cardiovasculares
Exames complementares cardiovascularesExames complementares cardiovasculares
Exames complementares cardiovasculares
 
Сезонни промени - 2 клас - В. П.
Сезонни промени - 2 клас - В. П.Сезонни промени - 2 клас - В. П.
Сезонни промени - 2 клас - В. П.
 

Similar to Interpolation techniques - Background and implementation

Unique fixed point theorems for generalized weakly contractive condition in o...
Unique fixed point theorems for generalized weakly contractive condition in o...Unique fixed point theorems for generalized weakly contractive condition in o...
Unique fixed point theorems for generalized weakly contractive condition in o...
Alexander Decker
 
Paper06
Paper06Paper06
Probability and Statistics
Probability and StatisticsProbability and Statistics
Probability and Statistics
Malik Sb
 
a) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdf
a) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdfa) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdf
a) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdf
petercoiffeur18
 
AJMS_402_22_Reprocess_new.pdf
AJMS_402_22_Reprocess_new.pdfAJMS_402_22_Reprocess_new.pdf
AJMS_402_22_Reprocess_new.pdf
BRNSS Publication Hub
 
03 truncation errors
03 truncation errors03 truncation errors
03 truncation errors
maheej
 
Applied numerical methods lec9
Applied numerical methods lec9Applied numerical methods lec9
Applied numerical methods lec9
Yasser Ahmed
 
Polynomials
PolynomialsPolynomials
Polynomials
Astitva Kathait
 
QMC: Operator Splitting Workshop, Stochastic Block-Coordinate Fixed Point Alg...
QMC: Operator Splitting Workshop, Stochastic Block-Coordinate Fixed Point Alg...QMC: Operator Splitting Workshop, Stochastic Block-Coordinate Fixed Point Alg...
QMC: Operator Splitting Workshop, Stochastic Block-Coordinate Fixed Point Alg...
The Statistical and Applied Mathematical Sciences Institute
 
SlidesL28.pdf
SlidesL28.pdfSlidesL28.pdf
SlidesL28.pdf
UmarMuhammadDauda1
 
Imc2017 day2-solutions
Imc2017 day2-solutionsImc2017 day2-solutions
Imc2017 day2-solutions
Christos Loizos
 
Lesson20 Tangent Planes Slides+Notes
Lesson20   Tangent Planes Slides+NotesLesson20   Tangent Planes Slides+Notes
Lesson20 Tangent Planes Slides+Notes
Matthew Leingang
 
02_AJMS_186_19_RA.pdf
02_AJMS_186_19_RA.pdf02_AJMS_186_19_RA.pdf
02_AJMS_186_19_RA.pdf
BRNSS Publication Hub
 
02_AJMS_186_19_RA.pdf
02_AJMS_186_19_RA.pdf02_AJMS_186_19_RA.pdf
02_AJMS_186_19_RA.pdf
BRNSS Publication Hub
 
Roots equations
Roots equationsRoots equations
Roots equations
oscar
 
On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...
On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...
On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...
BRNSS Publication Hub
 
The Euclidean Spaces (elementary topology and sequences)
The Euclidean Spaces (elementary topology and sequences)The Euclidean Spaces (elementary topology and sequences)
The Euclidean Spaces (elementary topology and sequences)
JelaiAujero
 
Daa chapter7
Daa chapter7Daa chapter7
Daa chapter7
B.Kirron Reddi
 
Applications of Differential Calculus in real life
Applications of Differential Calculus in real life Applications of Differential Calculus in real life
Applications of Differential Calculus in real life
OlooPundit
 
Dynamical systems solved ex
Dynamical systems solved exDynamical systems solved ex
Dynamical systems solved ex
Maths Tutoring
 

Similar to Interpolation techniques - Background and implementation (20)

Unique fixed point theorems for generalized weakly contractive condition in o...
Unique fixed point theorems for generalized weakly contractive condition in o...Unique fixed point theorems for generalized weakly contractive condition in o...
Unique fixed point theorems for generalized weakly contractive condition in o...
 
Paper06
Paper06Paper06
Paper06
 
Probability and Statistics
Probability and StatisticsProbability and Statistics
Probability and Statistics
 
a) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdf
a) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdfa) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdf
a) Use Newton’s Polynomials for Evenly Spaced data to derive the O(h.pdf
 
AJMS_402_22_Reprocess_new.pdf
AJMS_402_22_Reprocess_new.pdfAJMS_402_22_Reprocess_new.pdf
AJMS_402_22_Reprocess_new.pdf
 
03 truncation errors
03 truncation errors03 truncation errors
03 truncation errors
 
Applied numerical methods lec9
Applied numerical methods lec9Applied numerical methods lec9
Applied numerical methods lec9
 
Polynomials
PolynomialsPolynomials
Polynomials
 
QMC: Operator Splitting Workshop, Stochastic Block-Coordinate Fixed Point Alg...
QMC: Operator Splitting Workshop, Stochastic Block-Coordinate Fixed Point Alg...QMC: Operator Splitting Workshop, Stochastic Block-Coordinate Fixed Point Alg...
QMC: Operator Splitting Workshop, Stochastic Block-Coordinate Fixed Point Alg...
 
SlidesL28.pdf
SlidesL28.pdfSlidesL28.pdf
SlidesL28.pdf
 
Imc2017 day2-solutions
Imc2017 day2-solutionsImc2017 day2-solutions
Imc2017 day2-solutions
 
Lesson20 Tangent Planes Slides+Notes
Lesson20   Tangent Planes Slides+NotesLesson20   Tangent Planes Slides+Notes
Lesson20 Tangent Planes Slides+Notes
 
02_AJMS_186_19_RA.pdf
02_AJMS_186_19_RA.pdf02_AJMS_186_19_RA.pdf
02_AJMS_186_19_RA.pdf
 
02_AJMS_186_19_RA.pdf
02_AJMS_186_19_RA.pdf02_AJMS_186_19_RA.pdf
02_AJMS_186_19_RA.pdf
 
Roots equations
Roots equationsRoots equations
Roots equations
 
On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...
On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...
On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...
 
The Euclidean Spaces (elementary topology and sequences)
The Euclidean Spaces (elementary topology and sequences)The Euclidean Spaces (elementary topology and sequences)
The Euclidean Spaces (elementary topology and sequences)
 
Daa chapter7
Daa chapter7Daa chapter7
Daa chapter7
 
Applications of Differential Calculus in real life
Applications of Differential Calculus in real life Applications of Differential Calculus in real life
Applications of Differential Calculus in real life
 
Dynamical systems solved ex
Dynamical systems solved exDynamical systems solved ex
Dynamical systems solved ex
 

More from Quasar Chunawala

Resume
ResumeResume
Options pricing using Lattice models
Options pricing using Lattice modelsOptions pricing using Lattice models
Options pricing using Lattice models
Quasar Chunawala
 
Systems of linear algebraic equations i
Systems of linear algebraic equations iSystems of linear algebraic equations i
Systems of linear algebraic equations i
Quasar Chunawala
 
Vector Addition
Vector AdditionVector Addition
Vector Addition
Quasar Chunawala
 
Recursive squaring
Recursive squaringRecursive squaring
Recursive squaring
Quasar Chunawala
 
Investigation of functions
Investigation of functionsInvestigation of functions
Investigation of functions
Quasar Chunawala
 
Vector spaces
Vector spacesVector spaces
Vector spaces
Quasar Chunawala
 
On building FX Volatility surface - The Vanna Volga method
On building FX Volatility surface - The Vanna Volga methodOn building FX Volatility surface - The Vanna Volga method
On building FX Volatility surface - The Vanna Volga method
Quasar Chunawala
 

More from Quasar Chunawala (8)

Resume
ResumeResume
Resume
 
Options pricing using Lattice models
Options pricing using Lattice modelsOptions pricing using Lattice models
Options pricing using Lattice models
 
Systems of linear algebraic equations i
Systems of linear algebraic equations iSystems of linear algebraic equations i
Systems of linear algebraic equations i
 
Vector Addition
Vector AdditionVector Addition
Vector Addition
 
Recursive squaring
Recursive squaringRecursive squaring
Recursive squaring
 
Investigation of functions
Investigation of functionsInvestigation of functions
Investigation of functions
 
Vector spaces
Vector spacesVector spaces
Vector spaces
 
On building FX Volatility surface - The Vanna Volga method
On building FX Volatility surface - The Vanna Volga methodOn building FX Volatility surface - The Vanna Volga method
On building FX Volatility surface - The Vanna Volga method
 

Recently uploaded

Independent Study - College of Wooster Research (2023-2024) FDI, Culture, Glo...
Independent Study - College of Wooster Research (2023-2024) FDI, Culture, Glo...Independent Study - College of Wooster Research (2023-2024) FDI, Culture, Glo...
Independent Study - College of Wooster Research (2023-2024) FDI, Culture, Glo...
AntoniaOwensDetwiler
 
Earn a passive income with prosocial investing
Earn a passive income with prosocial investingEarn a passive income with prosocial investing
Earn a passive income with prosocial investing
Colin R. Turner
 
Who Is Abhay Bhutada, MD of Poonawalla Fincorp
Who Is Abhay Bhutada, MD of Poonawalla FincorpWho Is Abhay Bhutada, MD of Poonawalla Fincorp
Who Is Abhay Bhutada, MD of Poonawalla Fincorp
beulahfernandes8
 
Instant Issue Debit Cards - High School Spirit
Instant Issue Debit Cards - High School SpiritInstant Issue Debit Cards - High School Spirit
Instant Issue Debit Cards - High School Spirit
egoetzinger
 
Tdasx: Unveiling the Trillion-Dollar Potential of Bitcoin DeFi
Tdasx: Unveiling the Trillion-Dollar Potential of Bitcoin DeFiTdasx: Unveiling the Trillion-Dollar Potential of Bitcoin DeFi
Tdasx: Unveiling the Trillion-Dollar Potential of Bitcoin DeFi
nimaruinazawa258
 
when will pi network coin be available on crypto exchange.
when will pi network coin be available on crypto exchange.when will pi network coin be available on crypto exchange.
when will pi network coin be available on crypto exchange.
DOT TECH
 
一比一原版(UoB毕业证)伯明翰大学毕业证如何办理
一比一原版(UoB毕业证)伯明翰大学毕业证如何办理一比一原版(UoB毕业证)伯明翰大学毕业证如何办理
一比一原版(UoB毕业证)伯明翰大学毕业证如何办理
nexop1
 
An Overview of the Prosocial dHEDGE Vault works
An Overview of the Prosocial dHEDGE Vault worksAn Overview of the Prosocial dHEDGE Vault works
An Overview of the Prosocial dHEDGE Vault works
Colin R. Turner
 
Abhay Bhutada Leads Poonawalla Fincorp To Record Low NPA And Unprecedented Gr...
Abhay Bhutada Leads Poonawalla Fincorp To Record Low NPA And Unprecedented Gr...Abhay Bhutada Leads Poonawalla Fincorp To Record Low NPA And Unprecedented Gr...
Abhay Bhutada Leads Poonawalla Fincorp To Record Low NPA And Unprecedented Gr...
Vighnesh Shashtri
 
Applying the Global Internal Audit Standards_AIS.pdf
Applying the Global Internal Audit Standards_AIS.pdfApplying the Global Internal Audit Standards_AIS.pdf
Applying the Global Internal Audit Standards_AIS.pdf
alexiusbrian1
 
where can I find a legit pi merchant online
where can I find a legit pi merchant onlinewhere can I find a legit pi merchant online
where can I find a legit pi merchant online
DOT TECH
 
Independent Study - College of Wooster Research (2023-2024)
Independent Study - College of Wooster Research (2023-2024)Independent Study - College of Wooster Research (2023-2024)
Independent Study - College of Wooster Research (2023-2024)
AntoniaOwensDetwiler
 
在线办理(GU毕业证书)美国贡萨加大学毕业证学历证书一模一样
在线办理(GU毕业证书)美国贡萨加大学毕业证学历证书一模一样在线办理(GU毕业证书)美国贡萨加大学毕业证学历证书一模一样
在线办理(GU毕业证书)美国贡萨加大学毕业证学历证书一模一样
5spllj1l
 
一比一原版(UCSB毕业证)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB毕业证)圣芭芭拉分校毕业证如何办理一比一原版(UCSB毕业证)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB毕业证)圣芭芭拉分校毕业证如何办理
bbeucd
 
APP I Lecture Notes to students 0f 4the year
APP I  Lecture Notes  to students 0f 4the yearAPP I  Lecture Notes  to students 0f 4the year
APP I Lecture Notes to students 0f 4the year
telilaalilemlem
 
^%$Zone1:+971)581248768’][* Legit & Safe #Abortion #Pills #For #Sale In #Duba...
^%$Zone1:+971)581248768’][* Legit & Safe #Abortion #Pills #For #Sale In #Duba...^%$Zone1:+971)581248768’][* Legit & Safe #Abortion #Pills #For #Sale In #Duba...
^%$Zone1:+971)581248768’][* Legit & Safe #Abortion #Pills #For #Sale In #Duba...
mayaclinic18
 
This assessment plan proposal is to outline a structured approach to evaluati...
This assessment plan proposal is to outline a structured approach to evaluati...This assessment plan proposal is to outline a structured approach to evaluati...
This assessment plan proposal is to outline a structured approach to evaluati...
lamluanvan.net Viết thuê luận văn
 
G20 summit held in India. Proper presentation for G20 summit
G20 summit held in India. Proper presentation for G20 summitG20 summit held in India. Proper presentation for G20 summit
G20 summit held in India. Proper presentation for G20 summit
rohitsaxena882511
 
Pensions and housing - Pensions PlayPen - 4 June 2024 v3 (1).pdf
Pensions and housing - Pensions PlayPen - 4 June 2024 v3 (1).pdfPensions and housing - Pensions PlayPen - 4 June 2024 v3 (1).pdf
Pensions and housing - Pensions PlayPen - 4 June 2024 v3 (1).pdf
Henry Tapper
 
DEMAND AND SUPPLY.docx Notes for Economics
DEMAND AND SUPPLY.docx Notes for EconomicsDEMAND AND SUPPLY.docx Notes for Economics
DEMAND AND SUPPLY.docx Notes for Economics
Opanga1
 

Recently uploaded (20)

Independent Study - College of Wooster Research (2023-2024) FDI, Culture, Glo...
Independent Study - College of Wooster Research (2023-2024) FDI, Culture, Glo...Independent Study - College of Wooster Research (2023-2024) FDI, Culture, Glo...
Independent Study - College of Wooster Research (2023-2024) FDI, Culture, Glo...
 
Earn a passive income with prosocial investing
Earn a passive income with prosocial investingEarn a passive income with prosocial investing
Earn a passive income with prosocial investing
 
Who Is Abhay Bhutada, MD of Poonawalla Fincorp
Who Is Abhay Bhutada, MD of Poonawalla FincorpWho Is Abhay Bhutada, MD of Poonawalla Fincorp
Who Is Abhay Bhutada, MD of Poonawalla Fincorp
 
Instant Issue Debit Cards - High School Spirit
Instant Issue Debit Cards - High School SpiritInstant Issue Debit Cards - High School Spirit
Instant Issue Debit Cards - High School Spirit
 
Tdasx: Unveiling the Trillion-Dollar Potential of Bitcoin DeFi
Tdasx: Unveiling the Trillion-Dollar Potential of Bitcoin DeFiTdasx: Unveiling the Trillion-Dollar Potential of Bitcoin DeFi
Tdasx: Unveiling the Trillion-Dollar Potential of Bitcoin DeFi
 
when will pi network coin be available on crypto exchange.
when will pi network coin be available on crypto exchange.when will pi network coin be available on crypto exchange.
when will pi network coin be available on crypto exchange.
 
一比一原版(UoB毕业证)伯明翰大学毕业证如何办理
一比一原版(UoB毕业证)伯明翰大学毕业证如何办理一比一原版(UoB毕业证)伯明翰大学毕业证如何办理
一比一原版(UoB毕业证)伯明翰大学毕业证如何办理
 
An Overview of the Prosocial dHEDGE Vault works
An Overview of the Prosocial dHEDGE Vault worksAn Overview of the Prosocial dHEDGE Vault works
An Overview of the Prosocial dHEDGE Vault works
 
Abhay Bhutada Leads Poonawalla Fincorp To Record Low NPA And Unprecedented Gr...
Abhay Bhutada Leads Poonawalla Fincorp To Record Low NPA And Unprecedented Gr...Abhay Bhutada Leads Poonawalla Fincorp To Record Low NPA And Unprecedented Gr...
Abhay Bhutada Leads Poonawalla Fincorp To Record Low NPA And Unprecedented Gr...
 
Applying the Global Internal Audit Standards_AIS.pdf
Applying the Global Internal Audit Standards_AIS.pdfApplying the Global Internal Audit Standards_AIS.pdf
Applying the Global Internal Audit Standards_AIS.pdf
 
where can I find a legit pi merchant online
where can I find a legit pi merchant onlinewhere can I find a legit pi merchant online
where can I find a legit pi merchant online
 
Independent Study - College of Wooster Research (2023-2024)
Independent Study - College of Wooster Research (2023-2024)Independent Study - College of Wooster Research (2023-2024)
Independent Study - College of Wooster Research (2023-2024)
 
在线办理(GU毕业证书)美国贡萨加大学毕业证学历证书一模一样
在线办理(GU毕业证书)美国贡萨加大学毕业证学历证书一模一样在线办理(GU毕业证书)美国贡萨加大学毕业证学历证书一模一样
在线办理(GU毕业证书)美国贡萨加大学毕业证学历证书一模一样
 
一比一原版(UCSB毕业证)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB毕业证)圣芭芭拉分校毕业证如何办理一比一原版(UCSB毕业证)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB毕业证)圣芭芭拉分校毕业证如何办理
 
APP I Lecture Notes to students 0f 4the year
APP I  Lecture Notes  to students 0f 4the yearAPP I  Lecture Notes  to students 0f 4the year
APP I Lecture Notes to students 0f 4the year
 
^%$Zone1:+971)581248768’][* Legit & Safe #Abortion #Pills #For #Sale In #Duba...
^%$Zone1:+971)581248768’][* Legit & Safe #Abortion #Pills #For #Sale In #Duba...^%$Zone1:+971)581248768’][* Legit & Safe #Abortion #Pills #For #Sale In #Duba...
^%$Zone1:+971)581248768’][* Legit & Safe #Abortion #Pills #For #Sale In #Duba...
 
This assessment plan proposal is to outline a structured approach to evaluati...
This assessment plan proposal is to outline a structured approach to evaluati...This assessment plan proposal is to outline a structured approach to evaluati...
This assessment plan proposal is to outline a structured approach to evaluati...
 
G20 summit held in India. Proper presentation for G20 summit
G20 summit held in India. Proper presentation for G20 summitG20 summit held in India. Proper presentation for G20 summit
G20 summit held in India. Proper presentation for G20 summit
 
Pensions and housing - Pensions PlayPen - 4 June 2024 v3 (1).pdf
Pensions and housing - Pensions PlayPen - 4 June 2024 v3 (1).pdfPensions and housing - Pensions PlayPen - 4 June 2024 v3 (1).pdf
Pensions and housing - Pensions PlayPen - 4 June 2024 v3 (1).pdf
 
DEMAND AND SUPPLY.docx Notes for Economics
DEMAND AND SUPPLY.docx Notes for EconomicsDEMAND AND SUPPLY.docx Notes for Economics
DEMAND AND SUPPLY.docx Notes for Economics
 

Interpolation techniques - Background and implementation

  • 1. Interpolation Techniques Background and implementation in C++ Pedagogical notes 2016 Quasar Chunawala
  • 2. Introduction Say that, in the study of some phenomenon, there is an established functional relationship between the quantities y and x; but the function f(x) is unknown. The experiment has established the values of the function y0, y1, . . . , yN for cer- tain values of the argument x0, x1, . . . , xN in the interval [x0, xN ]. We don't have an analytic expression for f(x). The problem is then to nd a function (as simple as possible from the computational stand-point; for example a polyno- mial) which will represent the unknown function y = f(x). In more abstract fashion, the problem may be formulated as follows: given on the interval [x0, xN ], the values of an unknown function y = f(x) at N + 1 distinct points x0, x1, . . . , xN , such that, y0 = f(x0), y1 = f(x1), . . . , yN = f(xN ) It is required to nd a polynomial P(x) of degree≤ n that approximately expresses the function f(x). Further, the task is to estimate f(x) for some target value of x. Interpolating polynomial given one data point and its higher order derivatives Say that, we are required to t a polynomial P(x), at a point x = x0, where the value of the function and the value of its rst n derivatives at that point f(x0), f (x), f(2) (x), . . . , f(n) (x) are given. Then, the Taylor's series expansion of the function in terms of a polynomial of degree n over the interval [x0, x] is the interpolating polynomial. This is intuitive, because the Taylor's series polynomial and its higher order derivatives have the same values as the function and its derivatives. The Taylor's series expansion of a function f(x) over the interval [x0, x], such that Pn(x0) = f(x0), Pn(x0) = f (x0), Pn (x0) = f (x0), . . . , P (n) n (x0) = f(n) (x0) is given as Pn(x) = f(x0) + (x−x0) 1! f (x0) + (x−x0)2 2! f (x0) + . . . + (x−x0)n n! f(n) (x) + Rn(x) Rn(x) is called the remainder. For those values of x, for which the Rn(x) is small, the polynomial Pn(x) yields an approximate representation of the function f(x). On interpolating any value using the polynomial Pn(x), it is necessary to know, the degree of accuracy of the estimate, or the error. The remainder term can be expressed in the form Rn(x) = (x−x0)(n+1) (n+1)! f(n+1) (ξ), where x0 ξ x 1
  • 3. Error term The error in an interpolation is of prime importance. For example, we may be given N = 1000 data points. To construct an interpolating polynomial, we may use only M = 4 points. What will be the error in that approximation. Further, is there an upper bound on the error - what is the largest possible error in that interpolation. The answers to these questions will be known through the error term. We have, Rn(x) = 1 (n + 1)! · |(x − x0)|n+1 · |fn+1 (ξ)| ≤ 1 (n + 1)! · |(x − x0)|n+1 · Mn+1 where Mn+1 is the maximum value of fn+1 (ξ) over an interval [x0, x]. Assume that an estimate of Mn+1is available. Suppose, we are asked to con- struct a 5-term Taylor's series. Say, we desire have an error no more than an acceptable tolerance, that is|Rn(x)| . To fulll this condition, we must have, |Rn(x)| = 1 (n+1)! · |(x − x0)|n+1 · Mn+1 Conclusions: 1. If the tolerance and the number of terms in the Taylor's series n are given to us, then we can easily nd out the distance h from the point x0, so that the accuracy is retained. 2
  • 4. 2. If the distance h and the tolerance are given, we can solve for n, the number of terms required in the Taylor's series, so that the accuracy is retained. Example. Obtain the polynomial approximation to f(x) = √ 1 + x over the interval [0, 1] by means of Taylor's series, about the point x0 = 0. (i) Estimate the error of the approximate equation √ 1 + x ≈ 1+ 1 2 x− 1 8 x2 when x = 0.2. (ii) Find the number of terms required in the expansion to obtain results correct to 5 × 10−6 for 0 x 1 2 . Solution. i f(i) (x) f(i) (0) 0 (1 + x)1/2 1 1 1 2 (1 + x)−1/2 1 2 2 − 1 22 (1 + x)−3/2 − 1 22 3 1·3 23 (1 + x)−5/2 1·3 23 n (−1)n−1 · 1·3·...·(2n−3) 2n (1 + x)−(2n−1)/2 (−1)n 1·3·...·(2n−3) 2n n + 1 (−1)n · 1·3·...·(2n−1) 2n+1 (1 + x)−(2n+1)/2 Therefore, our polynomial approximation is, P(x) = 1 + 1 2 x − 1 2! 1 22 x2 + 1 3! 1 · 3 23 x3 + . . . + (−1)n−1 xn n! · 1 · 3 · . . . · (2n − 3) 2n + Rn(x) = 1 + x 2 − x2 8 + x3 16 + . . . + (−1)n−1 xn n! · 1 · 3 · . . . · (2n − 3) 2n + Rn(x) (i) The maximum of f(n+1) (x) in the interval [0, 1 2 ] is as follows. f(n+1) (x) = 1·3·...·(2n−1) 2n+1 · 1 (1+x)(2n+1)/2 This will be maximum when (1 + x) is minimum, or x is minimum. Thus, f(n+1) (x) will be maximum at x = 0. Mn+1 = 1·3·...·(2n−1) 2n+1 = (2n)! 2nn! · 1 2n+1 = 1 22n+1 · (2n)! n! Rn(x) ≤ 1 (n+1)! · |x|n · Mn+1 = 1 (n+1)! · |x|n+1 · 1 22n+1 · (2n)! n! At x = 0.2, n = 2, 3
  • 5. Rn(0.2) ≤ 1 (3)! · | 2 10 |3 · 1 25 · (4)! 2! = 5 × 10−4 (ii) We must have, = 1 (n+1)! · |x|n+1 · 1 22n+1 · (2n)! n! Rn(0.5) = 1 (n+1)! · |1 2 |n+1 · 1 22n+1 · (2n)! n! = (2n)! n!(n+1)! · 1 23n+2 We must have, Rn(0.5) ≤ 5 × 10−6 . Solving for n, we get n = 10. Interpolating polynomial for a table of data points Suppose, we are given N + 1 data points. x x0 x1 . . . xi . . . xn f(x) f(x0) f(x1) . . . f(xi) . . . f(xn) In the rectangular plane, • given N = 2 distinct points, we can always construct a straight line; a polynomial P1(x) of order 1 that passes through these two points. • given N = 3 distinct points, we can always construct a quadratic, a poly- nomial P2(x) of order 2 that passes through these two points. In an ex- treme case, if all the 3 points lie on a straight line, then it will degenerate into a polynomial of order 1. Hence, through N = 3 points, a polynomial P2(x) of order ≤ 2 can be constructed. • given N = 4 distinct points, we can always construct a cubic, a polynomial P3(x) of order ≤ 3 that passes through these three points. • given N +1 distinct points, we can always construct a polynomial of order ≤ N that passes through these two points. The existence of this fact can also be proved mathematically. 4
  • 6. Theorem. Given N + 1 data points, there exists a unique interpolating poly- nomial Pn(x) of order N, which ts these points. Proof. Suppose the interpolating polynomial is of the form Pn(x) = C0 + C1x + C2x2 + . . . + Cnxn This polynomial ts the N + 1 data points, (xi, f(xi)) : i = 0, 1, . . . , N. There- fore, these points must satisfy the equation of the polynomial. We have, f(x0) = C0 + C1x0 + C2x2 0 + C3x3 0 + . . . + Cixi 0 + . . . + CN xN 0 f(x1) = C0 + C1x1 + C2x2 1 + C3x3 1 + . . . + Cixi 1 + . . . + CN xN 1 ... f(xN ) = C0 + C1xN + C2x2 N + C3x3 N + . . . + Cixi N + . . . + CN xN N This is a system of N + 1 equations in N + 1 unknowns C0, C1, . . . , CN . We are to determine C0, C1, . . . , CN . If a unique solution for C0, C1, . . . , CN exists, then the interpolating polynomial exists uniquely. A unique solution exists if and only if, the determinant of the coecients of these variables must not be equal to 0. D = 1 x0 x2 0 . . . xr 0 . . . xN 0 1 x1 x2 1 . . . xr 1 . . . xN 1 ... 1 xi x2 i . . . xr i . . . xN i ... 1 xN x2 N . . . xr N . . . xN N This determinant is called the Vandermonde's determinant. If we subtract the rst row from the second, the rst row from the third and so forth, we have 5
  • 7. D = 1 x0 x2 0 . . . xr 0 . . . xN 0 0 (x1 − x0) (x2 1 − x2 0) . . . (xr 1 − xr 0) . . . (xN 1 − xN 0 ) 0 (x2 − x0) (x2 2 − x2 0) . . . (xr 2 − xr 0) . . . (xN 2 − xN 0 ) ... 0 (xi − x0) (x2 i − x2 0) . . . (xr i − xr 0) . . . (xN i − xN 0 ) ... 0 (xN − x0) (x2 N − x2 0) . . . (xr N − xr 0) . . . (xN N − xN 0 ) = 1 x0 x2 0 . . . xr 0 . . . xN 0 0 (x1 − x0) (x2 1 − x2 0) . . . (xr 1 − xr 0) . . . (xN 1 − xN 0 ) 0 (x2 − x0) (x2 2 − x2 0) . . . (xr 2 − xr 0) . . . (xN 2 − xN 0 ) ... 0 (xi − x0) (x2 i − x2 0) . . . (xr i − xr 0) . . . (xN i − xN 0 ) ... 0 (xN − x0) (x2 N − x2 0) . . . (xr N − xr 0) . . . (xN N − xN 0 ) = (x1 − x0)(x2 − x0) . . . (xi − x0) . . . (xN − x0)· 1 (x1 − x0) (x2 1 − x2 0) . . . (xr−1 1 − xr−1 0 ) . . . (xN−1 1 − xN−1 0 ) 1 (x2 − x0) (x2 2 − x2 0) . . . (xr−1 2 − xr−1 0 ) . . . (xN−1 2 − xN−1 0 ) ... 1 (xi − x0) (x2 i − x2 0) . . . (xr−1 i − xr−1 0 ) . . . (xN−1 i − xN−1 0 ) ... 1 (xN − x0) (x2 N − x2 0) . . . (xr−1 N − xr−1 0 ) . . . (xN−1 N − xN−1 0 ) Continuing in this fashion, we get, D = (x1 − x0)(x2 − x0) . . . (xi − x0) . . . (xN − x0)(x2 − x1)(x3 − x1) . . . (xi − x1) . . . (xN − x1) . . . (xN − xN−1) D is the product of all possible factors xi − xj. Hence, it can be expressed as : D = n i, j = 0 i j (xi − xj) Since, these are N +1 distinct points, xi = xj for all i, j. Thus, the value of the Vandermonde's determinant is non-zero. Hence, a unique solution C0, C1, . . . , CN exists. We can further prove that the interpolating polynomial is also unique. Let P∗ n(x) be another polynomial which ts the given data. This means, P∗ n(xi) = f(xi) for all i. Let us dene an auxiliary function, Q(x) = Pn(x) − P∗ n(x) Since, both Pn(x) and P∗ n(x) are polynomials of degree ≤ n, the auxiliary func- tion Q(x) must be a polynomial of degree ≤ n. 6
  • 8. Now, Q(xi) = Pn(xi) − P∗ n(xi) = 0, for all i = 0, 1, . . . , n Observe that Q(x) vanishes at n+1 points, and thus has n+1 roots. But, Q(x) is a polynomial of degree ≤ n. This is possible if and only if, Q(x) is identically equal to 0. Q(x) ≡ 0 Pn(x) ≡ P∗ n(x) Thus, the interpolating polynomial Pn(x) is unique. Lagrange's interpolating polynomial Given N + 1 data points, we are asked to nd the interpolating polynomial Pn(x) that ts these points. x x0 x1 . . . xi . . . xn f(x) f(x0) f(x1) . . . f(xi) . . . f(xn) Since, the polynomial satises all of these points, it must be a linear combination of all f(xi)'s. Let Pn(x) = l0(x)f(x0)+l1(x)f(x1)+l2(x)f(x2)+. . .+li(x)f(xi)+. . .+ln(x)f(xn) As noted in the previous section Pn(x) is a polynomial of degree n. f(x0), f(x1), f(x2), . . ., f(xn) are all numbers. Therefore, the only possibility is that li(x) for all i = 0, 1, 2, . . . , n should be polynomials of degree n. Since, Pn(x) ts all the data points, we must have, f(x0) = Pn(x0) = l0(x0)f(x0) + l1(x0)f(x1) + l2(x0)f(x2) + . . . + li(x0)f(xi) + . . . + ln(x0)f(xn) f(x1) = Pn(x1) = l0(x1)f(x0) + l1(x1)f(x1) + l2(x1)f(x2) + . . . + li(x1)f(xi) + . . . + ln(x1)f(xn) ... f(xj) = Pn(xj) = l0(xj)f(x0) + l1(xj)f(x1) + l2(xj)f(x2) + . . . + li(xj)f(xi) + . . . + ln(xj)f(xn) ... f(xn) = Pn(xn) = l0(xn)f(x0) + l1(xn)f(x1) + l2(xn)f(x2) + . . . + li(xn)f(xi) + . . . + ln(xn)f(xn) The above conditions are satised, if and only if, the polynomial functions l(x) are such that, li(xj) = 1, i = j 0, i = j These polynomials are called Lagrange fundamental polynomials. Let us dene li(x) therefore in the following way: 7
  • 9. li(x) = (x − x0)(x − x1)(x − x2) . . . (x − xi−1)(x − xi+1) . . . (x − xn) (xi − x0)(xi − x1)(xi − x2) . . . (xi − xi−1)(xi − xi+1) . . . (xi − xn) This satises the property that li(xj) = 0 for i = j, and li(xj) = 1 for i = j. Also, note that li(x) is a polynomial of degree n. We can express li(x) in the below form. Let w(x) = (x − x0)(x − x1)(x − x2) . . . (x − xi−1)(x − xi)(x − xi+1) . . . (x − xn). Then, w (xi) = (xi − x0)(xi − x1)(xi − x2) . . . (xi − xi−1)(xi − xi+1) . . . (xi − xn) Li(x) = w(x) (x − xi)w (x) Linear Interpolation In linear interpolation, we are interested to nd a straight-line passing through the two points (x0, f(x0)) and (x1, f(x1)). Then, l0(x) = x − x1 (x0 − x1) l1(x) = x − x0 (x1 − x0) P1(x) = x − x1 (x0 − x1) · f(x0) + x − x0 (x0 − x1) · f(x1) Example. Construct the linear polynomial which ts the data (1, 2) and (2, 5). Predict the value at x = 1.5. P1(x) = x − 2 (1 − 2) · 2 + x − 1 (2 − 1) · 5 = −2(x − 2) + 5(x − 1) = 3x − 1 P1(1.5) = 3(1.5) − 1 = 3.5 Quadratic Interpolation In quadratic interpolation, we are interested to nd a quadratic curve passing through the two points (x0, f(x0)), (x1, f(x1)) and (x2, f(x2)). Then, l0(x) = (x − x1)(x − x2) (x0 − x1)(x0 − x2) 8
  • 10. l1(x) = (x − x0)(x − x2) (x1 − x0)(x1 − x2) l2(x) = (x − x0)(x − x1) (x2 − x0)(x2 − x1) P2(x) = l0(x) · f(x0) + l1(x) · f(x1) + l2(x)f(x2) Example. Construct the quadratic polynomial which ts the data (1, 2), (2, 5), (4, 17) . Predict the value at x = 3. l0(x) = (x − 2)(x − 4) (1 − 2)(1 − 4) = 1 3 (x2 − 6x + 8) l1(x) = (x − 1)(x − 4) (2 − 1)(2 − 4) = − 1 2 (x2 − 5x + 4) l2(x) = (x − 1)(x − 2) (4 − 1)(4 − 2) = 1 6 (x2 − 3x + 2) P2(x) = 2 3 (x2 − 6x + 8) − 5 2 (x2 − 5x + 4) + 17 6 (x2 − 3x + 2) = x2 + 1 P2(3) = 32 + 1 = 10 Neville's method Conceptually, the interpolation process has two stages: (1) Fit (once) an inter- polating function to the data points provided. (2) Evaluate as many times as you wish that interpolating function at a target point x. However, this two- stage method is usually not the best way to proceed in practice. Typically, it is computationally less ecient, than methods that construct and estimate of f(x) directly from the N tabulated values, every time one is desired. Neville's method is one such method. For concreteness, we shall consider three distinct points (x0, f(x0)), (x1, f(x1)) and (x2, f(x2)). Also, suppose that, we would like to approximate the value of the function at x = p. From each of these three points, we can construct a constant, zero-order polynomial to approximate f(p). f(p) ≈ P0(p) = f(x0) 9
  • 11. f(p) ≈ P1(p) = f(x1) f(p) ≈ P2(p) = f(x2) Of course, this isn't a very good approximation, so we turn to the rst order Lagrange polynomials. LetP01(x) be a linear interpolation of the points (x0, f(x0)) and (x1, f(x1)). Thus, P01(x) is a linear interpolation of P0(x) and P1(x). LetP12(x) be a linear interpolation of the points (x1, f(x1)) and (x2, f(x2)). Thus, P12(x) is a linear interpolation of P1(x) and P2(x). P01(x) = (x−x1) (x0−x1) f(x0) + (x−x0) (x1−x0) f(x1) = (x−x1) (x0−x1) · P0(x) − (x−x0) (x0−x1) · P1(x) P12(x) = (x−x2) (x1−x2) f(x1) + (x−x1) (x2−x1) f(x2) = (x−x2) (x1−x2) · P0(x) − (x−x0) (x1−x2) · P2(x) In general, we are applying linear interpolation toPi(x) and Pi+1(x). The result are polynomials of one degree higher then either of the two used to construct and that interpolates all of the points of the individual polynomials combined. Further, let P012(x) be a linear interpolation of the points P01(x), P12(x). P012(x) = (x−x2) (x0−x2) · P01(x) − (x−x0) (x0−x2) · P12(x) This can be expressed in the form of a table, whose columns are evaluated from left-to-right. The polynomials for N = 4 are shown below. i xi m = 0 m = 1 m = 2 m = 3 0 x0 P0 P01 1 x1 P1 P012 P12 P0123 2 x2 P2 P123 P23 3 x3 P3 In general we have, Pi...(i+m)(x) = (x − x(i+m))Pi...(i+m−1) − (x − xi)P(i+1)...(i+m) (xi − x(i+m)) An implementation of the Neville's algorithm in C++ is shown next. 10
  • 12. Program listing. Neville's method /∗ Polynomial interpolation f i t t i n g a set of data points xx [ 0 . . . n−1], yy [ 0 . . . n−1]. This r e s u l t s in a polynomial approximation of order (n−1). ∗/ void poly_interp ( f l o a t ∗xx , f l o a t ∗yy , f l o a t x , i n t n , f l o a t ∗y) { f l o a t ∗P = new f l o a t [ n ] ; i n t m, i ; f o r (m = 0; m n ; m++) { f o r ( i = 0; i n − m; i++) { i f (m 0) { P[ i ] = (( x − xx [ i + m])∗ (P[ i ] ) − (x − xx [ i ])∗ (P[ i + 1])) / (xx [ i ] − xx [ i + m] ) ; } e l s e { P[ i ] = yy [ i ] ; } } } ∗y = P[ 0 ] ; } Error of interpolation Let us denote the error of interpolation as, En(f; x) = f(x) − Pn(x) We are also given the N + 1 data points. x x0 x1 . . . xi . . . xn f(x) f(x0) f(x1) . . . f(xi) . . . f(xn) Since, the interpolating polynomial ts the above data points, there is no error at the nodal points. En(f; xi) = f(xi) − P(xi) = 0 Let us denote the rst point x0 = a and the last point xn = b. Let us choose an arbitrary point x at which we are interpolating f(x). Therefore, x ∈ [a, b]. Let us dene an auxiliary function, g(t) = [f(t) − P(t)] − [f(x) − P(x)] (t−x0)(t−x1)...(t−xn) (x−x0)(x−x1)...(x−xn) g(t) is a continuous function. 11
  • 13. (i) At t = x,g(x) = 0. (ii) At t = xi, g(xi) = f(xi) − P(xi) = 0 Thus, the function g(t) vanishes at N + 2 points, x0, x1, x2, . . . , xn. Also, g(t) is dierentiable on each of the sub-intervals [x0, x1], [x1, x2], . . . , [xn−1, xn]. Applying Rolle's theorem, there must be atleast one point c1, c2, . . . , ci, . . . , cn in each of these sub-intervals such that g (ci) = 0. Now, if we apply Rolle's theorem to the function g (t) over the sub-intervals [c1, c2], [c2, c3], . . . , [cn−1, cn], then there exist points di : i = 1, 2, . . . , n − 1 in each of these sub-intervals where the second derivative g (t) = 0. Continuing in this fashion and applying Rolle's theorem iteratively n + 1 times (since there are N + 2 points), there must be atleast one point in the interval ξ ∈ [x0, xn], such that g(n+1) (ξ) = 0. Let us now dierentiate g(t), n + 1 times. Note that P(t) is a polynomial of degree n. Hence, its (n + 1)'th derivative is zero. g(n+1) (ξ) = f(n+1) (ξ) − 0 − [f(x)−P (x)](n+1)! (x−x0)(x−x1)...(x−xn) But, g(n+1) (ξ) = 0. Therefore, En(f; x) = f(x) − P(x) = f(n+1) (ξ) · w(x) (n+1)! The magnitude of f(x) − P(x), would be: |f(x) − P(x)| = 1 (n+1)! · |w(x)| · |f(n+1) (ξ)| Since ξ is unknown to us, we don't know, what is the exact value of f(n+1) (ξ) is. But, we can establish an upper bound on the error. We take the maximum possible value of f(n+1) (x). Therefore, |f(x) − P(x)| ≤ 1 (n+1)! · max |w(x)| · max |f(n+1) (x)| Error in linear interpolation We can express E1(f; x) as, E1(f; x) = f (ξ) · (x−x0)(x−x1) 2! |E1(f; x)| ≤ 1 2 max |f (x)| · max |(x − x0)(x − x1)| The maximum of the expression (x − x0)(x − x1) is found by setting the rst derivative to zero. h(x) = x2 − (x0 + x1)x + x0x1 h (x) = 2x − (x0 + x1) The function h(x) has a maximum at x = x0+x1 2 . The maximum value of h(x) is, h x0+x1 2 = x1 2 − x0 2 x0 2 − x1 2 = −(x1−x0)2 4 . 12
  • 14. Let us further denote the distance between the two points x0and x1, that is x1 − x0 = h. Then, max |(x − x0)(x − x1)| = h2 4 . Therefore, |E1(f; x)| ≤ 1 2 max |f (x)| · h2 4 . Let us denote max |f (x)| by M2. Then, |E1(f; x)| ≤ h2 8 · M2 Error in quadratic interpolation We can write, |E2(f; x)| ≤ 1 3! · max |(x − x0)(x − x1)(x − x3)| · M3 In the special case, that the data is equispaced, then we can nd a simple expression for maximum error. If x0, x1, x2 are equispaced, then we can call the distance x − x1 = t, x − x0 = t − h and x − x2 = t + h. Let us call represent the function y(x) as, y(x) = (x − x0)(x − x1)(x − x3) = (t − h)t(t + h) = (t3 − th2 ) y (x) = 3t2 − h2 y(x) has a maximum at the point t = h√ 3 . The maximum value is, − 2h3 3 √ 3 . Thus, |E2(f; x)| ≤ 1 6 · 2 3 √ 3 h3 · M3 = 2h3 9 √ 3 M3 13