1. St. John's University of Tanzania
MAT210 NUMERICAL ANALYSIS
2013/14 Semester II
INTERPOLATION
Introduction and Direct Method
Kaw, Chapter 5.01-5.02
2. MAT210 2013/14 Sem II 2 of 15
● Interpolation
● Approximating data points within the range of a discrete set of known
data points (wikipedia)
● Example: Boiling point of water (BP)
– 102.3C@110kPa, 111.4C@150kPa
– BP@130kPa is about 1/2 way between, i.e. 106.8C
– Actually it is 107.1C, εt = 0.3%... not bad
● Interpolation of functions
● Approximating a complex or unknown function with a simpler function
– simpler function usually a polynomial
● sometimes use exponential or trigonometric functions
Introduction
3. MAT210 2013/14 Sem II 3 of 15
Some background
● Approximating a function is more useful than
approximating a value
● Why?
● Function yields value, but also any other value in the range
● Function can be
– Differentiated
– Integrated
– Used in advanced methods, such as solving differential equations
4. MAT210 2013/14 Sem II 4 of 15
Why a polynomial?
● Easy to evaluate
● Easy to differentiate
● Easy to integrate
● … and what is the Taylor Series?
A POLYNOMIAL!
f (x) = ∑
i=0
n
ai x
i
f ' (x) = ∑
i=1
n
i ai xi−1
∫ f (x)dx = ∑
i=0
n
ai x
i+1
i+1
+C
5. MAT210 2013/14 Sem II 5 of 15
Interpolation vs Extrapolation
● Interpolation approximating inside range
● Extrapolation is outside
● Interpolation
● Error can be bounded or approximated
● “Safe”
● Extrapolation
● “Dangerous”
● More on this later
6. MAT210 2013/14 Sem II 6 of 15
Methods
● Linear, quadratic, cubic functions (f)
● Rarely go beyond cubic (why?)
● Fitting a single f on the entire range
● Direct
● Newton Divided Difference
● Lagrangian
● Fitting multiple f on subsets of the range
● Splines
7. MAT210 2013/14 Sem II 7 of 15
Direct Method
● With n+1 points, fit an nth order polynomial
● 1st order: A line has two parameters, so there must be
two equations – two points – to find them both
● And so on
● The method is simply solving n+1 simultaneous
linear equations
● It is linear algebra, which you know
● If not, read Kaw, Chapter 4 for a refresher
8. MAT210 2013/14 Sem II 8 of 15
Thoughts on points and order
● It is not necessary to use all the points in a range to
determine the polynomial
● Choosing points and the order is a bit of an “art”
but looking at a graph of the data, or knowing
something about the underlying model of the
phenomena can help
● “A picture is worth a thousand words”
14. MAT210 2013/14 Sem II 14 of 15
Find a better v(16)
● Use t=10,15,20 (Why?)
15. MAT210 2013/14 Sem II 15 of 15
How much better?
● Use relative approximate error (Why?)
● The assumption is that quadratic is more accurate
than linear
|ϵa|=
|vquadratic−vlinear
vquadratic
|