Esercitazione4_2010-2011

7
Esercitazione 4 di Matematica Applicata Laura Marcias – [email protected] 18 Dicembre 2010 Esercizio 1 Calcolare il numero di condizionamento rispetto alle norme con indice 1, 2 e della matrice - = b b b A 1 0 1 0 0 0 1 2 essendo b un numero reale positivo. Soluzione - = b b b A T 1 0 1 0 0 0 1 2 A = A T La matrice A è simmetrica. Poiché abbiamo una matrice simmetrica: = A A 1 - - = 1 1 1 A A ( A A ρ = 2 Numero di condizionamento: ( ( A K A A A K - = = 1 1 1 1 ( 29 ( ( 29 A A A K min max 2 λ λ = Devo calcolare l’inversa della matrice A. ( 29 A A A det 1 + - = ( 29 ( ( ( 2 2 2 2 1 1 1 det - = - - = b b b A La matrice è invertibile se il determinante è diverso da zero, perciò: ( 0 det A ( 0 1 2 2 - b 1 ± b ( 29 ( 29 ( 29 ( 29 - - - - - - - = + 1 1 0 1 1 0 0 0 1 2 2 2 2 2 b b b b b b b A ( 29 ( 29 ( 29 ( 29 ( 29 - - - - - - - = - 1 1 1 0 1 1 1 0 0 0 1 1 2 2 2 2 2 1 b b b b b b b A ( ( ( [ ] 1 , 1 , 1 max 2 1 + + - = b b b A ( 29 ( 29 ( 29 ( 29 ( 29 - - - = - + - - + - - = - 1 1 , 1 1 , 1 1 max 1 1 1 , 1 1 1 , 1 1 max 2 2 2 2 2 2 1 1 b b b b b b b b b b A Per b < 1 con 1 1 + = = b A A e 1 1 1 1 1 - = = - - b A A ( 29 ( 29 1 1 1 - = = b b A K A K Per b > 1 1 2 1 - = = b A A e 1 1 1 1 1 - = = - - b A A ( ( 1 1 = = b A K A K

description

Matematica Applicata

Transcript of Esercitazione4_2010-2011

  • Esercitazione 4 di Matematica Applicata Laura Marcias [email protected]

    18 Dicembre 2010

    Esercizio 1 Calcolare il numero di condizionamento rispetto alle norme con indice 1, 2 e della matrice

    =

    bb

    bA

    10100012

    essendo b un numero reale positivo. Soluzione

    =

    bb

    bAT

    10100012

    A = AT La matrice A simmetrica.

    Poich abbiamo una matrice simmetrica:

    = AA1

    =1

    11 AA

    ( )AA =2

    Numero di condizionamento:

    ( ) ( )AKAAAK

    ==1

    111

    ( ) ( )( )AA

    AKmin

    max

    2

    =

    Devo calcolare linversa della matrice A.

    ( )AAA

    det1

    +

    =

    ( ) ( )( ) ( )2222 111det == bbbA

    La matrice invertibile se il determinante diverso da zero, perci: ( ) 0det A

    ( ) 01 22 b

    1b

    ( ) ( )( ) ( )

    =+

    110110

    001

    22

    22

    2

    bbbbbb

    bA

    ( )( ) ( )( ) ( )

    =

    1110

    11

    10

    001

    1

    22

    22

    2

    1

    bb

    b

    bbb

    b

    A

    ( ) ( ) ( )[ ]1,1,1max 21

    ++= bbbA

    ( ) ( ) ( ) ( ) ( )

    =

    +

    +

    =

    11

    ,

    11

    ,

    11

    max11

    1,

    11

    1,

    11

    max 22222211

    bbbbb

    bbbb

    bA

    Per b < 1 con

    11

    +==

    bAA

    e 1

    111

    1

    ==

    bAA

    ( ) ( )11

    1

    +==

    bbAKAK

    Per b > 1

    121

    ==

    bAA

    e 1

    111

    1

    ==

    bAA

    ( ) ( ) 11 +== bAKAK

  • Calcolo gli autovalori di A: ( ) 0det = IA

    010

    10001

    det

    2

    =

    bb

    b

    ( )( )[ ] 011 22 = bb

    ( )[ ]( )[ ] 011 22 = bb ( )[ ] ( )[ ] ( )[ ] 01112 =+ bbb

    ( )[ ] 012 = b 121 = b

    ( )[ ] 01 = b 12 = b ( )[ ] 01 =+ b

    13 += b

    Per b < 1

    1max += b

    1min = b

    ( )11

    2

    +=

    bbAK

    Per b > 1

    12max = b 1min = b ( ) 12 += bAK

    Esercizio 2 Dire per quali valori dei parametri ,

    il seguente metodo alle differenze finite convergente

    e per quale valore dei parametri risulta del secondo ordine. Soluzione

    ( ) ( ) ( )hyxhyxhyx ;,;,;, = errore locale di discretizzazione ( ) ( ) ( )[ ] ( ) ( ) ( ) ( )[ ] ( )2,,,

    2,

    1;, hOyxfyxfyxfhyxfxyhy

    hhyx yx +++=+=

    ( ) ( ) ( )( )yxhfyhxfyxfhyx ,,,;, +++=

    ( )iiii xh ,1 +=+ ( ) ( ) ( )( )iiiiiiii xhfhxfxfx ,,,, +++=

    Il metodo converge quando ( ) 0;,lim0

    =

    hyxh

    ( )hyx ;, dipende solo dalla soluzione del problema ( )hyx ;, dipende dal metodo, devo perci svilupparlo in serie di Taylor, con punto

    iniziale h = 0

    ( ) ( ) ( ) ( ) ( )3''2'!2!1

    , hOxfhxfhxfyxf +++=

    ( ) ( ) ( ) ( ) ( )2,,,, hOyxfhyxfhyxfhyhxf yyxxyx +++=++ Perci lo sviluppo in serie di Taylor di ( )hyx ;, per h 0 sar:

    ( ) ( ) ( ) ( ) ( ) ( )[ ] ( )2,,,,,;, hOyxfyxhfyxhfyxfyxfhyx yx ++++= ( ) ( ) ( ) ( ) ( )[ ]{ } ( )2,,,,2;, hOyxfyxfyxfhyxfhyx yx +++= ( ) ( ) ( ) ( ) ( )[ ] ( )2,,,,2;, hOyxfyxfyxfhyxfhyx yx +++=

    ( ) ( )( )[ ]

    =

    ++++=+

    00

    1 ,,,

    yxhfhxfxfh iiiiiiii

  • ( ) ( ) ( ) ( ) ( )[ ] ( ) ( ) ( ) ( )[ ] ( )2,,,,2,,,2

    ,;, hOyxfyxfyxfhyxfyxfyxfyxfhyxfhyx yxyx +

    +++=

    ( ) ( ) ( ) ( ) ( )[ ] ( ) ( ) ( ) ( )[ ] ( )2,,,,2,,,2

    ,;, hOyxfyxfyxfhyxfyxfyxfyxfhyxfhyx yxyx +

    +++=

    ( ) ( ) ( ) ( ) ( ) ( )[ ] ( )2,,,21

    ,21;, hOyxfyxfyxfhyxfhyx yx ++

    +=

    ( ) 0;,lim0

    =

    hyxh

    quando 021 = 21

    = metodo converge

    Il metodo del secondo ordine quando ( )hyx ;, proporzionale a O(h2), cio quando resta solo O(h2), quindi:

    =

    =

    021

    021

    =

    =

    121

    Esercizio 3 Date le matrici

    =

    2020002

    A

    =

    100010

    010001

    B

    dire per quali valori dei parametri e risultano essere non singolari e definite positive. Soluzione

    Una matrice non singolare se e solo se il suo determinante diverso da zero, inoltre definita positiva se nCx si ha x*Ax>0, cio gli autovalori sono positivi. Per quanto riguarda la matrice A:

    ( ) ( )42det 2 = A ( ) 042 2 2 A non singolare per { }2;2 Calcolo gli auto valori della matrice A:

    0)det( = IA 020

    20002

    det =

    ( ) ( )[ ] 042 2 = ( )( )( ) 0222 =+ 21 = 22 = 23 +=

    La matrice A definita positiva per 2>

    Per quanto riguarda la matrice B, non singolare se: ( ) 0det B

    ( ) ( ) ( ) ( )224222 121111000

    10

    10010

    011det =+=+++=+=

    B

    ( ) 01 22 1

  • La matrice B non singolare per { }1;1

    Calcolo gli auto valori della matrice B:

    0

    100010

    010001

    det =

    ( ) ( )

    +

    =

    1000

    10

    10010

    011det IB

    ( ) ( ) ( ) ( ) ( )[ ] ( ) ( )[ ] 2222 111111det ++= IB

    ( ) ( ) ( ) ( )[ ]2224224 1112det =+= IB ( )22 1 =

    =1

    m1=

    =121 += 143 021 > 01 > 1 01 >+ 1>

    La matrice B definita positiva per 11

  • Esercizio 5 Considerato il sistema lineare Ax = b, con

    =

    212122223

    A

    =

    220

    b

    dire se il metodo di Gauss-Seidel risulta convergente e, fissato il vettore iniziale [ ]Tx 000= , calcolare le iterazioni x(1) e x(2).

    Soluzione Il metodo di Gauss-Seidel convergente se e solo se (BGS) < 1 Metodo iterattivo: ( ) ( ) fBxx kk +=+1 dove B = P-1N f = P-1b Il metodo di Gauss-Seidel corrisponde alla scelta: P = D L e N = U perci: BGS = (D L)-1U f = (D L)-1b

    =

    200020003

    D

    =

    012002000

    L

    =

    212022003

    LD

    ( ) ( )( )LDLDLD

    =

    +

    det1

    ( ) 12det = LD

    ( )

    =

    200120223

    TLD ( )

    =+

    6320622004

    LD

    ( )

    =

    2141122021620031

    1LD

    =

    000100

    220U

    ( )

    ==

    12561061310

    323201ULDBGS

    Calcolo gli autovalori associati alla matrice di iterazione:

    ( ) 0det = IBGS

    0125610

    613103232

    det =

    0361

    125

    31

    =

    +

    0361

    125

    31

    365 2

    =

    ++

    061

    432

    =

    +

    ( ) 0291212 2 =+

    01 =

    jj2415

    83

    24159

    2496819

    32 =

    =

    =

    41.066

    57615

    649

    32 ==+= 132

  • Calcolo delle prime due iterate:

    ( ) ( ) ( )kk UxbxLD += +1

    ( ) ( ) ( ) ( )kk UxLDbLDx 111 + +=

    ( ) ( ) fxBx kGSk +=+1

    Per k = 0

    ( )

    +

    =

    220

    21

    41

    122

    021

    62

    0031

    000

    125

    610

    61

    310

    32

    320

    1x

    ( )

    =

    2310

    1x

    Per k = 1

    ( )

    +

    =

    220

    21

    41

    122

    021

    62

    0031

    2310

    125

    610

    61

    310

    32

    320

    2x

    ( )

    +

    +

    +

    =

    2310

    23

    125

    61

    23

    61

    31

    623

    32

    2x

    ( )

    =

    +

    +

    +

    =

    2447

    1219

    62

    2310

    85

    61

    41

    31

    22

    32

    2x

    ( )

    =

    2447

    1219

    62

    2x

    Secondo metodo per il calcolo delle prime due iterate: ( ) ( ) ( )kk UxbxLD += +1 ( ) ( ) ( )kkk UxLxbDx ++= ++ 11

    ( )( ) ( ) ( )( ) ( )( )ikikiik UxLxbDx ++= ++ 11

    ( ) ( ) ( )+=

    =

    ++=

    n

    ij

    kjij

    i

    j

    kjiji

    kiii xaxabxa

    1

    1

    1

    11

    ( ) ( ) ( )

    =

    +=

    =

    ++n

    ij

    kjij

    i

    j

    kjiji

    ii

    ki xaxab

    ax

    1

    1

    1

    11 1 i = 1, , n

    Per k = 0 ( ) ( ) ( )

    =

    +=

    =

    n

    ijjij

    i

    jjiji

    iii xaxab

    ax

    1

    01

    1

    11 1 i = 1, 2, 3

    ( ) ( ) ( ) ( )[ ] 01111

    10313

    02121

    11

    3

    2

    011

    11

    11 ===

    =

    =a

    bxaxab

    axab

    ax

    jjj

    ( ) ( ) ( )[ ] [ ] 1022211 0

    3231

    121222

    12 =+== xaxab

    ax

    ( ) ( ) ( ) ( )[ ] [ ]231022

    2111 1

    2321

    131333

    2

    1

    133

    33

    1\3 =+==

    =

    =

    xaxaba

    xaba

    xj

    jj

    Per k = 1 ( ) ( ) ( )

    =

    +=

    =

    n

    ijjij

    i

    jjiji

    iii xaxab

    ax

    1

    11

    1

    22 1 i = 1, 2, 3

  • ( ) ( ) ( ) ( )[ ]62

    23220

    3111 1

    3131

    212111

    3

    2

    111

    11

    21 =

    +==

    =

    =

    xaxaba

    xaba

    xj

    jj

    ( ) ( ) ( )[ ]1219

    231

    6222

    211 1

    3232

    121222

    22 =

    +

    +== xaxab

    ax

    ( ) ( ) ( ) ( )[ ]2447

    12191

    6222

    2111 2

    2322

    131333

    2

    1

    233

    33

    2\3 =

    +

    ==

    =

    =

    xaxaba

    xaba

    xj

    jj