Lecture2 Pss 2

download Lecture2 Pss 2

of 11

Transcript of Lecture2 Pss 2

  • 8/11/2019 Lecture2 Pss 2

    1/11

    Iterative Methods (Conjugate Gradient)

    =

    When A is symmetric and positive definite, i.e.,

    =; > 0Some properties of inner product

    < , > = =

    = < , > = < , >

    =

    < + , > = < , > + < , >< , > = Lemma: If A is symmetric and positive definite, then the problem of solving =

    is equivalent to minimising the quadratic form

  • 8/11/2019 Lecture2 Pss 2

    2/11

    = < , > 2 < , >See pg. 205 for proof of this Lemma.

    Offshoot of this lemma

    the iteration process

    (+) = () + ()

    where

    = < , >< , >

    With

    =

    (Steepest descent)

  • 8/11/2019 Lecture2 Pss 2

    3/11

    Conjugate Gradient (pg 211 pseudocode)

    ,

    ,

    ,

    ,

    ,

    = < , > = ,

    +

    < +

  • 8/11/2019 Lecture2 Pss 2

    4/11

    If we perturb the equation we have

    + = + A) = = +

    = +

    =

    +

    = +

  • 8/11/2019 Lecture2 Pss 2

    5/11

    = +

    If is very small A is very poorly conditioned. i.e A is very close to singular.If we can precondition A, say such that

    = So thatis better conditioned. How does one choose the preconditioner?Simplest case; choose the diagonal elements of A. (See pg. 217) for pseudo code.

  • 8/11/2019 Lecture2 Pss 2

    6/11

    Example: Heat conduction equation solved with PCG.

    Nice to write formal matrix equations but when we code we apply smart

    approaches.

    = =

    =

    = + Let us discretise the problem with finite difference = ; = + ; = , .

    +

    +

    =

  • 8/11/2019 Lecture2 Pss 2

    7/11

    =

    Residual

    =

    where

    + + + = Need to multiply only non-zero elements.

    Show code for PCG.

  • 8/11/2019 Lecture2 Pss 2

    8/11

    Eigenvalue problems

    Occur in vibrations, molecular modelling and many more areas

    = xwhere is a scalar. = 0

    Which implies is singular or

    = 0

    = Characteristic Polynomial

    =

    1 2 1

    0 1 3

    2 1 1

  • 8/11/2019 Lecture2 Pss 2

    9/11

    1 2 10 1 32 1 1

    = 0

    1 1 1 3 26 21 = 0whose roots are

    4, 12 + 72 , 12 72 Complex eigenvalues occur in conjugate pairs.

    Power Method

    Will compute the largest eigenvalue in magnitude provided(a) There is a single eigenvalues with the largest modulus

    (b) There is a linearly independent set of n eigen vectors.

  • 8/11/2019 Lecture2 Pss 2

    10/11

    1 > 2 3 . If

    (

    )are the eigen vectors, i.e

    () = ()If (0) = (1) + (2) + + ()then

    (1) =0 ; (2) =1 ; () =1 =0

    =1 +2 + . . + = 11 + 22 + . . +

    = 1 1 + 21 2 + . . + 1

  • 8/11/2019 Lecture2 Pss 2

    11/11

    Let be a linear functional (which can be just a component of x) , then = (+1)(()) 1 Pseudo code (page 230; Exercise.. code this).

    ,

    ,

    ,

    = 1,2

    This is a very restrictive algorithm. Not much applicability. In practice we useQR factorization. Many routines can be found in EISPACK, LAPACK