0% found this document useful (0 votes)
7 views27 pages

Chapter 4

Chapter 4 discusses curve fitting, focusing on interpolation and least-squares regression as methods for estimating values between discrete data points. It introduces polynomial interpolation techniques, including Newton's Forward and Backward method, Newton's divided difference method, and Lagrangian interpolation. The chapter provides examples of linear and quadratic interpolation using velocity data from a rocket, illustrating how to derive interpolating functions and compute values at specific points.

Uploaded by

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

Chapter 4

Chapter 4 discusses curve fitting, focusing on interpolation and least-squares regression as methods for estimating values between discrete data points. It introduces polynomial interpolation techniques, including Newton's Forward and Backward method, Newton's divided difference method, and Lagrangian interpolation. The chapter provides examples of linear and quadratic interpolation using velocity data from a rocket, illustrating how to derive interpolating functions and compute values at specific points.

Uploaded by

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

Chapter 4

Curve Fitting
Introduction: Many times, Data is often given for discrete values along a range. However, you may require
estimates at points between the discrete values. In addition, you may require a simplified version of a complicated
function. To do this, a simpler function may be derived to fit these values. Such process is called Curve fitting.
There are two general approaches for curve fitting that are distinguished from each other on the basis of the amount of
error associated with the data.

First, where the data exhibits a significant degree of error, the strategy is to derive a single curve that represents the
general trend of the data, not necessarily passing through the data points. This approach is called Least-Squares
regression.

Second, where the data is known to be very precise, the basic approach is to fit a curve or a series of curves that pass
directly through each of the data points. Such approach is called Interpolation.

4.1 Basic concepts of Finite difference

4.2 Interpolation

Suppose we are given n+1 discrete points such as ( x 0 , y 0 ) , ( x 1 , y 1 ) , . .. .. . , ( x n−1 , y n−1 ) , ( x n , y n ) . So, how then does
one find the value of y at any other value of x ? Well, a continuous function f (x) may be used to represent the
n+1 data values with f ( x ) passing through the n+1 points. Then one can find the value of y at any other value
of x . This is called interpolation.

Of course, if x falls outside the range of x for which the data is given, it is no longer interpolation but instead is
called extrapolation.

So what kind of function f ( x ) should one choose? A polynomial is a common choice for an interpolating function
because polynomials are easy to
(A) evaluate,
(B) differentiate, and
(C) integrate relative to other choices such as a trigonometric and exponential series.

Polynomial interpolation involves finding a polynomial of order n that passes through the n+1 points.

Basic methods of interpolation are:


 Newton’s Forward and Backward method. (used for equally and unequally step size h )
 Newton’s divided difference method. (used for equally and unequally step size h )
 Lagrangian interpolation method. (used for equally and unequally step size h )

Gambella University Chapter 4, Curve Fitting (Interpolation)


1 of 33
I. Newton’s Forward and Backward method

II. Newton divided difference Method


After reading this method, you should be able to:
 derive Newton’s divided difference method of interpolation,
 apply Newton’s divided difference method of interpolation, and
 apply Newton’s divided difference method interpolants to find derivatives and integrals.

To illustrate this method, linear and quadratic interpolation is presented first. Then, the general form of Newton’s
divided difference polynomial method is presented. To illustrate the general form, cubic interpolation is shown in
Figure 1.

x3 , y3 

x1, y1 

f x 
x2 , y2 
x0 , y0 
x
Figure 1 Interpolation of discrete data.

Linear Interpolation
Given
( x 0 , y 0 ) and ( x 1 , y 1 ), fit a linear interpolant through the data. Noting y=f ( x ) and y 1 =f ( x 1 ) , assume the
linear interpolant f 1 ( x ) is given by (Figure 2)
f 1 ( x )=b0 +b1 ( x− x0 )
Since at
x=x 0 ,
f 1 ( x 0 )=f ( x 0 )=b0 +b1 ( x 0−x 0 )=b0
and at
x=x 1 ,
f 1 ( x 1 )=f (x 1 )=b 0 +b1 ( x 1 −x 0 )
=f ( x 0 )+b1 ( x1 −x 0 )
giving
f ( x 1 )−f ( x 0 )
b 1=
x 1−x 0
So
b 0=f ( x 0 )
f ( x 1 )−f ( x 0 )
b 1=
x 1−x 0
Gambella University Chapter 4, Curve Fitting (Interpolation)
2 of 33
giving the linear interpolant as
f 1 ( x )=b0 + b1 ( x− x0 )
f ( x 1 )−f ( x0 )
f 1 ( x )=f ( x 0 )+ ( x−x 0 )
x 1 −x 0

x1 , y1 

f1 x 

x0 , y0 
x
Figure 2 Linear interpolation.

Example 1
The upward velocity of a rocket is given as a function of time in Table 1 (Figure 3).

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

Determine the value of the velocity at t =16 seconds using first order polynomial interpolation by Newton’s divided
difference polynomial method.
Solution
For linear interpolation, the velocity is given by
v (t )=b0 +b1 (t−t 0 )
Since we want to find the velocity at t =16 , and we are using a first order polynomial, we need to choose the two
data points that are closest to t =16 that also bracket t =16 to evaluate it. The two points are t =15 and t =20 .
Then
t 0 =15 , v (t 0 )=362 . 78
t 1=20 , v (t 1 )=517 . 35
gives
b 0=v (t 0 )
=362 . 78

Gambella University Chapter 4, Curve Fitting (Interpolation)


3 of 33
v (t 1 )−v (t 0 )
b 1=
t 1 −t 0
517 . 35−362. 78
=
20−15
=30 . 914

Figure 3 Graph of velocity vs. time data for the rocket example.
Hence
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
If we expand
v (t )=362. 78+30 . 914 (t−15 ), 15≤t ≤20
we get
v (t )=−100 . 93+30 .914 t , 15≤t ≤20
and this is the same expression as obtained in the direct method.

Quadratic Interpolation
Given ( x 0 , y 0 ), ( x 1 , y 1 ), and ( x 2 , y 2 ), fit a quadratic interpolant through the data. Noting y=f ( x ), y 0 =f ( x 0 ),
y 1 =f ( x 1 ), and y 2 =f ( x 2 ) , assume the quadratic interpolant f 2 ( x ) is given by
f 2 ( x )=b0 +b1 (x −x 0 )+b2 ( x−x 0 )( x−x 1 )
At
x=x 0 ,
f 2 ( x 0 )=f ( x 0 )=b 0 +b 1 ( x 0− x0 )+b 2 ( x 0 −x 0 )( x0 −x 1 )
=b0
b 0=f ( x 0 )
At
x=x 1
f 2 ( x 1 )=f ( x1 )=b0 +b1 ( x 1 −x 0 )+b2 ( x 1 −x 0 )(x 1 −x 1 )

Gambella University Chapter 4, Curve Fitting (Interpolation)


4 of 33
f ( x1 )=f ( x 0 )+b1 ( x1 −x 0 )
giving
f ( x 1 )−f ( x 0 )
b 1=
x 1−x 0
At
x=x 2
f 2 ( x 2 )=f ( x2 )=b0 +b1 (x 2 −x 0 )+b2 ( x2 −x 0 )( x 2−x 1 )
f ( x 1 )−f ( x 0 )
f ( x 2 )=f ( x 0 )+ ( x 2−x 0 )+b 2 ( x 2 −x 0 )( x 2 −x 1 )
x 1 −x 0
Giving
f ( x 2 )−f ( x1 ) f ( x 1 )−f ( x 0 )

x 2 −x 1 x1 −x 0
b 2=
x2 −x 0
Hence the quadratic interpolant is given by
f 2 ( x )=b0 +b1 (x −x 0 )+b2 ( x−x 0 )( x−x 1 )
f (x 2 )−f ( x 1 ) f ( x1 )−f ( x 0 )

f ( x 1 )−f ( x 0 ) x 2−x 1 x 1−x 0
=f ( x 0 )+ ( x−x 0 )+ ( x−x 0 )( x−x 1 )
x 1 −x 0 x 2−x 0

x1 , y1 
x2 , y2 

f 2 x 

x0 , y0 
x
Figure 4 Quadratic interpolation.

Example 2
The upward velocity of a rocket is given as a function of time in Table 2.

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

Gambella University Chapter 4, Curve Fitting (Interpolation)


5 of 33
Determine the value of the velocity at t =16 seconds using second order polynomial interpolation using Newton’s
divided difference polynomial method.
Solution
For quadratic interpolation, the velocity is given by
v (t )=b0 +b1 (t−t 0 )+b 2 (t−t 0 )(t−t 1 )
Since we want to find the velocity at t=16 , and we are using a second order polynomial, we need to choose the
t =10 ,
three data points that are closest to t =16 that also bracket t =16 to evaluate it. The three points are 0
t 1=15 , and t 2=20 .
Then
t 0 =10 , v (t 0 )=227 . 04
t 1=15 , v (t 1 )=362 .78
t 2=20 , v (t 2 )=517 . 35
gives
b 0=v (t 0 )
=227 . 04
v (t )−v (t 0 )
b 1= 1
t 1 −t 0
362 . 78−227 . 04
=
15−10
=27 . 148
v (t 2 )−v (t 1 ) v (t 1 )−v (t 0 )

t 2 −t 1 t 1 −t 0
b 2=
t 2−t 0
517 . 35−362 .78 362 .78−227 . 04

20−15 15−10
=
20−10
30 . 914−27 . 148
=
10
=0. 37660
Hence
v (t )=b0 +b1 (t−t 0 )+b 2 (t−t 0 )(t−t 1 )
=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
If we expand
v (t )=227 . 04+27 . 148(t−10 )+0. 37660(t−10 )(t−15), 10≤t ≤20
we get
v (t )=12. 05+17 . 733 t+0. 37660 t 2 , 10≤t ≤20
This is the same expression obtained by the direct method.

General Form of Newton’s Divided Difference Polynomial


In the two previous cases, we found linear and quadratic interpolants for Newton’s divided difference method. Let us
revisit the quadratic polynomial interpolant formula
f 2 ( x )=b0 +b1 (x −x 0 )+b2 ( x−x 0 )( x−x 1 )

Gambella University Chapter 4, Curve Fitting (Interpolation)


6 of 33
where
b 0=f ( x 0 )
f ( x 1 )−f ( x 0 )
b 1=
x 1−x 0
f ( x 2 )−f ( x1 ) f ( x 1 )−f ( x 0 )

x 2 −x 1 x1 −x 0
b 2=
x2 −x 0
b ,b , b b ,b , b
Note that 0 1 and 2 are finite divided differences. 0 1 and 2 are the first, second, and third finite
divided differences, respectively. We denote the first divided difference by
f [ x 0 ]=f ( x 0 )
the second divided difference by
f ( x 1 )−f ( x 0 )
f [ x 1 , x 0 ]=
x 1 −x 0
and the third divided difference by
f [ x 2 , x 1 ]−f [ x 1 , x 0 ]
f [ x 2 , x 1 , x 0 ]=
x 2−x 0
f ( x 2 )−f ( x 1 ) f (x 1 )−f ( x 0 )

x2 −x 1 x 1−x 0
=
x2 −x 0
where
f [ x 0 ], f [ x 1 , x 0 ], and f [ x 2 , x 1 , x 0 ] are called bracketed functions of their variables enclosed in square
brackets.
Rewriting,
f 2 ( x )=f [ x 0 ]+f [ x 1 , x 0 ]( x−x 0 )+f [ x 2 , x 1 , x 0 ]( x−x 0 )( x−x 1 )
This leads us to writing the general form of the Newton’s divided difference polynomial for n+1 data points,
( x 0 , y 0 ) , ( x 1 , y 1 ) , .. .. . ., ( x n−1 , y n−1) , ( x n , y n ) , as
f n ( x )=b0 +b1 ( x−x 0 )+.. ..+b n ( x−x 0 )( x−x 1 ). . .(x −x n−1 )
where
b 0=f [ x 0 ]
b 1=f [ x 1 , x 0 ]
b 2=f [ x2 , x 1 , x 0 ]

b n−1 =f [ x n−1 , x n−2 ,. .. . , x 0 ]
b n=f [ x n , x n−1 , .. .. , x 0 ]
th
where the definition of the m divided difference is
b m=f [ x m ,. . .. .. . ., x 0 ]
f [ x m ,. . .. .. . ., x 1 ]−f [ x m−1 ,. .. . .. .. , x 0 ]
=
x m−x 0
From the above definition, it can be seen that the divided differences are calculated recursively.
For an example of a third order polynomial, given ( x 0 , y 0 ), ( x 1 , y 1 ), ( x 2 , y 2 ), and ( x 3 , y 3 ),
f 3 ( x )=f [ x 0 ]+f [ x1 , x 0 ]( x−x 0 )+f [ x 2 , x 1 , x 0 ]( x−x 0 )( x−x 1 )
+f [ x 3 , x 2 , x 1 , x 0 ]( x−x 0 )( x−x 1 )( x−x 2 )

Gambella University Chapter 4, Curve Fitting (Interpolation)


7 of 33
b0
b1
b2
x0 f x0 
b3
f x1 , x0 
f x2 , x1 , x0 
x1 f x1 
f  x2 , x1  f x3 , x2 , x1 , x0 

x2 f x2  f x3 , x2 , x1 
f  x3 , x 2 

x3 f x3 

Figure 5 Table of divided differences for a cubic polynomial.

Example 3
The upward velocity of a rocket is given as a function of time in Table 3.

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

a) Determine the value of the velocity at t =16 seconds with third order polynomial interpolation using Newton’s
divided difference polynomial method.
b) Using the third order polynomial interpolant for velocity, find the distance covered by the rocket from t=11 s to
t=16 s .
c) Using the third order polynomial interpolant for velocity, find the acceleration of the rocket at t=16 s .
Solution
a) For a third order polynomial, the velocity is given by
v (t )=b0 +b1 (t−t 0 )+b 2 (t−t 0 )(t−t 1 )+b 3 (t−t 0 )(t−t 1 )(t−t 2 )
Since we want to find the velocity at t=16 , and we are using a third order polynomial, we need to choose the four
t =10 , t 1=15 ,
data points that are closest to t =16 that also bracket t =16 to evaluate it. The four data points are 0
t 2=20 , and t 3=22. 5 .
Then
t 0 =10 , v (t 0 )=227 . 04
t 1=15 , v (t 1 )=362 .78
t 2=20 , v (t 2 )=517 . 35
t 3=22. 5 , v (t 3 )=602 . 97
gives
b 0=v [ t 0 ]

Gambella University Chapter 4, Curve Fitting (Interpolation)


8 of 33
=v (t 0 )
=227 . 04
b 1=v [t 1 , t 0 ]
v (t 1 )−v (t 0 )
=
t 1 −t 0
362 . 78−227 . 04
=
15−10
=27 . 148
b 2=v [t 2 , t 1 ,t 0 ]
v [t 2 , t 1 ]−v [t 1 ,t 0 ]
=
t 2 −t 0
v (t 2 )−v (t 1 )
v [t 2 , t 1 ]=
t 2 −t 1
517 . 35−362. 78
=
20−15
=30 . 914
v [t 1 , t 0 ]=27 . 148
v [t 2 , t 1 ]−v [ t 1 ,t 0 ]
b 2=
t 2 −t 0
30 . 914−27 . 148
=
20−10
=0. 37660
b 3=v [ t3 ,t 2 , t1 , t 0 ]
v [t 3 , t2 ,t 1 ]−v [ t2 , t 1 , t0 ]
=
t 3−t 0
v [t , t ]−v [t 2 , t 1 ]
v [t 3 , t 2 ,t 1 ]= 3 2
t 3 −t 1
v (t )−v (t 2 )
v [t 3 , t 2 ]= 3
t 3 −t 2
602 . 97−517 .35
=
22 . 5−20
=34 .248
v (t 2 )−v (t 1 )
v [t 2 , t 1 ]=
t 2 −t 1
517 . 35−362. 78
=
20−15
=30 . 914
v [t 3 , t 2 ]−v [t 2 , t 1 ]
v [t 3 , t 2 ,t 1 ]=
t 3 −t 1
34 .248−30 . 914
=
22 . 5−15
=0. 44453
v [t 2 , t 1 , t 0 ]=0 .37660

Gambella University Chapter 4, Curve Fitting (Interpolation)


9 of 33
v [t 3 , t 2 ,t 1 ]−v [ t 2 ,t 1 , t 0 ]
b 3=
t 3−t 0
0 . 44453−0 .37660
=
22 . 5−10
=5 . 4347×10−3
Hence
v (t )=b0 +b1 (t−t 0 )+b 2 (t−t 0 )(t−t 1 )+b 3 (t−t 0 )(t−t 1 )(t−t 2 )
=227 . 04 +27 .148 (t−10)+0 . 37660(t−10)(t−15 )
+5 .5347×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 . 5347×10−3 (16−10 )(16−15 )(16−20 )
=392 . 06 m/s
b) The distance covered by the rocket between t=11 s and t=16 s can be calculated from the interpolating
polynomial
v (t )=227 . 04+27 . 148(t−10 )+0. 37660(t−10 )(t−15)
+5 .5347×10−3 (t−10)(t−15 )(t−20)
=−4 .2541+21. 265 t+0 .13204 t 2 +0. 0054347 t 3 , 10≤t ≤22. 5
Note that the polynomial is valid between t =10 and t =22 .5 and hence includes the limits of t =11 and t =16 .
So
16
s ( 16 )−s ( 11 )=∫ v ( t ) dt
11
16
=∫ (−4 . 2541+21 .265 t+0 .13204 t 2 +0. 0054347 t 3 )dt
11

[ ]
16
t2 t3 t4
= −4 . 2541 t+21 . 265 +0 .13204 +0 .0054347
2 3 4 11
=1605 m
c) The acceleration at t =16 is given by
d
a (16)= v (t )|t=16
dt
d
a (t )= v (t )
dt
d
= (−4 . 2541+21. 265 t+0. 13204 t 2 +0 . 0054347 t 3 )
dt
=21 . 265+0 . 26408t +0 . 016304 t 2
a (16)=21. 265+0 . 26408(16 )+0 .016304 (16 )2
=29 . 664 m/s2

Gambella University Chapter 4, Curve Fitting (Interpolation)


10 of 33
III. Lagragian Method
After reading this method, you should be able to:
 derive Lagrangian method of interpolation,
 solve problems using Lagrangian method of interpolation, and
 use Lagrangian interpolants to find derivatives and integrals of discrete functions.
y

x3 , y3 

x1, y1 

f x 
x2 , y2 
x0 , y0 
x

Figure 1 Interpolation of discrete data.

The Lagrangian interpolating polynomial is given by


n
f n ( x )=∑ Li ( x )f ( x i )
i=0

where n in f n ( x ) stands for the n y=f ( x ) given at n+1 data


th
order polynomial that approximates the function
points as (
x 0 , y 0 ) , ( x 1 , y 1 ) , .. .. . ., ( x n−1 , y n−1 ) , ( x n , y n )
, and

¿ j≠i ¿ ¿ ¿ ¿
n
Li ( x ) is a weighting function that includes a product of n−1 terms with terms of j =i omitted. The application of
Lagrangian interpolation will be clarified using an example.

Example 1
The upward velocity of a rocket is given as a function of time in Table 1.
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

Gambella University Chapter 4, Curve Fitting (Interpolation)


11 of 33
Figure 2 Graph of velocity vs. time data for the rocket example.

Determine the value of the


velocity at t =16 seconds using a first order Lagrange polynomial.
Solution
For first order polynomial interpolation (also called linear interpolation), the velocity is given by
1
v (t )=∑ Li (t )v (t i )
i=0
=L0 (t )v (t 0 )+L1 (t )v (t 1 )

x1 , y1 

f1 x 

x0 , y0 
x
Figure 3 Linear interpolation.

Since we want to find the velocity at t =16 , and we are using a first order polynomial, we need to choose the two
t =15 and t 1=20 .
data points that are closest to t =16 that also bracket t =16 to evaluate it. The two points are 0

Then

Gambella University Chapter 4, Curve Fitting (Interpolation)


12 of 33
t 0 =15 , v ( t 0 ) =362 .78
t 1=20 , v ( t 1 )=517. 35
gives

¿ j≠0 ¿¿¿ ¿
1
t −t 1
=
t 0 −t 1

¿ j≠1 ¿¿¿ ¿
1
t −t 0
=
t 1−t 0
Hence
t−t 1 t−t 0
v (t )= v (t 0 )+ v (t 1 )
t 0 −t 1 t 1 −t 0
t−20 t−15
= (362 . 78)+ (517 . 35), 15≤t≤20
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 . 69 m/s
You can see that 0
L (t )=0 . 8 and L1 (t )=0 .2 are like weight ages given to the velocities at t =15 and t =20 to
calculate the velocity at t =16 .

Quadratic Interpolation
y

x1 , y1 
x2 , y2 

f 2 x 

x0 , y0 
x
Figure 4 Quadratic interpolation.

Example 2
The upward velocity of a rocket is given as a function of time in Table 2.

Table 2 Velocity as a function of time.

Gambella University Chapter 4, Curve Fitting (Interpolation)


13 of 33
t
(s)
v (t ) (m/s)
0 0
10 227.04
15 362.78
20 517.35
22.5 602.97
30 901.67

a) Determine the value of the velocity at t =16 seconds with second order polynomial interpolation using Lagrangian
polynomial interpolation.
b) Find the absolute relative approximate error for the second order polynomial approximation.
Solution
a) For second order polynomial interpolation (also called quadratic interpolation), the velocity is given by
2
v (t )=∑ Li (t )v (t i )
i=0
=L0 (t )v (t 0 )+L1 (t )v (t 1 )+L2 (t )v (t 2 )
Since we want to find the velocity at t =16 , and we are using a second order polynomial, we need to choose the three
data points that are closest to t =16 that also bracket t =16 to evaluate it. The three points are
t 0 =10 , t1 =15 , and t 2 =20 .
Then
t 0 =10 , v ( t 0 )=227 . 04 t 1=15 , v ( t 1 ) =362. 78 t 2=20 , v ( t 2 ) =517 . 35
gives

¿ j≠0 ¿¿¿ ¿
2
( )( )
t −t 1 t −t 2
=
t 0 −t 1 t 0 −t 2

¿ j≠1 ¿¿¿ ¿
2
( )( )
t −t 0 t −t 2
=
t 1 −t 0 t 1 −t 2

¿ j≠2 ¿¿¿ ¿
2
( )( )
t −t 0 t −t 1
=
t 2 −t 0 t 2 −t 1
Hence

( )( ) ( )( ) ( )( )
t −t 1 t−t 2 t−t 0 t−t 2 t−t 0 t −t 1
v ( t )= v ( t 0 )+ v ( t 1 )+ v ( t 2 ) , t 0≤t ≤t 2
t 0 −t 1 t 0 −t 2 t 1 −t 0 t 1−t 2 t 2 −t 0 t 2−t 1
(16−15)(16−20) (16−10 )(16−20)
v (16 )= (227 .04 )+ (362 .78 )
(10−15 )(10−20) (15−10 )(15−20 )
(16−10 )(16−15)
+ (517 . 35 )
(20−10 )(20−15 )

Gambella University Chapter 4, Curve Fitting (Interpolation)


14 of 33
=(−0. 08 )(227 .04 )+(0 . 96)(362 . 78)+(0. 12)(517 . 35)
=392 . 19 m/s
|∈ |
b) The absolute relative approximate error a for the second order polynomial is calculated by considering the result
of the first order polynomial (Example 1) as the previous approximation.
392.19−393.69
|∈a|=| |×100
392.19
=0. 38410 %
Example 3
The upward velocity of a rocket is given as a function of time in Table 3.
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
a) Determine the value of the velocity at t =16 seconds using third order Lagrangian polynomial interpolation.
b) Find the absolute relative approximate error for the third order polynomial approximation.
c) Using the third order polynomial interpolant for velocity, find the distance covered by the rocket from t=11 s to
t=16 s .
d) Using the third order polynomial interpolant for velocity, find the acceleration of the rocket at t=16 s .
Solution
a) For third order polynomial interpolation (also called cubic interpolation), the velocity is 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 )
y

x3 , y3 

x1, y1 

f 3 x 
x2 , y2 
x0 , y0 
Figure 5 Cubic interpolation. x

Since we want to find the velocity at t =16 , and we are using a third order polynomial, we need to choose the four
t =10 ,
data points closest to t =16 that also bracket t =16 to evaluate it. The four points are 0
t1 =15 , t 2=20 and
t 3=22. 5 . Then

Gambella University Chapter 4, Curve Fitting (Interpolation)


15 of 33
t 0 =10 , v ( t 0 )=227 . 04 t 1=15 , v ( t 1 ) =362. 78 t 2=20 , v ( t 2 ) =517 . 35
t 3=22. 5 , v ( t 3 )=602. 97
gives

¿ j≠0 ¿¿¿ ¿
3
( )( )( )
t −t 1 t −t 2 t −t 3
=
t 0 −t 1 t 0 −t 2 t 0−t 3

¿ j≠1 ¿¿¿ ¿
3
( )( )( )
t −t 0 t −t 2 t −t 3
=
t 1 −t 0 t 1 −t 2 t 1 −t 3

¿ j≠2 ¿¿¿ ¿
3
( )( )( )
t −t 0 t −t 1 t−t 3
=
t 2 −t 0 t 2 −t 1 t 2 −t 3

¿ j≠3 ¿¿¿ ¿
3
( )( )( )
t −t 0 t −t 1 t −t 2
=
t 3 −t 0 t 3 −t 1 t 3−t 2
Hence

( )( )( ) ( )( )( )
t−t 1 t −t 2 t −t 3 t −t 0 t −t 2 t −t 3
v ( t )= v (t 0 )+ v ( t 1)
t 0 −t 1 t 0 −t 2 t 0−t 3 t 1 −t 0 t 1 −t 2 t 1 −t 3

( )( )( ) ( )( )( )
t −t 0 t −t 1 t−t 3 t −t 0 t −t 1 t −t 2
+ v ( t 2 )+ v ( t 3 ) , t 0 ≤t ≤t 3
t 2 −t 0 t 2−t 1 t 2 −t 3 t 3−t 0 t 3 −t 1 t 3 −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 )
+ (517 . 35)
(20−10)(20−15 )(20−22 .5 )
(16−10)(16−15 )(16−20 )
+ (602 . 97 )
(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
b) The absolute percentage relative approximate error,
|∈ |
a for the value obtained for v (16 ) can be obtained by
comparing the result with that obtained using the second order polynomial (Example 2)
392.06−392.19
|∈a|=| |×100
392.06
=0. 033269 %
c) The distance covered by the rocket between t=11 s to t=16 s can be calculated from the interpolating
polynomial as

Gambella University Chapter 4, Curve Fitting (Interpolation)


16 of 33
(t−15 )(t−20)(t−22 . 5) (t−10 )(t−20 )(t−22 .5)
v(t )= (227 . 04 )+ (362. 78)
(10−15)(10−20)(10−22 .5 ) (15−10 )(15−20)(15−22. 5)
(t−10 )(t−15)(t−22 .5)
+ (517 . 35)
(20−10)(20−15 )(20−22 .5 )
(t−10 )(t−15)(t−20 )
+ (602 . 97 ), 10≤t≤22. 5
(22 .5−10 )(22 . 5−15 )(22. 5−20)
(t 2−35 t +300)(t−22 . 5) (t 2 −30 t+200 )(t−22. 5 )
= (227 . 04 )+ (362. 78 )
(−5)(−10)(−12 .5 ) (5 )(−5)(−7 .5 )
(t 2 −25 t+150 )(t−22 .5 ) (t 2 −25 t+150 )(t−20 )
+ (517 .35 )+ (602. 97 )
(10)(5 )(−2 . 5) (12 . 5)(7 . 5)(2 .5 )
=(t3 −57 . 5 t2 +1087 .5 t−6750 )(−0. 36326 )+(t 3−52. 5 t2 +875 t−4500 )(1. 9348 )
+(t 3 −47 . 5 t2 +712 . 5 t−3375)(−4 . 1388 )+(t 3−45 t2 +650 t−3000)(2 .5727 )
=−4 .245+21 .265 t +0 .13195 t 2 +0. 00544 t 3 , 10≤t ≤22. 5
Note that the polynomial is valid between t =10 and t =22 .5 and hence includes the limits of t =11 and t =16 .
So
16
s(16 )−s(11)=∫ v (t )dt
11
16
=∫ (−4 . 245+21 .265 t +0 .13195 t 2 +0 . 00544 t 3 )dt
11

[ ]
16
t2 t3 t4
= −4 . 245 t+21. 265 +0 .13195 +0 .00544
2 3 4 11
=1605 m
d) The acceleration at t =16 is given by
d
a ( 16 )= v ( t )|t=16
dt
Given that
v (t )=−4 .245+21 . 265 t+0 . 13195 t 2 +0 .00544 t 3 , 10≤t ≤22. 5
d
a ( t )= v ( t )
dt
d
= (−4 . 245+21 .265 t+0 .13195 t 2 +0 . 00544 t 3 )
dt
=21 . 265+0 . 26390t +0 . 01632t 2 , 10≤t ≤22. 5
a (16)=21. 265+0 . 26390(16 )+0 .01632(16 )2 =29 . 665 m/s2
Note: There is no need to get the simplified third order polynomial expression to conduct the differentiation. An
expression of the form

( )( )( )
t −t 1 t−t 2 t −t 3
L0 ( t )=
t 0 −t 1 t 0 −t 2 t 0 −t 3
gives the derivative without expansion as

( )( ) ( )( ) ( )( )
d t −t 1 t −t 2 t −t 2 t −t 3 t −t 3 t −t 1
( L0 (t ) ) = t −t t −t + t −t t −t + t −t t −t
dt 0 1 0 2 0 2 0 3 0 3 0 1

Gambella University Chapter 4, Curve Fitting (Interpolation)


17 of 33
IV. Spline Method
After reading this method, you should be able to:
 interpolate data using spline interpolation, and
 Understand why spline interpolation is important.
th
So is the spline method yet another method of obtaining this n order polynomial. …… NO! Actually, when n
becomes large, in many cases, one may get oscillatory behavior in the resulting polynomial.

x3 , y3 

x1, y1 

f x 
x2 , y2 
x0 , y0 
x
Figure 1 Interpolation of discrete data.

Table 1 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

Now through these six points, one can pass a fifth order polynomial
f 5 ( x )=3. 1378×10−11 x 5 +1 .2019 x 4 −3 . 3651×10−11 x 3 −1 .7308 x 2 +1 .0004×10−11 x+5 . 6731×10−1 ,
−1≤x ≤1
through the six data points. On plotting the fifth order polynomial (Figure 2) and the original function, one can see
that the two do not match well. One may consider choosing more points in the interval [–1, 1] to get a better match,
but it diverges even more (see Figure 3), where 20 equidistant points were chosen in the interval [–1, 1] to draw a 19th
order polynomial. In fact, Runge found that as the order of the polynomial becomes infinite, the polynomial diverges
in the interval of −1< x <−0 . 726 and 0 . 726< x <1 .
So what is the answer to using information from more data points, but at the same time keeping the function
true to the data behavior? The answer is in spline interpolation. The most common spline interpolations used are
linear, quadratic, and cubic splines.

Gambella University Chapter 4, Curve Fitting (Interpolation)


18 of 33
1.2

0.8

0.4
y

0
-1 -0.5 0 0.5 1

-0.4
x
5th Order Polynomial Function 1/(1+25*x^2)

Figure 2 5th order polynomial interpolation with six equidistant points.

1.2

0.8

0.4
y

0
-1 -0.5 0 0.5 1

-0.4
x
5th Order Polynomial Function 1/(1+25*x^2)

19th Order Polynomial 12th Order Polynomial

Figure 3 Higher order polynomial interpolation is a bad idea.

Linear Spline Interpolation


Given ( 0 0 ) ( 1 1 ) ( n−1 n−1)( n n) , fit linear splines (Figure 4) to the data. This simply involves
x , y , x , y , .. .. . ., x ,y x ,y
forming the consecutive data through straight lines. So if the above data is given in an ascending order, the linear
splines are given by y i =f ( x i ) .

Gambella University Chapter 4, Curve Fitting (Interpolation)


19 of 33
y

(x3, y3)

(x1, y1)

(x2, y2)

(x0, y0)
x
Figure 4 Linear splines.

f ( x 1 )−f ( x 0 )
f ( x )=f ( x 0 )+ ( x −x 0 ) ,
x 1 −x0 x 0 ≤x≤x 1
f ( x 2 )−f ( x 1 )
=f ( x 1 )+ ( x−x 1 ) ,
x 2 −x1 x 1≤x ≤x 2
.
.
.
f ( x n )−f ( x n−1 )
=f ( x n−1 )+ (x −x n−1 ),
x n−x n−1 x n−1 ≤x≤x n
Note the terms of
f ( x i )−f ( xi−1 )
xi −x i−1
x x
in the above function are simply slopes between i−1 and i .

Example 1
The upward velocity of a rocket is given as a function of time in Table 2 (Figure 5).
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

GambellaFigure
University
5 Graph of velocity vs. time data for theChapter
rocket 4, Curve Fitting (Interpolation)
example.
20 of 33
Determine the value of the velocity at t =16 seconds using linear splines.
Solution
Since we want to evaluate the velocity at t =16 , and we are using linear splines, we need to choose the two data
t =15 and t 1=20 .
points closest to t =16 that also bracket t =16 to evaluate it. The two points are 0
Then
t 0 =15 , v (t 0 )=362 . 78
t 1=20 , v (t 1 )=517 . 35
gives
v (t 1 )−v (t 0 )
v (t )=v (t 0 )+ (t−t 0 )
t 1−t 0
517 .35−362 .78
=362 . 78+ (t−15 )
20−15
=362. 78+30 . 913(t−15 ) , 15≤t ≤20
At t=16 ,
v (16 )=362. 78+30 . 913(16−15 )
=393.7 m/s
Linear spline interpolation is no different from linear polynomial interpolation. Linear splines still use data only from
the two consecutive data points. Also at the interior points of the data, the slope changes abruptly. This means that the
first derivative is not continuous at these points. So how do we improve on this? We can do so by using quadratic
splines.

Quadratic Splines
In these splines, a quadratic polynomial approximates the data between two consecutive data points. Given
( x 0 , y 0 ) , ( x 1 , y 1 ) , .. .. . ., ( x n−1 , y n−1) , ( x n , y n ) , fit quadratic splines through the data. The splines are given by
2
f ( x )=a 1 x +b1 x +c 1 , x 0 ≤x≤x 1
=a2 x 2 +b 2 x+ c 2 , x 1≤x ≤x 2
.
.
.
=an x 2 + bn x +c n , x n−1 ≤x≤x n
So how does one find the coefficients of these quadratic splines? There are 3 n such coefficients
a i , i=1,2,.....,n
b i , i=1,2,.....,n

Gambella University Chapter 4, Curve Fitting (Interpolation)


21 of 33
c i , i=1,2,.....,n
To find 3 n unknowns, one needs to set up 3 n equations and then simultaneously solve them. These 3 n equations
are found as follows.
1. Each quadratic spline goes through two consecutive data points
a 1 x 2 +b 1 x 0 +c 1 =f ( x 0 )
0
a 1 x 2 +b 1 x 1 + c 1=f ( x 1 )
1
.
.
.
ai x 2 +b i x i −1 + c i=f ( x i−1 )
i −1
a i x 2 +bi x i +c i =f ( x i )
i
.
.
.
an x 2 +bn x n−1 +c n =f ( x n−1 )
n−1
a n x 2 + bn x n + c n =f ( x n )
n
This condition gives 2 n equations as there are n quadratic splines going through two consecutive data points.
2. The first derivatives of two quadratic splines are continuous at the interior points. For example, the derivative of
the first spline
a 1 x 2 +b1 x +c 1
is
2 a1 x +b1
The derivative of the second spline
a 2 x2 +b2 x +c 2
is
2 a2 x +b 2
and the two are equal at
x=x 1 giving
2 a1 x 1 +b 1=2a 2 x 1 +b2
2 a1 x 1 +b 1−2a 2 x 1−b 2=0
Similarly at the other interior points,
2 a2 x 2 +b2 −2 a3 x 2 −b3 =0
.
.
.
2 ai x i +b i−2 ai+1 x i−b i+1 =0
.
.
.
2 an−1 x n−1 +b n−1 −2 an x n−1−bn =0
Since there are (n−1) interior points, we have (n−1) such equations. So far, the total number of equations is
(2 n)+(n−1 )=(3 n−1) equations. We still then need one more equation.
We can assume that the first spline is linear, that is
a 1=0
This gives us 3 n equations and 3 n unknowns. These can be solved by a number of techniques used to solve
simultaneous linear equations.

Gambella University Chapter 4, Curve Fitting (Interpolation)


22 of 33
Example 2
The upward velocity of a rocket is given as a function of time as
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

a) Determine the value of the velocity at t =16 seconds using quadratic splines.
b) Using the quadratic splines as velocity functions, find the distance covered by the rocket from t=11 s to
t=16 s .
c) Using the quadratic splines as velocity functions, find the acceleration of the rocket at t=16 s .
d)
Solution
a) Since there are six data points, five quadratic splines pass through them.
v (t )=a1 t 2 + b1 t+ c1 , 0≤t ≤10
=a2 t 2 +b 2 t +c 2 , 10≤t ≤15
=a3 t 2 +b 3 t+ c3 , 15≤t ≤20
=a4 t 2 + b 4 t + c 4 , 20≤t ≤22. 5
=a5 t 2 +b 5 t+ c5 , 22 .5≤t ≤30
The equations are found as follows.
1. Each quadratic spline passes through two consecutive data points.
a 1 t 2 + b1 t + c 1 passes through t =0 and t =10 .
a 1 ( 0 )2 +b1 ( 0 )+ c 1=0 (1)
2
a 1 (10) +b1 (10)+c 1 =227 . 04 (2)

a 2 t 2 + b2 t +c 2 passes through t =10 and t =15 .


a 2 ( 10 )2 +b2 ( 10)+ c2 =227 . 04 (3)
2
a 2 ( 15 ) +b2 ( 15)+ c2 =362 .78 (4)

a 3 t 2 +b3 t +c 3 passes through t =15 and t =20 .


a 3 (15 )2 +b 3 (15 )+c 3=362 . 78 (5)
2
a 3 (20 ) +b 3 (20 )+ c 3 =517 .35 (6)

a 4 t 2 +b 4 t +c 4 passes through t =20 and t =22 .5 .


a 4 ( 20)2 + b4 ( 20 )+c 4 =517 . 35 (7)
2
a 4 ( 22. 5) +b 4 (22 . 5)+c 4 =602. 97 (8)

a 5 t 2 +b5 t +c 5 passes through t =22 .5 and t =30 .


Gambella University Chapter 4, Curve Fitting (Interpolation)
23 of 33
a 5 (22 .5 )2 +b 5 (22 .5 )+c 5 =602. 97 (9)
2
a 5 (30 ) +b 5 (30 )+ c 5=901. 67 (10)
2. Quadratic splines have continuous derivatives at the interior data points.
At t =10
2 a1 (10)+b 1−2 a 2 (10 )−b2 =0 (11)
At t =15
2 a2 (15)+b 2−2 a 3 (15 )−b 3=0 (12)
At t =20
2 a3 (20)+b 3 −2 a4 (20 )−b 4 =0 (13)
At t =22 .5
2 a 4 (22 . 5)+b 4 −2 a5 (22. 5 )−b5 =0 (14)
2
3. Assuming the first spline a 1 t + b1 t + c 1 is linear,
a 1=0

][ [ ]
(15)
Combining Equation (1) – (15) in matrix form gives

[
a1
0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 b1 0
100 10 1 0 0 0 0 0 0 0 0 0 0 0 0 c1 227 . 04
0 0 0 100 10 1 0 0 0 0 0 0 0 0 0 a2 227 . 04
0 0 0 225 15 1 0 0 0 0 0 0 0 0 0 362 . 78
b2
0 0 0 0 0 0 225 15 1 0 0 0 0 0 0 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
a4 901 . 67
20 1 0 −20 −1 0 0 0 0 0 0 0 0 0 0 0
b4
0 0 0 30 1 0 −30 −1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 40 1 0 −40 −1 0 0 0 0 c4 0
0 0 0 0 0 0 0 0 0 45 1 0 −45 −1 0 a5 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 b5 0
c5

Solving the above 15 equations give the 15 unknowns as


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

Therefore, the splines are given by


v (t )=22. 704 t , 0≤t ≤10
=0. 8888 t 2 +4 .928 t +88 . 88 , 10≤t ≤15
=−0.1356 t 2 +35 .66 t−141.61 , 15≤t ≤20

Gambella University Chapter 4, Curve Fitting (Interpolation)


24 of 33
=1 .6048 t2 −33 . 956t+554. 55 , 20≤t ≤22. 5
=0.20889 t 2 +28 .86 t−152 . 13 , 22 .5≤t ≤30
At t=16 s
v (16 )=−0 .1356 (16 )2 +35. 66 (16 )−141 . 61
=394 .24 m/s
b) The distance covered by the rocket between 11 and 16 seconds can be calculated as
16
s(16 )−s(11)=∫ v (t )dt
11
But since the splines are valid over different ranges, we need to break the integral accordingly as
v (t )=0 . 8888t 2 +4 . 928 t+88. 88 , 10≤t ≤15
=−0.1356 t 2 +35 .66 t−141.61 , 15≤t ≤20
16 15 16
∫ v (t )dt=∫ v (t )dt+∫ v (t )dt
11 11 15
15 16
s(16 )−s(11)=∫ (0 .8888 t +4 . 928 t+88 . 88 )dt +∫ (−0 . 1356 t 2 +35 .66 t−141 . 61)dt
2

11 15

[ ]
3 2 15
t t
= 0 .8888 +4 . 928 +88 . 88 t
3 2 11

[ ]
16
t3 t2
+ −0 .1356 +35 . 66 −141. 61t
3 2 15
=1217 . 35+378 . 53
=1595 . 9 m

c) What is the acceleration at t =16 ?


d
a (16)= v (t )|t=16
dt
d d
a (t )= v (t )= (−0 . 1356 t 2 +35 .66 t−141 .61 )
dt dt
=−0 . 2712 t+35 . 66 , 15≤t ≤20
a (16)=−0 .2712(16 )+35 .66
=31.321 m/s2

II. Newton’s Forward and Backward method


After reading this method, you should be able to
 derive Newton’s forward and backward method of interpolation,
 apply Newton’s forward and backward method of interpolation, and
 apply Newton’s forward and backward method interpolants to find derivatives and integrals.

Gambella University Chapter 4, Curve Fitting (Interpolation)


25 of 33
Given n+1 data points ( x i , y i ) for i=0 , 1 ,2 , … … .. n with constant step size h such that y ( x i )= y i and x i+1=x i +h

Objective: To find the nth degree polynomial P(x ) that passes through the n+1 data points. i.e P ( x i )= y i

Newton’s forward formula:

We can write any values of x between x 0 ≤ x ≤ x n in terms of x 0 as:

x=x 0 + p h for some p ∈ R

The general Newton’s forward formula is given by:

( x−x 0 ) ( x−x 0 )( x−x 1) 2 ( x−x 0 ) ( x−x 1 ) ( x−x 2 ) 3


P ( x )=P ( x 0+ ph ) =[1+ △+ 2
△ + 3
△ + …] y 0
1!h 2! h 3!h

 First order (first degree Newton’s forward polynomial) is given by:

( x−x 0 )
P1 ( x ) =[1+ △ ] y0
1!h

 Second order (second degree Newton’s forward polynomial) is given by:

( x−x 0 ) ( x −x 0) ( x−x 1 ) 2
P2 ( x ) =[1+ △+ 2
△ ] y0
1!h 2!h

 Third order (third degree Newton’s forward polynomial) is given by:

( x−x 0 ) ( x−x 0 )( x −x1 ) 2 ( x−x 0 ) ( x−x 1 )( x−x 2) 3


P3 ( x )=[1+ △+ 2
△ + 3
△ ] y0
1!h 2!h 3! h

NB: where △ , △ 2 , △ 3 , … … … are determined from the forward difference table

Activity: Drive Newton’s forward formulas from Newton’s divided difference methods for constant step size h

Newton’s backward formula:


We can write any values of x between x 0 ≤ x ≤ x n in terms of x n as: x=x n + p h for some p ∈ R
The general Newton’s backward formula is given by:

( x−x n ) ( x−x n )( x−x n−1) 2 ( x−x n ) ( x−x n−1 ) ( x−x n−2 ) 3


P ( x )=P ( x n+ ph ) =[1+ ∇+ 2
∇+ 3
∇ + …] y n
1!h 2!h 3!h

 First order (first degree Newton’s backward polynomial) is given by:

( x−x n )
P1 ( x ) =[1+ ∇ ] yn
1!h

 Second order (second degree Newton’s backward polynomial) is given by:

( x−x n ) ( x −x n) ( x−x n−1 ) 2


P2 ( x ) =[1+ ∇+ 2
∇ ] yn
1!h 2!h

Gambella University Chapter 4, Curve Fitting (Interpolation)


26 of 33
 Third order (third degree Newton’s backward polynomial) is given by:

( x−x n ) ( x−x n )( x −x n−1 ) 2 ( x−x n ) ( x−x n−1 )( x−x n−2) 3


P3 ( x )=[1+ ∇+ 2
∇+ 3
∇ ] yn
1!h 2!h 3! h

NB: where ∇ , ∇2 , ∇3 , … … … are determined from the backward difference table


Example 1
The velocity of an object is given as a function of time in Table 1.
Table 1 : Velocity as a function of time.
t (s) v (t ) (m/s)
4 1
6 3
8 8
10 20

Figure 2 Graph of velocity vs. time data for an object

 Find a polynomial of degree three which coincides or fits at the given data values using Newton’s forward
and backward formula.

 Determine the value of the velocity at t =7 seconds using the Newton’s forward and backward method of
interpolation of first and second order polynomial.

Gambella University Chapter 4, Curve Fitting (Interpolation)


27 of 33

You might also like