You are on page 1of 33

The Islamic University of Gaza

Faculty of Engineering
Civil Engineering Department

Numerical Analysis
ECIV 3306

Chapter 5
Bracketing Methods

PART II ROOTS OF EQUATIONS

Bisection method
Bracketing Methods
False Position Method

Simple fixed point iteration

Roots of Newton Raphson
Equations
Open Methods
Secant
System of Nonlinear
Equations
Modified Newton Raphson
Roots of polynomials

Muller Method

STUDY OBJECTIVES FOR PART TWO

• Understand the graphical interpretation of a root
• Know the graphical interpretation of the false-position method
and why it is usually superior to the bisection method.
• Understand the difference between bracketing and open
methods for root location.
• Understand the concepts of convergence and divergence.
• Know why bracketing methods always converge, whereas open
methods may sometimes diverge.
• Know the fundamental difference between the false-position
and secant methods and how it relates to convergence

0 b b 2 4ac ax 2 bx c 0 x 2a • But ax 5 bx 4 cx 3 dx 2 ex f 0 x ? sin x x 0 x ? . ROOTS OF EQUATIONS • Root of an equation: is the value of the equation variable which make the equations = 0.

Graphical solution (inaccurate) • Numerical systematic methods suitable for computers . ROOTS OF EQUATIONS • Non-computer methods: .Closed form solution (not always available) .

Graphical Solution • Plot the function f(x) f(x) roots x f(x)=0 f(x)=0 • The roots exist where f(x) crosses the x-axis. .

Graphical Solution: Example c mg t • The parachutist velocity is v (1 e m ) c • What is the drag coefficient c needed to reach a velocity of 40 m/s if m=68.75) = 40.059 ~ 0.146843c ) 40 c c c=14.75 Check: F (14. t =10 s.1 kg.38 f (c) (1 e 0.8 m/s2 f(c) c mg m t f (c) (1 e ) v c 667. g= 9.06 ~ 40 m/s .0 v (c=14.75) = 0.

Numerical Systematic Methods I. Bracketing Methods f(x) No roots or even f(x) Odd number of roots number of roots f(xl)=+ve f(xl)=+ve roots roots f(xu)=+ve x x xl xu f(xu)=-ve xl xu .

xu then f(xl).f(xu) <0. is bounded by values xl . Bracketing Methods (cont. f(x)=0.) • Two initial guesses (xl and xu) are required for the root which bracket the root (s). • If one root of a real and continuous function. (The function changes sign on opposite sides of the root) .

.

.

This process is repeated to obtained refined estimates. . then there is at least one real root between xl and xu to this function. Bracketing Methods 1. Then the interval is divided in half with the root lies in the midpoint of the subinterval.f(xu)<0. Bisection Method • Generally. • The interval at which the function changes sign is located. if f(x) is real and continuous in the interval xl to xu and f (xl).

xl = xr and go to f(xr2) step 2.f(xr)<0) the root lies in the f(x) (f(xl).f(xr)<0): xu = xr lower subinterval. f(x) Step 1: Choose lower xl and upper xu xr = ( xl + xu )/2 guesses for the root such that: f(xl ) f(xl).f(xr)=0) the root is xr and stop xr2 f(xu) .f(xu)<0 Step 2: The root estimate is: xr = ( xl + xu )/2 xl xr1 xu x f(xr1) f(xu) Step 3: Subdivide the interval according to: – If (f(xl). xu = xr and go to xr = ( xl + xu )/2 step 2.f(xr)>0) the root lies in the upper subinterval. xl xu x – If (f(xl). f(xu) – If (f(xl).

Termination Criteria Approximate relative Error : True relaive Error : X rn X rn 1 100% X true X approximate a X n t 100% r X true Xu Xl a 100% (Bisection) Xu Xl • For the Bisection Method a > t • The computation is terminated when a becomes less than a certain criterion ( a < s) . Bisection Method .

g= 9.8 m/s2 f(c) c mg m t f (c ) (1 e ) v c 667.38 f (c ) (1 e 0. t = 10 s.1 kg. Bisection method: Example c • The parachutist velocity is mg m t v (1 e ) c • What is the drag coefficient c needed to reach a velocity of 40 m/s if m = 68.146843c ) 40 c c .

6. The root: xr=(xl+xu)/2= 14 f(14)=1.269 4. f(x) 1.517 >0.f(15) = 1.425 -2.067 and f(xu)=-2.569 3.. x the root lies between 14 and 16. Set xl = 14 and xu=16.f(14)>0): xl = 14 5. 14 and 15. Check f(12).5 1.269 .067 2.569 and so on…. Check f(14). Assume xl =12 and xu=16 f(xl)=6. thus the new root xr=(14+ 15)/2= 14. the root lies bet.425= -0..569× -0. 15 x 14 16 -0.569=9.666 <0.067× 1. Set xl = 14 and xu=15.f(14) = 6.269 6. thus the new root xr=(14+ 16)/2= 15 f(x) f(14)=-0. 12 14 16 -2.425 (f(12).569 1.

75 15 14.813 0.75 1.291 .84 0.875 0. if the stopping criterion is t = 0.5%.204 5 14.279 2 14 16 15 6. Xl Xu Xr a% t% 1 12 16 14 ----. 5.5 3.5 15 14. Bisection method: Example • In the previous example.422 0.667 1.641 6 14.875 14.448 1. what is the root? Iter.896 4 14.487 3 14 15 14.74 14.695 1.

Bisection method .

5% . Use bisection method to find the root of 3 2 f ( x) x 4x 10 Continue the iterations until the approximate error falls below a stopping criteria ( s ) = 0. Bracketing Methods Bisection Example.

i xl xu xr 2 Stop i i 1 . s. a .1 s while False a> s & i <maxi Print: xr . f(xr ) . xu . Flow Chart –Bisection Start Input: xl . f(xu)<0 i=0 a=1. maxi False f(xl).

f(xr) Test= True 0 a=0. xu+xl =0 True xu xl a 100% xu xl Test=f(xl).0 Test< True 0 xu=xr False xl=xr .

False-position Method • The bisection method divides the interval xl to xu in half not accounting for the magnitudes of f(xl) and f(xu). . For example if f(xl) is closer to zero than f(xu). Bracketing Methods 2. then it is more likely that the root will be closer to f(xl).

. the intersection of which with the x-axis represents an improved estimate of the root. 2. False-position Method • False position method is an alternative approach where f(xl) and f(xu) are joined by a straight line.

False-position Method -Procedure f(x) f(xu) xl xr xu x f(xl) f(xr) f ( xl ) f ( xu ) xr xl xr xu f ( xu )( xl xu ) xr xu f ( xl ) f ( xu ) .

– If (f(xl). xu = xr and go to step 2. xl = xr and go to step 2.f(xr)<0) the root lies in the lower subinterval. False-position Method -Procedure Step 1: Choose lower xl and upper xu guesses for the root such that: f(xl).f(xr)=0) the root is xr and stop .f(xu)<0 Step 2: The root estimate is: f ( xu )( xl xu ) xr xu f ( xl ) f ( xu ) Step 3: Subdivide the interval according to: – If (f(xl). – If (f(xl).f(xr)>0) the root lies in the upper subinterval.

False position method: Example c mg t • The parachutist velocity is v (1 e m ) c • What is the drag coefficient c needed to reach a velocity of 40 m/s if m =68.8 m/s2 f(c) c mg m t f (c) (1 e ) v c 667. t =10 s.146843c ) 40 c c .38 f (c) (1 e 0.1 kg. g= 9.

The new root xr= 14. 12 and 14. 4. Assume xl = 12 and xu=16 6.91 x 12 16 f(12) .5426 < 0. f(xl)=6.067 and f(xu)= -2.067 and f(xu)=-0.269 2.9113.269 3.2543 5. -2. Assume xl = 12 and xu=14.9113. f(14.067 f(xl)= 6.9113) = -1.79% .False position method: Example f(x) 1. The root: xr=14.7942 6. This has an approximate error of 0.9113 14. The root lies bet.

False position method: Example .

f(xr ) .1 s while False a> s & i <maxi Print: xr .Flow Chart –False Position Start Input: xl . a . x0 . s. maxi False f(xl). i f (x u )(x l x u ) xr xu f (x l ) f (x u ) Stop i i 1 . f(xu)<0 i=0 a=1.

f(xr) True Test=0 a=0. i=1 or xr=0 True xr x r0 a 100% xr Test=f(xl).0 True Test<0 xu=xr xr0=xr False xl=xr xr0=xr .

False Position Method-Example 2 .

False Position Method .Example 2 .

Roots of Polynomials: Using Software Packages MS Excel:Goal seek f(x)=x-cos x .