iteration method with memory for the solution of a non-linear equation ...

4 downloads 0 Views 206KB Size Report
More efficient third order convergence methods, such .... 3. Rate of convergence against the number of iterations. Fig. 2. Forms of the functions for the four cases.
Shorter Communications Chemical

Engineering

Science,

AJI

1972,

Vol.27,pp. 2099-2101.

Pergamon

Press.

Printed in Great Britain

iteration method with memory for the solution of a non-linear equation (Received

23 December

MANY areas of chemical engineering analysis require the use of efficient techniques for determining the roots of algebraic or transcendental equations [6]. In many cases, the equation is not explicit, but is represented by an algorithm of a mathematical mode1 of elements of a process, with which an output variable is calculated for a certain input variable, and it is required to find the value of the input variable for which the value of the output variable is minimal or zero. Iterative methods are generally used to find the root of a non-linear function. The most commonly used method is the Newton-Raphson method, which requires the calculation of the values of the function and its derivative at each iteration point. More efficient third order convergence methods, such as the Chebyshev[ 1,4,5] and the Richmond[4,7] methods require the calculation of the value of the second derivative at each iteration point as well. For many chemical engineering problems the derivation of second derivatives is laborious, and the time to compute their values may not offset the gain in time by the reduction in the number of iterations. The proposed method is of the class defined by Traub[9] as one point iteration function with memory. However, whereas most methods of this class utilize one or two previously calculated values, this method uses all previously calculated values. THE PROPOSED METHOD The proposed Memory Method uses as an interpolation function, a polynomial of order n - 1 through n previously calculated points. It is desired to find the root of the function j-(x) = 0.

197 1)

Equation (5) is the main part of the algorithm and can be easily programmed in any computer language. A useful property of most chemical engineering problems is that only one real positive root exists, and can be bracketed easily. For instance, a normalized molar concentration is always in the range of O-l. However, any two points in the vicinity of the root can be used as the starting points. The Memory Method does not assure convergence, when the derivative of the function is zero at the neighbourhood of the root. However, no convergence problems were encountered in our tests of many chemical engineering problems. If the solution diverges, it can be checked against the bracketing values and returned into the correct range by a search technique, such as the interval halving method. Figure 1 (for case I, described below) shows the successive approximations of the function by the interpolation function. EXAMPLES Four cases of typical problems in chemical engineering, that result in a variety of forms of functions (Fig. 2) are demonstrated here: Case I. A chemical

equilibriumproblem

(Problem

distillation problem

Case II. AJash

(7)

(1)

This function is written in the form of: Y =f(x).

(2)

Assume that y,,. Y”_~,. . . , y0 have already been calculated for values of x,, x,_~, . . . , x0.A polynomial of the form x = P ( y) is formed and the next value of x is chosen by calculating x= P(0). It is convenient to use Lagrange’s interpolation method to form the polynomial. For this method: P(Y) = $0 G,(Y)

(3)

where

3 in[8])

The vapor fraction (JI) at a desired temperature and pressure was calculated for a known petroleum fraction with 19 components. Case III. A kinetic problem 1

Fexp

21000

( 1 7

-1~11x10”=0.

This equation was derived from a stirred reactor with cooling coils, similar to Example 1 in 121. Case IV.

The azeotropic

point of a binary solution

AB[B(l--x)2-A~21+o.14845=o~ [x(A-B) +B]’

(4)

(9)

This equation is based on Eqs. (7.9)-(22) in[3] for x,+1 =

P(O) = i k=O

x/cfi

A.

(5)

A = 0.38969

and

B = 0.55954

III=0

The roots of Eqs. (6)-(9) were computed by the following

nG+

2099

Shorter Communications

A -

First approximation Second approximation Third approximation

BC -

Fourth and fifth are indistinguishable on

this

Points iteration. Other

function function function

approximation functions from original function

scale

I and

2 are

points

starting

are

suCCessiYe

points

for

iteration

first points

Fig. 1. Illustration of successive approximations of the function by the interpolation polynomial.

Case II

Each

0.6

-0.66





o-2







0.4

0.6

I



O-6

point

is an

iteration

I I.0

Number

X

Fig. 2. Forms of the functions for the four cases. (For case 111X= (T-500)/100andY=yx10-“).

of

computations

of

functions

or derivatives

Fig. 3. Rate of convergence against the number of iterations (points) and number of computations of values of functions and derivatives for case II.

2100

Shorter Communications Table 1. Comparison of the five iteration methods Method RegulaFalsi

Secant Case No.

Root

NewtonRaphson

Chebyshev

Memory

Starting Point

a

b

a

b

a

b

a

b

a

b

:I

0.154677 0.254223

1.0 1-o

0.9

13 11

13 11

z 20 >

>20 > 20

10 9

19 17

-7

-19

10 9

10 9

III IV

551.774 0.691471

560 I.0

559 0.9

8 6

8 6

14 14

14 14

7 5

13 9

5 -

13 -

6 5

6 5

Convergence criterion: If(x) ) < lO+. a. Number of iterations. b. Number of computations of values of functions and derivatives. methods, which were programmed in PL/l with a 32 bit precision: (1) Secant, (2) Regula-Falsi, (3) Newton-Raphson, (4) Chebyshev (for cases II and III only), (5) The Memory Method. The same starting points were used for all methods. RESULTS Figure 3 shows the rate of convergence as function of the number of iterations (points) and the number of times a value of a function or a derivative was computed, for case II. Table 1 compares the number of iterations and number of calculations of values of functions and derivatives, for the four cases and the five methods, for a convergence criterion of If(x)1 c: lo-‘0.

(10)

DISCUSSION Comparing the methods on the basis of the number of iterations required for convergence, the order of advantage is: Chebyshev, Memory and Newton-Raphson, Secant, Regula-Falsi. Comparing the methods on the basis of the number of computations of values of the function or derivatives required for convergence, the order of advantage is: Memory, Secant, Newton-Raphson and Chebyshev, Regula-Falsi. For problems with complex functions and problems where the derivatives have to be computed by numerical methods, the Memory method will show superior performance over the other methods.

MORDECHAI SHACHAM EPHRAIM KEHAT Department of Chemical Engineering Technion, Israel Institute of Technology Haifa, Israel NOTATION constant in the Van Laar equation constant in the Van Laar equation equilibrium ratio Lagrange polynomial function of y a polynomial function of y temperature, “K independent variable x” independent variable function of x ; function of x concentration of species 3 vapor fraction after flash

A B K L(Y) P(Y) T

Subscripts a component k number of iteration point minus 1 (since two points are used for first iteration) n number of iteration point minus 1 (since two points are used for first iteration) m number of iteration point minus 1 (since two points are used for tirst iteration)

REFERENCES 111 BEREZIN I. S. and ZHIDKOV N. P., Computing Methods, Vol. 2, p. 142. Addison-Wesley, New York 1965. 121 BILOUS 0. and AMUNDSEN N. R., A.I.Ch.E. Jll955 1513. 131 HENLEY E. J. and ROSEN E. M., Material and Energy Balance Computations, p. 3 11. Wiley, New York 1969. [4] JELINEK J. and HLAVACEK V., Hydrocarbon Proc. 197150 (8) 135. [5] KUBICEK M. and HLAVACEK V., Chem. Engng Jll9712 100. [6] LAPIDUS L., Digital Computationfor Chemical Engineers, p. 282. McGraw-Hill, New York 1962. [7] Ibid., p. 292. [8] SMITH J. M. and VAN-NESS H. C., Introduction to Chemical Engineering Thermodynamics, 2nd Edn., p. 441. McGraw-Hill, New York 1959. [9] TRAUB J. F., Iterative Methods for Solution of Equations, p. 8. McGraw-Hill, New York 1964.

2101

Suggest Documents