Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

0251 ‫لسنة‬-‫العدد االول‬-‫المجلد السابع‬ ‫المجلة العراقية لتكنولوجيا المعلومات‬

A New Approach to Find Roots of Nonlinear Equations by Hybrid


Algorithm to Bisection and Newton-Raphson Algorithms
Abed Ali H. Altaee1, Haider K. Hoomod2 , Khalid Ali Hussein3
1(Department of Mathematics/ Al-Mustansiriyah University/ Baghdad –Iraq)

2,3(Department of computer/Al-Mustansiriyah University/ Baghdad –Iraq )

kah682001@yahoo.com , drhaider20032000@yahoo.com

Abstract
The root-finding problem is one of the most important computational problems and
applications. In this paper we introduced a new algorithm to finding real roots of single non-
linear equations by hybrid between the Bisection algorithm and Newton-Raphson algorithm with
described and comparison between them.

Keyword: Numerical Algorithms, bisection Method, Newton-Raphson Method, Hybrid


Algorithm, finding roots.

‫نهج جديد إلياد جذور المعد الت غير الخطية من قبل خوارزمية هاينة من خوارزميدت‬
‫التنصيف ونيوتن رافسون‬
‫ خالد علي حسين‬، ‫حيدركاظم حمود‬.‫ د‬، ‫عبدعلي حمودي الطائي‬.‫د‬

‫ قسم علوم الحاسبات‬/ ‫ كلية التربية‬/ ‫الجامعة المستنصرية‬

:‫الملخص‬
‫ في هذا البحث قدمنا خوارزمية جديدة اليجاد‬. ‫أيجاد جذور المعادلة الالخطية تعتبر احد اهم المشاكل الحسابية وتطبيقاتها‬
‫رافسون مع الوصف‬-‫الجذور الحقيقية للمعادالت الالخطية عن طريق مزيج بين خوارزمية التنصيف وخوارزمية نيوتن‬
. ‫والمقارنة بينهم‬

75
0251 ‫لسنة‬-‫العدد االول‬-‫المجلد السابع‬ ‫المجلة العراقية لتكنولوجيا المعلومات‬

1. Introduction
Numerical analysis is a very important branch of computer science that deals with the
study of algorithms that use numerical approximation in mathematical analysis. It involves the
study of methods of computing numerical data. It has its applications in all fields of engineering
and the sciences [1].

The algorithms in that study uses in several applications like as, uses bisection method in
electrical engineering [2], and implemented on an electrical circuit element [3], also uses in
image processing to adaptive filters, like as [4] using Newton-raphson method to improve two
novel algorithms CB (Center-to-Boundary) and BB (Boundary-to-Boundary) filters.

In this paper, we introduce a new algorithm to find the real roots of single nonlinear
equation, its Hybrid algorithm. It is organized as follows: section 2 establishments to root-
finding, Bisection and Newton-Raphson methods, section 3 putting hybrid algorithm, section 4
conclusion and results, section 5 future work.

2. Root-finding Algorithm
The root-finding problem is one of the most important computational problems. It rises in a
wide variety of practical applications in mathematics, physics, chemistry, biosciences,
engineering, etc. As a matter of fact, determination of any unknown appearing implicitly in
scientific or engineering formulas gives rise to a root-finding problem. A root-finding algorithm
is a numerical method to finding a value x such that f(x)=0 , for given function f. Numerical
root-finding methods use iteration, producing a sequence of numbers that hopefully converge
towards a limit (the so-called "fixed point") which is a root. The first values of this series are
initial guesses. The method computes subsequent values based on the old ones and the function f.

2.1. Bisection Method:

The Bisection (Binary Search) method which is based on the Intermediate value Theorem
(IVT).The bisection method in mathematics is a root-finding method that repeatedly bisects an
interval and then selects a subinterval in which a root must lie for further processing. It is a very
simple and robust method, but it is also relatively slow. Because of this, it is often used to obtain
a rough approximation to a solution which is then used as a starting point for more rapidly
converging methods. The method is also called the interval halving method, the binary search
method, or the dichotomy method [5][7] [8]. If f(x) is continuous on [a,b] with f(a) and f(b) of
opposite sign .The main idea of bisection method that[9] :

Let c= (a+b ) / 2 (midpoint of [a,b] ), compute f(c)

76
0251 ‫لسنة‬-‫العدد االول‬-‫المجلد السابع‬ ‫المجلة العراقية لتكنولوجيا المعلومات‬

If f ( c ) =0 , then c is a root

If f( a ) . f( c ) < 0 , a root exists in [a,c]

Else the root exists in [c,b] .

2.2. Newton – Raphson Method:

In numerical analysis ,Newton-Raphson method is a very popular numerical method used


for finding successively better approximations to the zeroes of a real-valued function f ( x ) = 0
.[6]

Xn+1 = xn - f ( xn ) / df (xn) …..(1)

This method is distinguished from the methods by the fact that it requires the evaluation
of both the function f( x) and the derivative df (x) at arbitrary points x, where df is derivative of
function f.

2.2.1 Newton-Raphson Algorithm:[6]

Given f , df , x0 (initial approximation) and δ (tolerance) .

Step 1 : i=1

Step 2 : x = x0 - f ( xo ) / df(xo)

Step 3 : If | x – x0 | < δ , then go to step 6

Step 4 : x0 = x

Step 5 : i = i + 1 , go back to step 2

Step 6 : stop iteration .

3. Hybrid algorithm
This algorithm is a new approach to compute the roots of nonlinear equations f(x)=0, by
propose hybrid algorithm between the Bisection algorithm and Newton-Raphson algorithm. It’s
take a first approximation by apply two times the Bisection method and complete a correct
approximation by use the Newton-Raphson method.

77
0251 ‫لسنة‬-‫العدد االول‬-‫المجلد السابع‬ ‫المجلة العراقية لتكنولوجيا المعلومات‬

3.1 Proposed Hybrid Algorithm

Given f , df , a , b , and δ=10-6 (tolerance)

Step 1 : for i=1 to 2

Step 2 : xi = (a+b) / 2

Step 3 : If f (xi ) = 0 or f (xi ) < δ , then step 10

Step 4 : If f (a) * f (xi) < 0 , then b= xi

Step 5 : Else a = xi

Step 6 : end for

Step 7 : x = xi - [ f ( xi ) / df (xi) ]

Step 8 : If f (x) < δ , then go to step 10

Step 9 : xi = x , and go to step 7

Step 10 : stop iteration .

78
0251 ‫لسنة‬-‫العدد االول‬-‫المجلد السابع‬ ‫المجلة العراقية لتكنولوجيا المعلومات‬

Start

Given f,df,a,b and δ

for i=1 To 2

xi= (a+b)/2

f(xi)=0 or f(xi) < δ

Yes
No

f(a) * f(xi) < 0

No Yes

a=xi

end for b=xi

for i=1 To N

x=xi - [f(xi) / df(xi)]

Yes
f(xi)< δ ?

No

xi=x

end for

Stop

Hybrid algorithm

fig.(1) flowchart of Hybrid Algorithm

79
0251 ‫لسنة‬-‫العدد االول‬-‫المجلد السابع‬ ‫المجلة العراقية لتكنولوجيا المعلومات‬

4. Results and discussion


We implement the numerical algorithms on Dell i7 core Intel (4 cores) computer using
Matlab ver. 7.12.0.635 (R2011a) 32-bit. The case study is real function (have real roots) as a
form quartic function f(x)= a x4 + b x3 + c x2 + d x + e , we take as for example f(x)= x 4 +3x3 –
15x2 -2x + 9, with tolerance δ=10-6 , where i= number of iterative, a & b are initials values and
c= (a + b) / 2.

Tables (1), (2), and (3) show the results of implement the above three algorithms. From
these results, the Hybrid method is better than Bisection method with respect to number of
iterative and elapsed time, but the result between Hybrid method and Newton-Raphson method is
convergent.

The serial Bisection method needs log2 [(b-a)/Ɛ] function evaluations, additions and
multiplications to enclose the zero in an interval of length Ɛ . The serial Newton-Raphson
method needs log2 Ω, where Ω is the number of iterative operations needs to reach f(x) < δ
(tolerance). So the number of operations of Hybrid is needs log2 [(b-a) / Ɛ] + log2 Ω, thus the
number of operations.

Table (1) result of Bisection method for 4 roots sequentially

Interval =[-6,-4] Interval=[-2,0] Interval =[0,2] Interval =[2,4]


i c F( c ) c F( c ) c F( c ) c F( c )
1 -5.0000000 -106.000000 -1.0000000 -6.0000000 1.0000000 -4.0000000 3.0000000 30.000000
2 -5.5000000 -17.8125000 -0.5000000 5.9375000 0.5000000 4.6875000 2.5000000 -3.8125000
3 -5.7500000 47.3632813 -0.7500000 1.1132813 0.7500000 0.6445313 2.7500000 9.6445313
4 -5.6250000 12.8342285 -0.8750000 -2.1579590 0.8750000 -1.6384277 2.6250000 2.1350098
5 -5.5625000 -2.9601898 -0.8125000 -0.4506683 0.8125000 -0.4824066 2.5625000 -1.0241547
6 -5.5937500 4.8174906 -0.7812500 0.3492441 0.7812500 0.0852671 2.5937500 0.5078592
7 -5.5781250 0.8989897 -0.7968750 -0.0462293 0.7968750 -0.1975889 2.5781250 -0.2698869
8 -5.5703125 -1.0379876 -0.7890625 0.1526284 0.7890625 -0.0559068 2.5859375 0.1160323
9 -5.5742188 -0.0713493 -0.7929688 0.0534797 0.7851563 0.0147447 2.5820313 -0.0776634
10 -5.5761719 0.4133572 -0.7949219 0.0036953 0.7871094 -0.0205650 2.5839844 0.0190001
11 -5.5751953 0.1708883 -0.7958984 -0.0212495 0.7861328 -0.0029061 2.5830078 -0.0293777
12 -5.5747070 0.0497406 -0.7954102 -0.0087727 0.7856445 0.0059203 2.5834961 -0.0052003
13 -5.5744629 -0.0108116 -0.7951660 -0.0025376 0.7858887 0.0015073 2.5837402 0.0068971
14 -5.5745850 0.0194627 -0.7950439 0.0005791 0.7860107 -0.0006993 2.5836182 0.0008477
15 -5.5745239 0.0043251 -0.7951050 -0.0009792 0.7859497 0.0004040 2.5835571 -0.0021765
16 -5.5744934 -0.0032433 -0.7950745 -0.0002000 0.7859802 -0.0001476 2.5835876 -0.0006644
17 -5.5745087 0.0005409 -0.7950592 0.0001895 0.7859650 0.0001282 2.5836029 0.0000916
18 -5.5745010 -0.0013512 -0.7950668 -0.0000053 0.7859726 -0.0000097 2.5835953 -0.0002864
19 -5.5745049 -0.0004052 -0.7950630 0.0000921 0.7859688 0.0000592 2.5835991 -0.0000974
20 -5.5745068 0.0000678 -0.7950649 0.0000434 0.7859707 0.0000248 2.5836010 -0.0000029
21 -5.5745058 -0.0001687 -0.7950659 0.0000191 0.7859716 0.0000075 2.5836020 0.0000443
22 -5.5745063 -0.0000504 -0.7950664 0.0000069 0.7859721 -0.0000011 2.5836015 0.0000207
23 -5.5745065 0.0000087 -0.7950666 0.0000008 0.7859719 0.0000032 2.5836012 0.0000089
24 -5.5745064 -0.0000209 0.7859720 0.0000010 2.5836011 0.0000030
25 -5.5745065 -0.0000061 0.7859721 -0.0000000 2.5836011 0.0000000
26 -5.5745065 0.0000013

80
0251 ‫لسنة‬-‫العدد االول‬-‫المجلد السابع‬ ‫المجلة العراقية لتكنولوجيا المعلومات‬

27 -5.5745065 -0.0000024
28 -5.5745065 -0.0000005
Elapsed time is 0.014695 Elapsed time is 0.014336 Elapsed is 0.014451 Elapsed time is 0.014487
seconds. seconds. seconds. seconds.

Table (2) result of newton-Raphson method for 4 roots sequentially

Interval =[-6,-4] Interval=[-2,0] Interval =[0,2] Interval =[2,4]


i x F( x ) x F( x ) x F( x ) x F( x )
1 -5.8346457 -106.000000 -0.8181818 -6.0000000 0.7894737 -4.0000000 2.6907216 30.000000
2 -5.6027540 73.0668182 -0.7954384 -0.5999590 0.7859749 -0.0633513 2.5933331 5.8785025
3 -5.5748896 7.1026607 -0.7950667 -0.0094933 0.7859721 -0.0000511 2.5836921 0.4867988
4 -5.5745066 0.0950193 -0.7950666 -0.0000025 0.7859721 -0.0000000 2.5836011 0.0045138
5 -5.5745065 0.0000178 -0.7950666 -0.0000000 2.5836011 0.0000004
6 -5.5745065 0.0000000
Elapsed time is 0.011374 Elapsed time is 0.010595 Elapsed time is 0.010326 Elapsed time is 0.010421
seconds. seconds. seconds. seconds.

Table (3) result of Hybrid algorithm for 4 roots sequentially

Interval =[-6,-4]
First approximate Second approximate
i c F( c ) a b c x F(c ) dF(c )
1 -5.000000 -6.0000000 -4.000000 -106.000 2 -5.500000 -5.5773616 -17.8125000 -230.2500000
2 -5.500000 -6.0000000 -5.000000 -17.8125 3 -5.577361 -5.5745105 0.7090557 -248.6955921
4 -5.574510 -5.5745065 0.0009868 -248.0035566
5 -5.574505 -5.5745065 0.0000000 -248.0025915
Elapsed time is 0.014242 seconds.
Interval =[-2,0]
First approximate Second approximate
i c a b F( c ) c x F(c) dF(c)
1 -1.000000 -2.000000 0.000000 -6.00000 2 -0.5000000 -0.9025424 5.9375000 14.7500000
2 -0.500000 -1.000000 0.000000 5.93750 3 -0.9025424 -0.8022361 -2.9556975 29.4667341
4 -0.8022361 -0.7951032 -0.1839870 25.7941074
5 -0.7951032 -0.7950666 -0.0009341 25.5321761
6 -0.7950666 -0.7950666 -0.0000000 25.5308325
Elapsed time is 0.014596 seconds.
Interval =[0,2]
First approximate Second approximate
i c a b F( c ) c x F(c) dF(c)
1 1.000000 0.000000 2.000000 -4.00000 2 0.5000000 0.8289474 4.6875000 -14.2500000
2 0.500000 0.000000 1.000000 4.68750 3 0.8289474 0.7863419 -0.7841777 -18.4055803
4 0.7863419 0.7859721 -0.0066870 -18.0803686
5 0.7859721 0.7859721 -0.0000006 -18.0772498
Elapsed time is 0.014393 seconds.
Interval=[2,4]
First approximate Second approximate
i c a b F( c ) c x F(c) dF(c)

81
0251 ‫لسنة‬-‫العدد االول‬-‫المجلد السابع‬ ‫المجلة العراقية لتكنولوجيا المعلومات‬

1 3.0000000 2.0000000 4.0000000 30.0000 2 2.5000000 2.5913174 -3.8125000 41.7500000


2 2.5000000 2.0000000 3.0000000 -3.81250 3 2.5913174 2.5836585 0.3852176 50.2968244
4 2.5836585 2.5836011 0.0028455 49.5545562
5 2.5836011 2.5836011 0.0000002 49.5490089
Elapsed time is 0.014102 seconds.

5. Future Work
 Convert the Hybrid Algorithm to parallel numerical algorithm.
 Convert the bisection and Newton-Raphson Algorithms to parallel numerical algorithms
with comparison with parallel Hybrid algorithm.
 Implement Hybrid Algorithm in different application field, for example ciphering, image
processing, electrical engineering, etc.

References

1. Soram R. , and others , On The Rate of Convergences of Newton-Raphson Method , the


international journal of engineering and sciences (IJES) , vol.2, Issue 11 , pp. 5-12, October 2013.
2. Autar Kaw, Bisection Method of Solving a Nonlinear Equation– More Examples in Electrical
Engineering, 2009.
3. A. Ersoz and M. Kurban, Bisection Method and Algorithm for Solving
the Electrical Circuits, International Eurasian Conference Mathematical and Sciences in
2013,Sarajevo,Bosnia-Herzegovina.,http://www.researchgate.net/publication/259849595.
4. K. K. Lavania, Shivali, R. Kumar, Image Enhancement Using Filtering Techniques, International
Journal on Computer Science and Engineering (IJCSE), Vol.4, NO. 01, pp. 14-20, 2012.
5. R.L. Burden, J.D. Faires , Numerical Analysis , 9th Edition , Brooks/Cole , 2011.
6. R.L. Burden; J.D. Faires , Numerical Analysis (3rd ed.), PWS Publishers, Boston, MA, 1985.
7. Otto S.R. , Denier J.P, An Introduction to programming and Numerical Methods in Matlab,
springer ,2005.
8. Yang W.Y., Cao W., Chung T.S., Marris J. , Applied Numerical Methods Using Matlab, Ajohn
wily & Sons. Inc. , 2005.
9. 1-A.W.Al-Khafaji and J.R.Tooley, Numerical Methods in Engineering Practice, CBS. Publishing
Japan Ltd., 1989.

82

You might also like