MDB3053_Root Finding Using Open Methods

download MDB3053_Root Finding Using Open Methods

of 24

Transcript of MDB3053_Root Finding Using Open Methods

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    1/24

    Chap6/1

    CHAPTER 6 : ROOTS OF EQUATIONS:Open Methods

    LESSON OUTCOMES

    To calculate roots of equation using

    Open Methods:1. Newton-Raphson Method

    2. Secant Method

    3. Fixed-point Iteration

    y

    x

    - when a function is zero

    - when a function crossesx-axis

    roots

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    2/24

    Chap6/2

    OPEN METHODS : INTRODUCTION

    Open methods are based on

    formulas that require only onesingle or two starting value(s)

    of x that do not need to

    bracket the root.

    Not always work as

    sometimes it can diverge,

    depending on the initial guess

    When it converges, it

    reaches solution much more

    faster than Bracketing

    method.

    Bisection method Open method

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    3/24

    Chap6/3

    NEWTON-RAPHSON METHOD

    Also called as Newtons method, it is a powerful and

    widely used method.

    Based on Taylor series expansion; truncate the series after

    1st order derivative term:

    )(

    )(

    )(0

    Re

    0)(whenofvaluetheisrootThe

    ...)()()(

    1

    1

    11

    1

    i

    iii

    iiii

    ii

    niii

    xf

    xfxx

    xx)(xf)f(x

    arranging,

    xfx

    Rxxfxfxf

    Newton-Raphson formula

    Solve forxi+1

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    4/24

    Chap6/4

    NEWTON-RAPHSON METHOD

    Convenient method for functions

    whose derivatives can be evaluatedanalytically.

    Not suitable for functions whose

    derivatives cannot be evaluatedanalytically

    It converges very fast as it is

    quadratically convergent (seebook in Box 6.2, p141)

    Pitfalls: cant find multiple roots, may not

    converge if guess is near zero slope !

    )(

    )(1

    i

    iii

    xf

    xfxx

    Fig. 6.5

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    5/24

    Chap6/5

    NEWTON-RAPHSON METHOD

    Rootis estimated byextending a tangent atx1

    down tox-axis

    )(

    )(

    0)()(

    1

    1

    i

    iii

    ii

    ii

    xf

    xfxx

    xxxfxf

    :Tangent

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    6/24

    Chap6/6

    NEWTON-RAPHSON METHODALGORITHM

    i

    iii

    xf

    xfxx

    1

    STEP 1: Assume initial value forxi x0

    STEP 2: Calculate the value ofxi+1using equation

    STEP 3 :Calculate the approx. error |a|

    STEP 4: Repeat STEP 2until a< spre-specified value,

    then root =xi+1

    1001

    1

    i

    iia

    x

    xx

    i= 0,1,2,3,

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    7/24

    Chap6/7

    Newton-Raphson method Poor Convergence

    Inflection point,f '' = 0 inthe vicinity of a root

    Oscillation of slopes

    Guess is near zero slope

    Zero slope is encountered

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    8/24

    Chap6/8

    CLASS ACTIVITY

    Determine the highest real root off(x) =x3 6x2 + 11x 6.1

    using Newton-Raphson Method. Consider three iterationswith guessxo=3.5. Also calculate the estimated error, aafter

    each iteration.

    i

    iii

    xf

    xfxx

    1

    1001

    1

    i

    iia

    x

    xx

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    9/24

    Chap6/9

    ii

    ii xf

    xfxx

    1

    i x(i+1) xi f(xi) f'(xi) epsilon(a) %

    1 3.1913 3.5000 1.7750 5.7500

    2 3.0687 3.1913 0.3994 3.2576 4.00

    3 3.0473 3.0687 0.0519 2.4264 0.70

    SOLUTION:

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    10/24

    Chap6/10

    SECANT METHOD

    For functions whose derivatives are difficult to evaluate,

    the derivatives f '(x) can be approximated byBackwardFinite-Divided Differencing scheme :

    1

    1)()(

    )(

    ii

    ii

    i xx

    xfxf

    xf

    ii

    ii

    xf

    xfxx

    1:RaphsonNewton

    )()(

    ))((:methodSecant

    1

    1

    1

    ii

    iii

    ii

    xfxf

    xxxfxx

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    11/24

    Chap6/11

    SECANT METHOD

    Requires 2 initial guesses:xi&

    xi-1 that do not necessarilybracket the root. Hence, NOT abracketing method !

    Similarity to false-positionmethod:

    )()())((

    1

    11

    ii

    iiiii

    xfxfxxxfxx

    Definition: Secantis astraight line that intercepts acurve at 2 or more points

    2initial guesses ofxi

    andxi-1

    uL

    uLuur

    xfxf

    xxxfxx

    Fig. 6.7

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    12/24

    Chap6/12

    SECANT METHOD

    Secant method requires

    TWOguesses:x1andx2

    Chord / Secant

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    13/24

    STEP 1: Assume 2 initial guesses forxi andxi-1 ati=0

    STEP 2: Calculate the value ofxi+1using

    STEP 3: Calculate the error |a|

    STEP 4: RepeatSTEP 2until a< pre-specified value, then

    set root =xi+1

    NOTE: Convergenceis not guaranteed for allxoChap6/13

    SECANT METHODALGORITHM

    )()(

    ))((

    1

    11

    ii

    iiiii

    xfxf

    xxxfxx

    1001

    1

    i

    iia

    x

    xx

    i= 0,1,2,3,

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    14/24

    Chap6/14

    CLASS ACTIVITY

    Use three iterations to determine the root off(x) =exx by

    using Secant Method with initial estimate of x-1=0 andx0=1.0. Also calculate the estimated error, a after eachiteration.

    1001

    1

    i

    iia

    x

    xx

    )()(

    ))((

    1

    11

    ii

    iiiii

    xfxf

    xxxfxx

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    15/24

    Chap6/15

    f(x) = exx

    x-1=0 andx0=1.0 )()(

    ))((

    1

    1

    1ii

    iii

    ii xfxf

    xxxf

    xx

    iter x(i+1) x(i-1) xi x(i-1)-xi f(xi) f(i-1) eps(a) %

    1 0.6127 0.0000 1.0000 -1.0000 -0.6321 1.0000

    2 0.5638 1.0000 0.6127 0.3873 -0.0708 -0.6321 8.67

    3 0.5672 0.6127 0.5638 0.0489 0.0052 -0.0708 0.59

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    16/24

    Chap6/16

    BRACKETING VS OPEN METHOD

    BRACKETING Method

    Bracketing methods

    can alwaysconvergeto

    a root.

    Bracketing method is

    slowto converge

    OPEN Method

    Open method might

    divergeor move away

    from the true root

    depending on the initialguess (see pitfalls)

    When it converges, it

    reaches results fasterthan the bracketing

    methods.

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    17/24

    Rearrange the function so thatxis on the left side of the

    equation: x= g(x) For example: x2 x 2 = 0 can be manipulated to yield

    x=x2 2

    or x= (x+ 2)1/2

    or x= (x+ 2)/x

    From an initial estimate ofxi, the next estimate,xi+1can be

    ITERATIVELYcomputed by the function ofxi+1= g(xi) The approximate percent error:

    Chap6/17

    FIXED-POINT ITERATION

    To obtain x= g(x)

    %1001

    1

    i

    iia

    x

    xx

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    18/24

    Chap6/18

    EXAMPLE

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    19/24

    Chap6/19

    CLASS ACTIVITY

    Use fixed-point iteration to find the root of x2 - 3x+2=0

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    20/24

    Chap6/20

    Xi eps(a)

    1 0.0000

    2 0.6667 100.00

    3 0.8148 18.18

    4 0.8880 8.24

    5 0.9295 4.47

    6 0.9547 2.64

    7 0.9705 1.63

    8 0.9806 1.03

    9 0.9872 0.67

    SOLUTION

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    21/24

    x=g(x) can be expressed as a

    pair of equations:f1(x) =x and

    f2(x) = g(x)

    Plot these two equationsseparately the intersectionof the two curves will be the

    root! The method is slower to

    converge because it is

    linearly convergent Chap6/21

    FIXED-POINT ITERATION CONVERGENCE

    Figure 6.2

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    22/24

    Fixed-point methods may sometime diverge, depending

    on the starting point (initial guess) and how the functionbehaves (see Sec 6.1.1).

    It will converge if the absolute slope

    When the method converges, the error is roughly

    proportional to the error of the previous step, therefore it

    is called linearly convergent.Chap6/22

    FIXED-POINT ITERATION CONVERGENCE

    1)( xg the absolute slope ofy = g(x) is lessthan the slope ofy=x, see Fig 6.3 (p137)

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    23/24

    Chap6/23

    FIXED-POINT ITERATION CONVERGENCE

    |g(x)|1

    diverge

    |g(x)|>1

    |g(x)|

  • 7/26/2019 MDB3053_Root Finding Using Open Methods

    24/24

    THANK YOU