A M O D I F I E D

advertisement
BIT 11 (1971), 168--174
A MODIFIED
FOR COMPUTING
REGULA
THE
M. DOWELL
FALSI METHOD
ROOT OF AN EQUATION
a n d I ). J A R R A T T
Abstract.
The Illinois method is briefly described and the asymptotic convergence of the
method investigated. Numerical examples are also given including comparisons
with other similar robust methods.
Introduction.
1.
I n practical root-finding problems where good initial estimates of the
roots are known, there is a wide range of computationally efficient
algorithms available which can be programmed for use on a digital computer. For difficult problems, however, in which the prior information
on the location of the root is poor, such methods often fail to converge,
and this has led to a search for techniques which are relatively intensitive to the choice of starting values. One of the oldest and best known of
these methods is the l~egula Falsi which we briefly describe.
We consider the equation
(1)
f(x) = o
and suppose t h a t a t the start of t h e solution process two approximations to a root, x~_1 and xt, are available for which fi-lfi < 0. A new
value, x/+ 1, is now computed from t h e rule
f i(xl -- Zi_l)
(2)
X +l =
f
-A-1
'
and fi+l is evaluated. The estimates t o be used for the n e x t iteration are
xi+ 1 and whichever of x i and xi_ I give a function values of opposite sign
to fi+l. The process is continued until some suitable criterion has been
satisfied, for example [(xi+1 -x~)/xt[ < (~, where ~ is a nominated tolerance.
The method is attractive since convergence to a root of (1) is guaranteed. I t suffers from the drawback, however, t h a t once an interval is
reached on which the function is convex or concave, thereafter one of
the end-points of this interval is always retained, and this feature slows
R e c e i v e d N o v e m b e r 5, 1970.
A MODIFIED REGULA FALSI METHOD FOR C O M P U T I N G . . .
169
down the asymptotic convergence to first order. We now describe a modification of the I~egula Falsi which leads to a considerable enhancement
in speeed of convergence without the guarantee of convergence being lost.
This refinement, which has now entered the folklore of computing, is
thought b y some to have been due originally to the staff of the computer
centre at the University of Illinois in the early 1950's. The present paper
gives a theoretical analysis of the behaviour of this refinement and also
reports some numerical experience with the process.
2. The Illinois algorithm.
The method follows the Regula Falsi except that the estimates chosen
for the next iteration are selected according to the following rules:
i) if fl+lfi < 0, then (Xi_l,f~_l) is replaced b y (xi,fi)
ii) if fi+lft > O, then (Xi_l,ft_l) is replaced b y (Xi_l,ft_l/2).
As before, (xl+l,ft+l) replaces (xi,fi). The function values used at each
iteration will again always have opposite signs and the introduction of
the value fi_l/2 for fi-1 is a modification designed to speed convergence
b y preventing the retention of an end point.
We now analyse the asymptotic convergence of the method. For initial estimates x 0 and x 1 which are sufficiently close to a root 0 of (1),
asymptotic error theory can be used to examine formally the behaviour
of the algorithm. We begin b y defining the error in the ith approximation
b y ei = x i - O , and using the Taylor expansion of fi about 0 we find
fi = ~ c~i r, where c r = f(r)(O)/r!
r=l
and co =f(0) = 0.
B y substituting in (2) it is easy to show that for a simple root
C2
(3)
8t+1 '~ ~ ~i~i_l.
The behaviour at the next iteration depends on whether ft+lft is less
than or greater than zero. In the former unmodified case, b y straightforwardly applying (3) we shall have
C2
El+2 ~ ~l~l+l~i
while for the latter modified case analysis gives
(4)
el+~ ~
-~t+l.
170
M. DOWELL AND P. JARRATT
B y using (3) a n d (4) it is n o w possible t o examine t h e a s y m p t o t i c itera t i n g p a t t e r n of the Illinois m e t h o d . A s s u m i n g t h a t et_ ~ is negative a n d
ei positive, a n d t a k i n g first t h e case c~/c 1 positive, we find a sequence of
values, calculated f r o m modified (M) a n d u n m o d i f i e d (U) iterations in
t h e order U U M , U U M , U U M . . . . . F o r c~/c I negative, t h e p a t t e r n is
U.M, U U A I , U U M , . . . ,
a n d in b o t h cases t h e basic p a t t e r n is one of t w o
u n m o d i f i e d iterations, followed b y a modified one. F r o m (3) a n d (4) it
can be s h o w n t h a t
/ c2"~~
~
3
t-4,)
'
a n d if we designate the three iterations U U M
error #, we find
as a single iteration with
/c2\ ~ 3
.
H e n c e we h a v e a process which is t h i r d o r d e r a t a cost of three evaluations of f per step in t h e sequence.
Accordingly, using T r a u b ' s (1, A p p e n d i x C) Efficiency I n d e x , we find
t h a t t h e c o m p u t a t i o n a l efficiency of t h e Illinois m e t h o d is 33 = 1.442 . . . .
c o m p a r e d w i t h a n efficiency of 1 for t h e u n m o d i f i e d R e g u l a Falsi.
3. N u m e r i c a l
Illustrations.
W e show first in Table 1 the b e h a v i o u r of the m e t h o d for the equation
s i n x - 0.5 = 0.
The root is 0 = z / 6 for which c2/cl = - t a n 0 = - 1/[/3, a n d we s t a r t with
initial estimates x 0 = 0.0, x 1 = 1.5.
Table 1.
i
2
3
4
5
6
7
8
9
10
e~
0.228
--0.895 × 10-1
0.666 × 10-2
0.160 × 10-a
--0.152 × 10-s
0.702 X 10-8
0.308 X 10-13
- 0 . 3 0 8 × 10-18
< ½X 10-18
Iteration
U
M
U
U
M
U
U
M
U
F r o m the table it is clear t h a t ee ~ - e s , e9 ~ - e s , illustrating the effect
of the modified iteration.
A MODIFIED I~EGULA FALSI METHOD FOR COMPUTING...
171
W e n o w u n d e r t a k e a n u m e r i c a l c o m p a r i s o n of t h e p e r f o r m a n c e of
t h e Illinois m e t h o d w i t h those of a n u m b e r of c o m p e t i t i v e r o b u s t m e t h o d s .
T h e a l g o r i t h m s chosen for c o m p a r i s o n were t h e R e g u l a Falsi, a l r e a d y
described, the well-known Bisection a l g o r i t h m (1), a n d a h y b r i d m e t h o d
f r e q u e n t l y used a n d f o r m e d f r o m a c o m b i n a t i o n of t h e R e g u l a Falsi a n d
t h e Bisection a l g o r i t h m . H e r e a similar a p p r o a c h to t h e Illinois m e t h o d
is a d o p t e d e x c e p t t h a t for t h e case f/+ifi > 0, the n e x t v a l u e is t a k e n as
(xi_l+xi+l)/2, a g a i n p r e v e n t i n g t h e r e t e n t i o n of a n end point.
I n a n a t t e m p t t o c a r r y o u t t h e c o m p a r i s o n o v e r as r e p r e s e n t a t i v e a
class of p r o b l e m s as possible, a n u m b e r of e q u a t i o n s were c o n s t r u c t e d
which possess characteristics c o m m o n l y e n c o u n t e r e d in root-finding p r o b lems. I n each case t h e f u n c t i o n used possesses a p a r a m e t e r n w h i c h can
be v a r i e d to give a f a m i l y of curves of the s a m e t y p e . T h e calculations
were p e r f o r m e d in double precision a r i t h m e t i c a n d t e r m i n a t e d w h e n
If(x)I < 0 . 5 × 10-1% All t h e roots lie in t h e r a n g e [0,1] a n d a p a r t f r o m
T a b l e 7 t h e s t a r t i n g values x 0 = 0, x I = 1 were used in e a c h case.
T a b l e 2.
f(x) =
2xe -n + 1 - 2e -nx. No
turning points
or
inflexions on [0,1].
Number of Iterations
1
5
15
20
Bisection
Regula
Falsi
64
64
67
67
23
40
41
42
l~egula Falsi
+
Bisection
19
21
23
23
Illinois
9
10
11
11
T a b l e 3. f ( x ) = (1 + (1 - n)2)x - (1 - nx) ~. One turning point on [0, 1].
Number of Iterations
Bisection
2
5
15
20
64
62
71
71
Regula
Falsi
25
16
11
10
Regula Falsi
+
Bisection
21
17
15
15
Illinois
3l. DOWELL A N D P. JARRATT
t72
T a b l e 4.
f(x)=x~-(1-x) n.
One inflexion on [ 0 , 1 ] .
N u m b e r of I t e r a t i o n s
n
Bisection
Regula
Falsi
2
1
1
5
15
20
64
61
62
54
179
245
f(x) =
T a b l e 5.
Regula Falsi
+
Bisection
1
19
23
23
Illinois
1
8
11
12
n)4)x - (1 - nx) 4. One turning point
anzl one inflexion on [ 0 , 1 ] .
(1 + (1 -
N u m b e r of I t e r a t i o n s
~b
2
5
15
20
T a b l e 6.
Bisection
Regula
Falsi
Regula Falsi
+
Bisection
Illinois
64
71
76
77
40
9
6
5
21
13
9
9
10
7
6
6
f ( x ) = e-nX(x- 1 ) + x "~. A f a m i l y of curves which lie
increasingly close to the x-axis for large n.
N u m b e r of I t e r a t i o n s
1
5
10
15
Bisection
Regalia
Falsi
Regula Falsi
+
Bisection
Illinois
64
63
57
55
26
114
1286
> 104
19
21
23
21
9
9
13
16
A MODIFIED REGULA FALSI METHOD FOR COMPUTING...
173
Table 7. f(x)= ( n x - 1 ) / ( ( n - 1)x). A family of curves
with the y-axis asymptotic.
Number of Iterations
Bisection
Regula
Falsi
gegula Falsi
+
Bisection
Illinois
59
56
61
58
2008
809
262
192
2
25
25
25
14
14
14
15
n
2 I
5
15
20
T h e starting values used here were Xo=0.01, x l = 1.0.
F r o m these tables it is clear t h a t t h e Illinois m e t h o d is consistently
superior, in m a n y eases completing t h e calculation in fewer t h a n half
the n u m b e r of iterations required b y the n e x t best method.
4. Algol procedure.
W e give finally an A L G O L p r o c e d u r e for i m p l e m e n t i n g the Illinois
algorithm.
real p r o c e d u r e Illinois(f, x, xO, xl, delta);
real f, x, xO, x l , delta;
value xO, xl, delta;
c o m m e n t This procedure carries out the Illinois iterative process to find a
root of f(x)= O, given two approximations xO and xl which must be
chosen such that f(xO) a ~ f ( x l ) are of opposite sign;
begin real f0, f l , fx;
x:= xl;fl:--f;
x := x0;f0 := f;
for x : = x l - f l x (xl - x O ) / ( f l - f O ) while a b s ( x - x l ) > delta do
begin
fx:=f;
if fx × f l < 0.0 then begin
x o : = xl ; f o : = f I
end
else f 0 : = f 0 x 0.5;
174
•. D O W E L L AND P. J A R R A T T
xl := x; f l := fx
end of iterative loop;
Illinois := x
end of procedure Illinois;
REFERENCE
J . F. T r a u b , Iterutive Methods for the Solution of Equations, P r e n t i c e - H a l l , E n g l e w o o d
Cliffs, N . J . , 1964.
COMPUTING LABORATORY
UNIVERSITY OF BRADFORD
ENGLAND
Download