lecture13 (1)

Upload: abu-bakar-zahid

Post on 09-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/7/2019 lecture13 (1)

    1/23

    Lecture 13 - LU Decomposition

    CVEN 302

    September 24, 2001

  • 8/7/2019 lecture13 (1)

    2/23

    Lectures Goals

    LU Decomposition Crouts technique Doolittles technique Choleskys technique

  • 8/7/2019 lecture13 (1)

    3/23

    LU DecompositionA modification of the elimination method,called the LU decomposition. Thetechnique will rewrite the matrix as the

    product of two matrices.

    A = LU

  • 8/7/2019 lecture13 (1)

    4/23

    LU Decomposition

    The technique breaks the matrix into a product of two matrices, L and U , L is alower triangular matrix and U is an upper triangular matrix.

  • 8/7/2019 lecture13 (1)

    5/23

    LU Decomposition

    There are variation of the technique usingdifferent methods. Crouts reduction ( U has ones on the diagonal) Doolittles method( L has ones on the diagonal) Choleskys method ( The diagonal terms are the

    same value for the L and U matrices)

  • 8/7/2019 lecture13 (1)

    6/23

    Decomposition

    -

    -

    !

    -

    -

    !

    -

    -

    !

    -

    300

    120

    112

    103

    020

    001

    300

    240

    112

    103

    010

    001100

    5.010

    5.05.01

    306

    040

    002

    036

    240

    112

  • 8/7/2019 lecture13 (1)

    7/23

    LU Decomposition SolvingUsing the LU decomposition

    [A]{x} = [ L][U]{x} = [ L]{[U]{x}} = {b}Solve

    [L]{y} = {b}

    and then solve[U]{x} = {y}

  • 8/7/2019 lecture13 (1)

    8/23

    LU DecompositionThe matrices are represented by

    -

    -

    -

    44434241

    34333231

    24232221

    14131211

    44

    3433

    242322

    14131211

    44434241

    333231

    2221

    11

    000

    00

    0*

    0

    00

    000

    aaaa

    aaaa

    aaaa

    aaaa

    F

    F F

    F F F

    F F F F

    EEEE

    EEE

    EE

    E

  • 8/7/2019 lecture13 (1)

    9/23

    Equation SolvingWhat is the advantage of breaking up one

    linear set into two successive ones?

    The advantage is that the solution of triangular set of equations is trivial to solve.

  • 8/7/2019 lecture13 (1)

    10/23

    Equation SolvingFirst step - forward substitution

    ,2,i ,y b1y

    by

    1i

    1 j jiji

    iii

    11

    11

    -!

    -!

    !

    !

    EE

    E

  • 8/7/2019 lecture13 (1)

    11/23

    Equation SolvingSecond step - back substitution

    ,11, Ni ,xy1x

    yx

    N

    1iii

    iii

    NN

    N N

    -!

    -!

    !

    !

    F F

    F

  • 8/7/2019 lecture13 (1)

    12/23

  • 8/7/2019 lecture13 (1)

    13/23

    LU Decomposition (Doolittles method)Matrix decomposition

    -

    !

    -

    -

    44434241

    34333231

    24232221

    14131211

    44

    3433

    242322

    14131211

    434241

    3231

    21

    000

    00

    0*

    1

    01

    001

    0001

    aaaa

    aaaa

    aaaa

    aaaa

    u

    uu

    uuu

    uuuu

    l l l

    l l

    l

  • 8/7/2019 lecture13 (1)

    14/23

    Choleskys methodMatrix is decomposed into:

    where, l ii = u ii

    -

    !

    -

    -

    44434241

    34333231

    24232221

    14131211

    44

    3433

    242322

    14131211

    44434241

    333231

    2221

    11

    000

    00

    0*

    0

    00000

    aaaa

    aaaa

    aaaaaaaa

    u

    uu

    uuuuuuu

    l l l l

    l l l

    l l l

  • 8/7/2019 lecture13 (1)

    15/23

    LU Decomposition (Crouts reduction)Matrix decomposition

    -

    !

    -

    -

    44434241

    34333231

    24232221

    14131211

    34

    2423

    141312

    44434241

    333231

    2221

    11

    1000

    100

    10

    1

    *0

    00

    000

    aaaa

    aaaa

    aaaa

    aaaa

    u

    uu

    uuu

    l l l l

    l l l

    l l

    l

  • 8/7/2019 lecture13 (1)

    16/23

    Crouts ReductionThe method alternates from solving from thelower triangular to the upper triangular

    4141

    3131

    2121

    1111

    al

    al

    al

    al

    !!!!

    11

    1414141411

    11

    1313131311

    11

    1212121211

    l a

    uaul

    l auaul

    l a

    uaul

    !p!

    !p!

    !p! Step 1 : sweep down Step 2 : sweep a cross

  • 8/7/2019 lecture13 (1)

    17/23

    Crouts ReductionSecond set of steps through the reduction

    1421424242421241

    1321323232321231

    1221222222221221

    ul al al ul

    ul al al ul ul al al ul

    !p!!p! !p!

    Step 3 : sweep down

    22

    142124242424221421

    22

    132123232323221321

    l

    ul auaul ul

    l ul a

    uaul ul

    !p!

    !p! Step 4 : sweep a cross

  • 8/7/2019 lecture13 (1)

    18/23

    General formulation of Crouts

    These are the general equations for thecomponent of the two matrices

    n,2, ,i l

    ulau

    N,1,i i, ulal

    ii

    1i

    1k k ik i

    i

    1

    1k k ik ii

    -

    -

    !e!

    !e!

    !

    !

  • 8/7/2019 lecture13 (1)

    19/23

    ExampleThe matrix is broken into a lower and upper triangular matrices.

    -

    -

    !

    -

    100

    110

    3/23/11

    13/42

    03/71

    003

    122

    321

    213

  • 8/7/2019 lecture13 (1)

    20/23

    ExampleSolve problem using LU decomposition

    !

    !

    -

    !

    !

    -

    !

    -

    -

    7143.0

    0000.0

    1429.1

    7143.0

    7143.0

    6667.0

    100

    110

    3/23/117143.0

    7143.0

    6667.0

    3

    1

    2

    13/42

    03/71

    003

    31

    2

    100110

    3/23/11

    13/4203/71

    003

    3

    2

    1

    3

    2

    1

    3

    2

    1

    3

    2

    1

    3

    2

    1

    x

    x

    x

    x

    x

    x

    y

    y

    y

    y

    y

    y

    x x

    x

  • 8/7/2019 lecture13 (1)

    21/23

    LU ProgramsThere are two programs LU_ crout _ factor - the program does a Crout

    decomposition of a matrix and returns the L and U matrices

    LU_ solve uses an L and U matrix combinationto solve the system of equations.

  • 8/7/2019 lecture13 (1)

    22/23

    SummaryDefined a LU decomposition.Setup of the LU Crouts decomposition technique.Showed an example

  • 8/7/2019 lecture13 (1)

    23/23

    Homework

    Check the H omework webpage