NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

download NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

of 22

Transcript of NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    1/22

    Iterative Methods

    Berlin ChenDepartment of Computer Science & Information Engineering

    National Taiwan Normal University

    Reference:1. Applied Numerical Methods with MATLAB for Engineers , Chapter 12 & Teaching material

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    2/22

    Chapter Objectives

    Understanding the difference between the Gauss-Seideland Jacobi methods

    Knowing how to assess diagonal dominance andknowing what it means

    Recognizing how relaxation can be used to improve

    convergence of iterative methods Understanding how to solve systems of nonlinear

    equations with successive substitution and Newton-Raphson

    NM Berlin Chen 2

    [ A] { x} = { b}

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    3/22

    Gauss-Seidel Method The Gauss-Seidel method is the most commonly used

    iterative method for solving linear algebraic equations[ A]{ x }={b}

    The method solves each equation in a system for aparticular variable, and then uses that value in laterequations to solve later variables

    For a 3x3 system with nonzero elements along thediagonal , for example, the j th iteration values are foundfrom the j -1 th iteration using:

    NM Berlin Chen 3

    x1 j b1 a12 x2 j 1 a13 x3 j 1

    a11

    x2 j b2 a 21 x1 j a23 x3 j 1

    a 22

    x3 j b3 a 31 x1 j

    a 32 x2 j

    a 33

    3333232131

    2323222121

    1313212111

    b xa xa xa

    b xa xa xab xa xa xa

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    4/22

    Gauss-Seidel Method: Convergence

    The convergence of an iterative method can becalculated by determining the relative percent change of

    each element in { x }. For example, for the i th element inthe j th iteration,

    The method is ended when all elements have convergedto a set tolerance

    NM Berlin Chen 4

    a ,i xi

    j xi j 1 xi

    j 100%

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    5/22

    Gauss-Seidel Method: An Example (1/2)

    NM Berlin Chen 5

    Example 12.1

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    6/22

    Gauss-Seidel Method: An Example (2/2)

    NM Berlin Chen 6

    Example 12.1

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    7/22

    Tactic of Gauss-Seidel Method

    As each new x value is computed for the Gauss-Seidelmethod, it is immediately used in the next equation to

    determine another x value Thus, if the solution is converging, the best available

    estimates will be employed for the Gauss-Seidel method

    NM Berlin Chen 7

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    8/22

    Jacobi Iteration

    The Jacobi iteration is similar to the Gauss-Seidelmethod, except the j -1th information is used to update all

    variables in the j th iteration: Gauss-Seidel Jacobi

    NM Berlin Chen 8

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    9/22

    Diagonal Dominance

    The Gauss-Seidel method may diverge, but if thesystem is diagonally dominant, it will definitely

    converge

    Diagonal dominance means:

    NM Berlin Chen 9

    a ii aij j 1 j i

    n

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    10/22

    MATLAB Program

    NM Berlin Chen 10

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    11/22

    Relaxation

    To enhance convergence, an iterative programcan introduce relaxation where the value at aparticular iteration is made up of a combinationof the old value and the newly calculated value:

    where is a weighting factor that is assigned a value between 0and 2

    0<

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    12/22

    Gauss-Seidel with Relaxation: An Example (1/3)

    NM Berlin Chen 12

    Example 12.2

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    13/22

    Gauss-Seidel with Relaxation: An Example (2/3)

    NM Berlin Chen 13

    Example 12.2

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    14/22

    Gauss-Seidel with Relaxation: An Example (3/3)

    NM Berlin Chen 14

    Example 12.2

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    15/22

    Nonlinear Systems

    Nonlinear systems can also be solved using the samestrategy as the Gauss-Seidel method

    Solve each system for one of the unknowns and update eachunknown using information from the previous iteration

    This is called successive substitution

    NM Berlin Chen 15

    573

    102212

    2121

    x x x

    x x x

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    16/22

    Successive Substitution: An Example (1/2)

    NM Berlin Chen 16

    Example 12.3

    573

    102212

    2121

    x x x

    x x x

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    17/22

    Successive Substitution: An Example (2/2)

    NM Berlin Chen 17

    Example 12.3

    1. For successive substitution, convergence

    often depends on the manner in whichthe equations are formulated

    2. Divergence also can occur if the initial guesses are insufficiently close to the truesolution

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    18/22

    Newton-Raphson (1/3)

    Nonlinear systems may also be solved using theNewton-Raphson method for multiple variables

    For a two-variable system , the Taylor seriesapproximation and resulting Newton-Raphson equationsare:

    NM Berlin Chen 18

    2

    ,2,21,2

    1

    ,2,11,1,21,2

    2

    ,1,21,2

    1

    ,1,11,1,11,1

    x f x x

    x f x x f f

    x

    f x x

    x

    f x x f f

    iii

    iiiii

    iii

    iiiii

    0

    0

    1,2

    1,1

    i

    i

    f

    f

    ii

    ii

    iii

    ii

    ii

    ii

    iii

    ii

    x x

    f x x

    f f x x

    f x x

    f

    x x

    f x

    x

    f f x

    x

    f x

    x

    f

    ,22

    ,2,1

    1

    ,1,11,2

    2

    ,11,1

    1

    ,1

    ,22

    ,1,1

    1

    ,1,11,2

    2

    ,11,1

    1

    ,1

    ii

    ii

    iiiii

    x f

    x f x x

    f

    x f x x x f x f

    1

    11

    )of expansionseriesTaylororder-(first

    0

    :equationsingleaof rootthe

    forRaphon- Newton6,ChapterinRecall

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    19/22

    Newton-Raphson (2/3)

    After algebraic manipulation

    NM Berlin Chen 19

    1

    ,2

    2

    ,1

    2

    ,2

    1

    ,1

    1

    ,2,1

    1

    ,1,2

    ,21,2

    1

    ,2

    2

    ,1

    2

    ,2

    1

    ,1

    2

    ,1

    ,22

    ,2

    ,1

    ,11,1

    x

    f

    x

    f

    x

    f

    x

    f x

    f f

    x

    f f

    x x

    x

    f

    x

    f

    x

    f

    x

    f x

    f

    f x

    f

    f x x

    iiii

    ii

    ii

    ii

    iiii

    i

    i

    i

    i

    ii

    Referred to as the determinant

    of the Jacobian of the system

    2

    ,2

    1

    ,2

    2

    ,1

    1

    ,1

    x

    f

    x

    f x

    f

    x

    f

    J ii

    ii

    Referred to as the Jacobian of the system

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    20/22

    Newton-Raphson (3/3)

    Matrix notion of Newton-Raphson Also can be generalized to n simultaneous equations

    NM Berlin Chen 20

    f J x x

    x J f x J

    ii

    ii

    11

    1

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    21/22

    Newton-Raphson: An Example

    NM Berlin Chen 21

    0573,

    010,

    573

    10

    21

    2212212

    2121211

    21

    2212

    2121

    x x x x x x f

    x x x x x f

    x x x x

    x x x

    Example 12.4

  • 8/10/2019 NM2012S-Lecture12-Iterative Methods Gauss Siedel With Relaxation

    22/22

    MATLAB Program

    NM Berlin Chen 22