Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 5 Bracketing Methods.

Similar presentations


Presentation on theme: "The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 5 Bracketing Methods."— Presentation transcript:

1 The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 5 Bracketing Methods

2 PART II ROOTS OF EQUATIONS Roots of Equations Bracketing Methods Bisection methodFalse Position Method Open Methods Simple fixed point iterationNewton RaphsonSecantModified Newton Raphson System of Nonlinear Equations Roots of polynomials Muller Method

3 Study Objectives for Part Two

4 ROOTS OF EQUATIONS Root of an equation: is the value of the equation variable which make the equations = 0.0 But

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

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

7 Graphical Solution: Example The parachutist velocity is What is the drag coefficient c needed to reach a velocity of 40 m/s if m=68.1 kg, t =10 s, g= 9.8 m/s 2 Check: F (14.75) = 0.059 ~ 0.0 v (c=14.75) = 40.06 ~ 40 m/s

8 Numerical Systematic Methods I. Bracketing Methods f(x) x roots f(x l )=+ve f(x u )=+ve xlxl xuxu No roots or even number of roots f(x) x roots f(x l )=+ve f(x u )=-ve xlxl xuxu Odd number of roots

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

10 Special Cases

11 Effect of computer scale resolution

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

13 f(x) x xuxu xlxl f(x u ) x r1 f(x) x xuxu xlxl f(x u ) x r2 x r = ( x l + x u )/2 f(x u ) f(x r1 ) f(x r2 ) (f(x l ).f(x r )<0): x u = x r x r = ( x l + x u )/2 Step 1: Choose lower x l and upper x u guesses for the root such that: f(x l ).f(x u )<0 Step 2: The root estimate is: x r = ( x l + x u )/2 Step 3: Subdivide the interval according to: – If (f(x l ).f(x r )<0) the root lies in the lower subinterval; x u = x r and go to step 2. – If (f(x l ).f(x r )>0) the root lies in the upper subinterval; x l = x r and go to step 2. – If (f(x l ).f(x r )=0) the root is x r and stop

14 Bisection Method - Termination Criteria For the Bisection Method  a >  t The computation is terminated when  a becomes less than a certain criterion (  a <  s )

15 Bisection method: Example The parachutist velocity is What is the drag coefficient c needed to reach a velocity of 40 m/s if m = 68.1 kg, t = 10 s, g= 9.8 m/s 2 f(c) c

16 f(x) x 1612 -2.269 6.067 14 f(x) x 14 16 -0.425 - 2.269 1.569 (f(12).f(14)>0): x l = 14 1.Assume x l =12 and x u =16 f(x l )=6.067 and f(x u )=-2.269 2.The root: x r =(x l +x u )/2= 14 3.Check f(12).f(14) = 6.0671.569=9.517 >0; the root lies between 14 and 16. 4.Set x l = 14 and x u =16, thus the new root x r =(14+ 16)/2= 15 5.Check f(14).f(15) = 1.569-0.425= -0.666 <0; the root lies bet. 14 and 15. 6.Set x l = 14 and x u =15, thus the new root x r =(14+ 15)/2= 14.5 and so on…... 15

17 Iter. X l X u X r  a %  t % 112 16 145.279 -- 214 16 156.6671.487 314 1514.53.4481.896 4 14.5 1514.751.6951.204 5 14.75 1514.8750.840.641 6 14.74 14.87514.813 0.4220.291 In the previous example, if the stopping criterion is  t = 0.5%; what is the root? Bisection method: Example

18 Bisection method

19 Flow Chart –Bisection Start Input: x l, x u,  s, maxi f(x l ). f(x u )<0 i=0  a =1.1  s False while  a >  s & i <maxi False Stop Print: x r, f(x r ),  a, i

20 x u +x l =0 True Test=f(x l ). f(x r )  a =0.0 Test=0 x u =x r Test<0 x l =x r True False

21 Bracketing Methods 2. False-position Method The bisection method divides the interval x l to x u in half not accounting for the magnitudes of f(x l ) and f(x u ). For example if f(x l ) is closer to zero than f(x u ), then it is more likely that the root will be closer to f(x l ). False position method is an alternative approach where f(x l ) and f(x u ) are joined by a straight line; the intersection of which with the x-axis represents and improved estimate of the root.

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

23 f(x) x xuxu xlxl f(x u ) f(x l ) xrxr f(x r ) False-position Method -Procedure

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

25 False position method: Example The parachutist velocity is What is the drag coefficient c needed to reach a velocity of 40 m/s if m =68.1 kg, t =10 s, g= 9.8 m/s 2 f(c) c

26 f(x) x 1612 -2.269 6.067 14.91 False position method: Example 1.Assume x l = 12 and x u =16 f(x l )= 6.067 and f(x u )= -2.269 2.The root: x r =14.9113 f(12). f(14.9113) = -1.5426 < 0; 3.The root lies bet. 12 and 14.9113. 4.Assume x l = 12 and x u =14.9113, f(x l )=6.067 and f(x u )=-0.2543 5.The new root x r = 14.7942 6.This has an approximate error of 0.79%

27 False position method: Example

28 Flow Chart –False Position Start Input: x l, x 0,  s, maxi f(x l ). f(x u )<0 i=0  a =1.1  s False while  a >  s & i <maxi False Stop Print: x r, f(x r ),  a, i

29 i=1 or x r =0 True Test=f(x l ). f(x r )  a =0.0 Test=0 x u =x r x r0 =x r Test<0 x l =x r x r0 =x r True False

30 False Position Method-Example 2

31

32 Pitfalls of the False Position Method Although a method such as false position is often superior to bisection, there are some cases (when function has significant curvature that violate this general conclusion. In such cases, the approximate error might be misleading and the results should always be checked by substituting the root estimate into the original equation and determining whether the result is close to zero. major weakness of the false-position method: its one sidedness That is, as iterations are proceeding, one of the bracketing points will tend stay fixed which lead to poor convergence.

33 Modified Fixed Position One way to mitigate the "one-sided" nature of false position is to make the algorithm detect when one of the bounds is stuck. If this occur, the function value at the stagnant bound is divided in half. This is thought to fasten the convergence.


Download ppt "The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 5 Bracketing Methods."

Similar presentations


Ads by Google