Académique Documents
Professionnel Documents
Culture Documents
Week
Date
Topic
Classification of Topic
9 Feb. 2010
Introduction to
Numerical Methods
and Type of Errors
14 Feb. 2010
Nonlinear Equations
Bisection Method
21 Feb. 2010
28 Feb. 2010
7 March 2010
Least squares
Gaussian Jordan
11 April 2010
Gaussian Seidel
10
18 April 2010
Integration
11
25 April 2010
Ordinary Differential
Equations
Euler's Method
12
2 May2010
Newton-Raphson Method
Interpolation
Equations
Lagrange Interpolation
Interpolation
Newtons Divided Difference
What is Interpolation ?
Given (x0,y0), (x1,y1), (xn,yn), find the
value of y at a value of x that is not given.
Interpolants
Polynomials are the most common
choice of interpolants because they
are easy to:
Evaluate
Differentiate, and
Integrate.
x x o x1 x o
x xo
or y-yo ( y1 yo )
x1 xo
( y1 yo )
y yo
( x xo )
( x1 xo )
f ( x1) f ( x o )
f1( x ) f ( x o )
(x xo )
( x1 x o )
f 1 ( x) b0 b1 ( x x0 )
b0 f ( x0 )
f ( x1 ) f ( x0 )
b1
x1 x0
where
Example
The upward velocity of a rocket is given as a function of
time in Table 1. Find the velocity at t=16 seconds using
the Newton Divided Difference method for linear
interpolation.
v(t)
m/s
10
227.04
15
362.78
20
517.35
22.5
602.97
30
901.67
Table 1: Velocity as a
function of time
Linear Interpolation
517.35
v1(t ) b0 b1(t t 0 )
t 0 15, v(t 0 ) 362.78
500
ys
f ( range)
517.35 362.78
20 15
450
f x desired
400
b0 v (t 0 ) 362.78
v(t1 ) v(t 0 )
b1
t1 t 0
550
362.78
350
10
12
x s 10
0
30.914
14
16
18
x s range x desired
20
22
24
x s 10
1
550
500
ys
f ( range)
450
f x desired
400
362.78
350
10
12
14
v1(t ) b0 b1(t t 0 )
x s 10
0
16
18
20
x s range x desired
393.69 m/s
22
24
x s 10
1
Quadratic Interpolation
Given ( x 0 , y 0 ), ( x1 , y1 ), and ( x 2 , y 2 ),
fit a quadratic interpolant through the data.
f 2 ( x) b0 b1 ( x x0 ) b2 ( x x0 )( x x1 )
b0 f ( x 0 )
f ( x1 ) f ( x0 )
b1
x1 x0
f ( x 2 ) f ( x1 ) f ( x1 ) f ( x0 )
x 2 x1
x1 x0
b2
x 2 x0
Example
The upward velocity of a rocket is given as a function of
time in Table 1. Find the velocity at t=16 seconds using
the Newton Divided Difference method for quadratic
interpolation.
t
v(t)
m/s
10
227.04
15
362.78
20
517.35
22.5
602.97
30
901.67
Table 1: Velocity as a
function of time
550
500
450
ys
400
f ( range)
f x desired
350
300
250
227.04
200
10
10
12
14
16
x s range x desired
18
20
20
t1 t 0
15 10
27.148
t 2 t1
t1 t 0
b2
t 2 t0
30.914 27.148
10
0.37660
20 15
15 10
20 10
10 t 20
At t 16,
= 0.38502 %
General Form
f 2 ( x) b0 b1 ( x x0 ) b2 ( x x0 )( x x1 )
where
b0 f [ x0 ] f ( x0 )
b1 f [ x1 , x0 ]
f ( x1 ) f ( x 0 )
x1 x0
f ( x 2 ) f ( x1 ) f ( x1 ) f ( x0 )
f [ x 2 , x1 ] f [ x1 , x0 ]
x 2 x1
x1 x0
b2 f [ x 2 , x1 , x0 ]
x 2 x0
x 2 x0
Rewriting
f 2 ( x) f [ x0 ] f [ x1 , x0 ]( x x0 ) f [ x 2 , x1 , x0 ]( x x0 )( x x1 )
General Form
Given (n 1) data points, x0 , y 0 , x1 , y1 ,......, x n 1 , y n 1 , x n , y n as
f n ( x) b0 b1 ( x x0 ) .... bn ( x x0 )( x x1 )...( x x n 1 )
where
b0 f [ x0 ]
b1 f [ x1 , x0 ]
b2 f [ x 2 , x1 , x0 ]
bn 1 f [ x n 1 , x n 2 ,...., x0 ]
bn f [ x n , x n 1 ,...., x0 ]
General form
The third order polynomial, given ( x 0 , y 0 ), ( x1 , y1 ), ( x 2 , y 2 ), and ( x3 , y 3 ), is
f ( x0 )
b1
f [ x1 , x0 ]
x1
b2
f [ x 2 , x1 , x0 ]
f ( x1 )
f [ x3 , x 2 , x1 , x 0 ]
f [ x2 , x1 ]
x2
f [ x3 , x 2 , x1 ]
f ( x2 )
f [ x3 , x 2 ]
x3
f ( x3 )
b3
Example
The upward velocity of a rocket is given as a function of
time in Table 1. Find the velocity at t=16 seconds using
the Newton Divided Difference method for cubic
interpolation.
t
v(t)
m/s
10
227.04
15
362.78
20
517.35
22.5
602.97
30
901.67
Table 1: Velocity as a
function of time
Example
The velocity profile is chosen as
v(t 0 ) 227.04
t1 15,
v(t1 ) 362.78
t 2 20,
v(t 2 ) 517.35
Example
b0
t0 10
b1
227.04
b2
27.148
t1 15,
362.78
5.4347x103
30.914
t2 20,
b3
0.37660
517.35
0.44453
34.248
t3 22.5,
602.97
Example
Hence
v (t ) b0 b1 (t t 0 ) b2 (t t 0 )( t t1 ) b3 (t t 0 )( t t1 )(t t 2 )
227.04 27.148( t 10) 0.37660(t 10)(t 15)
5.4347 * 10 3 (t 10)( t 15)( t 20)
At t 16,
v (16) 227.04 27.148(16 10) 0.37660(16 10)(16 15)
5.4347 * 10 3 (16 10)(16 15)(16 20)
392.06 m/s
= 0.033427 %
Comparison Table
Order of
Polynomial
v(t=16)
m/s
Absolute Relative
Approximate Error
393.69
392.19
392.06
----------
0.38502 %
0.033427 %