PART II: ROOTS OF EQUATIONS Chapter 5: Bracketing Methods Dr. Amer M. Magableh Roots finding
Roots findings: One of the most basic problems in numerical analysis is
to find the value 𝑥 ∈ [𝑎, 𝑏] that would render 𝑓(𝑥) = 0. Example: roots of linear equations such as g x = 2𝑥 − 10; is very simple However, for non-linear equations, we need methods to find the roots. For second order equation, 𝑓 𝑥 = 𝑎𝑥 2 + 𝑏𝑥 + 𝑐, the roots can be found by the formula
Dr. Amer M. Magableh
Roots Finding Methods
Dr. Amer M. Magableh
Graphical Methods Graphical methods rely on a computational device that calculates the values of the function within certain intervals with specific steps in order to draw the graph of the function Use visual inspection, the analyst can identify the points at which the function crosses the x-axis. Graphical methods are very useful for one-dimensional problems but not very precise Graphical methods can not be used in multi-variable problems since it is not possible to visualize a graph of a function of multi-variables.
Dr. Amer M. Magableh
Dr. Amer M. Magableh We can not find c analytically, but we can make a plot versus c, and find the required value graphically Dr. Amer M. Magableh Dr. Amer M. Magableh Bracketing Method
Dr. Amer M. Magableh
THE BISECTION METHOD In the bisection method, if 𝑓(𝑎)𝑓(𝑏) < 0, an estimate for the root of the 𝑎+𝑏 equation 𝑓(𝑥) = 0 can be found as the average of 𝒂 and 𝒃 (𝑥𝑖 = ) 2 Upon evaluating 𝑓(𝑥𝑖 ), the next iteration would be to set either 𝑎 = 𝑥𝑖 or 𝑏 = 𝑥𝑖 such that for the next iteration the root 𝑥𝑖+1 is between a and b. Algorithm
Dr. Amer M. Magableh
Graphical View of the Bisection Method
Dr. Amer M. Magableh
Example Let 𝑓 𝑥 = sin 5𝑥 + cos 2𝑥 , find the zero value in the interval of [0.1, 0.9], let the acceptable error 𝜀𝑠 = 0.0005
Dr. Amer M. Magableh
Dr. Amer M. Magableh Dr. Amer M. Magableh Dr. Amer M. Magableh Dr. Amer M. Magableh Dr. Amer M. Magableh Error Estimation Let 𝑉𝑡 to be the true value of the root and 𝑉𝑎 to be the estimate value, then the absolute value of the error |𝐸| = |𝑉𝑡 − 𝑉𝑎 | The absolute error, 𝐸 , should be less than or equal to a certain value in order to stop the iteration process (n) then, the number of iterations n needed to ensure that the absolute value of the error Let 𝐿 = 𝑏 − 𝑎 be the length of the original interval used. The 𝑎+𝑏 first estimate 𝑥1 = and so, in the next iteration, the interval 2 𝐿 where the root is contained has a length of . 2 As the process evolves, the interval for the iteration number n 𝐿 has a length of 𝑛 2
Dr. Amer M. Magableh
Dr. Amer M. Magableh False Position Method
Dr. Amer M. Magableh
False Position Method In the false position method, the new estimate 𝑥𝑖 at iteration i is obtained by considering the linear function passing through the two points 𝑎, 𝑓 𝑎 𝑎𝑛𝑑 𝑏, 𝑓 𝑏 .
Algorithm
Dr. Amer M. Magableh
Example Let 𝑓 𝑥 = sin 5𝑥 + cos 2𝑥 , find the zero value in the interval of [-0.6, -0.5], let the acceptable error 𝜀𝑠 = 0.0005, use false position method
Considering
Dr. Amer M. Magableh
Dr. Amer M. Magableh Pitfalls of False Position Algorithm In the previous example, it was clear that the false position converges much faster than the bisection method for that example Sometimes the bisection performs better than the false position method, such as in the following example
Dr. Amer M. Magableh
Dr. Amer M. Magableh False Position Method
Dr. Amer M. Magableh
Dr. Amer M. Magableh Always try to make a plot of the function first
Dr. Amer M. Magableh
Modified False Position Method
The improved false position method is obtained by modifying
Bracketing methods will converge to the solution Using Bisection Method 14 iterations Using False Position Method 39 iterations Using Modified False Position Method 12 iterations Dr. Amer M. Magableh End of Chapter 5