linear alg equ2

Upload: dch-narrasimhan

Post on 04-Jun-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 Linear Alg Equ2

    1/8

  • 8/13/2019 Linear Alg Equ2

    2/8

    Numerical Methods for Eng [ENGR 391] [Lyes KAEM !""#]

    )ooooooooouffffffffff ***.

    +or a general nn matri" !ou have to appl! the following e"pressions to find the LU

    decomposition of a matri" [A]#

    =

    =

    1

    1

    j

    kkjikijij ulal , i-, i$1/n

    =

    =

    ii

    i

    k

    kjikij

    ijl

    ula

    u

    1

    1, i0-, -$!(/n

    and 1=iiu , i$1/n

    $$$%!% -olution of e,uations

    2ow to solve our s!stem of linear equations we can e"press our initial s!stem#

    [ ]{ } { }bxA =Under the following form

    [ ]{ } [ ][ ]{ } { }bxULxA ==

    &o find the solution { }x we define first a vector{ }z #

    { } [ ]{ }xUz =

    )ur initial s!stem becomes then# [ ]{ } { }bzL =

    Linear Alge+raic E,uations 53

    345)6&A2& 2)&7

    As for the (( matri" 8see above9 it is better to follow a certain order when computing the

    terms of the [L] and [U] matrices. &his order is# l i1u1-, liu-, /,lin:1un:1-, lnn.

    7"ample

    +ind the LU decomposition of the following matri" using 'routs method#

    [A]$

    333231

    232221

    131211

    aaa

    aaa

    aaa

    $

    223

    134

    112

  • 8/13/2019 Linear Alg Equ2

    3/8

    Numerical Methods for Eng [ENGR 391] [Lyes KAEM !""#]

    As [L] is a lower triangular matri" the { }z can be computed starting b! ;1until ;n. &hen the valuesof { }x can be found using the equation#

    { } [ ]{ }xUz =

    as [U] is an upper triangular matri" it is possible to compute { }x using a bac< substitutionprocess starting "nuntil "1. [=ou will better understand with an e"ample /]

    &he general form to solve a s!stem of linear equations using LU decomposition is#

    nil

    zlb

    z

    l

    bz

    ii

    i

    k

    kiki

    i ,...,3,2;

    1

    1

    11

    11

    =

    =

    =

    =

    And

    1,2,...,2,1;1

    ==

    =

    +=

    nnixuzx

    zx

    n

    ik

    kikii

    nn

    $$$%3% (holes.i)s method for symmetric matrices

    Linear Alge+raic E,uations 54

    7"ample

    >olve the following equations using the LU decomposition#

    ==+

    =+

    634

    42

    321

    321

    xxx

    xxx

    2ote on storage of [A], [L], [U]

    1: 3n practice the matrices [L] and [U] do not need to be stored separatel!. ?! omittingthe ;eroes in [L] and [U] and the ones in the diagonal of [U] it is possible to store theelements of [L] and [U] in the same matri".

    : 2ote also that in the general formula for LU decomposition once an element of thematri" [A] is used it is not needed in the subsequent computations. Hence the

    elements of the matri" generated in point 819 above can be stored in [A]

  • 8/13/2019 Linear Alg Equ2

    4/8

    Numerical Methods for Eng [ENGR 391] [Lyes KAEM !""#]

    3n man! engineering applications the matrices involved will be s!mmetric and defined positive. 3tis then better to use the 'holes

  • 8/13/2019 Linear Alg Equ2

    5/8

    Numerical Methods for Eng [ENGR 391] [Lyes KAEM !""#]

    $$$%2%1% ector and matri norms

    A norm is a real:valued function that provides a measure of the si;e or length of multicomponentmathematical entities#

    +or a vectorx #

    =

    nx

    x

    x

    x

    .

    .

    .

    2

    1

    &he 7uclidean norm of this vector is defined as#

    ( )21

    22

    2

    2

    1 ... nxxxx +++=

    3n general Lp@norm of a vector x is defined as#

    Pn

    i

    P

    iP xL

    1

    1

    = =

    +or a matri", the first and infinit! norms are defined as#

    [ ] =

    =

    n

    i

    ijnj

    aA1

    11 max $ ma"imum column sum

    [ ] =

    =

    n

    j

    ijni

    aA1

    1max $ ma"imum of row sum.

    $$$%2%!% Matri condition num+er

    &he matri" condition number is defined as#

    Linear Alge+raic E,uations 56

    2ote

    3f the value of 8p9 is increased to infinit! in the above e"pression the value of the Lnorm will

    tend to the value of the largest component ofx #

    ixL max=

  • 8/13/2019 Linear Alg Equ2

    6/8

    Numerical Methods for Eng [ENGR 391] [Lyes KAEM !""#]

    [ ] 1= AAACond

    +or a matri" [A] we have that# cond [A] 1

    and

    [ ] AA

    ACondx

    x

    &herefore the error on the solution can be as large as the relative error of the norm of [A]multiplied b! the condition number.3f the precision on [A] is t:digits 81:t9 and 'ond[A]$1' the solution on ["] ma! be valid to onl! t:cdigits 81c:t9.

    $$$%4% 5aco+i iteration Method

    &he Bacobi method is an iterative method to solve s!stems of linear algebraic equations.'onsider the following s!stem#

    =+++++

    =++++

    nnnnnnnn

    nn

    bxaxaxaxa

    bxaxaxaxa

    ...

    .

    .

    ...

    332211

    11313212111

    &his s!stem can be written under the following form#

    ( )

    ( )

    =

    =

    1,1,22111

    13132121

    11

    1

    ...1

    .

    .

    ...1

    nnnnnnn

    nn

    nn

    xaxaxaba

    x

    xaxaxaba

    x

    &he general formulation is#

    =

    =

    n

    ijj

    jiji

    ii

    i xab

    a

    x,1

    1, i$1/n

    Here we start b! an initial guess for "1, ", /, "n and we compute the new values for the ne"titeration. 3f no good initial guess is available we can assume each component to be ;ero.%e generate the solution at the ne"t iteration using the following e"pression#

    =

    =

    +n

    ijj

    k

    jiji

    ii

    k

    i xaba

    x,1

    1 1, i$1/n, and for

  • 8/13/2019 Linear Alg Equ2

    7/8

    Numerical Methods for Eng [ENGR 391] [Lyes KAEM !""#]

    &he calculation must be stopped if#

    +

    k

    i

    k

    i

    k

    i

    x

    xx 1

    , is the desired precision.

    3t is possible to show that a sufficient condition for the convergence of the Bacobi method is#

    =

    >n

    ijj

    ijii aa,1

    $$$%#% Gauss6-eidel iteration Method

    3t can be seen that in Bacobi iteration method all the new values are computed using the valuesat the previous iteration. &his implies that both the present and the previous set of values have tobe stored. Gauss:>eidel method will improve the storage requirement as well as theconvergence.

    3n Gauss:>eidel method the values11

    2

    1

    1 ,...,,

    +++ ki

    kk xxx computed in the current iteration as

    well as knkiki xxx ,...,, 32 ++ are used in finding the value 11++kix . &his implies that alwa!s the

    most recent a''roimationsare used during the computation. &he general e"pression is#

    =

    = +=

    ++1

    1 1

    11 1 i

    j

    n

    ijOLD

    k

    iij

    NEW

    k

    jiji

    ii

    k

    i xaxaba

    x

    , i$1...n,

  • 8/13/2019 Linear Alg Equ2

    8/8

    Numerical Methods for Eng [ENGR 391] [Lyes KAEM !""#]

    OLD

    i

    NEW

    i

    NEW

    i xxx )1( +=

    And usuall! 00

    3f 001 we are using under:rela"ation used to ma