UG-Q4: Compare and contrast the following methods for finding roots of equation: the method of false position, Newton’s method, and fixed point iteration.

K. Krishanth Supervisor: Dr. T. Kirubarajan

July 28, 2014

Introduction Quadratic formula f (x) = ax2 + bx + c = 0

(1)

Roots: values of x that make f(x)equal to zero

x=

−b ±

√ b2 − 4ac 2a

(2)

Not always possible to determine the roots easily as above (e.g., f (x) = e−x − x) Bracketing methods Bisection method False-position method Open methods Fixed-point iteration Newton method 2 / 22

Method of false position Bracket method Start with guesses that bracket the root and then systematically reduce the width of the bracket Function typically change sign in the vicinity of the root Consider: interval from xl to xu and corresponding function values f (xl ) and f (xu ) At least one real root between xl and xu exists if f (xl ) and f (xu ) have opposite signs, that is f (xl )f (xu ) < 0

(3)

Then if f (xl ) is much closer to zero than f (xu ), it is likely that root is closer to xl than xu After finding xr , it replaces whichever of the two initial guesses, xl and xu , yields a function value with the same sign as f (xr )

3 / 22

Method of false position

Figure : Graphical depiction of method of false position (Courtesy of [1])

f (xl ) f (xu ) = xr − xl xr − xu f (xu )(xl − xu ) xr = xu − f (xl ) − f (xu )

(4) (5) 4 / 22

Termination criteria Termination criteria: approximate percent relative error εa = |

xnew − xold r r |100% new xr

(6) (7)

where xnew is the root of present iteration and xold r r is the root from previous iteration

5 / 22

Drawbacks Blanket generalization of root-location is not possible

Figure : Slow convergence of false position method f (x) = x10 − 1 (Courtesy of [1])

One-sidedness: one bracket point will tend to stay fixed

6 / 22

Fixed point iteration Open method Predict the root Rearrange the function f (x) = 0, so that x is on the left-hand side of the equation: x = g(x)

(8)

For example, x2 − 2x + 3 = 0 x=

x2 + 3 2

To predict: xi+1 = g(xi )

(9)

7 / 22

Convergence of fixed point iteration (Proof) Iterative equation is xi+1 = g(xi )

(10)

xr = g(xr )

(11)

xr − xi+1 = g(xr ) − g(xi )

(12)

Suppose the true solution is

subtracting these equations

Derivative mean theorem: If a function g(xr ) and its first derivative are continuous over an interval a ≤ x ≤ b, then there exists at least one value of x = ε within the interval such that g′ (ε) =

g(b) − g(a) b−a

(13)

8 / 22

Proof (contd..) Now, if we let a = xi and b = xr , the right hand side of Eq. (13) can be expressed as g(xr ) − g(xi ) = (xr − xi )g′ (ε)

(14)

where ε is somewhere between xi and xr . This result can be substituted Eq.(12) to yield xr − xi+1 = (xr − xi )g′ (ε)

(15)

If the true error for iteration i is defined as Et,i = (xr − xi )

(16)

Et,i+1 = g′ (ε)Et,i

(17)

then Eq. (15) becomes

9 / 22

Fixed point iteration Consequently, if |g′ (ε)| < 1, the errors decrease with each iteration If g′ (ε) is negative, the errors will oscillate Linearly convergent as the error is roughly proportional to and less than the error of previous step,

10 / 22

Newton method Open method Widely used root-locating technique Predict the root Newton method formula (Newton-Raphson formula) xi+1 = xi −

f (xi ) f ′ (xi )

(18)

Figure : (Courtesy of [1]) 11 / 22

Newton method Quadratic convergence Error is roughly proportional to the square of the previous error

12 / 22

Newton method: Drawbacks Divergence at inflection points (due to initial guess or iterated value falls closer to the inflection point)

Figure : Divergence at inflection point (Courtesy of [1])

13 / 22

Newton method: Drawbacks Division by zero

Figure : Pitfall of division by zero or a near zero number (Courtesy of [1])

14 / 22

Newton method: Drawbacks Oscillations near local maximum and minimum

Figure : Oscillations around local minima (Courtesy of [1])

15 / 22

Newton method: Drawbacks Root jumping

Figure : Root jumping from intended location of root for f (x) = sin x = 0 (Courtesy of [1])

16 / 22

Example Function f (x) = e−x − x, initial guess = 0, First derivative f (x) = −e−x − 1 Table : Newton method iteration values i 0 1 2 3 4

xi 0 0.500000000 0.566311003 0.567143165 0.567143290

εt (%) 100 11.8 0.147 0.0000220 < 10−8

For the same function with initial guess = 0, fixed point iteration values are After 4 iterations, εt (%) = 11.8% After 10 iterations, εt (%) = 0.399% 17 / 22

Comparison Table : Comparison Criteria Method Convergence Initialization Termination

False position Bracket Linear Interval points εa

Fixed point Open Linear Starting point εa

Newton Open Quadratic Starting point εa

18 / 22

References S. C. Chapra and R. P. Canale, “Numerical Methods for Engineers,” 5th edition, McGrawHill Higher Education, 2006.

19 / 22

Thank you Questions

20 / 22

Newton method: Derivation

f (xi+1 ) = f (xi ) + f ′ (xi )(xi+1 − xi ) + f (xi+1 ) ∼ = f (xi ) + f (xi )(xi+1 − xi )

(19)



(20)



(21)

0 = f (xi ) + f (xi )(xi+1 − xi )

xi+1 = xi −

f ′′ (ξ) (xi+1 − xi )2 2!

f (xi ) f ′ (xi )

(22)

21 / 22

Newton method: Derivation let xi+1 = xr where xr is the true value of the root. Substituting this with f (xr ) = 0 0 = f (xi ) + f ′ (xi )(xr − xi ) +

f ′′ (ξ) (xr − xi )2 2!

(23)

f ′′ (ξ) (xr − xi )2 2!

(24)

Subtract (21) from (23) 0 = f ′ (xi )(xr − xi+1 ) + Et,i+1 = xr − xi+1 0 = f ′ (xi )Et,i+1 +

(25) ′′

f (ξ) 2 Et,i 2!

(26)

′′

Et,i+1 =

−f (xr ) 2 E 2f ′ (xr ) t,i

(27)

22 / 22

Krishanth_UG-Q4.pdf

Page 1 of 22. UG-Q4: Compare and contrast the following methods for finding roots of. equation: the method of false position, Newton's method, and fixed point. iteration. K. Krishanth. Supervisor: Dr. T. Kirubarajan. July 28, 2014. Page 1 of 22 ...

1MB Sizes 0 Downloads 195 Views

Recommend Documents

No documents