Lecture 10 Root Finding using Open Methods

Slides:



Advertisements
Similar presentations
Part 2 Chapter 6 Roots: Open Methods
Advertisements

Chapter 6: Roots: Open Methods
Lecture 5 Newton-Raphson Method
Part 2 Chapter 6 Roots: Open Methods
Open Methods Chapter 6 The Islamic University of Gaza
ROOTS OF EQUATIONS Student Notes ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 61.
Open Methods Chapter 6 The Islamic University of Gaza
Open Methods Chapter 6 The Islamic University of Gaza
Roots of Equations Open Methods (Part 2).
Lecture #18 EEE 574 Dr. Dan Tylavsky Nonlinear Problem Solvers.
Second Term 05/061 Roots of Equations Bracketing Methods.
A few words about convergence We have been looking at e a as our measure of convergence A more technical means of differentiating the speed of convergence.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 6 Roots of Equations Bracketing Methods.
Open Methods (Part 1) Fixed Point Iteration & Newton-Raphson Methods
Roots of Equations Bracketing Methods.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 9 Roots of Equations Open Methods.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Martin Mendez UASLP Chapter 61 Unit II.
Open Methods Chapter 6 The Islamic University of Gaza
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.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 8 Roots of Equations Open Methods.
Roots of Equations Open Methods Second Term 05/06.
Secant Method Another Recursive Method. Secant Method The secant method is a recursive method used to find the solution to an equation like Newton’s Method.
8/30/ Secant Method Major: All Engineering Majors Authors: Autar Kaw, Jai Paul
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 2 Roots of Equations Why? But.
Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Roots of Equations ~ Open Methods Chapter 6 Credit:
Lecture 6 Numerical Analysis. Solution of Non-Linear Equations Chapter 2.
Chapter 3 Roots of Equations. Objectives Understanding what roots problems are and where they occur in engineering and science Knowing how to determine.
11/30/ Secant Method Industrial Engineering Majors Authors: Autar Kaw, Jai Paul
Numerical Methods Root Finding 4. Fixed-Point Iteration---- Successive Approximation Many problems also take on the specialized form: g(x)=x, where we.
Today’s class Roots of equation Finish up incremental search
MECN 3500 Inter - Bayamon Lecture 6 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Newton-Raphson Method. Figure 1 Geometrical illustration of the Newton-Raphson method. 2.
Lecture 5 - Single Variable Problems CVEN 302 June 12, 2002.
Numerical Methods Solution of Equation.
SOLVING NONLINEAR EQUATIONS. SECANT METHOD MATH-415 Numerical Analysis 1.
4 Numerical Methods Root Finding.
Newton-Raphson Method Computer Engineering Majors Authors: Autar Kaw, Jai Paul Transforming Numerical Methods Education.
6/13/ Secant Method Computer Engineering Majors Authors: Autar Kaw, Jai Paul
Project on Newton’s Iteration Method Presented by Dol Nath Khanal Project Advisor- Professor Dexuan Xie 05/11/2015.
Solution of Nonlinear Equations ( Root Finding Problems ) Definitions Classification of Methods  Analytical Solutions  Graphical Methods  Numerical.
7/11/ Bisection Method Major: All Engineering Majors Authors: Autar Kaw, Jai Paul
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
Newton-Raphson Method
Newton-Raphson Method
Secant Method.
Newton’s Method for Systems of Non Linear Equations
Part 2 Chapter 6 Roots: Open Methods
Secant Method – Derivation
Chapter 6.
Part 2 / Chapter 5.
Solution of Equations by Iteration
Newton-Raphson Method
Computers in Civil Engineering 53:081 Spring 2003
Newton-Raphson Method
SOLUTION OF NONLINEAR EQUATIONS
4 Numerical Methods Root Finding.
Chemical Engineering Majors Authors: Autar Kaw, Jai Paul
ROOTS OF EQUATIONS.
Newton’s Method and Its Extensions
Newton-Raphson Method
Fixed- Point Iteration
Chapter 6.
Part 2 Chapter 6 Roots: Open Methods
1 Newton’s Method.
Presentation transcript:

Lecture 10 Root Finding using Open Methods Dr .Qi Ying

Objectives Open methods Fixed point iteration Newton-Raphson Modified secant method

Open Methods vs. Bracketing Methods Root is located within the lower and upper bound. Pro: Always converge to the solution Con: Relatively slow Open methods Usually starting from a single starting point (initial estimate) Iteratively finding a new estimate Pro: Faster convergence (when they work) Con: Sometimes diverge from the true root

Single fixed point iteration Idea: f(x)=0 can be rewritten in a different form: x=g(x). If xr is the root, i.e., f(xr)=0, then xr=g(xr) Iteration process: The single fixed point iterations starts from an initial guess of the root x0. x0 is usually not the root, i.e., x0≠g(x0). However, g(x0) can be used as the new estimate of the root: x1=g(x0) If x1 is quite different from x0, then g(x1) is evaluated to get the new next estimate of the root, and the process is repeated: xi+1=g(xi). The iteration stops when xi+1 is sufficiently close to xi.

function [root,ea] = fixpoint( func,x,es ) %FIXPOINT find root for func(x)=x using fixed point iteration. % func: left hand side of func(x)=x % x: initial guess % es: relative convergence criteria iter=0; % iteration counter itermax=20; % stop after itermax iterations ea=100; % initial error estimate xold=x; % previous x estimate % iteration using fixed point method x=func(x) while iter<itermax & ea>es xnew=func(xold); ea=abs((xnew-xold)/xnew)*100; xold=xnew; iter=iter+1;a end % save the final iteration results root=xold; if ea>es msg='Number of iterations exceeds the limit.'; warning(msg); else fprintf('Solved in %d iterations\n',iter);

Example Find a root for using fixed point iteration. Solution: rearrange the above function to x=g(x) form. Thus, g(x)=e-x Check the result: >> f=@(x)exp(-x); >> [root,ea]=fixpoint(f,0,1.0) Solved in 11 iterations root = 0.5684 ea = 0.6244 >> exp(-0.5684)-0.5684 ans = -0.0020

Graphical explanation of the fixed point iteration method From Chapra, Figure 6.3

Newton-Raphson method First conceived by Newton (1671) and Joseph Raphson (1690). Generalized by Thomas Simpson (1740) to modern forms. Very widely used Fast convergence (quadratic convergence) Need to evaluate first derivative of f(x) Also used in optimization

Newton-Raphson method Since: Rearrange:

function [ root, ea ] = newtonraphson( func, dfunc, x, es ) %NEWTONRAPHSON solves func(x)=0 using the Newton-Raphson method. % func: func(x)=0, dfunc(x)=func'(x), x: initial guess, es: convergence % criteria itermax=50; % maximum number of irterations iter=0; % set interation counter ea=100; % initial error xold=x; % x from the previous iteration while iter<itermax & ea>es y=func(xold); dy=dfunc(xold); xnew=xold-y/dy; ea=abs((xnew-xold)/xnew)*100; xold=xnew; iter=iter+1; end % save the final iteration results root=xold; if ea>es msg='Number of iterations exceeds the limit.'; warning(msg); else fprintf('Solved in %d iterations\n',iter);

Example Find a root for using N-R method. Solution: find f’(x) first: >> f=@(x)exp(-x)-x; >> df=@(x)-exp(-x)-1; >> [root,ea]=newtonraphson(f,df,0,1.0) Solved in 3 iterations root = 0.5671 ea = 0.1647 Rate of convergence: Thus, “quadratic convergence”

Problems with N-R method

The Modified Secant Method Evaluating f’(x) is not always possible, thus, we need to a method to approximate f’(x). One way to do this is: Thus, you get the iteration equation for the modified secant method

The Modified Secant Method Advantage: No need for a separate derivative input Especially useful when f’(x) cannot be easily determined Difficulty: Choose of δx is not automatic. Too small – roundoff error may dominate and lead to wrong results. Too big – may become divergent

Exercise Program the modified secant method based on the N-R code.