Lecture Slides AMM Week 4 - Interpolation - Tagged
Lecture Slides AMM Week 4 - Interpolation - Tagged
Methods
Anna Huber
Numerical Methods
Interpolation
Interpolation
• Estimation of intermediate values between precise
data points.
• The most common method is polynomial
interpolation
f ( x) a0 a1 x a2 x 2 an x n
5
Introduction
• Although there is one and only one nth-order
polynomial that fits n+1 points, there are a variety
of mathematical formats in which this polynomial
can be expressed:
– The Newton polynomial
– The Lagrange polynomial
– The standard form
f ( x) a0 a1 x a2 x 2 an x n
6
Newton’s Divided-Difference Interpolating
Polynomials
Linear Interpolation
• Is the simplest form of interpolation, connecting two data points
with a straight line. Slope and a
finite divided
f1 ( x) f ( x0 ) f ( x1 ) f ( x0 ) difference
x x0 x1 x0 approximation to
1st derivative
f ( x1 ) f ( x0 )
f1 ( x) f ( x0 ) ( x x0 ) Linear-interpolation
x1 x0 formula
1.5
y lnx
1.0
f(x) True value
0.5
Linear estimates
0.0
0 1 2 3 4 5 6 7
x
Newton’s Divided-Difference Interpolating Polynomials
Quadratic Interpolation
• If three data points are available, the
estimate is improved by introducing some
curvature into the line connecting the
points.
𝑥=𝑥2
Example 2
• Fit a second order polynomial to the points
x0 = 1 f(x0) = 0
x1 = 4 f(x1) = 1.3863
x2 = 6 f(x2) = 1.7918
• Estimate the natural log of 2 using quadratic
interpolation
Example 2
• Fit a second order polynomial to the points
x0 = 1 f(x0) = 0
x1 = 4 f(x1) = 1.3863
x2 = 6 f(x2) = 1.7918
• Estimate the natural log of 2 using quadratic
interpolation
2.0
1.5
y lnx
f(x) 1.0
True value
Quadratic estimate
0.5
Linear estimate
0.0
0 1 2 3 4 5 6 7
x
General Form of Newton’s Interpolating
Polynomials
where
and
16
Advantages of Newton’s Interpolating
Polynomials
n
f n ( x) Li ( x ) f ( xi )
i 0
n x xj
Li ( x)
j 0 xi x j
j i
Interpolating Polynomials
• The Lagrange polynomial and the Newton’s
polynomial are different formulations of the
same thing.
• Data points need not be equally spaced or
in ascending order
• Newton’s most useful for sequential
calculation
• Lagrange often used when the order of the
polynomial is known a priori
Coefficients of an Interpolating Polynomial
• Although both the Newton and Lagrange
polynomials are well suited for determining
intermediate values between points, they do not
provide a polynomial in conventional form:
2 n
f ( x) a0 a1 x a2 x a x x
• Since n+1 data points are required to determine n+1
coefficients, simultaneous linear systems of equations
can be used to calculate “a”s.
23
2 n
f ( x0 ) a0 a1 x0 a x a x
2 0 n 0
2 n
f ( x1 ) a0 a1 x1 a x a x
2 1 n 1
2 n
f ( xn ) a0 a1 xn a x a x
2 n n n
Where “x”s are the knowns and “a”s are the unknowns.
24
Summary
• Three ways of formulating the unique
nth-order polynomial that fits n+1 points.
• Theoretically all the same.
• Practically:
– Newton’s most useful for sequential
calculation
– Lagrange often used when the order of the
polynomial is known a priori
– Standard form only used if there is a
specific interest in the coefficients.
References
• Chapra, S. & Canale, R (2021).
Numerical Methods for Engineers (8th Edition)
. London: McGraw-Hill.
– Chapter 18 (18.1 – 18.3)
• https://nm.mathforcollege.com
– Interpolation
• 05.03 NEWTON DIVIDED DIFFERENCE METHOD
• 05.04 LAGRANGE METHOD
Feedback
Feedback
Opportunity