Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
8 views

Numericalmethods Lecture 1

Uploaded by

Ailada Meephon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Numericalmethods Lecture 1

Uploaded by

Ailada Meephon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Chemical and Petroleum Refining Engineering

Numerical Methods / 3rd stage

Chapter 1 - Lecture 1

Polynomial Interpolation

1.1 Introduction

For the statement

𝑦 = 𝑓(𝑥), 𝑥1 ≤ 𝑥 ≤ 𝑥𝑁

Every value of x in the range 𝑥1 ≤ 𝑥 ≤ 𝑥𝑁 , there exists one or more values of y. Assuming that f(x)
is single – valued and continuous and known explicitly, then the values of f(x) corresponding to
certain given values of x can easily be computed and tabulated.

The central problem of numerical analysis is the converse one:

If the values of a function f (x) at a set of points x1, x2, ..., xN is known but the analytic expression of
the function is unknown that lets us calculate its value at an arbitrary point.
The task now is to estimate f(x) for arbitrary x by drawing a smooth curve through (and perhaps
beyond) the xi.
The procedure of estimating the value of f (x) for the desired x
 If the value for points between the largest and smallest of the xi’s (𝑥 ∈ [𝑥1 , 𝑥𝑁 ]) is called
interpolation
 If the value is for points outside that range (𝑥 ∉ [𝑥1 , 𝑥𝑁 ]) is called extrapolation.
For example, given the set of tabular values of a census of the population of the Us that is taken every
10 years

1
Chemical and Petroleum Refining Engineering
Numerical Methods / 3rd stage

To know the population of the US in year 1965 or year 2010, have to fit a function through the given
data.
The form of the function (𝜙 (𝑥)) that approximates the set of points should be a convenient one and
should be applicable to a general class of problems. The most usual class of functions fitted through
data are polynomials.
1.2 Polynomial Interpolation
The general formula for an (n – 1) th-order polynomial can be written as
𝑓(𝑥) = 𝑎1 + 𝑎2 𝑥 + 𝑎3 𝑥 2 + ⋯ + 𝑎𝑛 𝑥 𝑛−1
For n data points, there is one and only one polynomial of order (n − 1) that passes through all the
points. For example, there is only one straight line (i.e., a first-order polynomial) that connects two
points (Fig. 1a). Similarly, only one parabola connects a set of three points (Fig. 1b).

Figure 1: examples of interpolating polynomials: (a) first-order (linear) connecting two points, (b) second-order
(quadratic or parabolic) connecting three points, and (c) third-order (cubic) connecting four points.

Polynomial interpolation consists of determining the unique (n − 1)th order polynomial that fits n
data points. Then this polynomial provides a formula to compute intermediate values.

1.3 Newton Interpolating Polynomial


Newton’s interpolating polynomial is among the most popular and useful forms for expressing an
interpolating polynomial. First, introduce the first- and second-order versions because of their simple
visual interpretation, before presenting the general equation

2
Chemical and Petroleum Refining Engineering
Numerical Methods / 3rd stage

1.4.1 Linear Interpolation


The simplest form of interpolation is to connect two data points with a straight line. This technique,
called linear interpolation, is depicted graphically in Figure 2. The shaded areas indicate the similar
triangles used to derive the Newton linear-interpolation formula

Figure 2: linear-interpolation

𝑓1 (𝑥) − 𝑓(𝑥1 ) 𝑓(𝑥2 ) − 𝑓(𝑥1 )


=
𝑥 − 𝑥1 𝑥2 − 𝑥1
Which can be rearranged to
𝑓(𝑥2 ) − 𝑓(𝑥1 )
𝑓1 (𝑥) = 𝑓(𝑥1 ) + (𝑥 − 𝑥1 )
𝑥2 − 𝑥1
which is the Newton linear-interpolation formula. The notation 𝑓1 (𝑥)designates that this is a first
order interpolating polynomial. Notice that besides representing the slope of the line connecting the
𝑓(𝑥2 )−𝑓(𝑥1 )
points, the term is a finite-difference approximation of the first derivative.
𝑥2 −𝑥1

In general, the smaller the interval between the data points, the better the approximation. This is due
to the fact that, as the interval decreases, a continuous function will be better approximated by a
straight line. This characteristic is demonstrated in the following example.

3
Chemical and Petroleum Refining Engineering
Numerical Methods / 3rd stage

Example 1: Estimate the natural logarithm of 2 using linear interpolation during interval 1 to 6. Then,
repeat the procedure, but use a smaller interval from 1 to 4. Note that the true value of ln 2 is
0.6931472.
For interval [1, 6],
𝑓(𝑥1 ) = ln 1 = 0,
𝑓(𝑥2 ) = ln 6 = 1.791759
𝑓(𝑥2 ) − 𝑓(𝑥1 )
𝑓1 (𝑥) = 𝑓(𝑥1 ) + (𝑥 − 𝑥1 )
𝑥2 − 𝑥1
ln 6 − ln 1 1.791759 − 0
𝑓1 (2) = ln 1 + (2 − 1) → 𝑓1 (2) = 0 + = 0.3583519
6−1 5
which represents an error of εt = 48.3%
For interval [1, 4],
𝑓(𝑥1 ) = ln 1 = 0,
𝑓(𝑥2 ) = ln 4 = 1.386294
ln 4 − ln 1 1.386294 − 0
𝑓1 (2) = ln 1 + (2 − 1) → 𝑓1 (2) = 0 + = 0.4620981
4−1 5
Thus, using the shorter interval reduces the percent relative error to εt = 33.3%. Both
interpolations are shown in Figure 3, along with the true function.

Figure 3: Two linear interpolations to estimate ln 2.

4
Chemical and Petroleum Refining Engineering
Numerical Methods / 3rd stage

1.4.2 Quadratic Interpolation


If three data points are available, this can be accomplished with a second-order polynomial (also
called a quadratic polynomial or a parabola). A particularly convenient form for this purpose is
𝑓2 (𝑥) = 𝑏1 + 𝑏2 (𝑥 − 𝑥1 ) + 𝑏3 (𝑥 − 𝑥1 )(𝑥 − 𝑥2 )
A simple procedure can be used to determine the values of the coefficients.
𝑥1 𝑓(𝑥1 )
𝑥2 𝑓(𝑥2 ) 𝑓(𝑥2 ) − 𝑓(𝑥1 )
𝑥2 − 𝑥1
𝑥3 𝑓(𝑥3 ) 𝑓(𝑥3 ) − 𝑓(𝑥2 ) 𝑓(𝑥3 ) − 𝑓(𝑥2 ) 𝑓(𝑥2 ) − 𝑓(𝑥1 )

𝑥3 − 𝑥2 𝑥3 − 𝑥2 𝑥2 − 𝑥1
𝑥3 − 𝑥1
𝑏1 = 𝑓(𝑥1 )
𝑓(𝑥2 ) − 𝑓(𝑥1 )
𝑏2 =
𝑥2 − 𝑥1
𝑓(𝑥3 ) − 𝑓(𝑥2 ) 𝑓(𝑥2 ) − 𝑓(𝑥1 )

𝑥3 − 𝑥2 𝑥2 − 𝑥1
𝑏3 =
𝑥3 − 𝑥1
Example 2: Employ a second order Newton polynomial to estimated ln 2 with
𝑥1 = 1 𝑓(𝑥1 ) = 0 0.4620981 −0.051731
𝑥2 = 4 𝑓(𝑥2 ) = 1.386294 0.2027325
𝑥3 = 6 𝑓(𝑥3 ) = 1.791759
𝑏1 = 0
1.386294 − 0
𝑏2 = = 0.4620981
4−1
1.791759 − 1.386294
− 0.4620981
𝑏3 = 6−4 = −0.051731
6−1
𝑓2 (𝑥) = 0 + 0.4620981(𝑥 − 1) − 0.051731(𝑥 − 1)(𝑥 − 4)
𝑓2 (𝑥) = 0.5658444

which represents a relative error of εt = 18.4%. Thus, the curvature introduced by the quadratic
formula (Figure 4) improves the interpolation compared with the result obtained using straight lines

5
Chemical and Petroleum Refining Engineering
Numerical Methods / 3rd stage

Figure 4: The use of quadratic interpolation to estimate ln 2. The linear interpolation from x = 1 to 4 is also included for
comparison.

1.4.3 General Form of Newton’s Interpolating Polynomials


The preceding analysis can be generalized to fit an (n − 1)th-order polynomial to n data points. The
(n − 1)th-order polynomial is
𝑓𝑛−1 (𝑥) = 𝑏1 + 𝑏2 (𝑥 − 𝑥1 ) + ⋯ + 𝑏𝑛 (𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) ⋯ (𝑥 − 𝑥𝑛−1 )
Data points can be used to evaluate the coefficients b1, b2, . . . , bn . For an (n − 1)th-order polynomial,
n data points are required: [x1, f (x1)], [x2, f (x2)], . . . , [xn, f (xn)] to evaluate the coefficients:
𝑏1 = 𝑓(𝑥1 )
𝑏2 = 𝑓[𝑥2 , 𝑥1 ]
𝑏3 = 𝑓[𝑥3 , 𝑥2 , 𝑥1 ]

𝑏𝑛 = 𝑓[𝑥𝑛 , 𝑥𝑛−1 , ⋯ , 𝑥3 , 𝑥2 , 𝑥1 ]
where the bracketed function evaluations are finite divided differences. For example, the first finite
divided difference is represented generally as
𝑓(𝑥𝑖 ) − 𝑓(𝑥𝑗 )
𝑓[𝑥𝑖 , 𝑥𝑗 ] =
𝑥𝑖 − 𝑥𝑗
The second finite divided difference, which represents the difference of two first divided differences,
is expressed generally as
𝑓[𝑥𝑖 , 𝑥𝑗 ] − 𝑓[𝑥𝑗 , 𝑥𝑘 ]
𝑓[𝑥𝑖 , 𝑥𝑗 , 𝑥𝑘 ] =
𝑥𝑖 − 𝑥𝑘

6
Chemical and Petroleum Refining Engineering
Numerical Methods / 3rd stage

Similarly, the nth finite divided difference is


𝑓[𝑥𝑛 , 𝑥𝑛−1 , ⋯ , 𝑥3 , 𝑥2 ] − 𝑓[𝑥𝑛 , 𝑥𝑛−1 , ⋯ , 𝑥3 , 𝑥2 , 𝑥1 ]
𝑓[𝑥𝑛 , 𝑥𝑛−1 , ⋯ , 𝑥3 , 𝑥2 , 𝑥1 ] =
𝑥𝑛 − 𝑥1

These differences can be used to evaluate the coefficients, which can then be substituted into the
general form of Newton.s interpolating polynomial:
𝑓𝑛−1 (𝑥) = 𝑓(𝑥1 ) + (𝑥 − 𝑥1 )𝑓[𝑥2 , 𝑥1 ] + (𝑥 − 𝑥1 )(𝑥 − 𝑥2 )𝑓[𝑥3 , 𝑥2 , 𝑥1 ] + ⋯
+ (𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) ⋯ (𝑥 − 𝑥𝑛−1 )𝑓[𝑥𝑛 , 𝑥𝑛−1 , ⋯ , 𝑥3 , 𝑥2 , 𝑥1 ]
Example 3: Employ a third order Newton polynomial to estimate ln 2 with a parabola.

𝑥1 = 1 𝑓(𝑥1 ) = 0
𝑥2 = 4 𝑓(𝑥2 ) = 1.386294
𝑥3 = 6 𝑓(𝑥3 ) = 1.791759
𝑥4 = 5 𝑓(𝑥4 ) = 1.609438

The third-order polynomial with n = 4 is


𝑓3 (𝑥) = 𝑏1 + 𝑏2 (𝑥 − 𝑥1 ) + 𝑏3 (𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) + 𝑏4 (𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )
The first divided differences

1.386294 − 0
𝑓[𝑥2 , 𝑥1 ] = = 0.4620981
4−1
1.791759 − 1.386294
𝑓[𝑥3 , 𝑥2 ] = = 0.2027326
6−4

7
Chemical and Petroleum Refining Engineering
Numerical Methods / 3rd stage

1.609438 − 1.791759
𝑓[𝑥4 , 𝑥3 ] = = 0.1823216
5−6
The second divided differences
0.2027326 − 0.4620981
𝑓[𝑥3 , 𝑥2 , 𝑥1 ] = = −0.05187311
6−1
0.1823216 − 0.2027326
𝑓[𝑥4 , 𝑥3 , 𝑥2 ] = = −0.02041100
5−4
The third divided differences
−0.02041100 − (−0.05187311)
𝑓[𝑥4 , 𝑥3 , 𝑥2 , , 𝑥1 ] = = 0.007865529
5−1
Thus, the divided difference table is

𝑥𝑖 𝑓(𝑥𝑖 ) First Second Third


1 0 0.4620981 −0.05187311 0.007865529
4 1.386294 0.2027326 −0.02041100
6 1.791759 0.1823216
5 1.609438

𝑓3 (𝑥) = 0 + 0.4620981(𝑥 − 1) − 0.05187311(𝑥 − 1)(𝑥 − 4)


+ 0.007865529(𝑥 − 1)(𝑥 − 4)(𝑥 − 6)
𝑓3 (2) = 0.6287686

Figure 5: The use of cubic interpolation to estimate ln 2.

8
Chemical and Petroleum Refining Engineering
Numerical Methods / 3rd stage

Notice about Newton’s interpolating:

1. General form of Newton’s interpolating polynomials is called Newton’s divided-difference


interpolating polynomial.

2. It is not necessary that the data points used be equally spaced.

3. With Newton's interpolation, if you add new points you don't have to re-calculate all the
coefficients. For example, the interpolation polynomial in the points 𝑥0 , 𝑥1 ,..., 𝑥𝑛 with addition the
point 𝑥𝑛+1 then using Newton's method the polynomial in the points 𝑥0 , 𝑥1 ,..., 𝑥𝑛 can be used to find
the polynomial for the points 𝑥0 , 𝑥1 ,..., 𝑥𝑛 , 𝑥𝑛+1You don't have to find all the coefficients all over
again.
1.5 Lagrange Interpolating Polynomial

The Lagrange interpolating polynomial is simply a reformulation of the Newton polynomial that
avoids the computation of divided differences. It can be represented as
𝑛

𝑓𝑛−1 (𝑥) = ∑ 𝐿𝑖 (𝑥)𝑓(𝑥𝑖 )


𝑖=1
𝑛
𝑥 − 𝑥𝑗
𝐿𝑖 (𝑥) = ∏
𝑥𝑖 − 𝑥𝑗
𝑗=1
𝑗≠𝑖

where ∏ designates the “product of.” For example, the linear version (n = 2) is
𝑓1 (𝑥) = 𝐿1 𝑓(𝑥1 ) + 𝐿2 𝑓(𝑥2 )
𝑥 − 𝑥2 𝑥 − 𝑥1
𝐿1 = 𝑎𝑛𝑑 𝐿2 =
𝑥1 − 𝑥2 𝑥2 − 𝑥1

Such a second-order Lagrange interpolating polynomial can be written as

(𝑥 − 𝑥2 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥1 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥1 )(𝑥 − 𝑥2 )


𝑓2 (𝑥) = 𝑓(𝑥1 ) + 𝑓(𝑥2 ) + 𝑓(𝑥3 )
(𝑥1 − 𝑥2 )(𝑥1 − 𝑥3 ) (𝑥2 − 𝑥1 )(𝑥2 − 𝑥3 ) (𝑥3 − 𝑥1 )(𝑥3 − 𝑥2 )
The drawbacks of Lagrange interpolation is that if we add another support point xn+1, we have to
recompute all of the Lagrange polynomials again.

9
Chemical and Petroleum Refining Engineering
Numerical Methods / 3rd stage

Example 4: Use a Lagrange interpolating polynomial of the first and second order to evaluate the
density of unused motor oil at T = 15 °C based on the following data:
𝑥1 = 0 𝑓(𝑥1 ) = 3.85
𝑥2 = 20 𝑓(𝑥2 ) = 0.8
𝑥3 = 40 𝑓(𝑥3 ) = 0.212

The first-order polynomial can be used to obtain the estimate at x = 15:


(𝑥 − 𝑥2 ) (𝑥 − 𝑥1 )
𝑓1 (𝑥) = 𝑓(𝑥1 ) + 𝑓(𝑥2 )
(𝑥1 − 𝑥2 ) (𝑥2 − 𝑥1 )

15 − 20 15 − 0
𝑓1 (𝑥) = 3.85 + 0.8 = 1.5625
0 − 20 20 − 0
In a similar fashion, the second-order polynomial is developed as

(𝑥 − 𝑥2 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥1 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥1 )(𝑥 − 𝑥2 )


𝑓2 (𝑥) = 𝑓(𝑥1 ) + 𝑓(𝑥2 ) + 𝑓(𝑥3 )
(𝑥1 − 𝑥2 )(𝑥1 − 𝑥3 ) (𝑥2 − 𝑥1 )(𝑥2 − 𝑥3 ) (𝑥3 − 𝑥1 )(𝑥3 − 𝑥2 )
(15 − 20)(15 − 40) (15 − 0)(15 − 40) (15 − 0)(15 − 20)
𝑓2 (𝑥) = 3.85 + 0.8 + 0.212
(0 − 20)(0 − 40) (20 − 0)(20 − 40) (40 − 0)(40 − 20)
= 1.3316875

Example 5: Use a Lagrange interpolating polynomial of the first, second and third order to evaluate
ln 2
𝑥1 = 1 𝑓(𝑥1 ) = 0
𝑥2 = 4 𝑓(𝑥2 ) = 1.386294
𝑥3 = 6 𝑓(𝑥3 ) = 1.791759
𝑥4 = 5 𝑓(𝑥4 ) = 1.609438
(𝑥 − 𝑥2 ) (𝑥 − 𝑥1 )
𝑓1 (𝑥) = 𝑓(𝑥1 ) + 𝑓(𝑥2 )
(𝑥1 − 𝑥2 ) (𝑥2 − 𝑥1 )
(2 − 4) (2 − 1)
𝑓1 (𝑥) = (0) + (1.386294) = 0.462098
(1 − 4) (4 − 1)

(2 − 4)(2 − 6) (2 − 1)(2 − 6) (2 − 1)(2 − 4)


𝑓2 (𝑥) = (0) + (1.386294) + (1.791759
(1 − 4)(1 − 6) (4 − 1)(4 − 6) (6 − 1)(6 − 4)
= 0.565844

10
Chemical and Petroleum Refining Engineering
Numerical Methods / 3rd stage

(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )(𝑥 − 𝑥4 ) (𝑥 − 𝑥1 )(𝑥 − 𝑥3 )(𝑥 − 𝑥4 )


𝑓3 (𝑥) = 𝑓(𝑥1 ) + 𝑓(𝑥2 )
(𝑥1 − 𝑥2 )(𝑥1 − 𝑥3 )(𝑥1 − 𝑥4 ) (𝑥2 − 𝑥1 )(𝑥2 − 𝑥3 )(𝑥2 − 𝑥4 )
(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥4 ) (𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )
+ 𝑓(𝑥3 ) + 𝑓(𝑥4 )
(𝑥3 − 𝑥1 )(𝑥3 − 𝑥2 )(𝑥3 − 𝑥4 ) (𝑥4 − 𝑥1 )(𝑥4 − 𝑥2 )(𝑥4 − 𝑥3 )
(2 − 4)(2 − 6)(2 − 5) (2 − 1)(2 − 6)(2 − 5)
𝑓3 (2) = (0) + (1.386294)
(1 − 4)(1 − 6)(1 − 5) (4 − 1)(4 − 6)(4 − 5)
(2 − 1)(2 − 4)(2 − 5) (2 − 1)(2 − 4)(2 − 6)
+ (1.791759) + (1.609438)
(6 − 1)(6 − 4)(6 − 5) (5 − 1)(5 − 4)(5 − 6)
𝑓3 (2) = 0.62876
These results agree with those previously obtained using Newton’s interpolating polynomial

Exercises:
1. Calculate 𝑓(3.4) using the following data using first Newton’s interpolating polynomial and
second Lagrange polynomial

𝒙 1 2 2.5 3 4 5
𝒇(𝒙) 0 5 6.5 7 3 1

2. The acceleration due to gravity at an altitude y above the surface of the earth is given by

𝒚, 𝒎 0 30000 60000 90000 120000


𝒈, 𝒎/𝒔𝟐 9.81 9.7487 9.6879 9.6278 9.5682

Compute g at y = 55,000 m.

11
Chemical and Petroleum Refining Engineering
Numerical Methods / 3rd stage

1.6 Polynomial Interpolation with Equally Spaced Base Points

When the base point values are equally spaced so that 𝑥1 − 𝑥0 = 𝑥2 − 𝑥1 = ⋯ = 𝑥𝑛 − 𝑥𝑛−1 = ℎ,
then the interpolating polynomial will be developed in terms of the forward (∆), backward (∇) and
central (𝛿)difference opertors. Use these operators permits reduction in computation compare with
Newton or Lagrange forms

1.6.1 Forward Differences (Newton-Gregory forward)

The forward difference operator is (∆). ∆𝑓(𝑥) is termed the first forward difference, ∆2 𝑓(𝑥) the
second forward difference, etc. the forward difference can be computed and saved in forward
difference table in much the same manner as shown earlier for the divided differences

𝑥𝑖 𝑓(𝑥𝑖 ) ∆𝑓(𝑥) ∆2 𝑓(𝑥) ∆3 𝑓(𝑥) ∆4 𝑓(𝑥)


0 −𝟓
𝟔
1 1 𝟐
8 𝟔
2 9 8 𝟎
16 6
3 25 14
30
4 55
A parameter α is introduced, in order to rewrite the forward finite difference in compact form such
that
𝑥 = 𝑥0 + 𝛼ℎ, 0 ≤ 𝛼 ≤ 𝑛
The forward difference polynomial formula in term of𝛼 is expressed as
𝛼(𝛼 − 1) 2 𝛼(𝛼 − 1)(𝛼 − 2) ⋯ (𝛼 − 𝑛 + 1) 𝑛
𝑓(𝑥) = 𝑓(𝑥0 ) + 𝛼 ∆𝑓(𝑥0 ) + ∆ 𝑓(𝑥0 ) + ⋯ + ∆ 𝑓(𝑥0 )
2! 𝑛!
Example 6: Apply Newton formal to the data and evaluate the second degree polynomial for
interpolation argument 𝑥 = 1.5
𝑥 − 𝑥1 1.5 − 0
𝛼= = = 1.5
ℎ 1

12
Chemical and Petroleum Refining Engineering
Numerical Methods / 3rd stage

𝛼(𝛼 − 1) 2
𝑓2 (𝑥) = 𝑓(𝑥0 ) + 𝛼 ∆𝑓(𝑥0 ) + ∆ 𝑓(𝑥0 )
2!
1.5(0.5)
𝑓2 (1.5) = −5 + 6 (1.5) + (2) = 4.75
2!
1.6.2 Backward differences (Newton-Gregory backward)
The backward difference operator is (∇). ∇𝑓(𝑥) is termed the first backward difference, ∇2 𝑓(𝑥) the
second backward difference, etc.
𝑥𝑖 𝑓(𝑥𝑖 ) ∆𝑓(𝑥) ∆2 𝑓(𝑥) ∆3 𝑓(𝑥) ∆4 𝑓(𝑥)
0 −5
6
1 1 2
8 6
2 9 8 𝟎
16 𝟔
3 25 𝟏𝟒
𝟑𝟎
4 𝟓𝟓
A parameter α is defined as the origin base point 𝑥𝑛 so that
𝑥 = 𝑥𝑛 + 𝛼ℎ, − 𝑛 ≤ 𝛼 ≤ 0
𝛼(𝛼 + 1) 2 𝛼(𝛼 + 1)(𝛼 + 2) ⋯ (𝛼 + 𝑛 − 1) 𝑛
𝑓(𝑥) = 𝑓(𝑥𝑛 ) + 𝛼 ∇𝑓(𝑥𝑛 ) + ∇ 𝑓(𝑥𝑛 ) + ⋯ + ∇ 𝑓(𝑥𝑛 )
2! 𝑛!

This equation is known as Newton backward formula. Since Newton backward formula uses
differences along the lower diagonal of the difference table, it is most useful for interpolation near
the end of a set of tabulated values.

Example 7: Find the interpolated value predicted by third degree NBF for 𝑥 = 3.5

𝑥 − 𝑥𝑛 3.5 − 4
𝛼= = = −0.5
ℎ 1
𝛼(𝛼 + 1) 2 𝛼(𝛼 + 1)(𝛼 + 2) 3
𝑓3 (𝑥) = 𝑓(𝑥𝑛 ) + 𝛼 ∇𝑓(𝑥𝑛 ) + ∇ 𝑓(𝑥𝑛 ) + ∇ 𝑓(𝑥𝑛 )
2! 3!
𝛼(𝛼 + 1) 𝛼(𝛼 + 1)(𝛼 + 2)
𝑓3 (𝑥) = 55 + 30 𝛼 + (14) + (6)
2! 3!

13
Chemical and Petroleum Refining Engineering
Numerical Methods / 3rd stage

𝑓3 (𝑥) = 55 + 30 𝛼 + 7𝛼 2 + 7𝛼 + 𝛼 3 + 3𝛼 2 + 2𝛼
𝑓3 (𝑥) = 55 + 39 (𝑥 − 4) + 10(𝑥 − 4)2 + (𝑥 − 4)3
𝑓3 (𝑥) = 55 + 39 𝑥 − 156 + 10𝑥 2 − 80𝑥 + 160 + 𝑥 3 − 8𝑥 2 + 16𝑥 − 4𝑥 2 + 32𝑥 − 64
𝑓3 (𝑥) = 𝑥 3 − 2𝑥 2 + 7𝑥 − 5
(0.5)(−0.5) (−0.5)(0.5)(1.5)
𝑓3 (3.5) = 55 + (−0.5)(30) + (14) + (6) = 37.875
2! 3!

1.6.3 Central Differences (Newton-Gregory Central)


A simple notation which describe differences along a part near the center of the difference table is
needed the central difference operator (𝛿) is defined as follows:
𝑥𝑖 𝑓(𝑥𝑖 ) 𝛿𝑓(𝑥) 𝛿 2 𝑓(𝑥) 𝛿 3 𝑓(𝑥) 𝛿 4 𝑓(𝑥)
−5
0 6
1 2
1 8 6
9 8 0
2 16 6
25 14
3 30
55
4

The central difference table (entires are identical with the forward and backward difference tables
except for subscripts of the base points) then takes the form central difference table.
If the solid lines is taken, the formulation is termed the Gass forward formula by

ℎ 𝑓(𝑥 0 ) 𝑓 (𝑥0 + 2)
𝑓(𝑥) = 𝑓(𝑥0 ) + 𝛼𝛿𝑓 (𝑥0 + ) + 𝛼(𝛼 − 1)𝛿 2 + 𝛼(𝛼 − 1)(𝛼 − 2)𝛿 3
2 2! 3!
𝑓(𝑥0 )
+ 𝛼(𝛼 − 1)(𝛼 − 2)(𝛼 − 3)𝛿 4
4!
𝑥 − 𝑥0
𝛼=

14
Chemical and Petroleum Refining Engineering
Numerical Methods / 3rd stage

when the dotted lines is used, Gass backward is generated



ℎ 𝑓(𝑥0 ) 𝑓 (𝑥0 − 2)
𝑓(𝑥) = 𝑓(𝑥0 ) + 𝛼𝛿𝑓 (𝑥0 − ) + 𝛼(𝛼 + 1)𝛿 2 + (𝛼 − 1)𝛼(𝛼 + 1)𝛿 3
2 2! 3!

Example 8: Use the gauss forward formula and central difference to compute the interpolant value
for inpoation argument 𝑥 = 2.5
𝑥 − 𝑥0 2.5 − 2
𝛼= = = 0.5
ℎ 1
(0.5)(−0.5) (0.5)(−0.5)(−1.5)
𝑓3 (2.5) = 9 + (0.5)(16) + (8) + (6) = 16.375
2! 3!

Exercises 2:
1. Use an appropriate interpolation formula to estimate 𝑓(16.4) and 𝑓(23.5) from following data
𝑥 16 18 20 22 24
𝑓𝑥) 261.3 293.7 330 372.2 422.3

2. Use gauss’s forward formula to evaluate 𝑦 at 30 from the following data

𝑥 21 25 29 33 37
𝑦 18.4708 17.8144 17.1070 16.3432 15.5154

15

You might also like