Recursive Methods for Finding Roots of Functions Bisection & Newton’s Method.

Slides:



Advertisements
Similar presentations
Mathematics1 Mathematics 1 Applied Informatics Štefan BEREŽNÝ.
Advertisements

Regula-Falsi Method. Type of Algorithm (Equation Solver) The Regula-Falsi Method (sometimes called the False Position Method) is a method used to find.
Bisection Method (Midpoint Method for Equations).
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.
Roots of Equations Bracketing Methods.
Root-Finding Algorithm Bisection method Suppose we want to solve the equation f(x) = 0. Given two points a and b such that f(a) and f(b) have opposite.
Lectures on Numerical Methods 1 Numerical Methods Charudatt Kadolkar Copyright 2000 © Charudatt Kadolkar.
NUMERICAL METHODS WITH C++ PROGRAMMING
מבוא מורחב למדעי המחשב בשפת Scheme תרגול 4. Outline High order procedures –Finding Roots –Compose Functions Accelerating Computations –Fibonacci 2.
FP1: Chapter 2 Numerical Solutions of Equations
Fin500J: Mathematical Foundations in Finance Topic 3: Numerical Methods for Solving Non-linear Equations Philip H. Dybvig Reference: Numerical Methods.
- + Suppose f(x) is a continuous function of x within interval [a, b]. f(a) = - ive and f(b) = + ive There exist at least a number p in [a, b] with f(p)
Numerical Analysis 1 EE, NCKU Tien-Hao Chang (Darby Chang)
MATH 175: NUMERICAL ANALYSIS II Lecturer: Jomar Fajardo Rabajante IMSP, UPLB 2 nd Semester AY
Scientific Computing Algorithm Convergence and Root Finding Methods.
Solving Non-Linear Equations (Root Finding)
Application of Bisection Method Presenting: c Presenters : Faisal Zubi.
Limits Basic facts about limits The concept of limit underlies all of calculus. Derivatives, integrals and series are all different kinds of limits. Limits.
Continuity ( Section 1.8) Alex Karassev. Definition A function f is continuous at a number a if Thus, we can use direct substitution to compute the limit.
Approximate computations Jordi Cortadella Department of Computer Science.
Loop Application: Numerical Methods, Part 1 The power of Matlab Mathematics + Coding.
Lecture 3 Numerical Analysis. Solution of Non-Linear Equations Chapter 2.
Solving equations numerically The sign - change rule If the function f(x) is continuous for an interval a  x  b of its domain, if f(a) and f(b) have.
Problem of the Day No calculator! What is the instantaneous rate of change at x = 2 of f(x) = x2 - 2 ? x - 1 A) -2 C) 1/2 E) 6 B) 1/6 D) 2.
Numerical Methods.
Review Limits When you see the words… This is what you think of doing…  f is continuous at x = a  Test each of the following 1.
1.4 Continuity  f is continuous at a if 1. is defined. 2. exists. 3.
The Bisection Method. Introduction Bisection Method: Bisection Method = a numerical method in Mathematics to find a root of a given function.
ME 142 Engineering Computation I Root Finding & Iterative Solutions.
Solving Non-Linear Equations (Root Finding)
Solution of Nonlinear Equations Topic: Bisection method
Numerical Methods Solution of Equation.
Today’s class Numerical differentiation Roots of equation Bracketing methods Numerical Methods, Lecture 4 1 Prof. Jinbo Bi CSE, UConn.
Section 5.5 The Intermediate Value Theorem Rolle’s Theorem The Mean Value Theorem 3.6.
Roots: Bracketing Methods
Intermediate Value Theorem Vince Varju. Definition The Intermediate Value Theorem states that if a function f is a continuous function on [a,b] then there.
4.8 Newton’s Method Mon Nov 9 Do Now Find the equation of a tangent line to f(x) = x^5 – x – 1 at x = 1.
Linearization, Newton’s Method
SOLVING NONLINEAR EQUATIONS. SECANT METHOD MATH-415 Numerical Analysis 1.
מבוא מורחב למדעי המחשב בשפת Scheme תרגול 3. Outline High order procedures –Finding Roots –Compose Functions Accelerating Computations –Fibonacci 2.
Warm Up Write an equation of the tangent line to the curve at the given point. 1)f(x)= x 3 – x + 1 where x = -1 2)g(x) = 3sin(x/2) where x = π/2 3)h(x)
If f (x) is continuous over [ a, b ] and differentiable in (a,b), then at some point, c, between a and b : Mean Value Theorem for Derivatives.
AP Calc AB IVT. Introduction Intermediate Value Theorem If a function is continuous between a and b, then it takes on every value between and. Because.
Lecture 4 Numerical Analysis. Solution of Non-Linear Equations Chapter 2.
Solution of Nonlinear Equations ( Root Finding Problems ) Definitions Classification of Methods  Analytical Solutions  Graphical Methods  Numerical.
Numerical Calculation Part 1: Equations &Roots Dr.Entesar Ganash (Bisection's Method)
MATH342: Numerical Analysis Sunjae Kim.
3.2 Rolle’s Theorem and the
Solution of Nonlinear Equations (Root finding Problems
Numerical Methods and Analysis
Table of Contents 8. Section 2.7 Intermediate Value Theorem.
3.2 Rolle’s Theorem and the
Important Values for Continuous functions
MATH 175: Numerical Analysis II
Intermediate Value Theorem
1. Be able to apply The Mean Value Theorem to various functions.
Intermediate Value Theorem
Table of Contents 8. Section 2.7 Intermediate Value Theorem.
1.4 Continuity and One-Sided Limits (Part 2)
Continuity Alex Karassev.
3.8 Newton’s Method How do you find a root of the following function without a graphing calculator? This is what Newton did.
3.8: Newton’s Method Greg Kelly, Hanford High School, Richland, Washington.
FP1: Chapter 2 Numerical Solutions of Equations
3.8: Newton’s Method Greg Kelly, Hanford High School, Richland, Washington.
Intermediate Value Theorem
Copyright © Cengage Learning. All rights reserved.
MATH 1910 Chapter 3 Section 8 Newton’s Method.
ME 142 Engineering Computation I
Solutions for Nonlinear Equations
Presentation transcript:

Recursive Methods for Finding Roots of Functions Bisection & Newton’s Method

Intermediate Value Theorem §Finding the root of a function will rely on this theorem. §It states that for any function that is continuous over the interval [a,b] then that function will take on every value between f(a) to f(b).

BISECTION §Bisection requires narrowing one root onto a certain interval [a,b] §Testing this interval in the function f should give values which are opposite in sign for f(a) and f(b). §Bisecting this interval and testing f((a+b)/2) will yield another smaller interval in which to continue bisecting until the desired accuracy is reached.

Bisection Example Given, find the root between 2 and 3 to an accuracy of 10^-3. §3rd, we narrow our search interval from [2,3] to [2,2.5] since f(2) is negative and f(2.5) is positive. §2nd Test f((2+3)/2) = f(2.5). All we need to know is it’s sign. It is positive. §1st Compare: f(2) = -1 and f(3) = 16. By the Intermediate Value Theorem we are insured that at least one root exists between 2 and 3.

§Continuing this pattern to finish the problem: iteration 2: f(2.25)>0, new interval: [2,2.25] iteration 3: f(2.125)>0, new interval: [2,2.125] iteration 4: f(2.0625)<0, new interval: [2.0625,2.125] iteration 5: f( )<0, new interval: [ ,2.125] iteration 6: f( )>0, new interval: [ , ] iteration 7: f( )>0, new int: [ , ] iteration 8: f( )>0, new int: [ , ] iteration 9: f( )>0, int: [ , ] Root approximation is the midpoint of this interval: x= Bisection Example

§We stop at this point because the desired accuracy has been reached. §The root is always as accurate as half of the interval arrived at, or in this case: ( )/2 = Bisection Example

Bisection Accuracy §Accuracy is always arrived at by taking half the current interval because the actual root could be no farther than that away from the midpoint. §The initial accuracy of the midpoint is: |b-a|/2 §After each iteration, this accuracy is halved. §After n iterations accuracy is: |b-a|/2^(n+1)

Psuedocode Input function, interval where root exists, and desired accuracy. {f, a, b, E} n = 1 While E > |b - a| / 2^n g = (b + a) / 2//make a guess for root at midpoint if f(g) is the same sign as b then b = g else a = g endif n = n + 1 End loop Display guess as g to accuracy of |b - a| / 2^n

NEWTON’S METHOD §Requires you to make a relatively good guess for the root of f(x), x 0. §Construct a tangent line to f(x) at this point: y - f(x 0 ) = f´(x 0 )(x - x 0 ) §Find the x-intercept of this line (y = 0): 0 - f(x 0 ) = f´(x 0 )(x - x 0 ) OR x = x 0 - f(x 0 ) / f´(x 0 ) §Repeat guess for this new x.

Newton’s Method Example Given, find the root between 2 and 3 to an accuracy of 10^-3. §1st Guess: By view the graph make an initial guess of x 0 = 2. §2nd find new x: x 1 = 2 - f(2) / f´(2) = 2.1 §3rd repeat for x = 2.1

§Continuing this pattern takes much less time to narrow down than bisection: iteration 2: x 2 = f(2.1) / f´(2.1) = iteration 3: x 3 = x 2 - f(x 2 ) / f´(x 2 ) = §You can already see that by the third iteration the accuracy of the root is to or less than 10^-3. §The number of iterations will depend on how good your guess is. Newton’s Method Example

Psuedocode Input function, guess, and desired accuracy. {f, g, E} n = 0 While |g n - g n-1 | > E n = n + 1 g n = g n-1 - f(g n-1 ) / f´(g n-1 ) End loop Display root as g n to accuracy of |g n - g n-1 |

Quirks and Exceptions to Newton’s Method §if along the way f´(x n ) = 0 then you will get a horizontal line with no x-intercept.

Quirks and Exceptions to Newton’s Method §You may get the wrong root depending on your initial guess. x0x0 x1x1

Quirks and Exceptions to Newton’s Method §You may get the wrong root. x0x0 x1x1