INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
IV. INTERPOLATION AND CURVE-FITTING
Subtopics:
4.1 Introduction
4.2 Finite Difference Operators
4.3 Interpolation with Equal Intervals
4.4 Interpolation with Unequal Intervals
4.5 Central Difference Interpolation
4.1 Interpolation
the technique of estimating the value of a function for any intermediate value of the
independent variable
denotes the method of computing the value of the function y = f (x) for any given value
of the independent variable x when a set of values of y = f (x) for certain values of x
are known or given
Interpolating function
If the function f (x) is known explicitly, then the value of y corresponding to any value
of x can easily be obtained
If the function f (x) is not known, then it is very hard to find the exact form of f (x)
with the tabulated values (xi, yi)
In such cases, the function f (x) can be replaced by a simpler function, say, φ (x),
which has the same values as f (x) for x0, x1, x2, …., xn.
The function φ (x) is called the interpolating or smoothing function and any other
value can be computed from φ (x)
Polynomial Interpolation
If φ (x) is a polynomial, then φ (x) is called the interpolating polynomial
The process of computing the intermediate values of y = f(x) is called the polynomial
interpolation
The following assumptions are made:
a) There are no sudden jumps in the values of the dependent variable for the period
under consideration
b) The rate of change of figures from one period to another is uniform.
4.2 Finite Difference Operators
Forward Differences
Backward Differences
Central Differences
a) Forward Differences
Simply difference operator is denoted by ∆
Defined as ∆f(x) = f(x + h) – f(x)
or writing in terms of y, at x = xi becomes:
∆f(xi)= f(xi + h) – f(xi)
or ∆yi = yi+1 – yi for i = 0, 1, 2, …., n – 1
Compiled by: Redin Jhon T. Carriedo, ECE Page 1 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
Second Differences
are the differences of the first differences
are denoted by ∆2𝑦0 , ∆2𝑦1 , . . . , ∆2𝑦𝑛
∆𝑛+1𝑦𝑖 = ∆𝑛𝑦𝑖+1 − ∆𝑛𝑦𝑖 , n = 0, 1, 2, . . .
where ∆0 ≡ 𝑖𝑑𝑒𝑛𝑡𝑖𝑡𝑦 𝑜𝑝𝑒𝑟𝑎𝑡𝑜𝑟 𝑖. 𝑒. , ∆0 𝑓(𝑥) = 𝑓(𝑥) 𝑎𝑛𝑑 ∆1= ∆
Example:
Construct the forward difference table for the following data:
b) Backward Differences
denoted by 𝛁
defined as: 𝛁 𝐟(𝐱) = 𝒇(𝒙) − 𝒇(𝒙 − 𝒉)
can be written as:
𝛁 𝒚𝒊 = 𝒚𝒊 − 𝒚𝒊−𝟏 , 𝒊 = 𝒏, 𝒏 − 𝟏,......., 𝟏
or 𝛁 𝒚𝟏 = 𝒚𝟏 − 𝒚𝟎 , 𝛁 𝒚𝟐 = 𝒚𝟐 − 𝒚𝟏 , . . . , 𝛁 𝒚𝒏 = 𝒚𝒏 − 𝒚𝒏−𝟏
Second Differences:
Compiled by: Redin Jhon T. Carriedo, ECE Page 2 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
Example:
Construct the backward difference table for the following data:
c) Central Differences
denoted by the symbol δ
defined by: δf(x) = f(x + h/2) – f(x – h/2)
where h is the interval of differencing
First central differences:
δy1/2 = y1 – y0,
δy3/2 = y2 – y1, …., δyn–
1/2 = yn – yn–1.
Second central differences:
Example:
Construct the central difference table for the following data:
Compiled by: Redin Jhon T. Carriedo, ECE Page 3 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
Compiled by: Redin Jhon T. Carriedo, ECE Page 4 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
Compiled by: Redin Jhon T. Carriedo, ECE Page 5 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
4.3 Interpolation with Equal Intervals
4.3.1 Missing Values
Let:
x0, x1, x2, …., xn are equally spaced values of the independent variable
where: xi = x0 + ih, i = 0, 1,..., n, where h is the spacing
y = f(x) such that y0, y1, y2, …., yn denote the corresponding values of the function
If one or more values of y = f (x) are missing, we can determine the missing values by
employing the relationship between the operators E and Δ
4.3.2 Newton’s Binomial Expansion
Newton’s Binomial Expansion Formula
Suppose y0, y1, y2, …., yn
- denote the values of y = f (x)
Let one of the values of y is missing since n values of the functions are known
In equation: Δny0 = 0
or using the shift operator, E:
(E – 1)ny0 = 0
Expanding (E – 1)ny0 = 0
[En – nC1En-1 + nC2En-2 + … + (-1)n] y0 = 0
which is quite useful in determining the missing values without actually constructing
the difference table
Compiled by: Redin Jhon T. Carriedo, ECE Page 6 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
Example 1:
Determine the missing entry in the following table.
Example 2:
Find the missing entry in the following table.
Compiled by: Redin Jhon T. Carriedo, ECE Page 7 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
Example 3:
Find the missing entries in the following table.
4.3.3 Newton’s Forward Interpolation
Newton’s Forward Interpolation Formula
used to interpolate the values of y near the beginning of a set of equally spaced tabular
values
where:
Example 1:
Given that √15500 = 124.4990 , √15510 = 124.5392 , √15520 = 124.5793 and
√15530 = 124.6194, find the value of √15516.
Compiled by: Redin Jhon T. Carriedo, ECE Page 8 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
Example 2:
The values of sin x are given below for different values of x. Find the value of sin 420.
Problem:
- Find y = e3x for x = 0.05 using the following table.
- A second degree polynomial passes through the points (1, - 1), (2, - 2), (3, - 1) and
(4, 2). Find the polynomial.
Compiled by: Redin Jhon T. Carriedo, ECE Page 9 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
4.3.4 Newton’s Backward Interpolation
used for interpolating values of y near the end of the tabulated values
also used for extrapolating values of y a little backward of yn
Example 1:
Calculate the value of f (84) for the data given in the table.
Example 2:
From the following table, estimate the no. of students who obtained marks in computer
programming between 75 and 80.
Compiled by: Redin Jhon T. Carriedo, ECE Page 10 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
Problem:
Use Newton’s backward interpolation formula to:
- Find y at x = 30 given the following table of values:
- Estimate the value of cos 580 from the following table:
4.3.5 Error in the Interpolation Formula
Error in the forward interpolation formula:
Error in the backward interpolation formula:
Example:
Using Newton’s forward interpolation formula find the value of cos 52º from the following data
and estimate the error.
Compiled by: Redin Jhon T. Carriedo, ECE Page 11 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
4.4 Interpolation with Unequal Intervals
4.4.1 Lagrange’s Formula for Unequal Intervals
Let y = f (x) be a real-valued continuous function defined in an interval [a, b]
Let x0, x1, x2, …, xn be (n + 1) distinct points
- which are not necessarily equally spaced
- corresponding values of the function are y0, y1, …, yn
y = f (x) is a polynomial in x of degree n
Lagrange’s Interpolation Formula
Compiled by: Redin Jhon T. Carriedo, ECE Page 12 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
Example 1:
Apply Lagrange’s interpolation formula to find a polynomial which passes through the points
(0, -20), (1, -12), (3, -20) and (4, -24).
Example 2:
Using Lagrange’s interpolation formula, find the value of y corresponding to x = 10 from the
following data.
Compiled by: Redin Jhon T. Carriedo, ECE Page 13 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
4.4.2 Lagrange’s Inverse Interpolation Formula
From Lagrange interpolation formula:
By interchanging x and y, x can be expressed as a function of y:
Example:
The following table gives the values of y corresponding to certain values of x. Find the value
of x when y = 297.
Compiled by: Redin Jhon T. Carriedo, ECE Page 14 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
4.5 Central Difference Interpolation
Central Differences Table
Central Differences Table using ∆
4.5.1 Besssel’s Formula
Bessel’s Interpolation Formula
Compiled by: Redin Jhon T. Carriedo, ECE Page 15 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
Example:
Apply Bessel’s interpolation formula to obtain y25, given that y20 = 2860, y24 = 3167,
y28 = 3555 and y32 = 4112.
4.5.2 Stirling’s Formula
Stirling’s Interpolation Formula
gives the most accurate result for - 0.25 ≤ u ≤ 0.25
hence, x0 should be selected such that u satisfies this inequality
Example 1:
Apply Stirling’s interpolation formula to obtain y25, given that y20 = 2860, y24 = 3167,
y28 = 3555 and y32 = 4112.
Compiled by: Redin Jhon T. Carriedo, ECE Page 16 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
Example 2:
Apply Stirling’s interpolation formula to obtain y28, given that y20 = 48234, y25 = 47354,
y30 = 46267, y35 = 44978 and y40 = 43389.
4.5.3 Laplace-Everett’s Formula
Laplace-Everett’s Interpolation Formula
uses only even differences of the function
Compiled by: Redin Jhon T. Carriedo, ECE Page 17 of 18
INTERPOLATION AND CURVE-FITTING MATH 19 – NUMERICAL SOLUTIONS TO CE PROBLEMS
Example:
Apply Everett’s interpolation formula to obtain y25 , given that y20 = 2860, y24 = 3167,
y28 = 3555 and y32 = 4112.
Selection of Interpolation Formula
a) Newton’s forward interpolation formula
- to find a tabulated value near the beginning of the table
b) Newton’s backward interpolation formula
- to find a value near the end of the table
c) Stirling or Bessel’s or Laplace-Everett’s
- to find an interpolated value near the center of the table
Exercise no. 4:
1. Using Lagrange’s interpolation formula, find the value of y corresponding to x = 8
from the following table:
2. Find the value of x when y = 420.61175 by applying Lagrange’s inverse interpolation
formula:
3. Apply Bessel’s, Stirling’s and Laplace-Everett’s formulas to find the value of f (12.2)
from the following data:
Compiled by: Redin Jhon T. Carriedo, ECE Page 18 of 18