Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
able to:
Determine the approximate value of a
function at a certain number using
interpolating polynomials.
Approximate a function using Newton’s
divided-difference interpolating
polynomials.
Approximate a function using Lagrange
interpolating polynomials .
Use spline interpolation to find a
function that can approximate a group
of ordered data points.
DIRECT METHOD
OF INTERPOLATION
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
Integrate
Given ‘n+1’ data points
(x0, y0), (x1, y1), . . . , (xn, yn)
pass a polynomial of order ‘n’ through
the data.
Set up ‘n+1’ equations of the form
y a0 a1 x .......... .......... an x n
v 22.5 602 .97 a0 a1 22.5 a2 22.5 a3 22.5
2
3
Answer 3:
Solving for v(16)
vt 4.2540 21.266t 0.13204 t 2 0.0054347 t 3 , 10 t 22.5
t V(t)
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67
Comparison Table
Order of
1 2 3
Polynomial
vt 16 m/s 393.7 392.19 392.06
Absolute
Relative 0.38410 0.033269
----------
Approximate % %
Error
Example 4:
Find the distance covered by the
rocket from t=11s to t=16s ?
v t 4.2540 21.266t 0.13204t 2 0.0054347t 3 ,
10 t 22.5
Answer 4:
16
s16 s11 v t dt
11
a t v t
d
dt
d
dt
4.2540 21.266t 0.13204t 2 0.0054347t 3
21.289 0.26130t 0.016382t 2 , 10 t 22.5
a 16 21.266 0.26408 16 0.016304 16 2
29.665 m/s 2
Newton’s Divided Difference
Polynomial Method of Interpolation
Linear interpolation:
Given two points pass a linear
interpolant through the data
f1 ( x) b0 b1 ( x x0 )
where
f ( x1 ) f ( x0 )
b0 f ( x0 ) b1
x1 x0
Example 1:
The upward velocity of a t V(t)
rocket is given as a 0 0
function of time. 10 227.04
Find the velocity at t=16 15 362.78
seconds using 20 517.35
Newton Divided 22.5 602.97
Difference method for 30 901.67
linear interpolation.
Answer 1:
v(t ) b0 b1 (t t 0 )
362.78 30.914(t 15), 15 t 20
At t 16
v(16) 362.78 30.914(16 15)
393.69 m/s
Quadratic interpolation:
Given three points pass a quadratic
interpolant through the data
f 2 ( x ) b0 b1 ( x x0 ) b2 ( x x0 )( x x1 )
where f ( x1 ) f ( x0 )
b0 f ( x0 ) b1
x1 x0
f ( x2 ) f ( x1 ) f ( x1 ) f ( x0 )
x2 x1 x1 x0
b2
x 2 x0
Example 2:
The upward velocity of a t V(t)
rocket is given as a 0 0
function of time. 10 227.04
Find the velocity at t=16 15 362.78
seconds using 20 517.35
Newton Divided 22.5 602.97
Difference method for 30 901.67
quadratic interpolation.
Answer 2:
b0 v(t 0 )
227.04
v(t ) v(t 0 ) 362.78 227.04
b1 1
t1 t 0 15 10
27.148
where n x xj
Li ( x )
j 0 xi xj
ji
Example 1:
The upward velocity t V(t)
of a rocket is given 0 0
as a function of time
10 227.04
in Table 1.
15 362.78
Find the velocity at
t=16 seconds using 20 517.35
the Lagrangian 22.5 602.97
method for linear 30 901.67
interpolation.
Answer 1:
1
v(t ) Li (t )v(ti )
i 0
L0 (t )v (t 0 ) L1 (t )v (t1 )
Quadratic:
For the second order polynomial, we
have
Example 2:
The upward velocity of a
t V(t)
rocket is given as a
0 0
function of time in
Table 1. 10 227.04
15 362.78
Find the velocity at t=16
20 517.35
seconds using the
Lagrangian method for 22.5 602.97
quadratic interpolation. 30 901.67
Answer 2:
Answer 2:
t t1 t t 2 t t 0 t t 2 t t 0 t t1
v t
v t 0
v t1 v t 2
t0 t1 t 0 t 2 t1 t 0 t1 t 2 t 2 t 0 t 2 t1
16 15 16 20
v 16 227.04
10 15 10 20
16 10 16 20
362.78
15 10 15 20
16 10 16 15
517.35
20 10 20 15
0.08227.04 0.96362.78 0.12527.35
392.19 m/s
Cubic:
For the third order polynomial, we have
Example 3:
The upward velocity t V(t)
of a rocket is given
0 0
as a function of time
in Table 1. 10 227.04
15 362.78
Find the velocity at
t=16 seconds using 20 517.35
the Lagrangian 22.5 602.97
method for cubic 30 901.67
interpolation.
Answer 3:
Answer 3:
t t1 t t 2 t t 3 t t 0 t t 2 t t 3
v t v t 0 v t1
t 0 t1 t 0 t 2 t 0 t 3 t1 t 0 t1 t 2 t1 t 3
t t 0 t t1 t t 3 t t1 t t1 t t 2
v t 2 v t 3
t
2 0 2 1 2 3
t t t t t t t t
3 1 3 1 3 2
t t t
16 15 16 20 16 22.5 16 10 16 20 16 22.5
v 16 227.04 362.78
10 15 10 20 10 22.5 15 10 15 20 15 22. 5
16 10 16 15 16 22.5 16 10 16 15 16 20
517.35 602.97
20 10 20 15 20 22 .5 22.5 10 22 .5 15 22 .5 20
0.0416227.04 0.832362.78 0.312517.35 0.1024602.97
392.06 m/s
Comparison:
Order of
1 2 3
Polynomial
v(t=16) m/s 393.69 392.19 392.06
Absolute Relative
-------- 0.38410% 0.033269%
Approximate Error
Spline Method of Interpolation
Why Splines ?
1
f ( x)
1 25 x 2
1
Why Splines ? f ( x)
1 25 x 2
1.2
0.8
0.4
y
0
-1 -0.5 0 0.5 1
-0.4
-0.8
x
19th Order Polynomial f (x) 5th Order Polynomial
Given ‘n+1’ data points
(x0, y0), (x1, y1), . . . , (xn, yn)
fit linear splines to the data.
The linear splines are given by:
Given ‘n+1’ data points
(x0, y0), (x1, y1), . . . , (xn, yn)
fit quadratic splines to the data.
The quadratic splines are given by:
Each quadratic splines goes trough two
data points.
At the interior points.
This gives us ‘3n’ equations and ‘3n’
unknowns.
Once we find the ‘3n’ constants, we can
find the function value of ‘x’ using the
splines.
Example:
The upward velocity of a
rocket is given as a function t V(t)
of time. Using quadratic 0 0
splines 10 227.04
Find the velocity and the 15 362.78
acceleration at t=16
20 517.35
seconds.
22.5 602.97
Find the distance
covered between t=11 and 30 901.67
t=16 seconds.
Solution:
Set up the equations.
Solution:
Each spline goes through two
consecutive data points.
Each spline goes through two
consecutive data points.
Derivatives are continuous at interior
data points
Derivatives are continuous at interior
data points.
i ai bi ci
1 0 22.704 0
2 0.8888 4.928 88.88
3 −0.1356 35.66 −141.61
4 1.6048 −33.956 554.55
5 0.20889 28.86 −152.13
Final equations:
Velocity at t=16 s
v16 0.1356 16 35.6616 141 .61
2
0.8888t 0.1356t
15 16
2 2
4.928t 88.88 dt 35.66t 141.61 dt
11 15
1595.9 m
Numerical Methods Using Matlab, 4th Edition,
2004 by John H. Mathews and Kurtis K. Fink
Holistic Numerical Methods Institute by Autar
Kaw and Jai Pau.
Numerical Methods for Engineers by Chapra
and Canale
Systems of Nonlinear equations by Power
show.com