Sec:5.2 The Bisection Method.

Slides:



Advertisements
Similar presentations
Numerical Methods: Finding Roots Department of Mathematics University of Leicester.
Advertisements

Mathematics1 Mathematics 1 Applied Informatics Štefan BEREŽNÝ.
CSE 330: Numerical Methods
Numeriska beräkningar i Naturvetenskap och Teknik 1.Solving equations.
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 51.
CSCE Finding Roots of Equations This is a fundamental computational problem Several methods exist. We will look at the bisection method and at Newton’s.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 6 Roots of Equations Bracketing Methods.
Lectures on Numerical Methods 1 Numerical Methods Charudatt Kadolkar Copyright 2000 © Charudatt Kadolkar.
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.
NUMERICAL METHODS WITH C++ PROGRAMMING
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 8 Roots of Equations Open Methods.
Bracketing Methods Chapter 5 The Islamic University of Gaza
Fin500J: Mathematical Foundations in Finance Topic 3: Numerical Methods for Solving Non-linear Equations Philip H. Dybvig Reference: Numerical Methods.
9.4 – Solving Absolute Value Equations and Inequalities 1.
Section 5.5 – The Real Zeros of a Rational Function
Numerical Analysis 1 EE, NCKU Tien-Hao Chang (Darby Chang)
Theorems on continuous functions. Weierstrass’ theorem Let f(x) be a continuous function over a closed bounded interval [a,b] Then f(x) has at least one.
MATH 175: NUMERICAL ANALYSIS II Lecturer: Jomar Fajardo Rabajante IMSP, UPLB 2 nd Semester AY
Limits Basic facts about limits The concept of limit underlies all of calculus. Derivatives, integrals and series are all different kinds of limits. Limits.
Solving Quadratic Equations
Lecture 3 Numerical Analysis. Solution of Non-Linear Equations Chapter 2.
Lecture 6 Numerical Analysis. Solution of Non-Linear Equations Chapter 2.
3.6 Solving Absolute Value Equations and Inequalities
ME 142 Engineering Computation I Root Finding & Iterative Solutions.
Solution of Nonlinear Equations Topic: Bisection method
Numerical Methods Solution of Equation.
11-2 Solving Quadratic Equations By Graphing
Roots: Bracketing Methods
Recursive Methods for Finding Roots of Functions Bisection & Newton’s Method.
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.
6/13/ Secant Method Computer Engineering Majors Authors: Autar Kaw, Jai Paul
Lecture 4 Numerical Analysis. Solution of Non-Linear Equations Chapter 2.
1 M 277 (60 h) Mathematics for Computer Sciences Bibliography  Discrete Mathematics and its applications, Kenneth H. Rosen  Numerical Analysis, Richard.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 2 / Chapter 5.
Chapter 5 Numerical Root Findings
Polynomial & Rational Inequalities
Numerical Analysis Lecture 5.
Solution of Nonlinear Equations (Root finding Problems
Numerical Methods and Analysis
Secant Method.
Read Chapters 5 and 6 of the textbook
Solving Quadratic Equations by Graphing
9.3 Solving Quadratic Equations
Secant Method – Derivation
4.2 Properties of Polynomial Graphs
College Algebra Chapter 3 Polynomial and Rational Functions
Chapter 1: False-Position Method of Solving a Nonlinear Equation
Important Values for Continuous functions
Zeros to Quadratic Functions
Computers in Civil Engineering 53:081 Spring 2003
Roots of equations Class IX.
6.5 Solving Inequalities by Factoring
SOLUTION OF NONLINEAR EQUATIONS
Chemical Engineering Majors Authors: Autar Kaw, Jai Paul
Section 4.8: Newton’s Method
Algorithms and Convergence
Newton’s Method and Its Extensions
3.8: Newton’s Method Greg Kelly, Hanford High School, Richland, Washington.
Solving Linear Equations by Graphing
4 minutes Warm-Up Graph. 1) 2) 3).
3.8: Newton’s Method Greg Kelly, Hanford High School, Richland, Washington.
Sec:5.2 The Bisection Method.
Solving Systems of Equations by Elimination Part 2
Objectives: To graph lines using the slope-intercept equation
Copyright © Cengage Learning. All rights reserved.
MATH 1910 Chapter 3 Section 8 Newton’s Method.
Solutions for Nonlinear Equations
Presentation transcript:

Sec:5.2 The Bisection Method

Sec:5.2 The Bisection Method The root-finding problem is a process involves finding a root, or solution, of an equation of the form 𝑓 𝑥 = 0 for a given function 𝑓 . A root of this equation is also called a zero of the function 𝑓 . In graph, the root (or zero) of a function is the x-intercept Two numerical methods for root-finding Sec(5.2): The Bisection Method root Sec(6.2): The Newton-Raphson Method

Sec:5.2 The Bisection Method This technique is based on the Intermediate Value Theorem Example: Suppose 𝑓 is a continuous function defined on the interval [𝑎, 𝑏], with 𝑓 (𝑎) and 𝑓 (𝑏) of opposite sign. The Intermediate Value Theorem implies that a number 𝑝 exists in (𝑎, 𝑏) with 𝑓 ( 𝑝) = 0. Show that 𝑓 (𝑥) = 10 𝑥 6 −149 𝑥 5 +10𝑥−149 10( 𝑥 4 +1) has a root in [12, 16] Sol: 12 16 𝒇(𝟏𝟐)=−𝟑𝟒.𝟖 𝒇(𝟏𝟔)=𝟏𝟕.𝟔

Sec:5.2 The Bisection Method Example: Use Bisection method to find the root of the function 𝑓 (𝑥) = 10 𝑥 6 −149 𝑥 5 +10𝑥−149 10( 𝑥 4 +1) in [12, 16] 12 16 Change of sign -34.8 17.6 𝒙 𝟏 = True root: 𝑥 𝑟 ∗ =14.9 12 14 Change of sign 16 Iter1 𝒏 𝒙 𝒏 -34.8 -12.6 17.6 1 14.0000000000 2 15.0000000000 3 14.5000000000 4 14.7500000000 5 14.8750000000 6 14.9375000000 7 14.9062500000 8 14.8906250000 9 14.8984375000 10 14.9023437500 11 14.9003906250 12 14.8994140625 13 14.8999023438 14 14.9001464844 15 14.9000244141 16 14.8999633789 𝒙 𝟐 = 14 15 16 Iter2 Change of sign -12.6 1.5 17.6 𝒙 𝟑 = Change of sign 14.5 14 15 Iter3 -5.8 1.5 -12.6

Sec:5.2 The Bisection Method Textbook notations 𝒙 𝒍 𝟎 𝒙 𝒖 𝟎 12 16 Change of sign ∆ 𝒙 𝟎 = 𝒙 𝒖 𝟎 − 𝒙 𝒍 𝟎 At the n-th iteration: -34.8 17.6 endpoints of the inteval 𝒙 𝒍 𝟏 𝒙 𝒖 𝟏 12 14 Change of sign 16 [ 𝒙 𝒍 𝒏 , 𝒙 𝒖 𝒏 ] Iter1 ∆ 𝒙 𝟏 = 𝒙 𝒖 𝟏 − 𝒙 𝒍 𝟏 -34.8 -12.6 17.6 Length of the interval 𝒙 𝒍 𝟐 𝒙 𝒖 𝟐 14 15 16 ∆ 𝒙 𝒏 = 𝒙 𝒖 𝒏 − 𝒙 𝒍 𝒏 Iter2 Change of sign ∆ 𝒙 𝟐 = 𝒙 𝒖 𝟐 − 𝒙 𝒍 𝟐 -12.6 1.5 17.6 = ∆ 𝒙 𝟎 𝟐 𝒏 𝒙 𝒍 𝟑 𝒙 𝒖 𝟑 Change of sign 14.5 14 15 Iter3 ∆ 𝒙 𝟑 = 𝒙 𝒖 𝟑 − 𝒙 𝒍 𝟑 -5.8 1.5 -12.6

Sec:5.2 The Bisection Method Error Estimates for Bisection 12 16 Change of sign -34.8 17.6 𝒙 𝒓 ∗ At the iter1: 𝒙 𝟏 = True root live inside this interval 𝒙 𝟏 − 𝒙 𝒓 ∗ < length of the interval 12 14 Change of sign 16 𝒙 𝟏 − 𝒙 𝒓 ∗ <∆ 𝒙 𝟏 = ∆ 𝒙 𝟎 𝟐 Iter1 -34.8 -12.6 17.6 𝒙 𝟐 At the iter2: = 14 15 16 𝒙 𝟐 − 𝒙 𝒓 ∗ < length of the interval Iter2 Change of sign 𝒙 𝟐 − 𝒙 𝒓 ∗ <∆ 𝒙 𝟐 = ∆ 𝒙 𝟎 𝟐 𝟐 -12.6 1.5 17.6 At the nth iteration: 𝒙 𝒏 − 𝒙 𝒓 ∗ < 𝒃−𝒂 𝟐 𝒏 Error Estimates for Bisection 𝒙 𝒏 − 𝒙 𝒓 ∗ < length of the interval 𝑬 𝒂 𝒏 < 𝒃−𝒂 𝟐 𝒏 the absolute error in the n-th iteration < 𝒃−𝒂 𝟐 𝒏 𝒙 𝒏 − 𝒙 𝒓 ∗ <∆ 𝒙 𝒏 = ∆ 𝒙 𝟎 𝟐 𝒏 = 𝒃−𝒂 𝟐 𝒏

Sec:5.2 The Bisection Method Error Estimates for Bisection 𝑬 𝒂 𝒏 < 𝒃−𝒂 𝟐 𝒏 𝒏 𝒙 𝒏 𝑬 𝒂 𝒏 1 14.0000000000 -9.0000000000e-01 2 15.0000000000 1.0000000000e-01 3 14.5000000000 -4.0000000000e-01 4 14.7500000000 -1.5000000000e-01 5 14.8750000000 -2.5000000000e-02 6 14.9375000000 3.7500000000e-02 7 14.9062500000 6.2500000000e-03 8 14.8906250000 -9.3750000000e-03 9 14.8984375000 -1.5625000000e-03 10 14.9023437500 2.3437500000e-03 11 14.9003906250 3.9062500000e-04 12 14.8994140625 -5.8593750000e-04 13 14.8999023438 -9.7656250000e-05 14 14.9001464844 1.4648437500e-04 15 14.9000244141 2.4414062500e-05 16 14.8999633789 -3.6621093750e-05 If 𝐸𝑎,𝑑 =10 −4 is the desired error, this equation can be solved for 𝑛 𝑬 𝒂 𝒏 < 𝟏𝟔−𝟏𝟐 𝟐 𝒏 < 𝟏𝟎 −𝟒 𝟐 𝒏 > 𝟒 𝟏𝟎 −𝟒 𝟐 𝒏 >𝟒× 𝟏𝟎 𝟒 𝒏> 𝒍𝒐𝒈 𝟒× 𝟏𝟎 𝟒 𝒍𝒐𝒈 𝟐 =𝟏𝟓.𝟐

Stopping Criteria Sec:5.2 The Bisection Method function [xr,err,yc,iter,x]=bisect_ver1(f,a,b,es) %Input: f is the function, a, b are endpts % es is the tolerance, imax is max iter %Output: c is the zero, yc= f(c) ya=f(a); yb=f(b); iter =0; if ya*yb > 0,return,end for k=1:1000 iter = iter +1; xr=(a+b)/2; yc=f(xr); x(k)=xr; if yc==0 a=xr; b=xr; elseif yb*yc>0 b=xr; yb=yc; else a=xr; ya=yc; end if b-a < es, break,end xr=(a+b)/2; err=abs(b-a); yc=f(xr); function [xr,err,yc,iter,x]=bisect_ver2(f,a,b,es) %Input: f is the function, a, b are endpts % es is the tolerance, imax is max iter %Output: c is the zero, yc= f(c) ya=f(a); yb=f(b); iter =0; if ya*yb > 0,return,end max1=1+round((log(b-a)-log(es))/log(2)); for k=1:max1 iter = iter +1; xr=(a+b)/2; yc=f(xr); x(k)=xr; if yc==0 a=xr; b=xr; elseif yb*yc>0 b=xr; yb=yc; else a=xr; ya=yc; end % if b-a < es, iter=k; break,end xr=(a+b)/2; err=abs(b-a); yc=f(xr); a=12; b=16; es=1e-4; % [xr,err,yc,iter,x]=bisect_ver2(f,a,b,es); [xr,err,yc,iter,x]=bisect_ver1(f,a,b,es); iteration = [1:iter]'; res = [ iteration, x' , x'-14.9] fprintf(' %d %14.10f %14.10e \n', res');

Sec:5.2 The Bisection Method