SlideShare a Scribd company logo
Numerical Methods - Interpolation
Unequal Intervals
Dr. N. B. Vyas
Department of Mathematics,
Atmiya Institute of Tech. and Science, Rajkot (Guj.)
niravbvyas@gmail.com
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Interpolation
To find the value of y for an x between different x - values
x0, x1, . . . , xn is called problem of interpolation.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Interpolation
To find the value of y for an x between different x - values
x0, x1, . . . , xn is called problem of interpolation.
To find the value of y for an x which falls outside the range of x
(x < x0 or x > xn) is called the problem of extrapolation.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Interpolation
To find the value of y for an x between different x - values
x0, x1, . . . , xn is called problem of interpolation.
To find the value of y for an x which falls outside the range of x
(x < x0 or x > xn) is called the problem of extrapolation.
Theorem by Weierstrass in 1885, “Every continuous
function in an interval (a,b) can be represented in that
interval to any desired accuracy by a polynomial. ”
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Interpolation
To find the value of y for an x between different x - values
x0, x1, . . . , xn is called problem of interpolation.
To find the value of y for an x which falls outside the range of x
(x < x0 or x > xn) is called the problem of extrapolation.
Theorem by Weierstrass in 1885, “Every continuous
function in an interval (a,b) can be represented in that
interval to any desired accuracy by a polynomial. ”
Let us assign polynomial Pn of degree n (or less) that assumes
the given data values
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Interpolation
To find the value of y for an x between different x - values
x0, x1, . . . , xn is called problem of interpolation.
To find the value of y for an x which falls outside the range of x
(x < x0 or x > xn) is called the problem of extrapolation.
Theorem by Weierstrass in 1885, “Every continuous
function in an interval (a,b) can be represented in that
interval to any desired accuracy by a polynomial. ”
Let us assign polynomial Pn of degree n (or less) that assumes
the given data values
Pn(x0) = y0, Pn(x1) = y1, . . ., Pn(xn) = yn
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Interpolation
To find the value of y for an x between different x - values
x0, x1, . . . , xn is called problem of interpolation.
To find the value of y for an x which falls outside the range of x
(x < x0 or x > xn) is called the problem of extrapolation.
Theorem by Weierstrass in 1885, “Every continuous
function in an interval (a,b) can be represented in that
interval to any desired accuracy by a polynomial. ”
Let us assign polynomial Pn of degree n (or less) that assumes
the given data values
Pn(x0) = y0, Pn(x1) = y1, . . ., Pn(xn) = yn
This polynomial Pn is called interpolation polynomial.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Interpolation
To find the value of y for an x between different x - values
x0, x1, . . . , xn is called problem of interpolation.
To find the value of y for an x which falls outside the range of x
(x < x0 or x > xn) is called the problem of extrapolation.
Theorem by Weierstrass in 1885, “Every continuous
function in an interval (a,b) can be represented in that
interval to any desired accuracy by a polynomial. ”
Let us assign polynomial Pn of degree n (or less) that assumes
the given data values
Pn(x0) = y0, Pn(x1) = y1, . . ., Pn(xn) = yn
This polynomial Pn is called interpolation polynomial.
x0, x1, . . . , xn is called the nodes ( tabular points, pivotal
points or arguments).
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Interpolation with unequal intervals
Lagrange’s interpolation formula with unequal intervals:
Let y = f(x) be continuous and differentiable in the interval
(a, b).
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Interpolation with unequal intervals
Lagrange’s interpolation formula with unequal intervals:
Let y = f(x) be continuous and differentiable in the interval
(a, b).
Given the set of n + 1 values (x0, y0), (x1, y1), . . . , (xn, yn) of x
and y, where the values of x need not necessarily be equally
spaced.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Interpolation with unequal intervals
Lagrange’s interpolation formula with unequal intervals:
Let y = f(x) be continuous and differentiable in the interval
(a, b).
Given the set of n + 1 values (x0, y0), (x1, y1), . . . , (xn, yn) of x
and y, where the values of x need not necessarily be equally
spaced.
It is required to find Pn(x), a polynomial of degree n such that y
and Pn(x) agree at the tabulated points.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Interpolation with unequal intervals
Lagrange’s interpolation formula with unequal intervals:
Let y = f(x) be continuous and differentiable in the interval
(a, b).
Given the set of n + 1 values (x0, y0), (x1, y1), . . . , (xn, yn) of x
and y, where the values of x need not necessarily be equally
spaced.
It is required to find Pn(x), a polynomial of degree n such that y
and Pn(x) agree at the tabulated points.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Lagrange’s Interpolation
This polynomial is given by the following formula:
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Lagrange’s Interpolation
This polynomial is given by the following formula:
y = f(x) ≈ Pn(x) =
(x − x1)(x − x2) . . . (x − xn)
(x0 − x1)(x0 − x2) . . . (x0 − xn)
y0
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Lagrange’s Interpolation
This polynomial is given by the following formula:
y = f(x) ≈ Pn(x) =
(x − x1)(x − x2) . . . (x − xn)
(x0 − x1)(x0 − x2) . . . (x0 − xn)
y0
+
(x − x0)(x − x2) . . . (x − xn)
(x1 − x0)(x1 − x2) . . . (x1 − xn)
y1 + . . .
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Lagrange’s Interpolation
This polynomial is given by the following formula:
y = f(x) ≈ Pn(x) =
(x − x1)(x − x2) . . . (x − xn)
(x0 − x1)(x0 − x2) . . . (x0 − xn)
y0
+
(x − x0)(x − x2) . . . (x − xn)
(x1 − x0)(x1 − x2) . . . (x1 − xn)
y1 + . . .
+
(x − x0)(x − x1) . . . (x − xn−1)
(xn − x0)(xn − x1) . . . (xn − xn−1)
yn
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Lagrange’s Interpolation
This polynomial is given by the following formula:
y = f(x) ≈ Pn(x) =
(x − x1)(x − x2) . . . (x − xn)
(x0 − x1)(x0 − x2) . . . (x0 − xn)
y0
+
(x − x0)(x − x2) . . . (x − xn)
(x1 − x0)(x1 − x2) . . . (x1 − xn)
y1 + . . .
+
(x − x0)(x − x1) . . . (x − xn−1)
(xn − x0)(xn − x1) . . . (xn − xn−1)
yn
NOTE:
The above formula can be used irrespective of whether the values
x0, x1, . . . , xn are equally spaced or not.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Lagrange’s Inverse Interpolation
In the Lagrange’s interpolation formula y is treated as dependent
variable and expressed as function of independent variable x.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Lagrange’s Inverse Interpolation
In the Lagrange’s interpolation formula y is treated as dependent
variable and expressed as function of independent variable x.
Instead if x is treated as dependent variable and expressed as the
function of independent variable y, then Lagrange’s interpolation
formula becomes
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Lagrange’s Inverse Interpolation
In the Lagrange’s interpolation formula y is treated as dependent
variable and expressed as function of independent variable x.
Instead if x is treated as dependent variable and expressed as the
function of independent variable y, then Lagrange’s interpolation
formula becomes
x = g(y) ≈ Pn(y) =
(y − y1)(y − y2) . . . (y − yn)
(y0 − y1)(y0 − y2) . . . (y0 − yn)
x0
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Lagrange’s Inverse Interpolation
In the Lagrange’s interpolation formula y is treated as dependent
variable and expressed as function of independent variable x.
Instead if x is treated as dependent variable and expressed as the
function of independent variable y, then Lagrange’s interpolation
formula becomes
x = g(y) ≈ Pn(y) =
(y − y1)(y − y2) . . . (y − yn)
(y0 − y1)(y0 − y2) . . . (y0 − yn)
x0
+
(y − y0)(y − y2) . . . (y − yn)
(y1 − y0)(y1 − y2) . . . (y1 − yn)
x1 + . . .
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Lagrange’s Inverse Interpolation
In the Lagrange’s interpolation formula y is treated as dependent
variable and expressed as function of independent variable x.
Instead if x is treated as dependent variable and expressed as the
function of independent variable y, then Lagrange’s interpolation
formula becomes
x = g(y) ≈ Pn(y) =
(y − y1)(y − y2) . . . (y − yn)
(y0 − y1)(y0 − y2) . . . (y0 − yn)
x0
+
(y − y0)(y − y2) . . . (y − yn)
(y1 − y0)(y1 − y2) . . . (y1 − yn)
x1 + . . .
+
(y − y0)(y − y1) . . . (y − yn−1)
(yn − y0)(yn − y1) . . . (yn − yn−1)
xn
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Lagrange’s Inverse Interpolation
In the Lagrange’s interpolation formula y is treated as dependent
variable and expressed as function of independent variable x.
Instead if x is treated as dependent variable and expressed as the
function of independent variable y, then Lagrange’s interpolation
formula becomes
x = g(y) ≈ Pn(y) =
(y − y1)(y − y2) . . . (y − yn)
(y0 − y1)(y0 − y2) . . . (y0 − yn)
x0
+
(y − y0)(y − y2) . . . (y − yn)
(y1 − y0)(y1 − y2) . . . (y1 − yn)
x1 + . . .
+
(y − y0)(y − y1) . . . (y − yn−1)
(yn − y0)(yn − y1) . . . (yn − yn−1)
xn
This relation is referred as Lagrange’s inverse interpolation
formula.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Ex. Given the table of values:
x 150 152 154 156
y =
√
x 12.247 12.329 12.410 12.490
Evaluate
√
155 using Lagrange’s interpolation formula.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol.: Here x0 = 150, x1 = 152, x2 = 154 and x3 = 156
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol.: Here x0 = 150, x1 = 152, x2 = 154 and x3 = 156
y0 = 12.247, y1 = 12.329, y2 = 12.410 and y3 = 12.490
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol.: Here x0 = 150, x1 = 152, x2 = 154 and x3 = 156
y0 = 12.247, y1 = 12.329, y2 = 12.410 and y3 = 12.490
By Lagrange’s interpolation formula,
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol.: Here x0 = 150, x1 = 152, x2 = 154 and x3 = 156
y0 = 12.247, y1 = 12.329, y2 = 12.410 and y3 = 12.490
By Lagrange’s interpolation formula,
f(x) ≈ Pn(x) =
(x − x1)(x − x2)(x − x3)
(x0 − x1)(x0 − x2)(x0 − x3)
y0
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol.: Here x0 = 150, x1 = 152, x2 = 154 and x3 = 156
y0 = 12.247, y1 = 12.329, y2 = 12.410 and y3 = 12.490
By Lagrange’s interpolation formula,
f(x) ≈ Pn(x) =
(x − x1)(x − x2)(x − x3)
(x0 − x1)(x0 − x2)(x0 − x3)
y0
+
(x − x0)(x − x2)(x − x3)
(x1 − x0)(x1 − x2)(x1 − x3)
y1
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol.: Here x0 = 150, x1 = 152, x2 = 154 and x3 = 156
y0 = 12.247, y1 = 12.329, y2 = 12.410 and y3 = 12.490
By Lagrange’s interpolation formula,
f(x) ≈ Pn(x) =
(x − x1)(x − x2)(x − x3)
(x0 − x1)(x0 − x2)(x0 − x3)
y0
+
(x − x0)(x − x2)(x − x3)
(x1 − x0)(x1 − x2)(x1 − x3)
y1
+
(x − x0)(x − x1)(x − x3)
(x2 − x0)(x2 − x1)(x2 − x3)
y2
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol.: Here x0 = 150, x1 = 152, x2 = 154 and x3 = 156
y0 = 12.247, y1 = 12.329, y2 = 12.410 and y3 = 12.490
By Lagrange’s interpolation formula,
f(x) ≈ Pn(x) =
(x − x1)(x − x2)(x − x3)
(x0 − x1)(x0 − x2)(x0 − x3)
y0
+
(x − x0)(x − x2)(x − x3)
(x1 − x0)(x1 − x2)(x1 − x3)
y1
+
(x − x0)(x − x1)(x − x3)
(x2 − x0)(x2 − x1)(x2 − x3)
y2
+
(x − x0)(x − x1)(x − x2)
(x3 − x0)(x3 − x1)(x3 − x2)
y3
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol.: Here x0 = 150, x1 = 152, x2 = 154 and x3 = 156
y0 = 12.247, y1 = 12.329, y2 = 12.410 and y3 = 12.490
By Lagrange’s interpolation formula,
f(x) ≈ Pn(x) =
(x − x1)(x − x2)(x − x3)
(x0 − x1)(x0 − x2)(x0 − x3)
y0
+
(x − x0)(x − x2)(x − x3)
(x1 − x0)(x1 − x2)(x1 − x3)
y1
+
(x − x0)(x − x1)(x − x3)
(x2 − x0)(x2 − x1)(x2 − x3)
y2
+
(x − x0)(x − x1)(x − x2)
(x3 − x0)(x3 − x1)(x3 − x2)
y3
for x = 155
∴ f(155) =
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Ex. Compute f(0.4) for the table below by the Lagrange’s
interpolation:
x 0.3 0.5 0.6
f(x) 0.61 0.69 0.72
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Ex. Using Lagrange’s formula, find the form of f(x) for the following
data:
x 0 1 2 5
f(x) 2 3 12 147
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Ex. Using Lagrange’s formula, find x for y = 7 for the following data:
x 1 3 4
y 4 12 19
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Ex. Using Lagrange’s formula, express the function
3x2 + x + 1
(x − 1)(x − 2)(x − 3)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol.: Let us evaluate y = 3x2 + x + 1 for x = 1, x = 2 and x = 3
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol.: Let us evaluate y = 3x2 + x + 1 for x = 1, x = 2 and x = 3
These values are x0 = 1, x1 = 2 and x2 = 3 and
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol.: Let us evaluate y = 3x2 + x + 1 for x = 1, x = 2 and x = 3
These values are x0 = 1, x1 = 2 and x2 = 3 and
y0 = 5,
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol.: Let us evaluate y = 3x2 + x + 1 for x = 1, x = 2 and x = 3
These values are x0 = 1, x1 = 2 and x2 = 3 and
y0 = 5, y1 = 15 and y2 = 31
By Lagrange’s interpolation formula,
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol.: Let us evaluate y = 3x2 + x + 1 for x = 1, x = 2 and x = 3
These values are x0 = 1, x1 = 2 and x2 = 3 and
y0 = 5, y1 = 15 and y2 = 31
By Lagrange’s interpolation formula,
y =
(x − x1)(x − x2)
(x0 − x1)(x0 − x2)
y0 +
(x − x0)(x − x2)
(x1 − x0)(x1 − x2)
y1
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol.: Let us evaluate y = 3x2 + x + 1 for x = 1, x = 2 and x = 3
These values are x0 = 1, x1 = 2 and x2 = 3 and
y0 = 5, y1 = 15 and y2 = 31
By Lagrange’s interpolation formula,
y =
(x − x1)(x − x2)
(x0 − x1)(x0 − x2)
y0 +
(x − x0)(x − x2)
(x1 − x0)(x1 − x2)
y1
+
(x − x0)(x − x1)
(x2 − x0)(x2 − x1)
y2
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol.: Let us evaluate y = 3x2 + x + 1 for x = 1, x = 2 and x = 3
These values are x0 = 1, x1 = 2 and x2 = 3 and
y0 = 5, y1 = 15 and y2 = 31
By Lagrange’s interpolation formula,
y =
(x − x1)(x − x2)
(x0 − x1)(x0 − x2)
y0 +
(x − x0)(x − x2)
(x1 − x0)(x1 − x2)
y1
+
(x − x0)(x − x1)
(x2 − x0)(x2 − x1)
y2
substituting above values, we get
y = 2.5(x − 2)(x − 3) − 15(x − 1)(x − 3) + 15.5(x − 1)(x − 2)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol.: Let us evaluate y = 3x2 + x + 1 for x = 1, x = 2 and x = 3
These values are x0 = 1, x1 = 2 and x2 = 3 and
y0 = 5, y1 = 15 and y2 = 31
By Lagrange’s interpolation formula,
y =
(x − x1)(x − x2)
(x0 − x1)(x0 − x2)
y0 +
(x − x0)(x − x2)
(x1 − x0)(x1 − x2)
y1
+
(x − x0)(x − x1)
(x2 − x0)(x2 − x1)
y2
substituting above values, we get
y = 2.5(x − 2)(x − 3) − 15(x − 1)(x − 3) + 15.5(x − 1)(x − 2)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Thus
3x2 + x + 1
(x − 1)(x − 2)(x − 3)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Thus
3x2 + x + 1
(x − 1)(x − 2)(x − 3)
=
2.5(x − 2)(x − 3) − 15(x − 1)(x − 3) + 15.5(x − 1)(x − 2)
(x − 1)(x − 2)(x − 3)
=
2.5
(x − 1)
-
15
(x − 2)
+
15.5
(x − 3)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Error in Interpolation
Error in Interpolation:
We assume that f(x) has continuous derivatives of order upto
n + 1 for all x ∈ (a, b). Since, f(x) is approximated by Pn(x), the
results contains errors. We define the error of interpolation or
truncation error as
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Error in Interpolation
Error in Interpolation:
We assume that f(x) has continuous derivatives of order upto
n + 1 for all x ∈ (a, b). Since, f(x) is approximated by Pn(x), the
results contains errors. We define the error of interpolation or
truncation error as
E(f, x) = f(x) − Pn(x) =
(x − x0)(x − x1) . . . (x − xn)
(n + 1)!
f(n+1)(ξ)
where min(x0, x1, . . . , xn, x) < ξ < min(x0, x1, . . . , xn, x)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Error in Interpolation
Error in Interpolation:
We assume that f(x) has continuous derivatives of order upto
n + 1 for all x ∈ (a, b). Since, f(x) is approximated by Pn(x), the
results contains errors. We define the error of interpolation or
truncation error as
E(f, x) = f(x) − Pn(x) =
(x − x0)(x − x1) . . . (x − xn)
(n + 1)!
f(n+1)(ξ)
where min(x0, x1, . . . , xn, x) < ξ < min(x0, x1, . . . , xn, x)
since, ξ is an unknown, it is difficult to find the value of error.
However, we can find a bound of the error. The bound of the
error is obtained as
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Error in Interpolation
Error in Interpolation:
We assume that f(x) has continuous derivatives of order upto
n + 1 for all x ∈ (a, b). Since, f(x) is approximated by Pn(x), the
results contains errors. We define the error of interpolation or
truncation error as
E(f, x) = f(x) − Pn(x) =
(x − x0)(x − x1) . . . (x − xn)
(n + 1)!
f(n+1)(ξ)
where min(x0, x1, . . . , xn, x) < ξ < min(x0, x1, . . . , xn, x)
since, ξ is an unknown, it is difficult to find the value of error.
However, we can find a bound of the error. The bound of the
error is obtained as
|E(f, x)| ≤
|(x − x0)(x − x1) . . . (x − xn)|
(n + 1)!
max
a≤ξ≤b
|f(n+1)(ξ)|
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Ex. Using the data sin(0.1) = 0.09983 and sin(0.2) = 0.19867, find
an approximate value of sin(0.15) by Lagrange interpolation.
Obtain a bound on the error at x = 0.15.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Lagrange’s Interpolation
Disadvantages:
In practice, we often do not know the degree of the interpolation
polynomial that will give the required accuracy, so we should be
prepared to increase the degree if necessary.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Lagrange’s Interpolation
Disadvantages:
In practice, we often do not know the degree of the interpolation
polynomial that will give the required accuracy, so we should be
prepared to increase the degree if necessary.
To increase the degree the addition of another interpolation point
leads to re-computation.
i.e. no previous work is useful.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Lagrange’s Interpolation
Disadvantages:
In practice, we often do not know the degree of the interpolation
polynomial that will give the required accuracy, so we should be
prepared to increase the degree if necessary.
To increase the degree the addition of another interpolation point
leads to re-computation.
i.e. no previous work is useful.
E.g: In calculating Pk(x), no obvious advantage can be taken of
the fact that one already has calculated Pk−1(x).
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Lagrange’s Interpolation
Disadvantages:
In practice, we often do not know the degree of the interpolation
polynomial that will give the required accuracy, so we should be
prepared to increase the degree if necessary.
To increase the degree the addition of another interpolation point
leads to re-computation.
i.e. no previous work is useful.
E.g: In calculating Pk(x), no obvious advantage can be taken of
the fact that one already has calculated Pk−1(x).
That means we need to calculate entirely new polynomial.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Divided Difference
Let f(x0), f(x1), . . . , f(xn) be the values of a function f
corresponding to the arguments x0, x1, . . . , xn where the intervals
x1 − x0, x2 − x1, . . . , xn − xn−1 are not necessarily equally spaced.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Divided Difference
Let f(x0), f(x1), . . . , f(xn) be the values of a function f
corresponding to the arguments x0, x1, . . . , xn where the intervals
x1 − x0, x2 − x1, . . . , xn − xn−1 are not necessarily equally spaced.
Then the first divided difference of f for the arguments
x0, x1, . . . , xn are defined by ,
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Divided Difference
Let f(x0), f(x1), . . . , f(xn) be the values of a function f
corresponding to the arguments x0, x1, . . . , xn where the intervals
x1 − x0, x2 − x1, . . . , xn − xn−1 are not necessarily equally spaced.
Then the first divided difference of f for the arguments
x0, x1, . . . , xn are defined by ,
f(x0, x1) =
f(x1) − f(x0)
x1 − x0
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Divided Difference
Let f(x0), f(x1), . . . , f(xn) be the values of a function f
corresponding to the arguments x0, x1, . . . , xn where the intervals
x1 − x0, x2 − x1, . . . , xn − xn−1 are not necessarily equally spaced.
Then the first divided difference of f for the arguments
x0, x1, . . . , xn are defined by ,
f(x0, x1) =
f(x1) − f(x0)
x1 − x0
f(x1, x2) =
f(x2) − f(x1)
x2 − x1
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Divided Difference
The second divided difference of f for three arguments
x0, x1, x2 is defined by
f(x0, x1, x2) =
f(x1, x2) − f(x0, x1)
x2 − x0
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Divided Difference
The second divided difference of f for three arguments
x0, x1, x2 is defined by
f(x0, x1, x2) =
f(x1, x2) − f(x0, x1)
x2 − x0
and similarly the divided difference of order n is defined by
f(x0, x1, . . . , xn) =
f(x1, x2, . . . , xn) − f(x0, x1, . . . , xn−1)
xn − x0
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Divided Difference
Properties:
The divided differences are symmetrical in all their arguments;
that is, the value of any divided difference is independent of the
order of the arguments.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Divided Difference
Properties:
The divided differences are symmetrical in all their arguments;
that is, the value of any divided difference is independent of the
order of the arguments.
The divided difference operator is linear.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Divided Difference
Properties:
The divided differences are symmetrical in all their arguments;
that is, the value of any divided difference is independent of the
order of the arguments.
The divided difference operator is linear.
The nth order divided differences of a polynomial of degree n are
constant, equal to the coefficient of xn.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Newton’s Divided Difference Interpolation
An interpolation formula which has the property that a
polynomial of higher degree may be derived from it by simply
adding new terms.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Newton’s Divided Difference Interpolation
An interpolation formula which has the property that a
polynomial of higher degree may be derived from it by simply
adding new terms.
Newton’s general interpolation formula is one such formula and
terms in it are called divided differences.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Newton’s Divided Difference Interpolation
An interpolation formula which has the property that a
polynomial of higher degree may be derived from it by simply
adding new terms.
Newton’s general interpolation formula is one such formula and
terms in it are called divided differences.
Let f(x0), f(x1), . . . , f(xn) be the values of a function f
corresponding to the arguments x0, x1, . . . , xn where the intervals
x1 − x0, x2 − x1, . . . , xn − xn−1 are not necessarily equally spaced.
By the definition of divided difference,
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Newton’s Divided Difference Interpolation
An interpolation formula which has the property that a
polynomial of higher degree may be derived from it by simply
adding new terms.
Newton’s general interpolation formula is one such formula and
terms in it are called divided differences.
Let f(x0), f(x1), . . . , f(xn) be the values of a function f
corresponding to the arguments x0, x1, . . . , xn where the intervals
x1 − x0, x2 − x1, . . . , xn − xn−1 are not necessarily equally spaced.
By the definition of divided difference,
f(x, x0) =
f(x) − f(x0)
x − x0
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Newton’s Divided Difference Interpolation
An interpolation formula which has the property that a
polynomial of higher degree may be derived from it by simply
adding new terms.
Newton’s general interpolation formula is one such formula and
terms in it are called divided differences.
Let f(x0), f(x1), . . . , f(xn) be the values of a function f
corresponding to the arguments x0, x1, . . . , xn where the intervals
x1 − x0, x2 − x1, . . . , xn − xn−1 are not necessarily equally spaced.
By the definition of divided difference,
f(x, x0) =
f(x) − f(x0)
x − x0
∴
f(x) = f(x0) + (x − x0)f(x, x0) − −(1)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Newton’s Divided Difference Interpolation
Further
f(x, x0, x1) =
f(x, x0) − f(x0, x1)
x − x1
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Newton’s Divided Difference Interpolation
Further
f(x, x0, x1) =
f(x, x0) − f(x0, x1)
x − x1
which yields
f(x, x0) = f(x0, x1) + (x − x1)f(x, x0, x1) − −(2)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Newton’s Divided Difference Interpolation
Further
f(x, x0, x1) =
f(x, x0) − f(x0, x1)
x − x1
which yields
f(x, x0) = f(x0, x1) + (x − x1)f(x, x0, x1) − −(2)
Similarly
f(x, x0, x1) = f(x0, x1, x2) + (x − x2)f(x, x0, x1, x2) − −(3)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Newton’s Divided Difference Interpolation
Further
f(x, x0, x1) =
f(x, x0) − f(x0, x1)
x − x1
which yields
f(x, x0) = f(x0, x1) + (x − x1)f(x, x0, x1) − −(2)
Similarly
f(x, x0, x1) = f(x0, x1, x2) + (x − x2)f(x, x0, x1, x2) − −(3)
and in general
f(x, x0, ..., xn−1) = f(x0, x1, ..., xn) + (x − xn)f(x, x0, x1, ..., xn) − −(4)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Newton’s Divided Difference Interpolation
multiplying equation (2) by (x − x0)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Newton’s Divided Difference Interpolation
multiplying equation (2) by (x − x0) , (3) by (x − x0) (x − x1)
and so on,
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Newton’s Divided Difference Interpolation
multiplying equation (2) by (x − x0) , (3) by (x − x0) (x − x1)
and so on, and finally the last term (4) by
(x − x0) (x − x1) ... (x − xn−1) and
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Newton’s Divided Difference Interpolation
multiplying equation (2) by (x − x0) , (3) by (x − x0) (x − x1)
and so on, and finally the last term (4) by
(x − x0) (x − x1) ... (x − xn−1) and adding (1), (2) , (3) up to (4)
we obtain
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Newton’s Divided Difference Interpolation
multiplying equation (2) by (x − x0) , (3) by (x − x0) (x − x1)
and so on, and finally the last term (4) by
(x − x0) (x − x1) ... (x − xn−1) and adding (1), (2) , (3) up to (4)
we obtain
f(x) =
f (x0) + (x − x0) f (x0, x1) + (x − x0) (x − x1) f (x0, x1, x2) + ... +
(x − x0) (x − x1) ... (x − xn−1) f (x0, x1, ..., xn)
This formula is called Newton’s divided difference formula.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Newton’s Divided Difference Interpolation
The divided difference upto third order
x y 1stdiv.diff. 2nddiv.diff. 3rddiv.diff.
x0 y0
[x0, x1]
x1 y1 [x0, x1, x2]
[x1, x2] [x0, x1, x2, x3]
x2 y2 [x1, x2, x3]
[x2, x3]
x3 y3
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Ex. Obtain the divided difference table for the data:
x -1 0 2 3
y -8 3 1 12
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. We have the following divided difference table for the data:
x y First d.d Second d.d Third d.d
-1 -8
3 + 8
0 + 1
= 11
0 3
−1 − 11
2 + 1
= −4
1 − 3
2 − 0
= −1
4 + 4
3 + 1
= 2
2 1
11 + 1
3 − 0
= 4
12 − 1
3 − 2
= 11
3 12
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Ex. Find f(x) as a polynomial in x for the following data by Newtons
divided difference formula:
x -4 -1 0 2 5
f(x) 1245 33 5 9 1335
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. We have the following divided difference table for the data:
x y 1st d.d 2nd d.d 3rd d.d 4th d.d
-4 1245
−404
-1 33 94
−28 −14
0 5 10 3
2 13
2 9 88
442
5 1335
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
The Newtons divided difference formula gives:
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
The Newtons divided difference formula gives:
f(x) = f(x0) +
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
The Newtons divided difference formula gives:
f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2]
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
The Newtons divided difference formula gives:
f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2]
+
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
The Newtons divided difference formula gives:
f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2]
+ (x − x0)(x − x1)(x − x2)f[x0, x1, x2, x3]
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
The Newtons divided difference formula gives:
f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2]
+ (x − x0)(x − x1)(x − x2)f[x0, x1, x2, x3]
+
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
The Newtons divided difference formula gives:
f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2]
+ (x − x0)(x − x1)(x − x2)f[x0, x1, x2, x3]
+ (x − x0)(x − x1)(x − x2)(x − x3)f[x0, x1, x2, x3, x4]
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
The Newtons divided difference formula gives:
f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2]
+ (x − x0)(x − x1)(x − x2)f[x0, x1, x2, x3]
+ (x − x0)(x − x1)(x − x2)(x − x3)f[x0, x1, x2, x3, x4]
= ...
= 3x4 − 5x3 + 6x2 − 14x + 5
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Ex. Find f(x) as a polynomial in x for the following data by Newtons
divided difference formula:
x -2 -1 0 1 3 4
f(x) 9 16 17 18 44 81
Hence, interpolate at x = 0.5 and x = 3.1.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. We form the divided difference table for the given data.
x f(x) 1st d.d 2nd d.d 3rd d.d 4th d.d
−2 9
7
−1 16 −3
1 1
0 17 0 0
1 1
1 18 4 0
13 1
3 44 8
37
4 81
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Since, the fourth order differences are zeros, the data represents a
third degree polynomial. Newtons divided difference formula
gives the polynomial as
f(x) = f(x0) +
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Since, the fourth order differences are zeros, the data represents a
third degree polynomial. Newtons divided difference formula
gives the polynomial as
f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2]
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Since, the fourth order differences are zeros, the data represents a
third degree polynomial. Newtons divided difference formula
gives the polynomial as
f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2]
+
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Since, the fourth order differences are zeros, the data represents a
third degree polynomial. Newtons divided difference formula
gives the polynomial as
f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2]
+ (x − x0)(x − x1)(x − x2)f[x0, x1, x2, x3]
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Since, the fourth order differences are zeros, the data represents a
third degree polynomial. Newtons divided difference formula
gives the polynomial as
f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2]
+ (x − x0)(x − x1)(x − x2)f[x0, x1, x2, x3]
= ...
= x3 + 17
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Ex. Find the missing term in the following table:
x 0 1 2 3 4
y 1 3 9 - 81
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Divided difference table:
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Divided difference table:
By Newton’s divided difference formula
f(x) =
f (x0) + (x − x0) f (x0, x1) + (x − x0) (x − x1) f (x0, x1, x2) + ...
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Spline Interpolation
Spline interpolation is a form of interpolation where the
interpolant is a special type of piecewise polynomial called a
spline
Consider the problem of interpolating between the data points
(x0, y0), (x1, y1), . . . , (xn, yn) by means of spline fitting.
Then the cubic spline f(x) is such that
(i) f(x) is a linear polynomial outside the interval (x0, xn)
(ii) f(x) is a cubic polynomial in each of the subintervals,
(iii) f (x) and f (x) are continuous at each point.
Since f(x) is cubic in each of the subintervals f (x) shall be
linear.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Spline Interpolation
f(x) =
(xi+1 − x)3Mi
6h
+
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Spline Interpolation
f(x) =
(xi+1 − x)3Mi
6h
+
(x − xi)3Mi+1
6h
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Spline Interpolation
f(x) =
(xi+1 − x)3Mi
6h
+
(x − xi)3Mi+1
6h
+
(xi+1 − x)
h
yi −
h2
6
Mi +
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Spline Interpolation
f(x) =
(xi+1 − x)3Mi
6h
+
(x − xi)3Mi+1
6h
+
(xi+1 − x)
h
yi −
h2
6
Mi +
(x − xi)
h
yi+1 −
h2
6
Mi+1
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Spline Interpolation
f(x) =
(xi+1 − x)3Mi
6h
+
(x − xi)3Mi+1
6h
+
(xi+1 − x)
h
yi −
h2
6
Mi +
(x − xi)
h
yi+1 −
h2
6
Mi+1
where Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1),
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Spline Interpolation
f(x) =
(xi+1 − x)3Mi
6h
+
(x − xi)3Mi+1
6h
+
(xi+1 − x)
h
yi −
h2
6
Mi +
(x − xi)
h
yi+1 −
h2
6
Mi+1
where Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1),
i = 1, 2, 3, ..., (n − 1)
and M0 = 0, Mn = 0, xi+1 − xi = h.
which gives n + 1 equations in n + 1 unknowns Mi(i = 0, 1, ..., n)
which can be solved. Substituting the value of Mi gives the
concerned cubic spline.
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Ex. Obtain cubic spline for the following data:
x 0 1 2 3
y 2 -6 -8 2
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3,
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1,
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 36; —(1)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 36; —(1)
for i = 2,
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 36; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 36; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 72 —(2)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 36; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 72 —(2)
solving these, we get
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 36; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 72 —(2)
solving these, we get M1 =
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 36; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 72 —(2)
solving these, we get M1 =4.8 and M2 =
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 36; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 72 —(2)
solving these, we get M1 =4.8 and M2 =16.8
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 36; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 72 —(2)
solving these, we get M1 =4.8 and M2 =16.8
Now the cubic spline in (xi ≤ x ≤ xi+1) is
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 36; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 72 —(2)
solving these, we get M1 =4.8 and M2 =16.8
Now the cubic spline in (xi ≤ x ≤ xi+1) is
f(x) =
(xi+1 − x)3Mi
6h
+
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 36; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 72 —(2)
solving these, we get M1 =4.8 and M2 =16.8
Now the cubic spline in (xi ≤ x ≤ xi+1) is
f(x) =
(xi+1 − x)3Mi
6h
+
(x − xi)3Mi+1
6h
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 36; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 72 —(2)
solving these, we get M1 =4.8 and M2 =16.8
Now the cubic spline in (xi ≤ x ≤ xi+1) is
f(x) =
(xi+1 − x)3Mi
6h
+
(x − xi)3Mi+1
6h
+
(xi+1 − x)
h
yi −
h2
6
Mi +
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 36; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 72 —(2)
solving these, we get M1 =4.8 and M2 =16.8
Now the cubic spline in (xi ≤ x ≤ xi+1) is
f(x) =
(xi+1 − x)3Mi
6h
+
(x − xi)3Mi+1
6h
+
(xi+1 − x)
h
yi −
h2
6
Mi +
(x − xi)
h
yi+1 −
h2
6
Mi+1 —(3)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 36; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 72 —(2)
solving these, we get M1 =4.8 and M2 =16.8
Now the cubic spline in (xi ≤ x ≤ xi+1) is
f(x) =
(xi+1 − x)3Mi
6h
+
(x − xi)3Mi+1
6h
+
(xi+1 − x)
h
yi −
h2
6
Mi +
(x − xi)
h
yi+1 −
h2
6
Mi+1 —(3)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Ex. The following values of x and y are given:
x 1 2 3 4
y 1 2 5 11
Find the cubic splines and evaluate y(1.5) and y (3)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3,
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1,
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 12; —(1)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 12; —(1)
for i = 2,
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 12; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 12; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 18 —(2)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 12; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 18 —(2)
solving these, we get
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 12; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 18 —(2)
solving these, we get M1 =
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 12; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 18 —(2)
solving these, we get M1 =2 and M2 =
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 12; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 18 —(2)
solving these, we get M1 =2 and M2 =4
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 12; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 18 —(2)
solving these, we get M1 =2 and M2 =4
Now the cubic spline in (xi ≤ x ≤ xi+1) is
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 12; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 18 —(2)
solving these, we get M1 =2 and M2 =4
Now the cubic spline in (xi ≤ x ≤ xi+1) is
f(x) =
(xi+1 − x)3Mi
6h
+
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 12; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 18 —(2)
solving these, we get M1 =2 and M2 =4
Now the cubic spline in (xi ≤ x ≤ xi+1) is
f(x) =
(xi+1 − x)3Mi
6h
+
(x − xi)3Mi+1
6h
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 12; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 18 —(2)
solving these, we get M1 =2 and M2 =4
Now the cubic spline in (xi ≤ x ≤ xi+1) is
f(x) =
(xi+1 − x)3Mi
6h
+
(x − xi)3Mi+1
6h
+
(xi+1 − x)
h
yi −
h2
6
Mi +
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 12; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 18 —(2)
solving these, we get M1 =2 and M2 =4
Now the cubic spline in (xi ≤ x ≤ xi+1) is
f(x) =
(xi+1 − x)3Mi
6h
+
(x − xi)3Mi+1
6h
+
(xi+1 − x)
h
yi −
h2
6
Mi +
(x − xi)
h
yi+1 −
h2
6
Mi+1 —(3)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. Since points are equispaced with h = 1 and n = 3, the cubic
spline can be determined from
Mi−1 + 4Mi + Mi+1 =
6
h2
(yi−1 − 2yi + yi+1), i = 1, 2
also M0 = 0 , M3 = 0
∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2)
therefore, 4M1 + M2 = 12; —(1)
for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3)
M1 + 4M2 = 18 —(2)
solving these, we get M1 =2 and M2 =4
Now the cubic spline in (xi ≤ x ≤ xi+1) is
f(x) =
(xi+1 − x)3Mi
6h
+
(x − xi)3Mi+1
6h
+
(xi+1 − x)
h
yi −
h2
6
Mi +
(x − xi)
h
yi+1 −
h2
6
Mi+1 —(3)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Ex. Find whether the following functions are cubic splines ?
1.
f(x) = 5x3 − 3x2, −1 ≤ x ≤ 0
= −5x3 − 3x2, 0 ≤ x ≤ 1
2.
f(x) = −2x3 − x2, −1 ≤ x ≤ 0
= 2x3 + 3x2, 0 ≤ x ≤ 1
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. In both the examples, f(x) is a cubic polynomial in both
intervals (1, 0) and (0, 1).
1. We have
lim
x→0+
f(x)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. In both the examples, f(x) is a cubic polynomial in both
intervals (1, 0) and (0, 1).
1. We have
lim
x→0+
f(x) = 0
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. In both the examples, f(x) is a cubic polynomial in both
intervals (1, 0) and (0, 1).
1. We have
lim
x→0+
f(x) = 0 = lim
x→0−
f(x)
therefore, given function f(x) is continuous on (−1, 1).
Now
f (x)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. In both the examples, f(x) is a cubic polynomial in both
intervals (1, 0) and (0, 1).
1. We have
lim
x→0+
f(x) = 0 = lim
x→0−
f(x)
therefore, given function f(x) is continuous on (−1, 1).
Now
f (x) = 15x2 − 6x, −1 ≤ x ≤ 0
= −15x2 − 6x, 0 ≤ x ≤ 1
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. In both the examples, f(x) is a cubic polynomial in both
intervals (1, 0) and (0, 1).
1. We have
lim
x→0+
f(x) = 0 = lim
x→0−
f(x)
therefore, given function f(x) is continuous on (−1, 1).
Now
f (x) = 15x2 − 6x, −1 ≤ x ≤ 0
= −15x2 − 6x, 0 ≤ x ≤ 1
we have,
lim
x→0+
f (x)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. In both the examples, f(x) is a cubic polynomial in both
intervals (1, 0) and (0, 1).
1. We have
lim
x→0+
f(x) = 0 = lim
x→0−
f(x)
therefore, given function f(x) is continuous on (−1, 1).
Now
f (x) = 15x2 − 6x, −1 ≤ x ≤ 0
= −15x2 − 6x, 0 ≤ x ≤ 1
we have,
lim
x→0+
f (x) = 0
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. In both the examples, f(x) is a cubic polynomial in both
intervals (1, 0) and (0, 1).
1. We have
lim
x→0+
f(x) = 0 = lim
x→0−
f(x)
therefore, given function f(x) is continuous on (−1, 1).
Now
f (x) = 15x2 − 6x, −1 ≤ x ≤ 0
= −15x2 − 6x, 0 ≤ x ≤ 1
we have,
lim
x→0+
f (x) = 0 = lim
x→0−
f (x)
therefore, the function f (x) is continuous on (−1, 1).
f (x)
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. In both the examples, f(x) is a cubic polynomial in both
intervals (1, 0) and (0, 1).
1. We have
lim
x→0+
f(x) = 0 = lim
x→0−
f(x)
therefore, given function f(x) is continuous on (−1, 1).
Now
f (x) = 15x2 − 6x, −1 ≤ x ≤ 0
= −15x2 − 6x, 0 ≤ x ≤ 1
we have,
lim
x→0+
f (x) = 0 = lim
x→0−
f (x)
therefore, the function f (x) is continuous on (−1, 1).
f (x) = 30x−6, −1 ≤ x ≤ 0
= −30x − 6, 0 ≤ x ≤ 1
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
Example
Sol. In both the examples, f(x) is a cubic polynomial in both
intervals (1, 0) and (0, 1).
1. We have
lim
x→0+
f(x) = 0 = lim
x→0−
f(x)
therefore, given function f(x) is continuous on (−1, 1).
Now
f (x) = 15x2 − 6x, −1 ≤ x ≤ 0
= −15x2 − 6x, 0 ≤ x ≤ 1
we have,
lim
x→0+
f (x) = 0 = lim
x→0−
f (x)
therefore, the function f (x) is continuous on (−1, 1).
f (x) = 30x−6, −1 ≤ x ≤ 0
= −30x − 6, 0 ≤ x ≤ 1
Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals

More Related Content

What's hot

Newton’s Forward & backward interpolation
Newton’s Forward &  backward interpolation Newton’s Forward &  backward interpolation
Newton’s Forward & backward interpolation
Meet Patel
 
Jacobi method
Jacobi methodJacobi method
Jacobi method
Grishma Maravia
 
System of linear equations
System of linear equationsSystem of linear equations
System of linear equations
Diler4
 
Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)
Syed Ahmed Zaki
 
Numerical Differentiation and Integration
 Numerical Differentiation and Integration Numerical Differentiation and Integration
Numerical Differentiation and Integration
Meenakshisundaram N
 
Interpolation In Numerical Methods.
 Interpolation In Numerical Methods. Interpolation In Numerical Methods.
Interpolation In Numerical Methods.
Abu Kaisar
 
Jacobi iteration method
Jacobi iteration methodJacobi iteration method
Jacobi iteration method
MONIRUL ISLAM
 
Gauss Forward And Backward Central Difference Interpolation Formula
 Gauss Forward And Backward Central Difference Interpolation Formula  Gauss Forward And Backward Central Difference Interpolation Formula
Gauss Forward And Backward Central Difference Interpolation Formula
Deep Dalsania
 
Newton's forward & backward interpolation
Newton's forward & backward interpolationNewton's forward & backward interpolation
Newton's forward & backward interpolation
Harshad Koshti
 
ORTHOGONAL, ORTHONORMAL VECTOR, GRAM SCHMIDT PROCESS, ORTHOGONALLY DIAGONALI...
ORTHOGONAL, ORTHONORMAL  VECTOR, GRAM SCHMIDT PROCESS, ORTHOGONALLY DIAGONALI...ORTHOGONAL, ORTHONORMAL  VECTOR, GRAM SCHMIDT PROCESS, ORTHOGONALLY DIAGONALI...
ORTHOGONAL, ORTHONORMAL VECTOR, GRAM SCHMIDT PROCESS, ORTHOGONALLY DIAGONALI...
Smit Shah
 
Newton Forward Difference Interpolation Method
Newton Forward Difference Interpolation MethodNewton Forward Difference Interpolation Method
Newton Forward Difference Interpolation Method
Adeel Rasheed
 
Z transforms and their applications
Z transforms and their applicationsZ transforms and their applications
Z transforms and their applications
Ram Kumar K R
 
Solved numerical problems of fourier series
Solved numerical problems of fourier seriesSolved numerical problems of fourier series
Solved numerical problems of fourier series
Mohammad Imran
 
Diagonalization of Matrices
Diagonalization of MatricesDiagonalization of Matrices
Diagonalization of Matrices
AmenahGondal1
 
Newton divided difference interpolation
Newton divided difference interpolationNewton divided difference interpolation
Newton divided difference interpolation
VISHAL DONGA
 
Partial differential equations
Partial differential equationsPartial differential equations
Partial differential equations
aman1894
 
Error control coding bch, reed-solomon etc..
Error control coding   bch, reed-solomon etc..Error control coding   bch, reed-solomon etc..
Error control coding bch, reed-solomon etc..
Madhumita Tamhane
 
Vector space
Vector spaceVector space
Vector space
Jaimin Patel
 
Dobule and triple integral
Dobule and triple integralDobule and triple integral
Dobule and triple integral
sonendra Gupta
 

What's hot (20)

newton raphson method
newton raphson methodnewton raphson method
newton raphson method
 
Newton’s Forward & backward interpolation
Newton’s Forward &  backward interpolation Newton’s Forward &  backward interpolation
Newton’s Forward & backward interpolation
 
Jacobi method
Jacobi methodJacobi method
Jacobi method
 
System of linear equations
System of linear equationsSystem of linear equations
System of linear equations
 
Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)
 
Numerical Differentiation and Integration
 Numerical Differentiation and Integration Numerical Differentiation and Integration
Numerical Differentiation and Integration
 
Interpolation In Numerical Methods.
 Interpolation In Numerical Methods. Interpolation In Numerical Methods.
Interpolation In Numerical Methods.
 
Jacobi iteration method
Jacobi iteration methodJacobi iteration method
Jacobi iteration method
 
Gauss Forward And Backward Central Difference Interpolation Formula
 Gauss Forward And Backward Central Difference Interpolation Formula  Gauss Forward And Backward Central Difference Interpolation Formula
Gauss Forward And Backward Central Difference Interpolation Formula
 
Newton's forward & backward interpolation
Newton's forward & backward interpolationNewton's forward & backward interpolation
Newton's forward & backward interpolation
 
ORTHOGONAL, ORTHONORMAL VECTOR, GRAM SCHMIDT PROCESS, ORTHOGONALLY DIAGONALI...
ORTHOGONAL, ORTHONORMAL  VECTOR, GRAM SCHMIDT PROCESS, ORTHOGONALLY DIAGONALI...ORTHOGONAL, ORTHONORMAL  VECTOR, GRAM SCHMIDT PROCESS, ORTHOGONALLY DIAGONALI...
ORTHOGONAL, ORTHONORMAL VECTOR, GRAM SCHMIDT PROCESS, ORTHOGONALLY DIAGONALI...
 
Newton Forward Difference Interpolation Method
Newton Forward Difference Interpolation MethodNewton Forward Difference Interpolation Method
Newton Forward Difference Interpolation Method
 
Z transforms and their applications
Z transforms and their applicationsZ transforms and their applications
Z transforms and their applications
 
Solved numerical problems of fourier series
Solved numerical problems of fourier seriesSolved numerical problems of fourier series
Solved numerical problems of fourier series
 
Diagonalization of Matrices
Diagonalization of MatricesDiagonalization of Matrices
Diagonalization of Matrices
 
Newton divided difference interpolation
Newton divided difference interpolationNewton divided difference interpolation
Newton divided difference interpolation
 
Partial differential equations
Partial differential equationsPartial differential equations
Partial differential equations
 
Error control coding bch, reed-solomon etc..
Error control coding   bch, reed-solomon etc..Error control coding   bch, reed-solomon etc..
Error control coding bch, reed-solomon etc..
 
Vector space
Vector spaceVector space
Vector space
 
Dobule and triple integral
Dobule and triple integralDobule and triple integral
Dobule and triple integral
 

Similar to Interpolation with unequal interval

Interpolation techniques - Background and implementation
Interpolation techniques - Background and implementationInterpolation techniques - Background and implementation
Interpolation techniques - Background and implementation
Quasar Chunawala
 
Chs4
Chs4Chs4
Chs4
CAALAAA
 
Paper06
Paper06Paper06
13 graphs of factorable polynomials x
13 graphs of factorable polynomials x13 graphs of factorable polynomials x
13 graphs of factorable polynomials x
math260
 
Basics of probability in statistical simulation and stochastic programming
Basics of probability in statistical simulation and stochastic programmingBasics of probability in statistical simulation and stochastic programming
Basics of probability in statistical simulation and stochastic programming
SSA KPI
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceasimnawaz54
 
2 vectors notes
2 vectors notes2 vectors notes
2 vectors notes
Vinh Nguyen Xuan
 
Basics of quantum mechanics
Basics of quantum mechanicsBasics of quantum mechanics
Basics of quantum mechanics
MirzaMusmanBaig
 
Probability distribution
Probability distributionProbability distribution
Probability distribution
Manoj Bhambu
 
this materials is useful for the students who studying masters level in elect...
this materials is useful for the students who studying masters level in elect...this materials is useful for the students who studying masters level in elect...
this materials is useful for the students who studying masters level in elect...
BhojRajAdhikari5
 
Module 2 Lesson 2 Notes
Module 2 Lesson 2 NotesModule 2 Lesson 2 Notes
Module 2 Lesson 2 Notes
toni dimella
 
Radial Basis Function Interpolation
Radial Basis Function InterpolationRadial Basis Function Interpolation
Radial Basis Function Interpolation
Jesse Bettencourt
 
Algebric Functions.pdf
Algebric Functions.pdfAlgebric Functions.pdf
Algebric Functions.pdf
MamadArip
 
2.9 graphs of factorable polynomials
2.9 graphs of factorable polynomials2.9 graphs of factorable polynomials
2.9 graphs of factorable polynomialsmath260
 
04 random-variables-probability-distributionsrv
04 random-variables-probability-distributionsrv04 random-variables-probability-distributionsrv
04 random-variables-probability-distributionsrvPooja Sakhla
 
Numerical Analysis (Solution of Non-Linear Equations) part 2
Numerical Analysis (Solution of Non-Linear Equations) part 2Numerical Analysis (Solution of Non-Linear Equations) part 2
Numerical Analysis (Solution of Non-Linear Equations) part 2
Asad Ali
 
Shannon’s Information Measures and Markov Structures
Shannon’s Information Measures and Markov StructuresShannon’s Information Measures and Markov Structures
Shannon’s Information Measures and Markov Structures
InfoEngg CUHK
 
COMPLEX PROJECT-3.pptx
COMPLEX PROJECT-3.pptxCOMPLEX PROJECT-3.pptx
COMPLEX PROJECT-3.pptx
JayabiGaming
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
IJERD Editor
 

Similar to Interpolation with unequal interval (20)

Interpolation techniques - Background and implementation
Interpolation techniques - Background and implementationInterpolation techniques - Background and implementation
Interpolation techniques - Background and implementation
 
Chs4
Chs4Chs4
Chs4
 
Paper06
Paper06Paper06
Paper06
 
13 graphs of factorable polynomials x
13 graphs of factorable polynomials x13 graphs of factorable polynomials x
13 graphs of factorable polynomials x
 
Basics of probability in statistical simulation and stochastic programming
Basics of probability in statistical simulation and stochastic programmingBasics of probability in statistical simulation and stochastic programming
Basics of probability in statistical simulation and stochastic programming
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inference
 
2 vectors notes
2 vectors notes2 vectors notes
2 vectors notes
 
Basics of quantum mechanics
Basics of quantum mechanicsBasics of quantum mechanics
Basics of quantum mechanics
 
Probability distribution
Probability distributionProbability distribution
Probability distribution
 
this materials is useful for the students who studying masters level in elect...
this materials is useful for the students who studying masters level in elect...this materials is useful for the students who studying masters level in elect...
this materials is useful for the students who studying masters level in elect...
 
Module 2 Lesson 2 Notes
Module 2 Lesson 2 NotesModule 2 Lesson 2 Notes
Module 2 Lesson 2 Notes
 
Radial Basis Function Interpolation
Radial Basis Function InterpolationRadial Basis Function Interpolation
Radial Basis Function Interpolation
 
Algebric Functions.pdf
Algebric Functions.pdfAlgebric Functions.pdf
Algebric Functions.pdf
 
2.9 graphs of factorable polynomials
2.9 graphs of factorable polynomials2.9 graphs of factorable polynomials
2.9 graphs of factorable polynomials
 
04 random-variables-probability-distributionsrv
04 random-variables-probability-distributionsrv04 random-variables-probability-distributionsrv
04 random-variables-probability-distributionsrv
 
Es272 ch5b
Es272 ch5bEs272 ch5b
Es272 ch5b
 
Numerical Analysis (Solution of Non-Linear Equations) part 2
Numerical Analysis (Solution of Non-Linear Equations) part 2Numerical Analysis (Solution of Non-Linear Equations) part 2
Numerical Analysis (Solution of Non-Linear Equations) part 2
 
Shannon’s Information Measures and Markov Structures
Shannon’s Information Measures and Markov StructuresShannon’s Information Measures and Markov Structures
Shannon’s Information Measures and Markov Structures
 
COMPLEX PROJECT-3.pptx
COMPLEX PROJECT-3.pptxCOMPLEX PROJECT-3.pptx
COMPLEX PROJECT-3.pptx
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
 

More from Dr. Nirav Vyas

Reduction forumla
Reduction forumlaReduction forumla
Reduction forumla
Dr. Nirav Vyas
 
Arithmetic Mean, Geometric Mean, Harmonic Mean
Arithmetic Mean, Geometric Mean, Harmonic MeanArithmetic Mean, Geometric Mean, Harmonic Mean
Arithmetic Mean, Geometric Mean, Harmonic Mean
Dr. Nirav Vyas
 
Geometric progressions
Geometric progressionsGeometric progressions
Geometric progressions
Dr. Nirav Vyas
 
Arithmetic progressions
Arithmetic progressionsArithmetic progressions
Arithmetic progressions
Dr. Nirav Vyas
 
Combinations
CombinationsCombinations
Combinations
Dr. Nirav Vyas
 
Permutation
PermutationPermutation
Permutation
Dr. Nirav Vyas
 
Curve fitting - Lecture Notes
Curve fitting - Lecture NotesCurve fitting - Lecture Notes
Curve fitting - Lecture Notes
Dr. Nirav Vyas
 
Trend analysis - Lecture Notes
Trend analysis - Lecture NotesTrend analysis - Lecture Notes
Trend analysis - Lecture Notes
Dr. Nirav Vyas
 
Basic Concepts of Statistics - Lecture Notes
Basic Concepts of Statistics - Lecture NotesBasic Concepts of Statistics - Lecture Notes
Basic Concepts of Statistics - Lecture Notes
Dr. Nirav Vyas
 
Numerical Methods - Power Method for Eigen values
Numerical Methods - Power Method for Eigen valuesNumerical Methods - Power Method for Eigen values
Numerical Methods - Power Method for Eigen values
Dr. Nirav Vyas
 
Numerical Methods - Oridnary Differential Equations - 3
Numerical Methods - Oridnary Differential Equations - 3Numerical Methods - Oridnary Differential Equations - 3
Numerical Methods - Oridnary Differential Equations - 3
Dr. Nirav Vyas
 
Numerical Methods - Oridnary Differential Equations - 2
Numerical Methods - Oridnary Differential Equations - 2Numerical Methods - Oridnary Differential Equations - 2
Numerical Methods - Oridnary Differential Equations - 2
Dr. Nirav Vyas
 
Numerical Methods - Oridnary Differential Equations - 1
Numerical Methods - Oridnary Differential Equations - 1Numerical Methods - Oridnary Differential Equations - 1
Numerical Methods - Oridnary Differential Equations - 1
Dr. Nirav Vyas
 
Partial Differential Equation - Notes
Partial Differential Equation - NotesPartial Differential Equation - Notes
Partial Differential Equation - Notes
Dr. Nirav Vyas
 
Special functions
Special functionsSpecial functions
Special functions
Dr. Nirav Vyas
 
Legendre Function
Legendre FunctionLegendre Function
Legendre Function
Dr. Nirav Vyas
 

More from Dr. Nirav Vyas (20)

Reduction forumla
Reduction forumlaReduction forumla
Reduction forumla
 
Arithmetic Mean, Geometric Mean, Harmonic Mean
Arithmetic Mean, Geometric Mean, Harmonic MeanArithmetic Mean, Geometric Mean, Harmonic Mean
Arithmetic Mean, Geometric Mean, Harmonic Mean
 
Geometric progressions
Geometric progressionsGeometric progressions
Geometric progressions
 
Arithmetic progressions
Arithmetic progressionsArithmetic progressions
Arithmetic progressions
 
Combinations
CombinationsCombinations
Combinations
 
Permutation
PermutationPermutation
Permutation
 
Curve fitting - Lecture Notes
Curve fitting - Lecture NotesCurve fitting - Lecture Notes
Curve fitting - Lecture Notes
 
Trend analysis - Lecture Notes
Trend analysis - Lecture NotesTrend analysis - Lecture Notes
Trend analysis - Lecture Notes
 
Basic Concepts of Statistics - Lecture Notes
Basic Concepts of Statistics - Lecture NotesBasic Concepts of Statistics - Lecture Notes
Basic Concepts of Statistics - Lecture Notes
 
Numerical Methods - Power Method for Eigen values
Numerical Methods - Power Method for Eigen valuesNumerical Methods - Power Method for Eigen values
Numerical Methods - Power Method for Eigen values
 
Numerical Methods - Oridnary Differential Equations - 3
Numerical Methods - Oridnary Differential Equations - 3Numerical Methods - Oridnary Differential Equations - 3
Numerical Methods - Oridnary Differential Equations - 3
 
Numerical Methods - Oridnary Differential Equations - 2
Numerical Methods - Oridnary Differential Equations - 2Numerical Methods - Oridnary Differential Equations - 2
Numerical Methods - Oridnary Differential Equations - 2
 
Numerical Methods - Oridnary Differential Equations - 1
Numerical Methods - Oridnary Differential Equations - 1Numerical Methods - Oridnary Differential Equations - 1
Numerical Methods - Oridnary Differential Equations - 1
 
Partial Differential Equation - Notes
Partial Differential Equation - NotesPartial Differential Equation - Notes
Partial Differential Equation - Notes
 
Special functions
Special functionsSpecial functions
Special functions
 
Legendre Function
Legendre FunctionLegendre Function
Legendre Function
 
Laplace Transforms
Laplace TransformsLaplace Transforms
Laplace Transforms
 
Fourier series 3
Fourier series 3Fourier series 3
Fourier series 3
 
Fourier series 2
Fourier series 2Fourier series 2
Fourier series 2
 
Fourier series 1
Fourier series 1Fourier series 1
Fourier series 1
 

Recently uploaded

How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 

Recently uploaded (20)

How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 

Interpolation with unequal interval

  • 1. Numerical Methods - Interpolation Unequal Intervals Dr. N. B. Vyas Department of Mathematics, Atmiya Institute of Tech. and Science, Rajkot (Guj.) niravbvyas@gmail.com Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 2. Interpolation To find the value of y for an x between different x - values x0, x1, . . . , xn is called problem of interpolation. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 3. Interpolation To find the value of y for an x between different x - values x0, x1, . . . , xn is called problem of interpolation. To find the value of y for an x which falls outside the range of x (x < x0 or x > xn) is called the problem of extrapolation. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 4. Interpolation To find the value of y for an x between different x - values x0, x1, . . . , xn is called problem of interpolation. To find the value of y for an x which falls outside the range of x (x < x0 or x > xn) is called the problem of extrapolation. Theorem by Weierstrass in 1885, “Every continuous function in an interval (a,b) can be represented in that interval to any desired accuracy by a polynomial. ” Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 5. Interpolation To find the value of y for an x between different x - values x0, x1, . . . , xn is called problem of interpolation. To find the value of y for an x which falls outside the range of x (x < x0 or x > xn) is called the problem of extrapolation. Theorem by Weierstrass in 1885, “Every continuous function in an interval (a,b) can be represented in that interval to any desired accuracy by a polynomial. ” Let us assign polynomial Pn of degree n (or less) that assumes the given data values Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 6. Interpolation To find the value of y for an x between different x - values x0, x1, . . . , xn is called problem of interpolation. To find the value of y for an x which falls outside the range of x (x < x0 or x > xn) is called the problem of extrapolation. Theorem by Weierstrass in 1885, “Every continuous function in an interval (a,b) can be represented in that interval to any desired accuracy by a polynomial. ” Let us assign polynomial Pn of degree n (or less) that assumes the given data values Pn(x0) = y0, Pn(x1) = y1, . . ., Pn(xn) = yn Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 7. Interpolation To find the value of y for an x between different x - values x0, x1, . . . , xn is called problem of interpolation. To find the value of y for an x which falls outside the range of x (x < x0 or x > xn) is called the problem of extrapolation. Theorem by Weierstrass in 1885, “Every continuous function in an interval (a,b) can be represented in that interval to any desired accuracy by a polynomial. ” Let us assign polynomial Pn of degree n (or less) that assumes the given data values Pn(x0) = y0, Pn(x1) = y1, . . ., Pn(xn) = yn This polynomial Pn is called interpolation polynomial. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 8. Interpolation To find the value of y for an x between different x - values x0, x1, . . . , xn is called problem of interpolation. To find the value of y for an x which falls outside the range of x (x < x0 or x > xn) is called the problem of extrapolation. Theorem by Weierstrass in 1885, “Every continuous function in an interval (a,b) can be represented in that interval to any desired accuracy by a polynomial. ” Let us assign polynomial Pn of degree n (or less) that assumes the given data values Pn(x0) = y0, Pn(x1) = y1, . . ., Pn(xn) = yn This polynomial Pn is called interpolation polynomial. x0, x1, . . . , xn is called the nodes ( tabular points, pivotal points or arguments). Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 9. Interpolation with unequal intervals Lagrange’s interpolation formula with unequal intervals: Let y = f(x) be continuous and differentiable in the interval (a, b). Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 10. Interpolation with unequal intervals Lagrange’s interpolation formula with unequal intervals: Let y = f(x) be continuous and differentiable in the interval (a, b). Given the set of n + 1 values (x0, y0), (x1, y1), . . . , (xn, yn) of x and y, where the values of x need not necessarily be equally spaced. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 11. Interpolation with unequal intervals Lagrange’s interpolation formula with unequal intervals: Let y = f(x) be continuous and differentiable in the interval (a, b). Given the set of n + 1 values (x0, y0), (x1, y1), . . . , (xn, yn) of x and y, where the values of x need not necessarily be equally spaced. It is required to find Pn(x), a polynomial of degree n such that y and Pn(x) agree at the tabulated points. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 12. Interpolation with unequal intervals Lagrange’s interpolation formula with unequal intervals: Let y = f(x) be continuous and differentiable in the interval (a, b). Given the set of n + 1 values (x0, y0), (x1, y1), . . . , (xn, yn) of x and y, where the values of x need not necessarily be equally spaced. It is required to find Pn(x), a polynomial of degree n such that y and Pn(x) agree at the tabulated points. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 13. Lagrange’s Interpolation This polynomial is given by the following formula: Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 14. Lagrange’s Interpolation This polynomial is given by the following formula: y = f(x) ≈ Pn(x) = (x − x1)(x − x2) . . . (x − xn) (x0 − x1)(x0 − x2) . . . (x0 − xn) y0 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 15. Lagrange’s Interpolation This polynomial is given by the following formula: y = f(x) ≈ Pn(x) = (x − x1)(x − x2) . . . (x − xn) (x0 − x1)(x0 − x2) . . . (x0 − xn) y0 + (x − x0)(x − x2) . . . (x − xn) (x1 − x0)(x1 − x2) . . . (x1 − xn) y1 + . . . Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 16. Lagrange’s Interpolation This polynomial is given by the following formula: y = f(x) ≈ Pn(x) = (x − x1)(x − x2) . . . (x − xn) (x0 − x1)(x0 − x2) . . . (x0 − xn) y0 + (x − x0)(x − x2) . . . (x − xn) (x1 − x0)(x1 − x2) . . . (x1 − xn) y1 + . . . + (x − x0)(x − x1) . . . (x − xn−1) (xn − x0)(xn − x1) . . . (xn − xn−1) yn Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 17. Lagrange’s Interpolation This polynomial is given by the following formula: y = f(x) ≈ Pn(x) = (x − x1)(x − x2) . . . (x − xn) (x0 − x1)(x0 − x2) . . . (x0 − xn) y0 + (x − x0)(x − x2) . . . (x − xn) (x1 − x0)(x1 − x2) . . . (x1 − xn) y1 + . . . + (x − x0)(x − x1) . . . (x − xn−1) (xn − x0)(xn − x1) . . . (xn − xn−1) yn NOTE: The above formula can be used irrespective of whether the values x0, x1, . . . , xn are equally spaced or not. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 18. Lagrange’s Inverse Interpolation In the Lagrange’s interpolation formula y is treated as dependent variable and expressed as function of independent variable x. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 19. Lagrange’s Inverse Interpolation In the Lagrange’s interpolation formula y is treated as dependent variable and expressed as function of independent variable x. Instead if x is treated as dependent variable and expressed as the function of independent variable y, then Lagrange’s interpolation formula becomes Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 20. Lagrange’s Inverse Interpolation In the Lagrange’s interpolation formula y is treated as dependent variable and expressed as function of independent variable x. Instead if x is treated as dependent variable and expressed as the function of independent variable y, then Lagrange’s interpolation formula becomes x = g(y) ≈ Pn(y) = (y − y1)(y − y2) . . . (y − yn) (y0 − y1)(y0 − y2) . . . (y0 − yn) x0 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 21. Lagrange’s Inverse Interpolation In the Lagrange’s interpolation formula y is treated as dependent variable and expressed as function of independent variable x. Instead if x is treated as dependent variable and expressed as the function of independent variable y, then Lagrange’s interpolation formula becomes x = g(y) ≈ Pn(y) = (y − y1)(y − y2) . . . (y − yn) (y0 − y1)(y0 − y2) . . . (y0 − yn) x0 + (y − y0)(y − y2) . . . (y − yn) (y1 − y0)(y1 − y2) . . . (y1 − yn) x1 + . . . Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 22. Lagrange’s Inverse Interpolation In the Lagrange’s interpolation formula y is treated as dependent variable and expressed as function of independent variable x. Instead if x is treated as dependent variable and expressed as the function of independent variable y, then Lagrange’s interpolation formula becomes x = g(y) ≈ Pn(y) = (y − y1)(y − y2) . . . (y − yn) (y0 − y1)(y0 − y2) . . . (y0 − yn) x0 + (y − y0)(y − y2) . . . (y − yn) (y1 − y0)(y1 − y2) . . . (y1 − yn) x1 + . . . + (y − y0)(y − y1) . . . (y − yn−1) (yn − y0)(yn − y1) . . . (yn − yn−1) xn Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 23. Lagrange’s Inverse Interpolation In the Lagrange’s interpolation formula y is treated as dependent variable and expressed as function of independent variable x. Instead if x is treated as dependent variable and expressed as the function of independent variable y, then Lagrange’s interpolation formula becomes x = g(y) ≈ Pn(y) = (y − y1)(y − y2) . . . (y − yn) (y0 − y1)(y0 − y2) . . . (y0 − yn) x0 + (y − y0)(y − y2) . . . (y − yn) (y1 − y0)(y1 − y2) . . . (y1 − yn) x1 + . . . + (y − y0)(y − y1) . . . (y − yn−1) (yn − y0)(yn − y1) . . . (yn − yn−1) xn This relation is referred as Lagrange’s inverse interpolation formula. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 24. Example Ex. Given the table of values: x 150 152 154 156 y = √ x 12.247 12.329 12.410 12.490 Evaluate √ 155 using Lagrange’s interpolation formula. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 25. Example Sol.: Here x0 = 150, x1 = 152, x2 = 154 and x3 = 156 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 26. Example Sol.: Here x0 = 150, x1 = 152, x2 = 154 and x3 = 156 y0 = 12.247, y1 = 12.329, y2 = 12.410 and y3 = 12.490 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 27. Example Sol.: Here x0 = 150, x1 = 152, x2 = 154 and x3 = 156 y0 = 12.247, y1 = 12.329, y2 = 12.410 and y3 = 12.490 By Lagrange’s interpolation formula, Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 28. Example Sol.: Here x0 = 150, x1 = 152, x2 = 154 and x3 = 156 y0 = 12.247, y1 = 12.329, y2 = 12.410 and y3 = 12.490 By Lagrange’s interpolation formula, f(x) ≈ Pn(x) = (x − x1)(x − x2)(x − x3) (x0 − x1)(x0 − x2)(x0 − x3) y0 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 29. Example Sol.: Here x0 = 150, x1 = 152, x2 = 154 and x3 = 156 y0 = 12.247, y1 = 12.329, y2 = 12.410 and y3 = 12.490 By Lagrange’s interpolation formula, f(x) ≈ Pn(x) = (x − x1)(x − x2)(x − x3) (x0 − x1)(x0 − x2)(x0 − x3) y0 + (x − x0)(x − x2)(x − x3) (x1 − x0)(x1 − x2)(x1 − x3) y1 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 30. Example Sol.: Here x0 = 150, x1 = 152, x2 = 154 and x3 = 156 y0 = 12.247, y1 = 12.329, y2 = 12.410 and y3 = 12.490 By Lagrange’s interpolation formula, f(x) ≈ Pn(x) = (x − x1)(x − x2)(x − x3) (x0 − x1)(x0 − x2)(x0 − x3) y0 + (x − x0)(x − x2)(x − x3) (x1 − x0)(x1 − x2)(x1 − x3) y1 + (x − x0)(x − x1)(x − x3) (x2 − x0)(x2 − x1)(x2 − x3) y2 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 31. Example Sol.: Here x0 = 150, x1 = 152, x2 = 154 and x3 = 156 y0 = 12.247, y1 = 12.329, y2 = 12.410 and y3 = 12.490 By Lagrange’s interpolation formula, f(x) ≈ Pn(x) = (x − x1)(x − x2)(x − x3) (x0 − x1)(x0 − x2)(x0 − x3) y0 + (x − x0)(x − x2)(x − x3) (x1 − x0)(x1 − x2)(x1 − x3) y1 + (x − x0)(x − x1)(x − x3) (x2 − x0)(x2 − x1)(x2 − x3) y2 + (x − x0)(x − x1)(x − x2) (x3 − x0)(x3 − x1)(x3 − x2) y3 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 32. Example Sol.: Here x0 = 150, x1 = 152, x2 = 154 and x3 = 156 y0 = 12.247, y1 = 12.329, y2 = 12.410 and y3 = 12.490 By Lagrange’s interpolation formula, f(x) ≈ Pn(x) = (x − x1)(x − x2)(x − x3) (x0 − x1)(x0 − x2)(x0 − x3) y0 + (x − x0)(x − x2)(x − x3) (x1 − x0)(x1 − x2)(x1 − x3) y1 + (x − x0)(x − x1)(x − x3) (x2 − x0)(x2 − x1)(x2 − x3) y2 + (x − x0)(x − x1)(x − x2) (x3 − x0)(x3 − x1)(x3 − x2) y3 for x = 155 ∴ f(155) = Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 33. Example Ex. Compute f(0.4) for the table below by the Lagrange’s interpolation: x 0.3 0.5 0.6 f(x) 0.61 0.69 0.72 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 34. Example Ex. Using Lagrange’s formula, find the form of f(x) for the following data: x 0 1 2 5 f(x) 2 3 12 147 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 35. Example Ex. Using Lagrange’s formula, find x for y = 7 for the following data: x 1 3 4 y 4 12 19 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 36. Example Ex. Using Lagrange’s formula, express the function 3x2 + x + 1 (x − 1)(x − 2)(x − 3) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 37. Example Sol.: Let us evaluate y = 3x2 + x + 1 for x = 1, x = 2 and x = 3 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 38. Example Sol.: Let us evaluate y = 3x2 + x + 1 for x = 1, x = 2 and x = 3 These values are x0 = 1, x1 = 2 and x2 = 3 and Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 39. Example Sol.: Let us evaluate y = 3x2 + x + 1 for x = 1, x = 2 and x = 3 These values are x0 = 1, x1 = 2 and x2 = 3 and y0 = 5, Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 40. Example Sol.: Let us evaluate y = 3x2 + x + 1 for x = 1, x = 2 and x = 3 These values are x0 = 1, x1 = 2 and x2 = 3 and y0 = 5, y1 = 15 and y2 = 31 By Lagrange’s interpolation formula, Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 41. Example Sol.: Let us evaluate y = 3x2 + x + 1 for x = 1, x = 2 and x = 3 These values are x0 = 1, x1 = 2 and x2 = 3 and y0 = 5, y1 = 15 and y2 = 31 By Lagrange’s interpolation formula, y = (x − x1)(x − x2) (x0 − x1)(x0 − x2) y0 + (x − x0)(x − x2) (x1 − x0)(x1 − x2) y1 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 42. Example Sol.: Let us evaluate y = 3x2 + x + 1 for x = 1, x = 2 and x = 3 These values are x0 = 1, x1 = 2 and x2 = 3 and y0 = 5, y1 = 15 and y2 = 31 By Lagrange’s interpolation formula, y = (x − x1)(x − x2) (x0 − x1)(x0 − x2) y0 + (x − x0)(x − x2) (x1 − x0)(x1 − x2) y1 + (x − x0)(x − x1) (x2 − x0)(x2 − x1) y2 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 43. Example Sol.: Let us evaluate y = 3x2 + x + 1 for x = 1, x = 2 and x = 3 These values are x0 = 1, x1 = 2 and x2 = 3 and y0 = 5, y1 = 15 and y2 = 31 By Lagrange’s interpolation formula, y = (x − x1)(x − x2) (x0 − x1)(x0 − x2) y0 + (x − x0)(x − x2) (x1 − x0)(x1 − x2) y1 + (x − x0)(x − x1) (x2 − x0)(x2 − x1) y2 substituting above values, we get y = 2.5(x − 2)(x − 3) − 15(x − 1)(x − 3) + 15.5(x − 1)(x − 2) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 44. Example Sol.: Let us evaluate y = 3x2 + x + 1 for x = 1, x = 2 and x = 3 These values are x0 = 1, x1 = 2 and x2 = 3 and y0 = 5, y1 = 15 and y2 = 31 By Lagrange’s interpolation formula, y = (x − x1)(x − x2) (x0 − x1)(x0 − x2) y0 + (x − x0)(x − x2) (x1 − x0)(x1 − x2) y1 + (x − x0)(x − x1) (x2 − x0)(x2 − x1) y2 substituting above values, we get y = 2.5(x − 2)(x − 3) − 15(x − 1)(x − 3) + 15.5(x − 1)(x − 2) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 45. Example Thus 3x2 + x + 1 (x − 1)(x − 2)(x − 3) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 46. Example Thus 3x2 + x + 1 (x − 1)(x − 2)(x − 3) = 2.5(x − 2)(x − 3) − 15(x − 1)(x − 3) + 15.5(x − 1)(x − 2) (x − 1)(x − 2)(x − 3) = 2.5 (x − 1) - 15 (x − 2) + 15.5 (x − 3) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 47. Error in Interpolation Error in Interpolation: We assume that f(x) has continuous derivatives of order upto n + 1 for all x ∈ (a, b). Since, f(x) is approximated by Pn(x), the results contains errors. We define the error of interpolation or truncation error as Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 48. Error in Interpolation Error in Interpolation: We assume that f(x) has continuous derivatives of order upto n + 1 for all x ∈ (a, b). Since, f(x) is approximated by Pn(x), the results contains errors. We define the error of interpolation or truncation error as E(f, x) = f(x) − Pn(x) = (x − x0)(x − x1) . . . (x − xn) (n + 1)! f(n+1)(ξ) where min(x0, x1, . . . , xn, x) < ξ < min(x0, x1, . . . , xn, x) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 49. Error in Interpolation Error in Interpolation: We assume that f(x) has continuous derivatives of order upto n + 1 for all x ∈ (a, b). Since, f(x) is approximated by Pn(x), the results contains errors. We define the error of interpolation or truncation error as E(f, x) = f(x) − Pn(x) = (x − x0)(x − x1) . . . (x − xn) (n + 1)! f(n+1)(ξ) where min(x0, x1, . . . , xn, x) < ξ < min(x0, x1, . . . , xn, x) since, ξ is an unknown, it is difficult to find the value of error. However, we can find a bound of the error. The bound of the error is obtained as Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 50. Error in Interpolation Error in Interpolation: We assume that f(x) has continuous derivatives of order upto n + 1 for all x ∈ (a, b). Since, f(x) is approximated by Pn(x), the results contains errors. We define the error of interpolation or truncation error as E(f, x) = f(x) − Pn(x) = (x − x0)(x − x1) . . . (x − xn) (n + 1)! f(n+1)(ξ) where min(x0, x1, . . . , xn, x) < ξ < min(x0, x1, . . . , xn, x) since, ξ is an unknown, it is difficult to find the value of error. However, we can find a bound of the error. The bound of the error is obtained as |E(f, x)| ≤ |(x − x0)(x − x1) . . . (x − xn)| (n + 1)! max a≤ξ≤b |f(n+1)(ξ)| Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 51. Example Ex. Using the data sin(0.1) = 0.09983 and sin(0.2) = 0.19867, find an approximate value of sin(0.15) by Lagrange interpolation. Obtain a bound on the error at x = 0.15. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 52. Lagrange’s Interpolation Disadvantages: In practice, we often do not know the degree of the interpolation polynomial that will give the required accuracy, so we should be prepared to increase the degree if necessary. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 53. Lagrange’s Interpolation Disadvantages: In practice, we often do not know the degree of the interpolation polynomial that will give the required accuracy, so we should be prepared to increase the degree if necessary. To increase the degree the addition of another interpolation point leads to re-computation. i.e. no previous work is useful. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 54. Lagrange’s Interpolation Disadvantages: In practice, we often do not know the degree of the interpolation polynomial that will give the required accuracy, so we should be prepared to increase the degree if necessary. To increase the degree the addition of another interpolation point leads to re-computation. i.e. no previous work is useful. E.g: In calculating Pk(x), no obvious advantage can be taken of the fact that one already has calculated Pk−1(x). Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 55. Lagrange’s Interpolation Disadvantages: In practice, we often do not know the degree of the interpolation polynomial that will give the required accuracy, so we should be prepared to increase the degree if necessary. To increase the degree the addition of another interpolation point leads to re-computation. i.e. no previous work is useful. E.g: In calculating Pk(x), no obvious advantage can be taken of the fact that one already has calculated Pk−1(x). That means we need to calculate entirely new polynomial. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 56. Divided Difference Let f(x0), f(x1), . . . , f(xn) be the values of a function f corresponding to the arguments x0, x1, . . . , xn where the intervals x1 − x0, x2 − x1, . . . , xn − xn−1 are not necessarily equally spaced. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 57. Divided Difference Let f(x0), f(x1), . . . , f(xn) be the values of a function f corresponding to the arguments x0, x1, . . . , xn where the intervals x1 − x0, x2 − x1, . . . , xn − xn−1 are not necessarily equally spaced. Then the first divided difference of f for the arguments x0, x1, . . . , xn are defined by , Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 58. Divided Difference Let f(x0), f(x1), . . . , f(xn) be the values of a function f corresponding to the arguments x0, x1, . . . , xn where the intervals x1 − x0, x2 − x1, . . . , xn − xn−1 are not necessarily equally spaced. Then the first divided difference of f for the arguments x0, x1, . . . , xn are defined by , f(x0, x1) = f(x1) − f(x0) x1 − x0 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 59. Divided Difference Let f(x0), f(x1), . . . , f(xn) be the values of a function f corresponding to the arguments x0, x1, . . . , xn where the intervals x1 − x0, x2 − x1, . . . , xn − xn−1 are not necessarily equally spaced. Then the first divided difference of f for the arguments x0, x1, . . . , xn are defined by , f(x0, x1) = f(x1) − f(x0) x1 − x0 f(x1, x2) = f(x2) − f(x1) x2 − x1 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 60. Divided Difference The second divided difference of f for three arguments x0, x1, x2 is defined by f(x0, x1, x2) = f(x1, x2) − f(x0, x1) x2 − x0 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 61. Divided Difference The second divided difference of f for three arguments x0, x1, x2 is defined by f(x0, x1, x2) = f(x1, x2) − f(x0, x1) x2 − x0 and similarly the divided difference of order n is defined by f(x0, x1, . . . , xn) = f(x1, x2, . . . , xn) − f(x0, x1, . . . , xn−1) xn − x0 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 62. Divided Difference Properties: The divided differences are symmetrical in all their arguments; that is, the value of any divided difference is independent of the order of the arguments. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 63. Divided Difference Properties: The divided differences are symmetrical in all their arguments; that is, the value of any divided difference is independent of the order of the arguments. The divided difference operator is linear. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 64. Divided Difference Properties: The divided differences are symmetrical in all their arguments; that is, the value of any divided difference is independent of the order of the arguments. The divided difference operator is linear. The nth order divided differences of a polynomial of degree n are constant, equal to the coefficient of xn. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 65. Newton’s Divided Difference Interpolation An interpolation formula which has the property that a polynomial of higher degree may be derived from it by simply adding new terms. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 66. Newton’s Divided Difference Interpolation An interpolation formula which has the property that a polynomial of higher degree may be derived from it by simply adding new terms. Newton’s general interpolation formula is one such formula and terms in it are called divided differences. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 67. Newton’s Divided Difference Interpolation An interpolation formula which has the property that a polynomial of higher degree may be derived from it by simply adding new terms. Newton’s general interpolation formula is one such formula and terms in it are called divided differences. Let f(x0), f(x1), . . . , f(xn) be the values of a function f corresponding to the arguments x0, x1, . . . , xn where the intervals x1 − x0, x2 − x1, . . . , xn − xn−1 are not necessarily equally spaced. By the definition of divided difference, Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 68. Newton’s Divided Difference Interpolation An interpolation formula which has the property that a polynomial of higher degree may be derived from it by simply adding new terms. Newton’s general interpolation formula is one such formula and terms in it are called divided differences. Let f(x0), f(x1), . . . , f(xn) be the values of a function f corresponding to the arguments x0, x1, . . . , xn where the intervals x1 − x0, x2 − x1, . . . , xn − xn−1 are not necessarily equally spaced. By the definition of divided difference, f(x, x0) = f(x) − f(x0) x − x0 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 69. Newton’s Divided Difference Interpolation An interpolation formula which has the property that a polynomial of higher degree may be derived from it by simply adding new terms. Newton’s general interpolation formula is one such formula and terms in it are called divided differences. Let f(x0), f(x1), . . . , f(xn) be the values of a function f corresponding to the arguments x0, x1, . . . , xn where the intervals x1 − x0, x2 − x1, . . . , xn − xn−1 are not necessarily equally spaced. By the definition of divided difference, f(x, x0) = f(x) − f(x0) x − x0 ∴ f(x) = f(x0) + (x − x0)f(x, x0) − −(1) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 70. Newton’s Divided Difference Interpolation Further f(x, x0, x1) = f(x, x0) − f(x0, x1) x − x1 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 71. Newton’s Divided Difference Interpolation Further f(x, x0, x1) = f(x, x0) − f(x0, x1) x − x1 which yields f(x, x0) = f(x0, x1) + (x − x1)f(x, x0, x1) − −(2) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 72. Newton’s Divided Difference Interpolation Further f(x, x0, x1) = f(x, x0) − f(x0, x1) x − x1 which yields f(x, x0) = f(x0, x1) + (x − x1)f(x, x0, x1) − −(2) Similarly f(x, x0, x1) = f(x0, x1, x2) + (x − x2)f(x, x0, x1, x2) − −(3) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 73. Newton’s Divided Difference Interpolation Further f(x, x0, x1) = f(x, x0) − f(x0, x1) x − x1 which yields f(x, x0) = f(x0, x1) + (x − x1)f(x, x0, x1) − −(2) Similarly f(x, x0, x1) = f(x0, x1, x2) + (x − x2)f(x, x0, x1, x2) − −(3) and in general f(x, x0, ..., xn−1) = f(x0, x1, ..., xn) + (x − xn)f(x, x0, x1, ..., xn) − −(4) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 74. Newton’s Divided Difference Interpolation multiplying equation (2) by (x − x0) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 75. Newton’s Divided Difference Interpolation multiplying equation (2) by (x − x0) , (3) by (x − x0) (x − x1) and so on, Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 76. Newton’s Divided Difference Interpolation multiplying equation (2) by (x − x0) , (3) by (x − x0) (x − x1) and so on, and finally the last term (4) by (x − x0) (x − x1) ... (x − xn−1) and Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 77. Newton’s Divided Difference Interpolation multiplying equation (2) by (x − x0) , (3) by (x − x0) (x − x1) and so on, and finally the last term (4) by (x − x0) (x − x1) ... (x − xn−1) and adding (1), (2) , (3) up to (4) we obtain Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 78. Newton’s Divided Difference Interpolation multiplying equation (2) by (x − x0) , (3) by (x − x0) (x − x1) and so on, and finally the last term (4) by (x − x0) (x − x1) ... (x − xn−1) and adding (1), (2) , (3) up to (4) we obtain f(x) = f (x0) + (x − x0) f (x0, x1) + (x − x0) (x − x1) f (x0, x1, x2) + ... + (x − x0) (x − x1) ... (x − xn−1) f (x0, x1, ..., xn) This formula is called Newton’s divided difference formula. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 79. Newton’s Divided Difference Interpolation The divided difference upto third order x y 1stdiv.diff. 2nddiv.diff. 3rddiv.diff. x0 y0 [x0, x1] x1 y1 [x0, x1, x2] [x1, x2] [x0, x1, x2, x3] x2 y2 [x1, x2, x3] [x2, x3] x3 y3 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 80. Example Ex. Obtain the divided difference table for the data: x -1 0 2 3 y -8 3 1 12 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 81. Example Sol. We have the following divided difference table for the data: x y First d.d Second d.d Third d.d -1 -8 3 + 8 0 + 1 = 11 0 3 −1 − 11 2 + 1 = −4 1 − 3 2 − 0 = −1 4 + 4 3 + 1 = 2 2 1 11 + 1 3 − 0 = 4 12 − 1 3 − 2 = 11 3 12 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 82. Example Ex. Find f(x) as a polynomial in x for the following data by Newtons divided difference formula: x -4 -1 0 2 5 f(x) 1245 33 5 9 1335 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 83. Example Sol. We have the following divided difference table for the data: x y 1st d.d 2nd d.d 3rd d.d 4th d.d -4 1245 −404 -1 33 94 −28 −14 0 5 10 3 2 13 2 9 88 442 5 1335 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 84. Example The Newtons divided difference formula gives: Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 85. Example The Newtons divided difference formula gives: f(x) = f(x0) + Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 86. Example The Newtons divided difference formula gives: f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2] Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 87. Example The Newtons divided difference formula gives: f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2] + Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 88. Example The Newtons divided difference formula gives: f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2] + (x − x0)(x − x1)(x − x2)f[x0, x1, x2, x3] Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 89. Example The Newtons divided difference formula gives: f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2] + (x − x0)(x − x1)(x − x2)f[x0, x1, x2, x3] + Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 90. Example The Newtons divided difference formula gives: f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2] + (x − x0)(x − x1)(x − x2)f[x0, x1, x2, x3] + (x − x0)(x − x1)(x − x2)(x − x3)f[x0, x1, x2, x3, x4] Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 91. Example The Newtons divided difference formula gives: f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2] + (x − x0)(x − x1)(x − x2)f[x0, x1, x2, x3] + (x − x0)(x − x1)(x − x2)(x − x3)f[x0, x1, x2, x3, x4] = ... = 3x4 − 5x3 + 6x2 − 14x + 5 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 92. Example Ex. Find f(x) as a polynomial in x for the following data by Newtons divided difference formula: x -2 -1 0 1 3 4 f(x) 9 16 17 18 44 81 Hence, interpolate at x = 0.5 and x = 3.1. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 93. Example Sol. We form the divided difference table for the given data. x f(x) 1st d.d 2nd d.d 3rd d.d 4th d.d −2 9 7 −1 16 −3 1 1 0 17 0 0 1 1 1 18 4 0 13 1 3 44 8 37 4 81 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 94. Example Since, the fourth order differences are zeros, the data represents a third degree polynomial. Newtons divided difference formula gives the polynomial as f(x) = f(x0) + Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 95. Example Since, the fourth order differences are zeros, the data represents a third degree polynomial. Newtons divided difference formula gives the polynomial as f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2] Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 96. Example Since, the fourth order differences are zeros, the data represents a third degree polynomial. Newtons divided difference formula gives the polynomial as f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2] + Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 97. Example Since, the fourth order differences are zeros, the data represents a third degree polynomial. Newtons divided difference formula gives the polynomial as f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2] + (x − x0)(x − x1)(x − x2)f[x0, x1, x2, x3] Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 98. Example Since, the fourth order differences are zeros, the data represents a third degree polynomial. Newtons divided difference formula gives the polynomial as f(x) = f(x0) + (x − x0)f[x0, x1] + (x − x0)(x − x1)f[x0, x1, x2] + (x − x0)(x − x1)(x − x2)f[x0, x1, x2, x3] = ... = x3 + 17 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 99. Example Ex. Find the missing term in the following table: x 0 1 2 3 4 y 1 3 9 - 81 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 100. Example Sol. Divided difference table: Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 101. Example Sol. Divided difference table: By Newton’s divided difference formula f(x) = f (x0) + (x − x0) f (x0, x1) + (x − x0) (x − x1) f (x0, x1, x2) + ... Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 102. Spline Interpolation Spline interpolation is a form of interpolation where the interpolant is a special type of piecewise polynomial called a spline Consider the problem of interpolating between the data points (x0, y0), (x1, y1), . . . , (xn, yn) by means of spline fitting. Then the cubic spline f(x) is such that (i) f(x) is a linear polynomial outside the interval (x0, xn) (ii) f(x) is a cubic polynomial in each of the subintervals, (iii) f (x) and f (x) are continuous at each point. Since f(x) is cubic in each of the subintervals f (x) shall be linear. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 103. Spline Interpolation f(x) = (xi+1 − x)3Mi 6h + Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 104. Spline Interpolation f(x) = (xi+1 − x)3Mi 6h + (x − xi)3Mi+1 6h Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 105. Spline Interpolation f(x) = (xi+1 − x)3Mi 6h + (x − xi)3Mi+1 6h + (xi+1 − x) h yi − h2 6 Mi + Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 106. Spline Interpolation f(x) = (xi+1 − x)3Mi 6h + (x − xi)3Mi+1 6h + (xi+1 − x) h yi − h2 6 Mi + (x − xi) h yi+1 − h2 6 Mi+1 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 107. Spline Interpolation f(x) = (xi+1 − x)3Mi 6h + (x − xi)3Mi+1 6h + (xi+1 − x) h yi − h2 6 Mi + (x − xi) h yi+1 − h2 6 Mi+1 where Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 108. Spline Interpolation f(x) = (xi+1 − x)3Mi 6h + (x − xi)3Mi+1 6h + (xi+1 − x) h yi − h2 6 Mi + (x − xi) h yi+1 − h2 6 Mi+1 where Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2, 3, ..., (n − 1) and M0 = 0, Mn = 0, xi+1 − xi = h. which gives n + 1 equations in n + 1 unknowns Mi(i = 0, 1, ..., n) which can be solved. Substituting the value of Mi gives the concerned cubic spline. Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 109. Example Ex. Obtain cubic spline for the following data: x 0 1 2 3 y 2 -6 -8 2 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 110. Example Sol. Since points are equispaced with h = 1 and n = 3, Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 111. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 112. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 113. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 114. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 36; —(1) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 115. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 36; —(1) for i = 2, Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 116. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 36; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 117. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 36; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 72 —(2) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 118. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 36; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 72 —(2) solving these, we get Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 119. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 36; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 72 —(2) solving these, we get M1 = Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 120. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 36; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 72 —(2) solving these, we get M1 =4.8 and M2 = Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 121. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 36; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 72 —(2) solving these, we get M1 =4.8 and M2 =16.8 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 122. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 36; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 72 —(2) solving these, we get M1 =4.8 and M2 =16.8 Now the cubic spline in (xi ≤ x ≤ xi+1) is Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 123. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 36; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 72 —(2) solving these, we get M1 =4.8 and M2 =16.8 Now the cubic spline in (xi ≤ x ≤ xi+1) is f(x) = (xi+1 − x)3Mi 6h + Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 124. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 36; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 72 —(2) solving these, we get M1 =4.8 and M2 =16.8 Now the cubic spline in (xi ≤ x ≤ xi+1) is f(x) = (xi+1 − x)3Mi 6h + (x − xi)3Mi+1 6h Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 125. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 36; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 72 —(2) solving these, we get M1 =4.8 and M2 =16.8 Now the cubic spline in (xi ≤ x ≤ xi+1) is f(x) = (xi+1 − x)3Mi 6h + (x − xi)3Mi+1 6h + (xi+1 − x) h yi − h2 6 Mi + Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 126. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 36; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 72 —(2) solving these, we get M1 =4.8 and M2 =16.8 Now the cubic spline in (xi ≤ x ≤ xi+1) is f(x) = (xi+1 − x)3Mi 6h + (x − xi)3Mi+1 6h + (xi+1 − x) h yi − h2 6 Mi + (x − xi) h yi+1 − h2 6 Mi+1 —(3) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 127. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 36; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 72 —(2) solving these, we get M1 =4.8 and M2 =16.8 Now the cubic spline in (xi ≤ x ≤ xi+1) is f(x) = (xi+1 − x)3Mi 6h + (x − xi)3Mi+1 6h + (xi+1 − x) h yi − h2 6 Mi + (x − xi) h yi+1 − h2 6 Mi+1 —(3) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 128. Example Ex. The following values of x and y are given: x 1 2 3 4 y 1 2 5 11 Find the cubic splines and evaluate y(1.5) and y (3) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 129. Example Sol. Since points are equispaced with h = 1 and n = 3, Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 130. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 131. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 132. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 133. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 12; —(1) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 134. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 12; —(1) for i = 2, Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 135. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 12; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 136. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 12; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 18 —(2) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 137. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 12; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 18 —(2) solving these, we get Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 138. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 12; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 18 —(2) solving these, we get M1 = Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 139. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 12; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 18 —(2) solving these, we get M1 =2 and M2 = Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 140. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 12; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 18 —(2) solving these, we get M1 =2 and M2 =4 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 141. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 12; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 18 —(2) solving these, we get M1 =2 and M2 =4 Now the cubic spline in (xi ≤ x ≤ xi+1) is Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 142. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 12; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 18 —(2) solving these, we get M1 =2 and M2 =4 Now the cubic spline in (xi ≤ x ≤ xi+1) is f(x) = (xi+1 − x)3Mi 6h + Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 143. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 12; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 18 —(2) solving these, we get M1 =2 and M2 =4 Now the cubic spline in (xi ≤ x ≤ xi+1) is f(x) = (xi+1 − x)3Mi 6h + (x − xi)3Mi+1 6h Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 144. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 12; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 18 —(2) solving these, we get M1 =2 and M2 =4 Now the cubic spline in (xi ≤ x ≤ xi+1) is f(x) = (xi+1 − x)3Mi 6h + (x − xi)3Mi+1 6h + (xi+1 − x) h yi − h2 6 Mi + Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 145. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 12; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 18 —(2) solving these, we get M1 =2 and M2 =4 Now the cubic spline in (xi ≤ x ≤ xi+1) is f(x) = (xi+1 − x)3Mi 6h + (x − xi)3Mi+1 6h + (xi+1 − x) h yi − h2 6 Mi + (x − xi) h yi+1 − h2 6 Mi+1 —(3) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 146. Example Sol. Since points are equispaced with h = 1 and n = 3, the cubic spline can be determined from Mi−1 + 4Mi + Mi+1 = 6 h2 (yi−1 − 2yi + yi+1), i = 1, 2 also M0 = 0 , M3 = 0 ∴ for i = 1, M0 + 4M1 + M2 = 6(y0 − 2y1 + y2) therefore, 4M1 + M2 = 12; —(1) for i = 2, M1 + 4M2 + M3 = 6(y1 − 2y2 + y3) M1 + 4M2 = 18 —(2) solving these, we get M1 =2 and M2 =4 Now the cubic spline in (xi ≤ x ≤ xi+1) is f(x) = (xi+1 − x)3Mi 6h + (x − xi)3Mi+1 6h + (xi+1 − x) h yi − h2 6 Mi + (x − xi) h yi+1 − h2 6 Mi+1 —(3) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 147. Example Ex. Find whether the following functions are cubic splines ? 1. f(x) = 5x3 − 3x2, −1 ≤ x ≤ 0 = −5x3 − 3x2, 0 ≤ x ≤ 1 2. f(x) = −2x3 − x2, −1 ≤ x ≤ 0 = 2x3 + 3x2, 0 ≤ x ≤ 1 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 148. Example Sol. In both the examples, f(x) is a cubic polynomial in both intervals (1, 0) and (0, 1). 1. We have lim x→0+ f(x) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 149. Example Sol. In both the examples, f(x) is a cubic polynomial in both intervals (1, 0) and (0, 1). 1. We have lim x→0+ f(x) = 0 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 150. Example Sol. In both the examples, f(x) is a cubic polynomial in both intervals (1, 0) and (0, 1). 1. We have lim x→0+ f(x) = 0 = lim x→0− f(x) therefore, given function f(x) is continuous on (−1, 1). Now f (x) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 151. Example Sol. In both the examples, f(x) is a cubic polynomial in both intervals (1, 0) and (0, 1). 1. We have lim x→0+ f(x) = 0 = lim x→0− f(x) therefore, given function f(x) is continuous on (−1, 1). Now f (x) = 15x2 − 6x, −1 ≤ x ≤ 0 = −15x2 − 6x, 0 ≤ x ≤ 1 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 152. Example Sol. In both the examples, f(x) is a cubic polynomial in both intervals (1, 0) and (0, 1). 1. We have lim x→0+ f(x) = 0 = lim x→0− f(x) therefore, given function f(x) is continuous on (−1, 1). Now f (x) = 15x2 − 6x, −1 ≤ x ≤ 0 = −15x2 − 6x, 0 ≤ x ≤ 1 we have, lim x→0+ f (x) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 153. Example Sol. In both the examples, f(x) is a cubic polynomial in both intervals (1, 0) and (0, 1). 1. We have lim x→0+ f(x) = 0 = lim x→0− f(x) therefore, given function f(x) is continuous on (−1, 1). Now f (x) = 15x2 − 6x, −1 ≤ x ≤ 0 = −15x2 − 6x, 0 ≤ x ≤ 1 we have, lim x→0+ f (x) = 0 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 154. Example Sol. In both the examples, f(x) is a cubic polynomial in both intervals (1, 0) and (0, 1). 1. We have lim x→0+ f(x) = 0 = lim x→0− f(x) therefore, given function f(x) is continuous on (−1, 1). Now f (x) = 15x2 − 6x, −1 ≤ x ≤ 0 = −15x2 − 6x, 0 ≤ x ≤ 1 we have, lim x→0+ f (x) = 0 = lim x→0− f (x) therefore, the function f (x) is continuous on (−1, 1). f (x) Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 155. Example Sol. In both the examples, f(x) is a cubic polynomial in both intervals (1, 0) and (0, 1). 1. We have lim x→0+ f(x) = 0 = lim x→0− f(x) therefore, given function f(x) is continuous on (−1, 1). Now f (x) = 15x2 − 6x, −1 ≤ x ≤ 0 = −15x2 − 6x, 0 ≤ x ≤ 1 we have, lim x→0+ f (x) = 0 = lim x→0− f (x) therefore, the function f (x) is continuous on (−1, 1). f (x) = 30x−6, −1 ≤ x ≤ 0 = −30x − 6, 0 ≤ x ≤ 1 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals
  • 156. Example Sol. In both the examples, f(x) is a cubic polynomial in both intervals (1, 0) and (0, 1). 1. We have lim x→0+ f(x) = 0 = lim x→0− f(x) therefore, given function f(x) is continuous on (−1, 1). Now f (x) = 15x2 − 6x, −1 ≤ x ≤ 0 = −15x2 − 6x, 0 ≤ x ≤ 1 we have, lim x→0+ f (x) = 0 = lim x→0− f (x) therefore, the function f (x) is continuous on (−1, 1). f (x) = 30x−6, −1 ≤ x ≤ 0 = −30x − 6, 0 ≤ x ≤ 1 Dr. N. B. Vyas Numerical Methods - Interpolation Unequal Intervals