Root Finding: Close Methods. Bisection and False Position Dr. Marco A. Arocha Aug, 2014

Similar documents
Bisection and False Position Dr. Marco A. Arocha Aug, 2014

Scientific Computing. Roots of Equations

CHAPTER-II ROOTS OF EQUATIONS

Solving Non-Linear Equations (Root Finding)

Numerical Methods. Root Finding

Today s class. Numerical differentiation Roots of equation Bracketing methods. Numerical Methods, Fall 2011 Lecture 4. Prof. Jinbo Bi CSE, UConn

INTRODUCTION TO NUMERICAL ANALYSIS

Figure 1: Graph of y = x cos(x)

3.1 Introduction. Solve non-linear real equation f(x) = 0 for real root or zero x. E.g. x x 1.5 =0, tan x x =0.

Root Finding (and Optimisation)

Solution of Algebric & Transcendental Equations

Determining the Roots of Non-Linear Equations Part I

A Review of Bracketing Methods for Finding Zeros of Nonlinear Functions

Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane.

MATH 3795 Lecture 12. Numerical Solution of Nonlinear Equations.

Practical Numerical Analysis: Sheet 3 Solutions

Scientific Computing: An Introductory Survey

Chapter 5 Roots of Equations: Bracketing Models. Gab-Byung Chae

CHAPTER 4 ROOTS OF EQUATIONS

PART I Lecture Notes on Numerical Solution of Root Finding Problems MATH 435

Chapter 3: Root Finding. September 26, 2005

SOLUTION OF ALGEBRAIC AND TRANSCENDENTAL EQUATIONS BISECTION METHOD

DRAFT - Math 101 Lecture Note - Dr. Said Algarni

Roots of Equations. ITCS 4133/5133: Introduction to Numerical Methods 1 Roots of Equations

Numerical Methods School of Mechanical Engineering Chung-Ang University

Bisected Direct Quadratic Regula Falsi

Numerical Solution of f(x) = 0

Numerical Methods Dr. Sanjeev Kumar Department of Mathematics Indian Institute of Technology Roorkee Lecture No 7 Regula Falsi and Secant Methods

Lecture 7. Root finding I. 1 Introduction. 2 Graphical solution

GENG2140, S2, 2012 Week 7: Curve fitting

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 5. Nonlinear Equations

Chapter 2 Solutions of Equations of One Variable

Outline. Math Numerical Analysis. Intermediate Value Theorem. Lecture Notes Zeros and Roots. Joseph M. Mahaffy,

Math Numerical Analysis

Math 471. Numerical methods Root-finding algorithms for nonlinear equations

NUMERICAL AND STATISTICAL COMPUTING (MCA-202-CR)

15 Nonlinear Equations and Zero-Finders

Chapter 1. Root Finding Methods. 1.1 Bisection method

MAE 107 Homework 7 Solutions

Outline. Scientific Computing: An Introductory Survey. Nonlinear Equations. Nonlinear Equations. Examples: Nonlinear Equations

Section 1.4 Tangents and Velocity

Goals for This Lecture:

Finding the Roots of f(x) = 0. Gerald W. Recktenwald Department of Mechanical Engineering Portland State University

Finding the Roots of f(x) = 0

Solution of Nonlinear Equations

Root finding. Root finding problem. Root finding problem. Root finding problem. Notes. Eugeniy E. Mikhailov. Lecture 05. Notes

Numerical Methods in Informatics

SOLVING EQUATIONS OF ONE VARIABLE

Hence a root lies between 1 and 2. Since f a is negative and f(x 0 ) is positive The root lies between a and x 0 i.e. 1 and 1.

Numerical Methods. Roots of Equations

4 Nonlinear Equations

CLASS NOTES Models, Algorithms and Data: Introduction to computing 2018

Solution of nonlinear equations

Calculus I. 1. Limits and Continuity

Halley s Method: A Cubically Converging. Method of Root Approximation

CS 450 Numerical Analysis. Chapter 5: Nonlinear Equations

x 2 x n r n J(x + t(x x ))(x x )dt. For warming-up we start with methods for solving a single equation of one variable.

Non-linear Equations. Chapter Particle in a Box Potential. h2 d 2 u. dx 2. 0 x>a. d 2 u(x) + 2m h 2 (V 0+ E)u(x)=0 x<a, (4.

Numerical Methods Lecture 3

ROOT FINDING REVIEW MICHELLE FENG

Solutions of Equations in One Variable. Newton s Method

Math Numerical Analysis Mid-Term Test Solutions

Nonlinear Equations. Chapter The Bisection Method

Lecture 5: Random numbers and Monte Carlo (Numerical Recipes, Chapter 7) Motivations for generating random numbers

Numerical optimization

Computational Methods CMSC/AMSC/MAPL 460. Solving nonlinear equations and zero finding. Finding zeroes of functions

Root finding. Eugeniy E. Mikhailov. Lecture 05. The College of William & Mary. Eugeniy Mikhailov (W&M) Practical Computing Lecture 05 1 / 10

Nonlinear Equations. Not guaranteed to have any real solutions, but generally do for astrophysical problems.

Nonlinearity Root-finding Bisection Fixed Point Iteration Newton s Method Secant Method Conclusion. Nonlinear Systems

Comments on An Improvement to the Brent s Method

4.9 APPROXIMATING DEFINITE INTEGRALS

Optimization and Calculus

1.5 F15 O Brien. 1.5: Linear Equations and Inequalities

Calculus. Weijiu Liu. Department of Mathematics University of Central Arkansas 201 Donaghey Avenue, Conway, AR 72035, USA

Unit 2: Solving Scalar Equations. Notes prepared by: Amos Ron, Yunpeng Li, Mark Cowlishaw, Steve Wright Instructor: Steve Wright

Calculus I Exam 1 Review Fall 2016

Lecture 7: Minimization or maximization of functions (Recipes Chapter 10)

EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science

Math 117: Calculus & Functions II

Root finding. Eugeniy E. Mikhailov. Lecture 06. The College of William & Mary. Eugeniy Mikhailov (W&M) Practical Computing Lecture 06 1 / 10

Lecture 8. Root finding II

Chapter 2 Differentiation. 2.1 Tangent Lines and Their Slopes. Calculus: A Complete Course, 8e Chapter 2: Differentiation

Line Search Methods. Shefali Kulkarni-Thaker

Numerical mathematics with GeoGebra in high school

Numerical Methods in Physics and Astrophysics

1. Method 1: bisection. The bisection methods starts from two points a 0 and b 0 such that

Consequences of Continuity and Differentiability

Substitutions and by Parts, Area Between Curves. Goals: The Method of Substitution Areas Integration by Parts

Continuity. To handle complicated functions, particularly those for which we have a reasonable formula or formulas, we need a more precise definition.

Numerical Methods

NUMERICAL METHODS. x n+1 = 2x n x 2 n. In particular: which of them gives faster convergence, and why? [Work to four decimal places.

Introductory Numerical Analysis

Numerical Methods in Physics and Astrophysics

Appendix 8 Numerical Methods for Solving Nonlinear Equations 1

Variable. Peter W. White Fall 2018 / Numerical Analysis. Department of Mathematics Tarleton State University

Root Finding Methods

Introduction to Numerical Analysis

AP CALCULUS (AB) Outline Chapter 4 Overview. 2) Recovering a function from its derivatives and a single point;

Continuity. MATH 161 Calculus I. J. Robert Buchanan. Fall Department of Mathematics

Math Section Bekki George: 08/28/18. University of Houston. Bekki George (UH) Math /28/18 1 / 37

Transcription:

Root Finding: Close Methods Bisection and False Position Dr. Marco A. Arocha Aug, 2014 1

Roots Given function f(x), we seek x values for which f(x)=0 Solution x is the root of the equation or zero of the function f(x) Problem is known as root finding or zero finding 2

Number of Roots Nonlinear equations can have any number of solutions: exp(x) + 1 = 0 exp( x) x = 0 x 2 4 sin(x) = 0 x 3 + 6x 2 + 11x 6 = 0 sin(x) = 0 has no solution has one solution has two solutions has three solutions has infinitely many solutions 3

Roots Root solving involves finding the values of x which satisfy relationships such as: ax 4 + bx 3 + cx 2 dx + c = 0 tan ax x 2 = 0 For values of x other than the roots, the above equations will not be satisfied and can be better expressed as: ax 4 + bx 3 + cx 2 dx + c = f(x) tan ax x 2 = g(x) Expressed as above allow us to graph them, e.g., f(x) vs x ; g(x) vs x Finding the roots of these equations is equivalent to finding the values of x for which f(x) and g(x) are zero 4

Graphical Methods A simple method for obtaining the estimate of the root of the equation f(x)=0 is to make a plot of the function as f(x) vs x and observe where it crosses the x-axis. Graphing the function can also indicate where roots may be and where some root-finding methods may fail: who is doing this one? a) Same sign, no roots b) Different sign, one root c) Same sign, two roots d) Different sign, three roots 5

Graphical methods Some difficult cases: Multiple roots that occurs when the function is tangential to the x axis. For this case, although the end points are of opposite signs, there are an even number of axis intersections for the interval. Discontinuous function where end points of opposite sign bracket an even number of roots. Special strategies are required for determining the roots for these cases. 6

GRAPHICAL METHODS Graphical techniques: Alone are of limited practical value because they are not precise. Are utilized to obtain rough estimates of roots. These estimates are employed as starting guesses for numerical methods. Are important tools for understanding the properties of the functions and anticipating the pitfalls of the numerical methods. 7

If you are asked to hand in a graph of a function in search of a root, what graph would you finally turn in? 8

Bracketing methods They are also called close methods as opposed to other methods called open methods. They exploit the fact that a function typically changes sign in the vicinity of a root. The method requires two initial guesses in each side of the root. The particular methods employ different strategies to systematically reduce the width of the bracket and, hence, home in on the correct answer. Close methods are generally slower than open methods but more robust. 9

Bisection The bisection method is a search method in which the interval is progressively divided in half. If a function changes sign over an interval, the function value at the midpoint is evaluated. The location of the root is then determined as lying within the subinterval where the sign change occurs. The absolute error is reduced by a factor of 2 for each iteration. c root 10

first iteration second iteration third iteration fourth iteration 11

Algorithm: Step 1: Choose lower a and upper b guesses for the root such that the function changes sign over the interval. This can me checked by ensuring that f(a)f(b)<0 Step 2: An estimate of the root c is determined by c=(a+b)/2 Step 3: Determine in which subinterval the root lies: (a) if f(a)f(c)<0, then b=c; return to Step 2 (b) if f(a)f(c)>0, then a=c; return to Step 2 (c) if f(a)f(c)=0, then error=0, and c is the root, Stop computation Step 4: Repeat Step 2 to 3 until a Stopping criterium is reached 12

Bisection Method, Stop Criteria: We can use one or more of the following criteria for the iteration process: 1. Interval small enough, i.e., (b-a) ϵ, where ϵ is a very small number. ϵ is an approximate error where a is the root lower bound and b is the root upper bound of the present iteration. The absolute value is used because we are usually concerned with the magnitude of ϵ rather than with its sign. 2. f(c) very small,i.e., f(c) ϵ; where c is the middle point and the new root estimate 3. Max number of iterations reached 4. Any number or combination of the criteria listed in (1), (2), and (3) An approximate percent relative error ε a can also be calculated: ε a = c new C old 100% C new where c new is the root for the present iteration and c old is the root from the previous iteration. The absolute value is used because we are usually concerned with the magnitude of ε a rather than with its sign. 13

BISECTION PSEUDOCODE INPUT a, b, tol, imax iter = 0 DO c = (a + b) / 2 iter = iter + 1 error = ABS(b-a) IF (f(a) * f(c))<0 THEN b = c ELSEIF (f(a) * f(c))>0 THEN a = c ELSE error = 0 END IF WHILE error>tol AND iter imax Result = c 14

false position method An alternative method to bisection, sometimes faster. Exploits a graphical strategy, join f(a) and f(b) by a straight line. The intersection of this line with the x axis represents an improved estimate of the root. The fact that the replacement of the curve by a straight line gives a false position of the root is the origin of the name, method of false position, or in Latin, regula falsi. It is also called the linear interpolation method. 15

false position method Derive the method s formula by using similar triangles. The intersection of the straight line with the x axis c can be estimated as f b 0 b c = (f a 0) c a which can be solved for c c = b f(b) (a b) f(a) f(b) 16

false position method The value of c so computed then replaces whichever of the two initial guesses, a or b, yields a function value with the same sign as f(c). By this way, the values of a and b always bracket the true root. The process is repeated until the root is estimated. The algorithm is similar to the one for bisection with the exception for the c eq. The difference is that the root is approached from only one side of the values bracketing the root, as you can see in the next slide. 17

pitfalls for some cases false-position method may show slow convergence 18

FALSE POSITION Method, Stop Criteria: We can use one or more of the following criteria for the iteration process: 1. f(c) very small,i.e., f(c) ϵ 2. Max number of iterations reached 3. Any number or combination of the criteria listed in (1), (2), and (3) ONE COMPLICATION: As this method approaches the root from one side of the interval (b-a), either from the left or the right of the interval, the criterion interval small enough, i.e., (b-a) ϵ, can t be used for this method. For instances, you can see this problem in the Excel program. 19

quick comparison Bisection New estimate of the root: Stop criteria: c = (a + b) 2 error = b a tolerance False Position New estimate of the root c = b f(b) Stop criteria f(c) tolerance (a b) f(a) f(b) 20