Goals for This Lecture:

Similar documents
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.

CHAPTER 4 ROOTS OF EQUATIONS

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

Scientific Computing. Roots of Equations

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

Chapter 3: Root Finding. September 26, 2005

ROOT FINDING REVIEW MICHELLE FENG

Numerical Methods Lecture 3

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

Numerical Methods. Root Finding

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

Numerical Methods in Informatics

Newton s Method and Linear Approximations

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

Root Finding (and Optimisation)

Lec7p1, ORF363/COS323

CHAPTER 10 Zeros of Functions

Zeros of Functions. Chapter 10

Newton s Method and Linear Approximations

Chapter 2 Solutions of Equations of One Variable

Analysis Methods in Atmospheric and Oceanic Science

Introductory Numerical Analysis

Lecture 8. Root finding II

1.1: The bisection method. September 2017

NUMERICAL AND STATISTICAL COMPUTING (MCA-202-CR)

Newton s Method and Linear Approximations 10/19/2011

Math Numerical Analysis

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

Module 2: Reflecting on One s Problems

CHAPTER-II ROOTS OF EQUATIONS

MATH 3795 Lecture 12. Numerical Solution of Nonlinear Equations.

Numerical Methods I Solving Nonlinear Equations

Solving Non-Linear Equations (Root Finding)

Chapter 6. Nonlinear Equations. 6.1 The Problem of Nonlinear Root-finding. 6.2 Rate of Convergence

MATHEMATICS FOR COMPUTER VISION WEEK 8 OPTIMISATION PART 2. Dr Fabio Cuzzolin MSc in Computer Vision Oxford Brookes University Year

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

converges to a root, it may not always be the root you have in mind.

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.

CHAPTER 2 EXTRACTION OF THE QUADRATICS FROM REAL ALGEBRAIC POLYNOMIAL

X. Numerical Methods

BEKG 2452 NUMERICAL METHODS Solution of Nonlinear Equations

An Improved Hybrid Algorithm to Bisection Method and Newton-Raphson Method

Analysis Methods in Atmospheric and Oceanic Science

Solution of Algebric & Transcendental Equations

Numerical Study of Some Iterative Methods for Solving Nonlinear Equations

Simple Iteration, cont d

Module 5 : Linear and Quadratic Approximations, Error Estimates, Taylor's Theorem, Newton and Picard Methods

Extended Introduction to Computer Science CS1001.py. Lecture 8 part A: Finding Zeroes of Real Functions: Newton Raphson Iteration

Practical Numerical Analysis: Sheet 3 Solutions

Lecture 5. September 4, 2018 Math/CS 471: Introduction to Scientific Computing University of New Mexico

Solutions of Equations in One Variable. Newton s Method

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

Chapter 1. Root Finding Methods. 1.1 Bisection method

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

Numerical Methods. Roots of Equations

Scientific Computing: An Introductory Survey

Nonlinear Equations. Chapter The Bisection Method

2-2: Evaluate and Graph Polynomial Functions

Numerical Methods in Physics and Astrophysics

Numerical Analysis Fall. Roots: Open Methods

Lecture 8 Optimization

A Few Concepts from Numerical Analysis

Root Finding Methods

Numerical Methods in Physics and Astrophysics

Root Finding Convergence Analysis

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

Root Finding For NonLinear Equations Bisection Method

Numerical Solution of f(x) = 0

Line Search Methods. Shefali Kulkarni-Thaker

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

1-D Optimization. Lab 16. Overview of Line Search Algorithms. Derivative versus Derivative-Free Methods

CS 323: Numerical Analysis and Computing

Solving nonlinear equations (See online notes and lecture notes for full details) 1.3: Newton s Method

Solution of Nonlinear Equations

Chapter 4. Solution of a Single Nonlinear Algebraic Equation

CS 323: Numerical Analysis and Computing

Numerical Methods. King Saud University

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

Finding the Roots of f(x) = 0

Review. Numerical Methods Lecture 22. Prof. Jinbo Bi CSE, UConn

Solution Methods. Richard Lusby. Department of Management Engineering Technical University of Denmark

SOLUTION OF ALGEBRAIC AND TRANSCENDENTAL EQUATIONS BISECTION METHOD

INTRODUCTION TO NUMERICAL ANALYSIS

Motivation: We have already seen an example of a system of nonlinear equations when we studied Gaussian integration (p.8 of integration notes)

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

5 Finding roots of equations

Chapter 4. Solution of Non-linear Equation. Module No. 1. Newton s Method to Solve Transcendental Equation

2.3 Differentiation Formulas. Copyright Cengage Learning. All rights reserved.

CS 450 Numerical Analysis. Chapter 5: Nonlinear Equations

MATH 350: Introduction to Computational Mathematics

Nonlinear Equations. Your nonlinearity confuses me.

NON-LINEAR ALGEBRAIC EQUATIONS Lec. 5.1: Nonlinear Equation in Single Variable

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.

Math Numerical Analysis

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

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

Numerical solutions of nonlinear systems of equations

STOP, a i+ 1 is the desired root. )f(a i) > 0. Else If f(a i+ 1. Set a i+1 = a i+ 1 and b i+1 = b Else Set a i+1 = a i and b i+1 = a i+ 1

Solving Nonlinear Equations

Unit 1: Polynomial Functions SuggestedTime:14 hours

Transcription:

Goals for This Lecture: Learn the Newton-Raphson method for finding real roots of real functions Learn the Bisection method for finding real roots of a real function Look at efficient implementations of both methods in F95

Roots of a function We define a root of a function, F, to be a value x such that F(x)=0 In general we can only find roots analytically for the simplest functions Example: quadratic, cubic, and quartic polynomials Otherwise roots must be found numerically

First Rule of Root Finding: Plot the Function whenever possible root root root

The Newton-Raphson Method (Part I) Let x r be a root of F(x) Expand F(x) in a Taylor series for x near x r But recall that F(x r ) = 0 by definition Therefore we have

The Newton-Raphson Method (Part II) Exploit the structure of the Taylor series expansion to improve a guess at the value of the root Make an initial guess at a value for the root: 0 x Use the Taylor series expansion to find a better approximation to the root: Use 1 x as an improved guess at the root and employ the Taylor series expansion again to get a better guess 2 x Repeat process until the answer is accurate enough

A Geometrical Interpretation of Newton- Raphson Iteration True root Initial guess at root 0 x 3 rd estimate First improved estimate of root based on intercept of tangent line with slope F( 0 x) 2 nd improved estimate of root based on intercept of tangent line with slope F( 1 x)

Newton-Raphson Iteration is not foolproof! Example of a simple function that will defeat Newton-Raphson Iteration: 1 st estimate 3 rd estimate 2 nd estimate Each estimate gets further From the true root!

Stopping Criterion When do we stop iterating? Could stop when F(x) < some tolerance This method may fail if you don t understand the behavior of F(x) near the root Could check to see if relative change between old and new estimates is small Choice depends on the problem Visually verify root by inspecting plot of function if possible

Newton-Raphson Program AST/PHY 277 Lecture 15! Purpose: Find the root of (x^2)-8x+16 via Newton-Raphson Iteration! Author: F. Douglas Swesty! Date: 10/7/2005 program newton_raphson implicit none! Turn off implicit typing real :: xold! Old estimate of root real :: xnew! New estimate of root real :: fold! Value of F(xold) real :: fpold! Value of df/dx(xold) real :: xchange! Relative change in x integer :: niter=1! Number of iterations integer, parameter :: niter_max = 30! Maximum # of iterations allowed xold = 3.2! Initial guess at root do while (niter < niter_max)! Initiate loop fold = (xold**2)-8.0*xold+16.0! Evaluate function at old estimate fpold = 2.0*xold-8.0! Evaluate derivative at old estimate if(abs(fpold) < 1.0e-20) then! If derivative is zero the method fails write(*,*) fpold is approx. zero write(*,*) method failed stop endif xnew = xold fold/fpold! Calculate new estimate xchange = abs((xnew-xold)/xold)! Calculate relative change if(xchange < 1.0e-5) then write(*,*) root is,xnew stop else xold = xnew! Update the old guess to the new guess niter = niter+1! Update iteration counter endif enddo! Terminate loop write(*,*) Method failed! stop! Stop execution of the program end program newton_raphson

What can we do when Newton-Raphson fails? Recast N-R iteration as: Try restricting the step size δx where 0 < C < 1 Reduce C until F( n+1 x) < F( n x) These methods may slow convergence These methods may not work!

An Alternative Method: bisection Assume that F(x) is continuous Suppose we have two values x L and x H > x L such that F(x L ) and F(x H ) have opposite signs The Intermediate Value Theorem tells us that there must a point x r, where x L < x r < x H, such that F(x r ) = 0 Root is contained in the interval (x L,x H ) We say the root is bracketed by x L and x H Bisection Algorithm: 1. Choose x L and x H such that root is bracketed 2. Choose the midpoint x M = (x L +x H )/2 3. If F(x M ) = 0 then x M is the root 4. If F(x M ) and F(x L ) have opposite signs then the Intermediate Value Theorem tells us that x L < x r < x M 5. Otherwise x M < x r < x H 6. Repeat process (starting with step 1) on subinterval containing the root until answer is accurate enough Algorithm easily implemented in a program with loops and conditional constructs

A comparison of the Methods When Newton-Raphson works it is usually much faster Error usually decreases quadraticly However, Newton-Raphson iteration can fail for a variety of reasons Newton-Raphson can easily be extended to multivariable problems Bisection is usually slower than N-R iteration However, bisection is usually robust Bisection cannot be extended to multivariable problems