Download presentation

Presentation is loading. Please wait.

Published byRonan Gelder Modified about 1 year ago

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

2
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.

3
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.

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

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

6
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.”

7
Simple Fixed-Point Iteration-Convergence

8
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) = x 2 -2x-1 = 0 x= (x 2 -1)/2 g(x) = (x 2 -1)/2 2. Set x i at an initial guess x o. 3. Evaluate g(xi) 4. Let x i+1 = g(x i ) 5. Find a =(X i+1 – x i )/X i+1, and set xi at x i+1 6. Repeat steps 3 through 5 until | a |<= a

9
Example: Simple Fixed-Point Iteration 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: x i+1 = e - x i 3. Guess xo = 0 4. The iterations continues till the approx. error reaches a certain limiting value f(x) Rootx f(x) x f(x)=e -x - x g(x) = e -x f 1 (x) = x f(x) = e -x - x

10
Example: Simple Fixed-Point Iteration ix i g(x i ) % t % 001.0 11.00.367879 100 76.3 20.3678790.692201 171.835.1 30.6922010.50047346.922.1 40.5004730.60624438.311.8 50.6062440.54539617.46.89 60.5453960.57961211.23.83 70.5796120.5601155.902.2 80.5601150.5711433.481.24 90.5711430.5648791.930.705 100.5648791.110.399

11
Example: Simple Fixed-Point Iteration ix i g(x i ) % t % 001.0 11.00.367879 100 76.3 20.3678790.692201 171.835.1 30.6922010.50047346.922.1 40.5004730.60624438.311.8 50.6062440.54539617.46.89 60.5453960.57961211.23.83 70.5796120.5601155.902.2 80.5601150.5711433.481.24 90.5711430.5648791.930.705 100.5648791.110.399

12
Ex 5.1

13
Flow Chart – Fixed Point Start Input: x o, s, maxi i=0 a =1.1 s 1

14
Stop 1 while a < s & i >maxi x n =0 x 0 =x n Print: x o, f(x o ), a, i False True

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

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

17
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.x i t % 00100 1 0.5 11.8 20.566311003 0.147 30.567143165 0.00002 40.567143290<10 -8

18
Flow Chart – Newton Raphson Start Input: x o, s, maxi i=0 a =1.1 s 1

19
Stop 1 while a > s & i

20
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

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

22
The Secant Method Requires two initial estimates of x, e.g, x o, x 1. 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 x o, x 1, f(x).

23
Secant Method: Example Use the Secant method to find the root of e -x -x=0; f(x) = e -x -x and x i-1 =0, x 0 =1 to get x 1 of the first iteration using: Iterx i-1 f(x i-1 ) x i f(x i ) x i+1 t % 101.01.0 -0.6320.613 8.0 21.0-0.6320.613 -0.07080.5638 0.58 30.613-0.07080.5638 0.005180.5672 0.0048

24
Comparison of convergence of False Position and Secant Methods False PositionSecant Method Use two estimate x l and x u Use two estimate x i and x i-1 f(x) must changes signs between x l and x u f(x) is not required to change signs between x i and x i-1 X r replaces whichever of the original values yielded a function value with the same sign as f(x r ) X i+1 replace x i X i replace x i-1 Always convergeMay be diverge Slower convergence than Secant in case the secant converges. If converges, It does faster then False Position

25
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 x l = x i-1 =0.5, x u =x i = 5. 1. False position method 2. Secant method Iter x i-1 x i x i+1 1 0.5 5.0 1.8546 2 5 1.8546 -0.10438 Iter x l x u x r 1 0.5 5.0 1.8546 2 0.5 1.8546 1.2163 3 0.5 1.2163 1.0585

26
False Position and Secant Methods x i-1 xixi xuxu xlxl 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

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

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

29
Stop 1 while a > s & i < maxi X i+1 =0 X i-1 =x i X i =x i+1 Print: x i, f(x i ), a, i False True

30
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

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

32
Multiple Roots x f(x)= (x-3)(x-1)(x-1) = x 3 - 5x 2 +7x -3 f(x) 1 x 3 Double roots f(x)= (x-3)(x-1)(x-1)(x-1) = x 4 - 6x 3 + 125 x 2 - 10x+3 f(x) 13 triple roots

33
Multiple Roots “Multiple root” corresponds to a point where a function is tangent to the x axis. Difficulties - Function does not change sign with double (or even number of multiple root), therefore, cannot use bracketing methods. - Both f(x) and f′(x)=0, division by zero with Newton’s and Secant methods which may diverge around this root.

34
4. The Modified Newton Raphson Method Another u(x) is introduced such that u(x)=f(x)/f / (x); Getting the roots of u(x) using Newton Raphson technique: This function has roots at all the same locations as the original function

35
Modified Newton Raphson Method: Example Using the Newton Raphson and Modified Newton Raphson evaluate the multiple roots of f(x)= x 3 -5x 2 +7x-3 with an initial guess of x 0 =0 Newton Raphson formula: Modified Newton Raphson formula:

36
Newton Raphson Modified Newton-Raphson Iter x i t %iter x i t % 0010000100 10.4286 5711.10526 11 20.6857 3121.00308 0.31 30.8328617 3 1.000002 00024 40.913328.7 50.955784.4 60.977662.2 Newton Raphson technique is linearly converging towards the true value of 1.0 while the Modified Newton Raphson is quadratically converging. For simple roots, modified Newton Raphson is less efficient and requires more computational effort than the standard Newton Raphson method Modified Newton Raphson Method: Example

37
Systems of Nonlinear Equations Roots of a set of simultaneous equations: f 1 (x 1,x 2,…….,x n )=0 f 2 (x 1,x 2,…….,x n )=0 f n (x 1,x 2,…….,x n )=0 The solution is a set of x values that simultaneously get the equations to zero.

38
Systems of Nonlinear Equations Example: x 2 + xy = 10 & y + 3xy 2 = 57 u(x,y) = x 2 + xy -10 = 0 v(x,y) = y+ 3xy 2 -57 = 0 The solution will be the value of x and y which makes u(x,y)=0 and v(x,y)=0 These are x=2 and y=3 Numerical methods used are extension of the open methods for solving single equation; Fixed point iteration and Newton-Raphson. (we will only discuss the Newton Raphson)

39
Systems of Nonlinear Equations: 2. Newton Raphson Method Recall the standard Newton Raphson formula: which can be written as the following formula

40
By multi-equation version (in this section we deal only with two equation) the formula can be derived in an identical fashion: u(x,y)=0 and v(x,y)=0 Systems of Nonlinear Equations: 2. Newton Raphson Method

41
And thus Systems of Nonlinear Equations: 2. Newton Raphson Method

42
x 2 + xy =10 and y + 3xy 2 = 57 are two nonlinear simultaneous equations with two unknown x and y they can be expressed in the form: use the point (1.5,3.5) as initial guess. Systems of Nonlinear Equations: 2. Newton Raphson Method

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google