Open Methods Chapter 6 The Islamic University of Gaza

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
Roundoff and truncation errors
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.
Engineering Computation
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.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 7 Roots of Equations Bracketing Methods.
Chapter 4 Roots of Equations
PHYS2020 NUMERICAL ALGORITHM NOTES ROOTS OF EQUATIONS.
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.
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.
Systems of Non-Linear Equations
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.
Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis
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
Roots of Equations Open Methods Second Term 05/06.
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
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.
Numerical Methods for Engineering MECN 3500
Numerical Methods.
Numerical Methods Root Finding 4. Fixed-Point Iteration---- Successive Approximation Many problems also take on the specialized form: g(x)=x, where we.
Newton’s Method, Root Finding with MATLAB and Excel
Applied Numerical Methods
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
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 7 Roots of Polynomials.
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 5 Bracketing Methods.
4 Numerical Methods Root Finding Secant Method Modified Secant
SOLVING NONLINEAR EQUATIONS. SECANT METHOD MATH-415 Numerical Analysis 1.
4 Numerical Methods Root Finding.
Project on Newton’s Iteration Method Presented by Dol Nath Khanal Project Advisor- Professor Dexuan Xie 05/11/2015.
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.
Numerical Methods and Optimization C o u r s e 1 By Bharat R Chaudhari.
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.
4 Numerical Methods Root Finding Secant Method Modified Secant
Part 2 Chapter 6 Roots: Open Methods
Chapter 6.
Computers in Civil Engineering 53:081 Spring 2003
MATH 2140 Numerical Methods
4 Numerical Methods Root Finding.
ROOTS OF EQUATIONS.
Fixed- Point Iteration
Chapter 6.
Part 2 Chapter 6 Roots: Open Methods
Presentation transcript:

Open Methods Chapter 6 The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 6 Open Methods

Open Methods Bracketing methods are based on assuming an interval of the function which brackets the root. The bracketing methods always converge to the root. Open methods are based on formulas that require only a single starting value of x or two starting values that do not necessarily bracket the root. These method sometimes diverge from the true root.

1. Simple Fixed-Point Iteration Rearrange the function so that x is on the left side of the equation: Bracketing methods are “convergent”. Fixed-point methods may sometime “diverge”, depending on the stating point (initial guess) and how the function behaves.

Simple Fixed-Point Iteration Examples: 1. f(x) = x 2-2x+3  x = g(x)=(x2+3)/2 f(x) = sin x  x = g(x)= sin x + x f(x) = e-x- x  x = g(x)= e-x

Simple Fixed-Point Iteration Convergence x = g(x) can be expressed as a pair of equations: y1= x y2= g(x)…. (component equations) Plot them separately.

Simple Fixed-Point Iteration Convergence Fixed-point iteration converges if : When the method converges, the error is roughly proportional to or less than the error of the previous step, therefore it is called “linearly convergent.”

Simple Fixed-Point Iteration-Convergence

Steps of Simple Fixed Pint Iteration 1. Rearrange the equation f(x) = 0 so that x is on the left hand side and g(x) is on the right hand side. e.g f(x) = x2-2x-1 = 0  x= (x2-1)/2 g(x) = (x2-1)/2 2. Set xi at an initial guess xo. 3. Evaluate g(xi) 4. Let xi+1 = g(xi) 5. Find a=(Xi+1 – xi)/Xi+1, and set xi at xi+1 6. Repeat steps 3 through 5 until |a|<= a

Example: Simple Fixed-Point Iteration f(x) = e-x - x f(x) f(x)=e-x - x 1. f(x) is manipulated so that we get x=g(x) g(x) = e-x 2. Thus, the formula predicting the new value of x is: xi+1 = e-xi 3. Guess xo = 0 4. The iterations continues till the approx. error reaches a certain limiting value Root x f(x) f1(x) = x g(x) = e-x x

Example: Simple Fixed-Point Iteration i xi g(xi) ea% et% 0 0 1.0 1 1.0 0.367879 100 76.3 2 0.367879 0.692201 171.8 35.1 3 0.692201 0.500473 46.9 22.1 4 0.500473 0.606244 38.3 11.8 5 0.606244 0.545396 17.4 6.89 6 0.545396 0.579612 11.2 3.83 7 0.579612 0.560115 5.90 2.2 8 0.560115 0.571143 3.48 1.24 9 0.571143 0.564879 1.93 0.705 10 0.564879 1.11 0.399

Example: Simple Fixed-Point Iteration i xi g(xi) ea% et% 0 0 1.0 1 1.0 0.367879 100 76.3 2 0.367879 0.692201 171.8 35.1 3 0.692201 0.500473 46.9 22.1 4 0.500473 0.606244 38.3 11.8 5 0.606244 0.545396 17.4 6.89 6 0.545396 0.579612 11.2 3.83 7 0.579612 0.560115 5.90 2.2 8 0.560115 0.571143 3.48 1.24 9 0.571143 0.564879 1.93 0.705 10 0.564879 1.11 0.399

Ex 5.1

Flow Chart – Fixed Point Start Input: xo , s, maxi i=0 a=1.1s 1

1 False Stop True while a< s & i >maxi xn=0 x0=xn Print: xo, f(xo) ,a , i False True

2. The Newton-Raphson Method Most widely used method. Based on Taylor series expansion: Solve for Newton-Raphson formula

The Newton-Raphson Method A tangent to f(x) at the initial point xi is extended till it meets the x-axis at the improved estimate of the root xi+1. The iterations continues till the approx. error reaches a certain limiting value. f(x) Root x xi xi+1 Slope f /(xi) f(xi)

Example: The Newton Raphson Method Use the Newton-Raphson method to find the root of e-x-x= 0  f(x) = e-x-x and f`(x)= -e-x-1; thus Iter. xi et% 0 0 100 1 0.5 11.8 2 0.566311003 0.147 3 0.567143165 0.00002 4 0.567143290 <10-8

Flow Chart – Newton Raphson Start Input: xo , s, maxi i=0 a=1.1s 1

1 False Stop True while a >s & i <maxi xn=0 x0=xn Print: xo, f(xo) ,a , i False True

Pitfalls of The Newton Raphson Method Cases where Newton Raphson method diverges or exhibit poor convergence. a) Reflection point b) oscillating around a local optimum c) Near zero slop , and d) zero slop

Thus, the formula predicting the xi+1 is: 3. The Secant Method The derivative is sometimes difficult to evaluate by the computer program. It may be replaced by a backward finite divided difference Thus, the formula predicting the xi+1 is:

The Secant Method Requires two initial estimates of x , e.g, xo, x1. However, because f(x) is not required to change signs between estimates, it is not classified as a “bracketing” method. The scant method has the same properties as Newton’s method. Convergence is not guaranteed for all xo, x1, f(x).

Secant Method: Example Use the Secant method to find the root of e-x-x=0; f(x) = e-x-x and xi-1=0, x0=1 to get x1 of the first iteration using: Iter xi-1 f(xi-1) xi f(xi) xi+1 et% 1 0 1.0 1.0 -0.632 0.613 8.0 2 1.0 -0.632 0.613 -0.0708 0.5638 0.58 3 0.613 -0.0708 0.5638 0.00518 0.5672 0.0048

Comparison of convergence of False Position and Secant Methods Use two estimate xl and xu Use two estimate xi and xi-1 f(x) must changes signs between xl and xu f(x) is not required to change signs between xi and xi-1 Xr replaces whichever of the original values yielded a function value with the same sign as f(xr) Xi+1 replace xi Xi replace xi-1 Always converge May be diverge Slower convergence than Secant in case the secant converges. If converges, It does faster then False Position

Comparison of convergence of False Position and Secant Methods Use the false-position and secant method to find the root of f(x)=lnx. Start computation with xl= xi-1=0.5, xu=xi = 5. False position method Secant method Iter xi-1 xi xi+1 1 0.5 5.0 1.8546 2 5 1.8546 -0.10438 Iter xl xu xr 0.5 5.0 1.8546 0.5 1.8546 1.2163 0.5 1.2163 1.0585

False Position and Secant Methods Although the secant method may be divergent, when it converges it usually does so at a quicker rate than the false position method See the next figure xl xi-1 xu xi

Comparison of the true percent relative Errors Et for the methods to the determine the root of f(x)=e-x-x

Flow Chart – Secant Method Start Input: x-1 , x0,s, maxi i=0 a=1.1s 1

1 False Stop True while a >s & i < maxi Xi-1=xi Xi=xi+1 Print: xi , f(xi) ,a , i False True

Modified Secant Method Rather than using two initial values, an alternative approach is using a fractional perturbation of the independent variable to estimate  is a small perturbation fraction

Modified Secant Method: Example Use the modified secant method to find the root of f(x) = e-x-x and, x0=1 and =0.01