~ Roots of Equations ~ Bracketing Methods Chapter 5

Slides:



Advertisements
Similar presentations
Roundoff and truncation errors
Advertisements

Roots: Bracketing Methods
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 One-Dimensional Unconstrained Optimization Chapter.
Roots of Equations Our first real numerical method – Root finding
ROOTS OF EQUATIONS Student Notes ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.
Numerical Methods. Read xl and xu Define the function f(xl)f(xu) : 0 xu = xm Find xm=(xl+xu)/2 Read ε(limit) & max_iteration f(xl)f(xm):0 Ea = |(xm-xmold)*100/xm|
Optimization Introduction & 1-D Unconstrained Optimization
Bisection Method (Midpoint Method for Equations).
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 61.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 7 Roots of Equations Bracketing Methods.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 51.
Roots of Equations Open Methods (Part 2).
Chapter 6 Open Methods.
Second Term 05/061 Roots of Equations Bracketing Methods.
Open Methods (Part 1) Fixed Point Iteration & Newton-Raphson Methods
Roots of Equations Bracketing Methods.
Dr. Marco A. Arocha Aug,  “Roots” problems occur when some function f can be written in terms of one or more dependent variables x, where the.
Bracketing Methods Chapter 5 The Islamic University of Gaza
Roots of Equations Open Methods Second Term 05/06.
Roots of Equations Chapter 3. Roots of Equations Also called “zeroes” of the equation –A value x such that f(x) = 0 Extremely important in applications.
I. Finding Roots II. Integrating Functions
Solving Non-Linear Equations (Root Finding)
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 2 Roots of Equations Why? But.
Introduction This chapter gives you several methods which can be used to solve complicated equations to given levels of accuracy These are similar to.
Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis
Part 2 Chapter 5 Roots: Bracketing Methods PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Roots of Equations ~ Open Methods Chapter 6 Credit:
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Numerical Differentiation and Integration ~ Integration.
Chapter 3 Roots of Equations. Objectives Understanding what roots problems are and where they occur in engineering and science Knowing how to determine.
Numerical Methods for Engineering MECN 3500
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Roots of Equations ~ Bracketing Methods Chapter 5.
Today’s class Roots of equation Finish up incremental search
4 Numerical Methods Root Finding Secant Method Modified Secant
ROOTS OF EQUATIONS. Bracketing Methods The Bisection Method The False-Position Method Open Methods Simple Fixed-Point Iteration The Secant Method.
Lecture 5 - Single Variable Problems CVEN 302 June 12, 2002.
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 5 Bracketing Methods.
Solving Non-Linear Equations (Root Finding)
Numerical Methods Solution of Equation.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Applied Numerical Methods With MATLAB ® for Engineers.
Today’s class Numerical differentiation Roots of equation Bracketing methods Numerical Methods, Lecture 4 1 Prof. Jinbo Bi CSE, UConn.
Roots: Bracketing Methods
4 Numerical Methods Root Finding Secant Method Modified Secant
SOLVING NONLINEAR EQUATIONS. SECANT METHOD MATH-415 Numerical Analysis 1.
Root Finding UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
CSE 330: Numerical Methods. What is true error? True error is the difference between the true value (also called the exact value) and the approximate.
Solution of Nonlinear Equations ( Root Finding Problems ) Definitions Classification of Methods  Analytical Solutions  Graphical Methods  Numerical.
Numerical Methods Slide Credit
CSE 330: Numerical Methods. Introduction The bisection and false position method require bracketing of the root by two guesses Such methods are called.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 2 / Chapter 5.
Solution of Nonlinear Equations ( Root Finding Problems )
Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis
4 Numerical Methods Root Finding Secant Method Modified Secant
Bracketing Methods (Bisection Method)
Newton’s Method for Systems of Non Linear Equations
Lecture 4: Numerical Methods
Read Chapters 5 and 6 of the textbook
Chemical Engineering Majors Authors: Autar Kaw, Jai Paul
Part 2 / Chapter 5.
Chapter 1: False-Position Method of Solving a Nonlinear Equation
Computers in Civil Engineering 53:081 Spring 2003
Bisection Method.
SOLUTION OF NONLINEAR EQUATIONS
Roots: Bracketing Methods
ROOTS OF EQUATIONS.
Mechanical Engineering Majors Authors: Autar Kaw, Jai Paul
Roots: Bracketing Methods
Industrial Engineering Majors Authors: Autar Kaw, Jai Paul
Major: All Engineering Majors Authors: Autar Kaw, Jai Paul
Presentation transcript:

~ Roots of Equations ~ Bracketing Methods Chapter 5 Credit: Prof. Lale Yurttas, Chemical Eng., Texas A&M University

Easy But, not easy How about these? Roots of Equations Easy But, not easy How about these?

Graphical Approach Make a plot of the function f(x) and observe where it crosses the x-axis, i.e. f(x) = 0 Not very practical but can be used to obtain rough estimates for roots These estimates can be used as initial guesses for numerical methods that we’ll study here. Using MATLAB, plot f(x)=sin(10x)+cos(3x) Two distinct roots between x= 4.2 and 4.3 need to be careful

Bracketing: Odd and even number of roots exceptions

Bisection Method Termination criteria: e < Epsilon OR Max.Iteration is reached

MATLAB code Bisection Method % Bisection Method - simple % function f(x) = exp(-x) - x = 0 sample call: bisection(-2, 4, 0.001,500) function root = bisection(xl, xu, es, imax); if ((exp(-xl) - xl)*(exp(-xu) - xu))>0 % if guesses do not bracket, exit disp('no bracket') return end for i=1:1:imax xr=(xu+xl)/2; % compute the midpoint xr ea = abs((xu-xl)/xl); % approx. relative error test= (exp(-xl) - xl) * (exp(-xr) - xr); % compute f(xl)*f(xr) if (test < 0) xu=xr; else xl=xr; if (test == 0) ea=0; end if (ea < es) break; end s=sprintf('\n Root= %f #Iterations = %d \n', xr,i); disp(s); MATLAB code Bisection Method Minimize function evaluations in the code. Why? Because they are costly (takes more time)

How Many Iterations will It Take? Length of the first Interval Lo= xu- xl After 1 iteration L1=Lo/2 After 2 iterations L2=Lo/4 ….. ….. After k iterations Lk=Lo/2k Then we can write:

Bisection Method Pros Cons Easy Always finds a root Number of iterations required to attain an absolute error can be computed a priori. Cons Slow Need to find initial guesses for xl and xu No account is taken of the fact that if f(xl) is closer to zero, it is likely that root is closer to xl .

The False-Position Method (Regula-Falsi) We can approximate the solution by doing a linear interpolation between f(xu) and f(xl) Find xr such that l(xr)=0, where l(x) is the linear approximation of f(x) between xl and xu Derive xr using similar triangles

Modified False-Position The False-Position Method Works well, but not always!  Here is a pitfall  Modified False-Position One way to mitigate the “one-sided” nature of the false position (i.e. the pitfall case) is to have the algorithm detect when one of the bounds is stuck. If this occurs, then the original formula xr = (xl + xu)/2 can be used

How to find good initial guesses? Start at one end of the region of interest (xa) and evaluate f(xa), f(xa+Dx), f(xa+2Dx), f(xa+3Dx), ........ Continue until the sign of the result changes. If that happens between f(xa+k*Dx) and f(xa+(k+1)*Dx) then pick xl= xa+k*Dx and xu= xa+(k+1)*Dx Problem: if Dx is too small  search is very time consuming if Dx is too large  could jump over two closely spaced roots Ultimate solution: Know the application and plot the function to see the location of the roots, and pick xl and xu accordingly to start the iterations.