0% found this document useful (0 votes)
11 views43 pages

Numerical Chap 4

The document describes the direct method of interpolation using polynomials. It explains that the direct method finds a polynomial that passes exactly through discrete data points by setting up equations for the polynomial's coefficients. Three examples are provided to illustrate linear, quadratic, and cubic interpolation using the direct method on velocity-time data from a rocket. The velocity value at t=16 seconds is found to be 393.7 m/s for linear interpolation, 392.19 m/s for quadratic interpolation, and the error between these results is 0.384%.

Uploaded by

minh hoang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views43 pages

Numerical Chap 4

The document describes the direct method of interpolation using polynomials. It explains that the direct method finds a polynomial that passes exactly through discrete data points by setting up equations for the polynomial's coefficients. Three examples are provided to illustrate linear, quadratic, and cubic interpolation using the direct method on velocity-time data from a rocket. The velocity value at t=16 seconds is found to be 393.7 m/s for linear interpolation, 392.19 m/s for quadratic interpolation, and the error between these results is 0.384%.

Uploaded by

minh hoang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

10/14/2021

Direct Method of
Interpolation

Son Dao, PhD © 1

What is Interpolation ?
Given (x0,y0), (x1,y1), …… (xn,yn), find the value of ‘y’ at a
value of ‘x’ that is not given.

Figure 1 Interpolation of discrete.


2

1
10/14/2021

Interpolants
Polynomials are the most common
choice of interpolants because they
are easy to:
Evaluate
Differentiate, and
Integrate

Direct Method
Given ‘n+1’ data points (x0,y0), (x1,y1),………….. (xn,yn),
pass a polynomial of order ‘n’ through the data as given
below:

y  a0  a1 x  ....................  an x n .
where a0, a1,………………. an are real constants.
 Set up ‘n+1’ equations to find ‘n+1’ constants.

 To find the value ‘y’ at a given value of ‘x’, simply


substitute the value of ‘x’ in the above polynomial.

2
10/14/2021

Example 1
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
direct method for linear interpolation.
Table 1 Velocity as a function
of time.

t , s  vt , m/s 
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67 Figure 2 Velocity vs. time data for the
rocket example
5

Linear Interpolation
vt   a0  a1t y

v 15  a 0  a1 15  362.78 x1 , y1 

v20   a 0  a1 20   517.35  x0 , y0 


f1  x 

Solving the above two equations gives, x

a0  100.93 a1  30.914 Figure 3 Linear interpolation.

Hence
vt   100.93  30.914t , 15  t  20.
v16  100.93  30.91416  393.7 m/s

3
10/14/2021

Example 2
The upward velocity of a rocket is given as a
function of time in Table 2.
Find the velocity at t=16 seconds using the
direct method for quadratic interpolation.
Table 2 Velocity as a function
of time.

t , s  vt , m/s 
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67 Figure 5 Velocity vs. time data for the
rocket example
7

The picture can't be display ed.

Quadratic Interpolation
y

vt   a0  a1t  a2t 2 x1 , y1 


v10  a0  a1 10  a2 10  227.04
2  x2 , y 2 

v15  a0  a1 15  a2 15  362.78


2

f2 x 
v20  a0  a120  a2 20  517.35
2
x 0 , y 0 
x

Figure 6 Quadratic interpolation.

Solving the above three equations gives


a0  12.05 a1  17.733 a2  0.3766
8

4
10/14/2021

Quadratic Interpolation (cont.)


550
517.35

v t   12 .05  17 .733t  0.3766 t 2 , 10  t  20


500

450

ys

v16   12.05  17.73316   0.376616 


400
2 f ( range)


f x desired  350

 392.19 m/s 300

250

227.04 200
10 12 14 16 18 20
10 x s  range x desired 20

The absolute relative approximate error a obtained between


the results from the first and second order polynomial is
392.19  393.70
a   100
392.19
 0.38410%
9

Example 3
The upward velocity of a rocket is given as a
function of time in Table 3.
Find the velocity at t=16 seconds using the
direct method for cubic interpolation.
Table 3 Velocity as a function
of time.

t , s  vt , m/s 
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67 Figure 6 Velocity vs. time data for the
rocket example
10

5
10/14/2021

Cubic Interpolation
y

x3 , y3 
vt   a0  a1t  a2t 2  a3t 3
x1 , y1 
v10  227.04  a0  a1 10  a2 10  a3 10
2 3

f 3 x 
 x2 , y 2 
v15  362.78  a0  a1 15  a2 15  a3 15
2 3
x0 , y0 

x
v20  517.35  a0  a1 20  a2 20  a3 20
2 3

Figure 7 Cubic interpolation.


v22.5  602.97  a0  a1 22.5  a2 22.5  a3 22.5
2 3

a0  4.2540 a1  21.266 a2  0.13204 a3  0.0054347

11

Cubic Interpolation (contd)


vt   4.2540  21.266t  0.13204t 2  0.0054347t 3 , 10  t  22.5
v 16    4 .2540  21 .266 16   0 .13204 16   0 .0054347 16 
2 3

 392 .06 m/s


700
602.97

The absolute percentage relative


approximate error a between
600

ys 500 second and third order polynomial is


f ( range)


f x desired 

392 .06  392 .19


400

a   100
392 .06
300

227.04 200
10
10
12 14 16 18
x s  range x desired
20 22 24
22.5
 0.033269 %

12

6
10/14/2021

Comparison Table
Table 4 Comparison of different orders of the polynomial.

Order of
t(s) v (m/s) 1 2 3
Polynomial
0 0
vt  16  m/s 393.7 392.19 392.06
10 227.04
15 362.78 Absolute Relative
---------- 0.38410 % 0.033269 %
Approximate Error
20 517.35
22.5 602.97
30 901.67

13

Distance from Velocity Profile


Find the distance covered by the rocket from t=11s to t=16s ?
vt   4.3810  21.289t  0.13064t 2  0.0054606t 3 , 10  t  22.5
16
s16   s 11   v t dt
11
16
   4.2540  21.266t  0.13204t 
 0.0054347 t 3 dt
2

11
16
 t2 t3 t4 
   4.2540t  21.266  0.13204  0.0054347 
 2 3 4 11
 1605 m

14

7
10/14/2021

Acceleration from Velocity Profile


Find the acceleration of the rocket at t=16s given that
 t   4.2540  21.266t  0.13204 2  0.0054347t 3 ,10  t  22.5
d
at   v t 
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

15

THANK YOU!

8
10/14/2021

Spline Interpolation Method

1
Son Dao, PhD ©

What is Interpolation ?
Given (x0,y0), (x1,y1), …… (xn,yn), find the
value of ‘y’ at a value of ‘x’ that is not given.

1
10/14/2021

Interpolants
Polynomials are the most common
choice of interpolants because they
are easy to:

Evaluate
Differentiate, and
Integrate.

Rocket Example Results


t v Polynomial Velocity at Absolute Least
(s) (m/s) Order t=16 in Relative Number of
0 0 m/s Approxima Significant
10 227.04 te Error Digits
15 362.78 Correct
20 517.35 1 393.69 -------------
22.5 602.97 2 392.19 0.38% 2
30 901.67 3 392.05 0.036% 3
4 392.07 0.0051% 3
5 392.06 0.0026% 4

2
10/14/2021

Why Splines ?
1
f ( x) 
1  25 x 2
Table : Six equidistantly spaced points in [-1, 1]
1
x y
1  25 x 2

-1.0 0.038461

-0.6 0.1

-0.2 0.5

0.2 0.5

0.6 0.1

1.0 0.038461 Figure : 5th order polynomial vs. exact function

Why Splines ?
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

Figure : Higher order polynomial interpolation is a bad idea


6

3
10/14/2021

Linear Interpolation
Given  x0 , y0 , x1 , y1 ,......, x n 1 , y n1  x n , y n  , fit linear splines to the data. This simply involves
forming the consecutive data through straight lines. So if the above data is given in an ascending
order, the linear splines are given by  yi  f ( xi ) 
Figure : Linear splines

Linear Interpolation (contd)


f ( x1 )  f ( x 0 )
f ( x )  f ( x0 )  ( x  x 0 ), x 0  x  x1
x1  x 0

f ( x 2 )  f ( x1 )
 f ( x1 )  ( x  x1 ), x1  x  x 2
x2  x1
.
.
.
f ( x n )  f ( x n 1 )
 f ( x n 1 )  ( x  x n 1 ), x n 1  x  x n
x n  x n 1

Note the terms of


f ( xi )  f ( x i 1 )
xi  x i 1

in the above function are simply slopes between xi 1 and x i .


8

4
10/14/2021

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 linear splines.
Table Velocity as a
function of time

t (s) v (t ) (m/s)
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67
Figure. Velocity vs. time data
for the rocket example
9

Linear Interpolation
t 0  15, v (t 0 )  362.78 550
517.35

t1  20, v (t1 )  517.35


500
v(t 1 )  v (t 0 )
v (t )  v(t 0 )  (t  t0 )
t1  t 0 ys

f ( range)
450
517.35  362.78 f x 
 362.78  (t  15) desired
20  15
400
v (t )  362.78  30.913( t  15)
At t  16, 362.78 350
10 12 14 16 18 20 22 24
v (16)  362.78  30.913(16  15) x s 10
0
x s  range x desired x s  10
1

 393.7 m/s

10

10

5
10/14/2021

Quadratic Interpolation
Given  x0 , y0 ,  x1 , y1 ,......, x n1 , y n 1 ,  x n , y n  , fit quadratic splines through the data. The splines
are given by
f ( x )  a1 x 2  b1 x  c1 , x 0  x  x1

 a 2 x 2  b 2 x  c2 , x1  x  x 2
.
.
.
 a n x 2  b n x  cn , x n1  x  x n

Find a i , bi , ci , i  1, 2, …, n

11

11

Quadratic Interpolation (contd)


Each quadratic spline goes through two consecutive data points
2
a1 x 0  b1 x 0  c1  f ( x0 )

a1 x1  b1 x1  c1  f ( x1 )
2
.
.
.
2
a i xi 1  bi xi 1  ci  f ( xi 1 )
2
a i xi  bi xi  c i  f ( xi ) .
.
.
2
a n x n1  bn x n1  c n  f ( xn 1 )
2
a n x n  bn xn  cn  f ( x n )
This condition gives 2n equations
12

12

6
10/14/2021

Quadratic Splines (contd)


The first derivatives of two quadratic splines are continuous at the interior points.
For example, the derivative of the first spline
a1 x 2  b1 x  c1 is 2 a1 x  b1
The derivative of the second spline
a 2 x 2  b2 x  c 2 is 2 a2 x  b2
and the two are equal at x  x1 giving

2 a1 x1  b1  2a 2 x1  b2

2 a1 x1  b1  2a 2 x1  b2  0

13

13

Quadratic Splines (contd)


Similarly at the other interior points,
2a 2 x2  b2  2a3 x 2  b3  0
.
.
.
2ai xi  bi  2ai 1 xi  bi 1  0
.
.
.
2a n 1 x n 1  bn 1  2a n x n1  bn  0

We have (n-1) such equations. The total number of equations is (2n)  (n  1)  (3n  1) .
We can assume that the first spline is linear, that is a1  0

14

14

7
10/14/2021

Quadratic Splines (contd)


This gives us ‘3n’ equations and ‘3n’ unknowns. Once we find the ‘3n’ constants,
we can find the function at any value of ‘x’ using the splines,

f ( x )  a1 x 2  b1 x  c1 , x 0  x  x1

 a 2 x 2  b2 x  c 2 , x1  x  x 2
.
.
.
 a n x 2  bn x  c n , x n 1  x  x n

15

15

Quadratic Spline Example


The upward velocity of a rocket is given as a function of time.
Using quadratic splines
a) Find the velocity at t=16 seconds
b) Find the acceleration at t=16 seconds

c) Find the distance covered between t=11 and t=16 seconds

Table Velocity as a
function of time

t (s) v (t ) (m/s)
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67 Figure. Velocity vs. time data
for the rocket example

16

16

8
10/14/2021

Solution
v(t )  a1t 2  b1t  c1 , 0  t  10
 a 2 t 2  b2 t  c 2 , 10  t  15
 a3 t 2  b3 t  c3 , 15  t  20
 a 4 t 2  b4 t  c 4 , 20  t  22.5
 a 5 t 2  b5 t  c5 , 22.5  t  30
Let us set up the equations
17

17

Each Spline Goes Through


Two Consecutive Data Points
v(t )  a1t 2  b1t  c1 , 0  t  10
a1 (0) 2  b1 (0)  c1  0
a1 (10) 2  b1 (10)  c1  227.04

18

18

9
10/14/2021

Each Spline Goes Through


Two Consecutive Data Points
a 2 (10) 2  b2 (10)  c 2  227.04
t v(t)
a 2 (15) 2  b2 (15)  c 2  362.78
s m/s
0 0 a 3 (15 ) 2  b3 (15 )  c 3  362 . 78
10 227.04 a 3 ( 20 ) 2  b3 ( 20 )  c 3  517 .35
15 362.78
a 4 ( 20 ) 2  b4 ( 20 )  c 4  517 .35
20 517.35
a4 (22.5) 2  b4 (22.5)  c4  602.97
22.5 602.97
30 901.67 a5 (22.5) 2  b5 (22.5)  c5  602.97
a 5 (30 ) 2  b5 (30 )  c 5  901 .67
19

19

Derivatives are Continuous at


Interior Data Points
v (t )  a1t  b1t  c1 , 0  t  10
2

 a 2 t 2  b2 t  c 2 ,10  t  15
d
dt

a1t 2  b1t  c1  
d
dt

a2t 2  b2t  c2 
t 10 t 10

2a1t  b1  t 10  2a2t  b2  t 10


2a1 10  b1  2a2 10   b2
20a1  b1  20a2  b2  0
20

20

10
10/14/2021

Derivatives are continuous at


Interior Data Points
At t=10
2a1 (10)  b1  2a 2 (10)  b2  0
At t=15
2a 2 (15)  b2  2a 3 (15)  b3  0
At t=20
2a3 (20)  b3  2a 4 (20)  b4  0
At t=22.5
2a 4 (22.5)  b4  2a5 (22.5)  b5  0
21

21

Last Equation

a1  0

22

22

11
10/14/2021

Final Set of Equations


0 0 1 0 0 0 0 0 0 0 0 0 0 0 0   a1   0 
100 10 1 0 0 0 0 0 0 0 0 0 0 0 0   b1  227.04
0 0 0 100 10 1 0 0 0 0 0 0 0 0
 
0 c1
 
    227.04
0 0 0 225 15 1 0 0 0 0 0 0 0 0 0  a 2  362.78 
0 0 0 0 0 0 225 15 1 0 0 0 0 0 0  b2  362.78 
0 0 0 0 0 0 400 20 1 0 0 0 0 0 0 c2
  517.35 
    
0 0 0 0 0 0 0 0 0 400 20 1 0 0 0   a3  517.35 
0 0 0 0 0 0 0 0 0 506.25 22.5 1 0 0 0   b3   602.97 
0 0 0 0 0 0 0 0 0 0 0 0 506.25 22.5 1   c3  602.97 
    
0 0 0 0 0 0 0 0 0 0 0 0 900 30 1  a 4  901.67 
 20 1 0  20  1 0 0 0 0 0 0 0 0 0 0  b4   0 
0 0 0 30 1 0  30  1 0 0 0 0 0 0 0  c4   0 
    
 40 1 0  a5 
0 0 0 0 0 0 40 1 0 0 0 0
  0 
0 0 0 0 0 0 0 0 0 45 1 0  45  1 0   b5   0 
 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0   c5   0 

23

23

Coefficients of Spline
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

24

24

12
10/14/2021

Quadratic Spline Interpolation


Part 2 of 2

25

25

Final Solution
v (t )  22.704t , 0  t  10
 0.8888t  4.928t  88.88,
2
10  t  15
 0.1356t 2  35.66t  141.61, 15  t  20
 1.6048t 2  33.956t  554.55, 20  t  22.5
 0.20889t 2  28.86t  152.13, 22.5  t  30

26

26

13
10/14/2021

Velocity at a Particular Point


a) Velocity at t=16
v (t )  22.704t , 0  t  10
 0.8888t  4.928t  88.88,
2
10  t  15
 0.1356t 2  35.66t  141.61, 15  t  20
 1.6048t 2  33.956t  554.55, 20  t  22.5
 0.20889t 2  28.86t  152.13, 22.5  t  30

v16  0.135616  35.6616   141.61


2

 394.24 m/s

27

27

Acceleration from Velocity Profile


b) The quadratic spline valid at t=16 is
given by
d
a (16)  v (t ) t 16
dt
v t    0 .1356 t 2  35 .66 t  141 .61, 15  t  20
d
a (t )  ( 0.1356t 2  35.66t  141.61)
dt
 0.2712t  35.66, 15  t  20
a (16)  0.2712(16)  35.66  31.321m/s
2

28

28

14
10/14/2021

Distance from Velocity Profile


c) Find the distance covered by the rocket from t=11s to
t=16s.
16
S 16  S 11   v (t )dt
11

vt   0.8888t 2  4.928t  88.88, 10  t  15


 0.1356t 2  35.66t  141.61, 15  t  20
16 15 16
S 16  S 11   vt dt   vt dt   vt dt
11 11 15
15 16
   
  0.8888t  4.928t  88.88 dt    0.1356t 2  35.66t  141.61 dt
2

11 15

 1595.9 m
29

29

THANK YOU!

30

15
10/14/2021

Lagrangian Interpolation

Son Dao, PhD © 1

Lagrangian Interpolation
Lagrangian interpolating polynomial is given by
n
f n ( x)   Li ( x ) f ( xi )
i 0

where ‘ n ’ in f n (x ) stands for the n th order polynomial that approximates the function y  f (x)

given at (n  1) data points as  x 0 , y 0 , x1 , y1 ,......,  x n 1 , y n 1 ,  x n , y n  , and


n x  xj
Li ( x)  
j 0 xi  x j
j i

Li (x ) is a weighting function that includes a product of (n  1) terms with terms of j  i


omitted.

1
10/14/2021

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 Lagrangian method for linear interpolation.
Table Velocity as a
function of time
t (s) v(t ) (m/s)
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67

Figure. Velocity vs. time data


5 for the rocket example

Linear Interpolation
550
517.35

1
v(t )   Li (t )v (ti ) 500
i 0
ys
 L0 (t )v(t 0 )  L1 (t )v (t1 ) f ( range)
450

f x desired 

t 0  15, t 0   362.78 400

t1  20, t1   517.35 362.78 350


10 12 14 16 18 20 22 24
x s 10 x s  range x desired x s  10
0 1

2
10/14/2021

Linear Interpolation (contd)


1 t tj t  t1
L0 (t )   
j 0 t0  t j t 0  t1
j 0

1 t tj t  t0
L1 (t )   
j 0 t1  t j t1  t 0
j 1

t  t1 t  t0 t  20 t  15
v (t )  v(t 0 )  v(t1 )  (362.78)  (517.35)
t 0  t1 t1  t 0 15  20 20  15
16  20 16  15
v(16)  (362.78)  (517.35)
15  20 20  15
 0.8(362.78)  0.2(517.35)

 393.7 m/s.

Quadratic Interpolation
For the second order polynomial interpolation (also called quadratic interpolation), we
choose the velocity given by
2
v (t )   Li ( t ) v(t i )
i 0

 L0 (t )v (t 0 )  L1 (t ) v( t1 )  L2 (t ) v( t 2 )

3
10/14/2021

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 Lagrangian method for quadratic interpolation.
Table Velocity as a
function of time
t (s) v(t ) (m/s)
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67

Figure. Velocity vs. time data


9 for the rocket example

Quadratic Interpolation (contd)


t 0  10, v(t 0 )  227.04
550
517.35

t1  15, v(t1 )  362.78


500

t 2  20, v(t 2 )  517.35 450

ys
400
f ( range)
2 t tj  t  t1  t  t 2 
L0 (t )       
f x desired  350
j 0 t0  t j  t 0  t 1  t 0  t 2 
j 0
300
2 t t j  t t0  t  t 2 
L1 (t )      
j 0 t1  t j  t1  t 0  t1  t2  250
j 1

2 t tj  t  t 0  t  t1  227.04 200


L2 (t )       10 12 14 16 18 20

t2  t j  t 2  t 0  t 2  t 1 
10 x s  range x desired 20
j 0
j 2

10

4
10/14/2021

Quadratic Interpolation (contd)


 t  t1  t  t2   t  t0  t  t2   t  t0  t  t1 
vt     vt0     vt1     vt2 
 t0  t1  t0  t2   t1  t0  t1  t2   t2  t0  t2  t1 
 16 15 16 20   1610  16 20   1610  1615 
v16    227.04    362.78    517.35
 10  15  10  20   15  10  15  20   2010 2015
  0.08227.04  0.96362.78  0.12527.35
 392.19 m/s
The absolute relative approximate error a obtained between the
results from the first and second order polynomial is

392.19  393.70
a  100
392.19
 0.38410%
11

Cubic Interpolation
For the third order polynomial (also called cubic interpolation), we choose the velocity given by
3
v (t )   Li ( t ) v(t i )
i 0

 L0 (t ) v( t 0 )  L1 ( t ) v(t 1 )  L2 ( t ) v(t 2 )  L3 ( t ) v(t 3 )


700
602.97

600

ys 500

f ( range)


f x desired 
400

300

227.04 200
10 12 14 16 18 20 22 24
10 x s  range x desired 22.5

12

5
10/14/2021

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 Lagrangian method for cubic interpolation.
Table Velocity as a
function of time
t (s) v(t ) (m/s)
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67

Figure. Velocity vs. time data


13 for the rocket example

Cubic Interpolation (contd)


t o  10, v to   227.04 t1  15, v t1   362.78

t 2  20, v t 2   517.35 t3  22.5, v t 3   602.97

700
3 t tj  t  t1  t  t 2  t  t 3  602.97

L0 (t )        ;
j 0 t0  t j  t 0  t 1  t 0  t 2  t0  t 3  600
j 0

3 t t j  t  t0  t  t 2  t  t3 
L1 (t )  
ys
     500

j 0 t1  t j  t1  t 0  t1  t 2  t1  t 3  f ( range)

j 1 
f x desired 
400

3 ttj  t  t 0  t  t1  t  t 3 
L2 (t )        ;
t2  t j  t 2  t 0  t 2  t 1  t 2  t 3 
300
j 0
j2

ttj  t  t 0  t  t1  t  t2 
227.04 200
3
L3 ( t )  
10 12 14 16 18 20 22 24
     10 x s  range  x desired 22.5

j 0 t3  t j  t3  t 0  t3  t1  t3  t2 
j 3

14

6
10/14/2021

Cubic Interpolation (contd)


 t  t1  t  t2  t  t3   t  t0  t  t 2  t  t3 
vt      vt1      vt 2 
 t0  t1  t0  t 2  t0  t3   t1  t0  t1  t 2  t1  t3 
 t  t 0  t  t1  t  t3   t  t1  t  t1  t  t 2 
    vt2      vt3 
 t 2  t0  t 2  t1  t 2  t3   t3  t1  t3  t1  t3  t 2 
 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.0416 227.04  0.832 362.78  0.312517.35   0.1024 602.97 
 392.06 m/s
The absolute relative approximate error a obtained between the
results from the first and second order polynomial is
392.06  392.19
a  100
392.06
 0.033269%
15

Comparison Table

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

16

7
10/14/2021

Distance from Velocity Profile


Find the distance covered by the rocket from t=11s to
t=16s ?
v(t )  (t 3  57.5t 2  1087.5t  6750)(0.36326)  (t 3  52.5t 2  875t  4500)(1.9348)
 (t 3  47.5t 2  712.5t  3375)(4.1388)  (t 3  45t 2  650t  3000)(2.5727)
v (t )  4.245  21.265t  0.13195t 2  0.00544t 3 , 10  t  22.5
16

s(16)  s (11)   v( t) dt
11

16

  ( 4.245  21.265t  0.13195t 2  0.00544t 3 ) dt


11

t2 t3 t4
 [ 4.245t  21.265  0.13195  0.00544 ]16
11
2 3 4

 1605 m
17

Acceleration from Velocity Profile


Find the acceleration of the rocket at t=16s given that

v(t )  4.245  21.265t  0.13195t 2  0.00544t 3 , 10  t  22.5

v t    4.245  21.265t  0.13195t 2  0.00544t 3 


d d
a t  
,

dt dt

 21.265  0.26390t  0.01632t 2

a (16)  21. 265  0.26390(16)  0.01632(16) 2

 29.665 m / s 2

18

8
10/14/2021

THANK YOU!

9
10/14/2021

Newton’s Divided Difference


Polynomial Method of
Interpolation

Son Dao, PhD © 1

Newton’s Divided Difference


Method
Linear interpolation: Given ( x0 , y 0 ), ( x1 , y1 ), pass a
linear interpolant through the data
f1 ( x)  b0  b1 ( x  x 0 )

where
b0  f ( x 0 )
f ( x1 )  f ( x 0 )
b1 
x1  x 0

1
10/14/2021

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.
Table. Velocity as a
function of time

t (s) v (t ) (m/s )
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67
Figure. Velocity vs. time data
4 for the rocket example

Linear Interpolation
550
517.35

v(t )  b0  b1 (t  t 0 ) 500

ys

t 0  15, v (t 0 )  362.78 f ( range)


450

f x desired 
t1  20, v (t1 )  517.35
b0  v(t 0 )  362.78 400

v (t1 )  v(t 0 )
b1   30.914 362.78 350
t1  t 0 10
x s 10
12 14 16 18
x s  range x desired
20 22 24
x s  10
0 1

2
10/14/2021

Linear Interpolation (contd)


550
517.35

500

ys

f ( range)
450

f x desired 

400

362.78 350
10 12 14 16 18 20 22 24
x s  10 x s  range x desired x s  10

v (t )  b0  b1 (t  t 0 )
0 1

 362.78  30.914(t  15), 15  t  20


At t  16
v(16)  362.78  30.914(16  15)
 393.69 m/s
6

Quadratic Interpolation
Given ( x0 , 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  x 0

f ( x 2 )  f ( x1 ) f ( x1 )  f ( x 0 )

x 2  x1 x1  x 0
b2 
x 2  x0

3
10/14/2021

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.
Table. Velocity as a
function of time

t (s) v (t ) (m/s )
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67
Figure. Velocity vs. time data
8 for the rocket example

Quadratic Interpolation (contd)


The picture can't be display ed.

550
517.35

500

450

ys
400
f ( range)


f x desired  350

300

250

227.04 200
10 12 14 16 18 20
10 x s  range x desired 20

t 0  10, v(t 0 )  227.04


t1  15, v(t1 )  362.78
t 2  20, v(t 2 )  517.35
9

4
10/14/2021

Quadratic Interpolation (contd)


b0  v(t 0 )
 227.04
v (t )  v (t 0 ) 362.78  227.04
b1  1 
t1  t 0 15  10
 27.148

v(t 2 )  v(t1 ) v(t1 )  v(t 0 ) 517.35  362.78 362.78  227.04


 
t 2  t1 t1  t 0 20  15 15  10
b2  
t2  t0 20  10
30.914  27.148

10
 0.37660
10

Quadratic Interpolation (contd)


v(t )  b0  b1 (t  t 0 )  b2 (t  t 0 )(t  t1 )
 227.04  27.148(t  10)  0.37660(t  10)(t  15), 10  t  20
At t  16,
v (16)  227.04  27.148(16  10)  0.37660(16  10)(16  15)  392.19 m/s

The absolute relative approximate error a obtained between the results from the first
order and second order polynomial is

392.19  393.69
a  x100
392.19

= 0.38502 %

11

5
10/14/2021

General Form
f 2 ( x )  b0  b1 ( x  x 0 )  b2 ( x  x 0 )( x  x1 )
where
b0  f [ x0 ]  f ( x0 )
f ( x1 )  f ( x0 )
b1  f [ x1 , x0 ] 
x1  x 0
f ( x 2 )  f ( x1 ) f ( x1 )  f ( x 0 )

f [ x 2 , x1 ]  f [ x1 , x0 ] x 2  x1 x1  x0
b2  f [ x2 , x1 , x0 ]  
x 2  x0 x 2  x0
Rewriting
f 2 ( x)  f [ x 0 ]  f [ x1 , x0 ]( x  x 0 )  f [ x 2 , x1 , x 0 ]( x  x0 )( x  x1 )

12

General Form
Given (n  1) data points,  x 0 , y 0 ,  x1 , y1 ,......,  x n 1 , y n 1 ,  x n , y n  as
f n ( x)  b0  b1 ( x  x 0 )  ....  bn ( x  x 0 )( x  x1 )...( x  x n 1 )
where
b0  f [ x 0 ]
b1  f [ x1 , x0 ]
b2  f [ x 2 , x1 , x 0 ]

bn 1  f [ x n 1 , x n 2 ,...., x0 ]
bn  f [ x n , x n 1 ,...., x 0 ]

13

6
10/14/2021

General form
The third order polynomial, given ( x 0 , y 0 ), ( x1 , y1 ), ( x 2 , y 2 ), and ( x3 , y 3 ), is

f 3 ( x)  f [ x 0 ]  f [ x1 , x 0 ]( x  x 0 )  f [ x 2 , x1 , x 0 ]( x  x 0 )( x  x1 )
 f [ x3 , x 2 , x1 , x 0 ]( x  x 0 )( x  x1 )( x  x 2 )
b0
x0 f ( x0 ) b1
f [ x1 , x0 ] b2
x1 f ( x1 ) f [ x 2 , x1 , x 0 ] b3
f [ x 2 , x1 ] f [ x3 , x2 , x1 , x0 ]
x2 f ( x2 ) f [ x3 , x2 , x1 ]
f [ x3 , x 2 ]
x3 f ( x3 )

14

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.
Table. Velocity as a
function of time

t (s) v (t ) (m/s )
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67
Figure. Velocity vs. time data
15 for the rocket example

7
10/14/2021

Example
The velocity profile is chosen as
v(t )  b0  b1 (t  t 0 )  b2 (t  t 0 )(t  t1 )  b3 (t  t 0 )(t  t1 )(t  t 2 )
we need to choose four data points that are closest to t  16
t0  10, v(t 0 )  227.04
t1  15, v(t1 )  362.78
t 2  20, v (t 2 )  517.35
t 3  22.5, v(t 3 )  602.97

The values of the constants are found as:


b0 = 227.04; b1 = 27.148; b2 = 0.37660; b3 = 5.4347×10−3
16

Example
b0
t0  10 227.04 b1
27.148 b2
t1  15, 362.78 0.37660 b3
30.914 5.4347 10 3
t2  20, 517.35 0.44453
34.248
t3  22.5, 602.97

b0 = 227.04; b1 = 27.148; b2 = 0.37660; b3 = 5.4347×10−3

17

8
10/14/2021

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
The absolute relative approximate error a obtained is
392.06  392.19
a  x100
392.06

= 0.033427 %
18

Comparison Table

Order of 1 2 3
Polynomial
v(t=16) 393.69 392.19 392.06
m/s
Absolute Relative ---------- 0.38502 % 0.033427 %
Approximate Error

19

9
10/14/2021

Distance from Velocity Profile


Find the distance covered by the rocket from t=11s to
t=16s ?
v (t )  227.04  27.148(t  10)  0.37660( t  10)( t  15)
10  t  22.5
 5.4347 * 10 3 (t  10)( t  15)( t  20)

 4.2541  21.265t  0.13204t 2  0.0054347t 3 10  t  22.5


So
16

s16  s11   v t dt


11

16

  (  4.2541  21.265t  0.13204t 2  0.0054347t 3 ) dt


11

16
 t2 t3 t4 
  4.2541t  21.265  0.13204  0.0054347 
 2 3 4  11

20  1605 m

Acceleration from Velocity Profile


Find the acceleration of the rocket at t=16s given that

v(t )  4.2541  21.265t  0.13204t 2  0.0054347t 3

a (t ) 
d
dt
v (t ) 
d
dt

 4.2541  21.265t  0.13204t 2  0.0054347t 3 
 21.265  0.26408t  0.016304t 2

a (16)  21.265  0.26408(16)  0.016304(16) 2

 29.664 m / s 2

21

10
10/14/2021

THANK YOU!

11

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy