W8_Finding the Roots

download W8_Finding the Roots

of 20

Transcript of W8_Finding the Roots

  • 8/2/2019 W8_Finding the Roots

    1/20

    Centre for Computer Technology

    ICT114ICT114Mathematics forMathematics for

    ComputingComputing

    Week 8Week 8

    Finding the Roots of f(x)Finding the Roots of f(x)

  • 8/2/2019 W8_Finding the Roots

    2/20

    March 20, 2012March 20, 2012 Copyright Box Hill Institute

    ObjectivesObjectives

    Review week 7Review week 7

    Convergence CriteriaConvergence Criteria

    Errors in ComputingErrors in ComputingFixed Point IterationFixed Point Iteration

    Bisection MethodBisection Method

    SummarySummary

  • 8/2/2019 W8_Finding the Roots

    3/20

    March 20, 2012March 20, 2012 Copyright Box Hill Institute

    Gauss Jordan MethodGauss Jordan Method

    For the above matrix,For the above matrix,perform a series of rowperform a series of rowoperations to obtain theoperations to obtain thematrix in the formmatrix in the form

    The matrix B is theThe matrix B is theinverse of the matrixinverse of the matrix

  • 8/2/2019 W8_Finding the Roots

    4/20

    March 20, 2012March 20, 2012 Copyright Box Hill Institute

    Gauss Elimination MethodGauss Elimination Method

    A x = bA x = b

    aa1111 aa1212 aa1313 xx11 bb11

    aa2121 aa2222 aa2323 xx22 = b= b22

    aa3131 aa3232 aa3333 xx33 bb33

    The solution of the above system ofThe solution of the above system ofequations isequations is x = Ax = A-1-1bb

  • 8/2/2019 W8_Finding the Roots

    5/20

    Centre for Computer Technology

    Finding the Roots of f(x)Finding the Roots of f(x)

  • 8/2/2019 W8_Finding the Roots

    6/20

    March 20, 2012March 20, 2012 Copyright Box Hill Institute

    IntroductionIntroduction

    We will discuss methods to find the rootsWe will discuss methods to find the roots

    of a polynomialof a polynomial

    Fixed Point IterationFixed Point IterationBisection MethodBisection Method

    Newton's MethodNewton's Method

    Secant MethodSecant Method

  • 8/2/2019 W8_Finding the Roots

    7/20

    March 20, 2012March 20, 2012 Copyright Box Hill Institute

    Convergence CriteriaConvergence Criteria

    Convergence is a procedure to monitor progress

    toward the root and stop when current guess is

    close enough to the desired root.

    Convergence checking

    will avoid searching to unnecessary accuracy.

    whether two successive approximations to the

    root are close enough to be considered equal. f(x) is sufficiently close to zero at the current

    guess.

  • 8/2/2019 W8_Finding the Roots

    8/20

    Centre for Computer Technology

    Fixed Point IterationFixed Point Iteration

  • 8/2/2019 W8_Finding the Roots

    9/20

    March 20, 2012March 20, 2012 Copyright Box Hill Institute

    Fixed Point IterationFixed Point Iteration

    ItIt involves evaluating a formulainvolves evaluating a formula that takesthat takes

    a guess at a root as inputa guess at a root as input andand returns anreturns an

    updated guess at the root as outputupdated guess at the root as output. The. Thesuccess of this method depends on thesuccess of this method depends on the

    choice of the formula that is iteratedchoice of the formula that is iterated

  • 8/2/2019 W8_Finding the Roots

    10/20

    March 20, 2012March 20, 2012 Copyright Box Hill Institute

    Algorithm : Fixed Point IterationAlgorithm : Fixed Point Iteration

    To solve

    f(x) = 0

    rewrite as

    xnew = g(xold)

    initialize:x0 = . . .

    fork= 1, 2, . . .xk= g(xk-1)

    if converged, stop

    end

  • 8/2/2019 W8_Finding the Roots

    11/20

    March 20, 2012March 20, 2012 Copyright Box Hill Institute

    Fixed Point IterationFixed Point Iteration

  • 8/2/2019 W8_Finding the Roots

    12/20

    March 20, 2012March 20, 2012 Copyright Box Hill Institute

  • 8/2/2019 W8_Finding the Roots

    13/20

    Centre for Computer Technology

    Bisection MethodBisection Method

  • 8/2/2019 W8_Finding the Roots

    14/20

    March 20, 2012March 20, 2012 Copyright Box Hill Institute

    Bisection MethodBisection Method

    Given anGiven an initial bracket for a rootinitial bracket for a root, the, thesystematic halving of the of the bracketsystematic halving of the of the bracketaround the rootaround the root is called the bisectionis called the bisectionmethod. Though it does it slowly,method. Though it does it slowly, it alwaysit alwaysconverges.converges.

    note:note: when a root is suspected to lie inwhen a root is suspected to lie inthe rangethe range xxleftleft x x x xrightright, the pair (x, the pair (xleftleft,,xxrightright ) is) is

    referred to as a bracket.referred to as a bracket.

  • 8/2/2019 W8_Finding the Roots

    15/20

    March 20, 2012March 20, 2012

    Copyright Box Hill Institute

    Bisection MethodBisection Method

  • 8/2/2019 W8_Finding the Roots

    16/20

    March 20, 2012March 20, 2012

    Copyright Box Hill Institute

    Bisection MethodBisection Method

  • 8/2/2019 W8_Finding the Roots

    17/20

    March 20, 2012March 20, 2012

    Copyright Box Hill Institute

    Algorithm : Bisection MethodAlgorithm : Bisection Method

    initialize: a = . . ., b = . . .

    fork= 1, 2, . . .xm= (a + b)/2

    iff(xm)

  • 8/2/2019 W8_Finding the Roots

    18/20

    March 20, 2012March 20, 2012Copyright Box Hill Institute

  • 8/2/2019 W8_Finding the Roots

    19/20

    March 20, 2012March 20, 2012Copyright Box Hill Institute

    SummarySummary

    Fixed Point Iteration - It involves evaluating aFixed Point Iteration - It involves evaluating a

    formula that takes a guess at a root as input andformula that takes a guess at a root as input and

    returns an updated guess at the root as output.returns an updated guess at the root as output.

    The success of this method depends on theThe success of this method depends on thechoice of the formula that is iteratedchoice of the formula that is iterated

    Bisection Method - Given an initial bracket for aBisection Method - Given an initial bracket for a

    root, the systematic halving of the of the bracketroot, the systematic halving of the of the bracketaround the root is called the bisection method.around the root is called the bisection method.

    Though it does it slowly, it always converges.Though it does it slowly, it always converges.

  • 8/2/2019 W8_Finding the Roots

    20/20

    March 20, 2012March 20, 2012Copyright Box Hill Institute

    ReferencesReferences

    Gerald W. Recktenwald, Numerical MethodsGerald W. Recktenwald, Numerical Methodswith MATLAB, Implementation and Application,with MATLAB, Implementation and Application,Prentice HallPrentice Hall

    H L Verma and C W Gross : Introduction toH L Verma and C W Gross : Introduction toQuantitative Methods,John WileyQuantitative Methods,John Wiley

    JB Scarborough : Numerical MathematicalJB Scarborough : Numerical MathematicalAnalysis, Jon Hopkins Hall, New JerseyAnalysis, Jon Hopkins Hall, New Jersey

    Finding the Roots off(x) = 0, Gerald W.Recktenwald, Department of MechanicalEngineering, Portland State University