Professional Documents
Culture Documents
Esercizio 1
Calcolare il numero di condizionamento rispetto alle norme con indice 1, 2 e della
matrice
b 2 1 0 0
A= 0
b 1
0
1 b
A = 0
b 1
0
1 b
A = AT
La matrice A simmetrica.
A 1 = A 1
A1 = A
K 2 ( A) =
K1 ( A) = A 1 A 1 = K ( A)
1
A 2 = ( A)
max ( A)
min ( A)
A 1 =
A+
det( A)
)(
) (
det( A) = b 2 1 b 2 1 = b 2 1
(b
det( A) 0
b 2 1
0
+
2
A = 0
b b 1
0
b2 1
(
(
[(
) (
) (
1
A 1 = max 2
1
b 1
b
1
, 2
+ 2
b 1
b 1
) (
) (
)
)
A 1 = max b 1 , (b + 1), (b + 1)
2
1 0
1
b
, 2
+ 2
b 1
b 1
) (
) (
A 1 = A = b +1
A 1 = A = b2 1
1
2
b 1
2
b 1
b
b 1
1
2
b 1
) (
1
1
1
= max 2
,
,
b 1 b 1 b 1
A 1 = A 1
K 1 ( A) = K ( A) =
Per b > 1
b 1
1
b2 1
A1 = 0
2
b 1
b b 2 1
0
b +1
b 1
A 1 = A 1
1
K 1 ( A) = K ( A) = b + 1
1
b 1
1
b 1
det( A I ) = 0
(b
[(b
[(b
2
2
)[
b 2 1
0
0
det
0
b
1 =0
0
1
b
2
b 2 1 (b ) 1 = 0
1 (b ) 1 = 0
) ]
) 1] = 0
1 [(b ) 1][(b ) + 1] = 0
[(b ) 1] = 0
[(b ) + 1] = 0
[(
) ][
1 = b 2 1
2 = b 1
3 = b + 1
Per b < 1
max = b + 1
Per b > 1
max = b 2 1
min = b 1
min = b 1
b +1
b 1
K 2 ( A) = b + 1
K 2 ( A) =
Esercizio 2
Dire per quali valori dei parametri , il seguente metodo alle differenze finite
convergente
i +1 = i + h[f ( xi , i ) + f ( xi + h, i + hf ( xi , i ))]
0 = y0
e per quale valore dei parametri risulta del secondo ordine.
Soluzione
] ( )
1
[( y + h ) y(x )] = f (x, y ) + h f x (x, y ) + f y (x, y ) f (x, y ) + O h 2
h
2
( x, y; h ) = f ( x, y ) + f ( x + h, y + hf ( x, y ))
( x , y; h ) =
i +1 = i + h( xi , i )
( xi , i ) = f ( xi , i ) + f ( xi + h, i + hf ( xi , i ))
Il metodo converge quando
lim (x, y; h ) = 0
h 0
( x, y; h )
( x, y; h )
( )
h '
h 2 ''
f (x ) +
f (x ) + O h 3
1!
2!
f (x + hx , y + h y ) = f ( x, y ) + hx f x ( x, y ) + h y f y ( x, y ) + O h
f ( x, y ) = f ( x ) +
( )
2
0 sar:
] ( )
[
] ( )
( x, y; h ) = 2f ( x, y ) + h[ f ( x, y ) + f ( x, y ) f (x, y )] + O(h )
(x, y; h ) = {2 f ( x, y ) + h f x ( x, y ) + f ( x, y ) f y ( x, y ) }+ O h 2
2
( )
f x (x, y ) + f ( x, y ) f y ( x, y ) 2f ( x, y ) h f x ( x, y ) + f ( x, y ) f y (x, y ) + O h 2
2
( x, y; h ) = f ( x, y ) + [ f x ( x, y ) + f ( x, y ) f y ( x, y )] 2f ( x, y ) h[ f x ( x, y ) + f ( x, y ) f y ( x, y )] + O(h 2 )
2
(x, y; h ) = (1 2 ) f ( x, y ) + h [ f x ( x, y ) + f ( x, y ) f y ( x, y )] + O(h 2 )
2
1
quando
1 2 = 0
metodo converge
( x, y; h ) = 0
=
lim
2
h 0
( x, y ; h ) = f ( x, y ) +
Il metodo del secondo ordine quando (x, y; h ) proporzionale a O(h2), cio quando resta
solo O(h2), quindi:
1
1 2 = 0
=
2
1
2 = 0
= 1
Esercizio 3
Date le matrici
1
0
B=
2 0 0
A = 0 2
0 2
0
1
1
0
0
0
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 x C n si ha x*Ax>0, cio gli autovalori sono positivi.
Per quanto riguarda la matrice A:
det ( A) = 2( 2 4 )
2( 2 4 ) 0
2
A non singolare per { 2;2}
Calcolo gli auto valori della matrice A:
0
0
2
det 0
2 = 0
det( A I ) = 0
0
2
(2 )([ )2 4] = 0
(2 )( 2)( + 2) = 0
1 = 2
2 = 2
3 = + 2
La matrice A definita positiva per > 2
1 0
0
0
1
0 1
0
det
=0
0 1
0
0 1
0
1
0
0 1
det(B I ) = (1 ) 0
1
0 +
0
0
0
1
0
1
det(B I ) = (1 ) (1 ) + (1 ) [ (1 )] (1 )[ (1 )] + 2 2
2
det (B I ) = 4 2 2 (1 ) + (1 ) = 2 (1 )
2
2 = (1 )2
1 2 = 1
3 4
1 =
= 1+
2 2
= 1m
1 2 > 0
1 > 0
<1
3 4 > 0
1+ > 0
> 1
La matrice B definita positiva per 1 < < 1
Esercizio 4
Determinare la fattorizzazione LU della matrice
1
1
a
A = 3a 2 a 2a
a
a
a
Soluzione
Triangolarizzo la matrice A:
1
1
a
3 3a 2 a 2a
1 a
a
a
1
1
a
0 (a + 1) 2a 3
1 0
a +1
a + 1
1
1
a
A = LU
det(A) = det(LU)
1
1
a
0 (a + 1) 2a 3
0
0
3a 2
Esercizio 5
Considerato il sistema lineare Ax = b, con
3
A = 2
2
2
2
1
1
2
0
b = 2
2
Soluzione
Il metodo di Gauss-Seidel convergente se e solo se (BGS) < 1
x (k +1) = Bx (k ) + f
Metodo iterattivo:
dove B = P-1N
f = P-1b
Il metodo di Gauss-Seidel corrisponde alla scelta:
P=DL
e
N=U
-1
perci: BGS = (D L) U
f = (D L)-1b
3 0 0
D = 0 2 0
0 0 2
0 0
0
L = 2 0 0
2 1 0
+
(D L )1 = (D L )
det (D L )
(D L )
3 2
= 0
2
0
0
U = 0
0
3
D L = 2
2
0
2 0
1 2
0
det(D L ) = 12
2
1
2
2
0
0
(D L )
2
1
0
0 0
4
= 2 2 6 0
2 3 6
BGS
(D L )
= (D L ) U = 0
0
det (BGS I ) = 0
det 0 1 3
0
1 6
0
0
13
= 2 6 1 2 0
2 12 1 4 1 2
2 3 2 3
13
16
1 6
5 12
2 3
16 =0
5 12
5
1
1
5 1
5
1
+ 2 + = 0
+ = 0
12
36
12
36
36 3
3
3
1
2 + = 0
12 122 9 + 2 = 0
4
6
9 81 96 9 15 j 3
15
2 3 =
=
=
j
1 = 0
24
24
8 24
9
15
6
2 3 =
+
=
= 0.41
2 3 < 1
il metodo converge
64 576
6
(D L )x (k +1) = b + Ux (k )
x (k +1) = (D L ) b + (D L ) Ux (k )
1
x (k +1) = BGS x (k ) + f
Per k = 0
x (1)
2
0
3
1
= 0
1
0 6
1
2
3 0 3
1 2
0 +
6 6
5 0
2
12
12
0
1
2
1
4
0
0
0 2
1 2
x (1)
0
= 1
3
2
Per k = 1
x (2 )
x (2 )
2
2
0 0
0
3
3
3 0
1
1
2
1
1 +
= 0
0 2
3
6 3 6
2
1
5 2
2 1 1 2
0
6
12
12 4 2
2 3 2
2
2
3
2 0 2 6
6
0
3
1 13
1 1 19
= +
+ 1
x (2 ) =
+
+ 1 =
3 62
3 4 12
1 5 3 3 2
1 5 3 2 47
24
6 12 2
6+8
x (2 )
19
=
12
47
24
(D L )x (k +1) = b + Ux (k )
Dx (k +1) = b + Lx (k +1) + Ux (k )
(Dx (k +1) )i = (b )i + (Lx (k +1) )i + (Ux (k ) )i
i 1
j =i +1
(k )
ij x j
xi(k +1) =
i 1
1
(k +1)
bi aij x j
aii
j =1
j =i +1
Per k = 0
i 1
n
(1)
b
a
x
aij x (j0 )
i = 1, 2, 3
i ij j
j =1
j =i +1
3
b
1
1
(0 )
=
b1 a12 x 2(0 ) a13 x3(0 ) = 1 = 0
b1 a1 j x j =
a11
a11
j =2
a11
1
1
=
b2 a 21 x1(1) a 23 x3(0 ) = 2 + 2 0 = 1
a 22
2
xi(1) =
x1(1)
x 2(1)
x3(1\) =
1
aii
Per k = 1
xi(2 ) =
2
1
1
1
3
(1)
b3 a31 x1(1) a32 x 2(1) = 2 2 0 + 1 =
b3 a3 j x j =
a33
2
2
j =1
a33
1
aii
i 1
(2 )
b
i aij x j
j =1
j =i +1
ij
x (j1)
i = 1, 2, 3
ij
x (jk ) i = 1, , n
x 2(2 )
3
1
1
1
3
2
(1)
b1 a12 x 2(1) a13 x3(1) = 0 + 2 2 =
b1 a1 j x j =
a11
3
2
6
j =2
a11
1
1
2 3 19
+1 =
=
b2 a 21 x1(2 ) a 23 x3(1) = 2 + 2
2
a 22
2
6
12
x1(2 ) =
x3(2\ ) =
1
a 33
1
1
2 19 47
(2 )
+1 =
b
b3 a 31 x1(2 ) a 32 x 2(2 ) = 2 2
3 a3 j x j =
12
a
2
6
j
=
1
24
33