0% found this document useful (0 votes)
4 views17 pages

Lecture 22

The document discusses Lagrange interpolation, detailing its formulation and application for evaluating functions based on given data points. It includes examples of using first and second order polynomials to estimate values, such as ln2 and temperature from resistance measurements. Additionally, it introduces spline interpolation methods, highlighting their advantages over higher-order polynomials for data fitting.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views17 pages

Lecture 22

The document discusses Lagrange interpolation, detailing its formulation and application for evaluating functions based on given data points. It includes examples of using first and second order polynomials to estimate values, such as ln2 and temperature from resistance measurements. Additionally, it introduces spline interpolation methods, highlighting their advantages over higher-order polynomials for data fitting.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 17

CHAPTER -18

Interpolation

Numerical Methods of Chemical Engineers


CHE F242
Lagrange Interpolation
The Lagrange interpolating polynomial is simply a reformulation of
the Newton polynomial that avoids the computation of divided
differences.
It can be represent concisely:

where ∏ designates ‘product of’


Lagrange Interpolation
The Lagrange interpolating polynomial is simply a reformulation of
the Newton polynomial that avoids the computation of divided
differences.
It can be represent concisely:

where ∏ designates ‘product of’


Problem
Use a Lagrange interpolating polynomial of the 1 st and 2nd
order to evaluate ln2 on the basis of the data given below.
x0=1, f(x0)=0, x1=4, f(x1)=1.386294, x2=6, f(x2)=1.791760
Solution:
Problem
Use a Lagrange interpolating polynomial of the 1 st and 2nd
order to evaluate ln2 on the basis of the data given below.
x0=1, f(x0)=0, x1=4, f(x1)=1.386294, x2=6, f(x2)=1.791760
Solution:
(i) 1st order Polynomial x=2,
(2  4) (2  1)
f1 (x)=f1 (2)= 0 1.386294 0.462098
(1  4) (4  1)
(ii) 2nd order Polynomial x=2,
(2  4)(2  6) (2  1)(2  6) (2  1)(2  4)
f 2 (x)=f 2 (2)= 0 1.386294  1.791760
(1  4)(1  6) (4  1)(4  6) (6  1)(6  4)
=0.565844
Problem
Use a Lagrange interpolating polynomial of the 1 st and 2nd
order to evaluate ln2 on the basis of the data given below.
x0=1, f(x0)=0, x1=4, f(x1)=1.386294, x2=6, f(x2)=1.791760
Solution:
(i) 1st order Polynomial x=2,
(2  4) (2  1)
f1 (x)=f1 (2)= 0 1.386294 0.462098
(1  4) (4  1)
(ii) 2nd order Polynomial x=2,
(2  4)(2  6) (2  1)(2  6) (2  1)(2  4)
f 2 (x)=f 2 (2)= 0 1.386294  1.791760
(1  4)(1  6) (4  1)(4  6) (6  1)(6  4)
=0.565844
Practice Problem
A manufacturer of thermistors makes the following observations on a
thermistor. Determine the temperature corresponding to 754.8 ohms
using the Lagrangian method for interpolation.
R T
Ohm C
1101.0 25.113
911.3 30.131
636.0 40.120
451.1 50.128
Practice Problem
A manufacturer of thermistors makes the following observations on a
thermistor. Determine the temperature corresponding to 754.8 ohms
using the Lagrangian method for interpolation.
Ro 1101.0, T Ro  25.113 R1 911.3, T R1  30.131
R T
Ohm C R2 636.0, T R2  40.120 R3 451.1, T R3  50.128

1101.0 25.113
911.3 30.131 3 R  Rj  R  R1   R  R2   R  R3 
L0 ( R )     
R0  R j  R0  R1   R0  R2  R  R 
 0 3 
636.0 40.120 j 0
j 0

451.1 50.128 3 R  Rj  R  R0   R  R2   R  R3 
L1 ( R)       
j 0 R1  R j  R1  R0   R1  R2   R1  R3 
j 1

3 R  Rj  R  R0   R  R1   R  R3 
L2 ( R )       
j 0 R 2  R j  R 2  R0   R2  R1   R2  R3 
j 2

3 R  Rj  R  R0   R  R1   R  R2 
L3 ( R )     
 R  R  R  R


j 0 R3  R j  R3  R0  3 1  3 2 
j 3
Practice Problem
Solution:
 R  R1   R  R2   R  R3   R  R0   R  R2   R  R3 
T ( R )      T ( R0 )       T ( R1 )
R
 0  R1   R0  R 2   R0  R3   R1  R0   R1  R2  1 R  R3 

 R  R0   R  R1   R  R3   R  R0   R  R1   R  R2 
      T ( R2 )       T ( R3 )
 R 2  R0   R2  R1   R2  R3   R3  R0  3 R  R1   R3  R 2 
(754.8  911.3)(754.8  636.0)(754.8  451.1)
T (754.8)  (25.113)
(1101.0  911.3)(1101.0  636.0)(1101.0  451.1)
(754.8  1101.0)(754.8  636.0)(754.8  451.1)
 (30.131)
(911.3  1101.0)(911.3  636.0)(911.3  451.1)
(754.8  1101.0)(754.8  911.3)(754.8  451.1)
 (40.120)
(636.0  1101.0)(636.0  911.3)(636.0  451.1)
(754.8  1101.0)(754.8  911.3)(754.8  636.0)
 (50.128)
(451.1  1101.0)( 451.1  911.3)( 451.1  636.0)
( 0.098494)( 25.113)  (0.51972)(30.131)  (0.69517 )(40.120 )  ( 0.11639 )(50.128 )

=35.242°C
Interpolation with Equally Spaced
Data
Or in general

• Newton’s Interpolation formula for equispaced data


points become:

• Newton’s Formula or Newton’s Gregory Forward


Formula

f n+1 (ξ) n+1


Rn = h α(α-1)(α-2)(α-3).......(α-n)
(n+1)!
Forward Difference Formula
Value of x Value of First Diff. Second Diff. 3rd Diff. 4th Diff. 5th Diff.
f(x)

xo f(x)o

xo + h f(x)1  f(x) o

2 f(x) o
xo + 2h f(x)2  f(x) 1 3 f(x) o
2 f(x) 1 4 f(x) o
xo + 3h f(x)3  f(x) 2 3 f(x) 1 5 f(x) o
2 f(x) 2 4 f(x) 1
 f(x) 3 3 f(x) 2
xo + 4h f(x)4
2 f(x) 3
 f(x) 4
xo + 5h f(x)5
Spline Interpolation
• An alternative approach to apply lower-order polynomials
to subsets of data points.
• Such connecting polynomials are called spline functions.
• For example, third-order curves employed to connect each
pair of data points are called cubic splines. These functions
can be constructed so that the connections between adjacent
cubic equations are visually smooth.

Splines are popular curves because of the simplicity of their


construction, their ease and accuracy of evaluation, and
their capacity to approximate complex shapes through curve
fitting and interactive curve design.
A Visual Representation of a Situation
where the Splines are Superior to Higher-
Order Interpolating Polynomials

(a), (b), (c) higher order polynomial interpolation. (d) Linear spline
interpolation
• Linear Spline
The primary disadvantage of first-order splines
is that they are not smooth. In essence, at the
data points where two splines meet (called a
knot), the slope changes abruptly. In formal
terms, the first derivative of the function is
discontinuous at these points.

• Quadratic Spline
Quadratic splines” have continuous first
derivatives at the knots. Although quadratic
splines do not ensure equal second derivatives
at the knots, they serve nicely to demonstrate
the general procedure for developing higher-
order splines.

• Cubic Spline
Third-order polynomials or cubic splines, that
ensure continuous first and second derivatives,
are most frequently used in practice.
Linear Splines
Linear Splines
Problem: Fit the data in the table with 1st order spline. Evaluate the
function at x=5.
Table: Data to be fit with spline Functions x f(x)
3.0 2.5
For the interval x=4.5 to 7, because x=5 lies
4.5 1.0
between these two values.
7.0 2.5

The slope can be computed as, 9.0 0.5

m=(2.5-1)/(7-4.5)=0.6
f(x)=f(x n-1 )+m x n-1 (x-x n-1 )=1.0+0.6(5-4.5)=1.3

You might also like