Lecture 22
Lecture 22
Interpolation
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
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.
(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
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