Vlastn´ı ˇ c´ısla a vlastn´ı vektory ˇ Pˇripomeˇ nme nejprve definici: Rekneme, ˇze λ je vlastn´ı ˇc´ıslo matice A ∈ Rn×n a nenulov´ y vektor x ∈ Rn je odpov´ıdaj´ıc´ı vlastn´ı vektor, jestliˇze plat´ı Ax = λx. Vlastn´ı ˇc´ısla re´aln´e matice mohou b´ yt re´aln´a nebo komplexn´ı. Symetrick´a matice m´a pouze re´aln´a vlastn´ı ˇc´ısla. Jestliˇze x je vlastn´ı vektor matice A, pak i kaˇzd´ y jeho nenulov´ y re´aln´ y n´asobek je vlastn´ı vektor matice A. Obdobn´a definice plat´ı i pro matice s komplexn´ımi prvky. Protoˇze Ax = λx ⇐⇒ (A − λE)x = 0, kde E = diag(1, . . . , 1) je jednotkov´a diagon´aln´ı matice, a tato homogenn´ı soustava line´arn´ıch algebraick´ ych rovnic m´a nenulov´e ˇreˇsen´ı pr´avˇe kdyˇz matice t´eto soustavy je singul´arn´ı, poˇc´ıt´ame vlastn´ı ˇc´ısla jako koˇreny charakteristick´e rovnice det(A − λE) = 0. V bal´ıku linalg m´ame k dispozici n´asleduj´ıc´ı pˇr´ıkazy: • charmat(A, λ); A je ˇctvercov´a matice, λ je jm´eno nebo algebraick´ y v´ yraz; funkce charmat konstruuje charakteristickou matici B = λE − A, kde E je jednotkov´a matice. Je-li λ jm´eno, pak det(B) je charakteristick´ y polynom matice A. • charpoly(A, λ); A je ˇctvercov´a matice ˇr´adu n, λ je jm´eno nebo algebraick´ y v´ yraz; funkce charpoly poˇc´ıt´a charakteristick´ y polynom matice A, tj. det(λE − A), kde E je jednotkov´a matice. Contents
First
Last
Prev
Next
Back
Close
Quit
• eigenvalues(A); eigenvalues(A, C), kde A, C jsou ˇctvercov´e matice stejn´eho ˇr´adu; pˇr´ıkaz eigenvalues(A) vrac´ı posloupnost vlastn´ıch ˇc´ısel matice A. Obsahuje-li A re´aln´a ˇc´ısla, je v´ ypoˇcet prov´adˇen numericky s pˇresnost´ı specifikovanou pˇr´ıkazem Digits. V symbolick´em pˇr´ıpadˇe se vlastn´ı ˇc´ısla poˇc´ıtaj´ı jako koˇreny charakteristick´eho polynomu. Pˇr´ıkaz eigenvalues(A, C) ˇreˇs´ı zobecnˇen´ y probl´em vlastn´ıch ˇc´ısel, tj. hled´a koˇreny polynomu det(λC− A). • eigenvectors(A), kde A je ˇctvercov´a matice; procedura eigenvectors poˇc´ıt´a vlastn´ı ˇc´ısla a vlastn´ı vektory matice A, tj. pro kaˇzd´e vlastn´ı ˇc´ıslo λ ˇreˇs´ı homogenn´ı soustavu line´arn´ıch algebraick´ ych rovnic (Eλ − A)x = 0 pro nezn´am´ y vektor x. V´ ysledkem je posloupnost seznam˚ u ve tvaru [ei , µ, v1,i , . . . , vni ,i ], kde ei je vlastn´ı ˇc´ıslo, µ je jeho algebraick´a n´asobnost a v1,i , . . . , vni ,i jsou vektory, kter´e tvoˇr´ı b´azi vlastn´ıho podprostoru odpov´ıdaj´ıc´ıho vlastn´ımu ˇc´ıslu ei , 1 ≤ ni ≤ µ, ni je dimenze vlastn´ıho podprostoru. Pro ˇc´ıseln´e matice se k v´ ypoˇctu pouˇz´ıvaj´ı standardn´ı numerick´e metody a v´ ypoˇcet se prov´ad´ı s pˇresnost´ı specifikovanou pˇr´ıkazem Digits. V symbolick´em pˇr´ıpadˇe se prov´ad´ı explicitn´ı (pˇresn´ y) v´ ypoˇcet pˇr´ısluˇsn´ ych vlastn´ıch podprostor˚ u. > restart; > with(linalg): with(plots): Warning, the protected names norm and trace have been redefined and unprotected Warning, the name changecoords has been redefined
> A := array([[2, 3, −1], [3, −6, 2], [−1, 2, 5]]);
2 3 −1 2 A := 3 −6 −1 2 5 > E := evalm(array(identity,1..3, 1..3)); Contents
First
Last
Prev
Next
Back
Close
Quit
1 0 0 E := 0 1 0 0 0 1 > B := evalm(A − λ ∗ E);
2−λ 3 −1 −6 − λ 2 B := 3 −1 2 5−λ > charp := det(B); charp := −119 + 46 λ + λ2 − λ3 > C:=charmat(A,µ);
µ − 2 −3 1 C := −3 µ + 6 −2 1 −2 µ − 5 Matici C jsme vytvoˇrili pˇr´ıkazem charmat. Matice B a C maj´ı opaˇcn´a znam´enka. Maj´ı stejn´ y charakteristick´ y polynom? > charp1 := det(C); charp1 := µ3 − µ2 − 46 µ + 119 Maj´ı polynomy charp a charp1 stejn´e koˇreny? Tedy vedou oba postupy k z´ısk´an´ı stejn´ ych vlastn´ıch ˇc´ısel matice A? Vyzkouˇsejme jeˇstˇe pˇr´ıkaz charpoly, kter´ y poˇc´ıt´a charakteristick´ y polynom dan´e matice A jako determinant matice λE − A : > charp2 := charpoly(A, π); charp2 := π 3 − π 2 − 46 π + 119 Contents
First
Last
Prev
Next
Back
Close
Quit
400
400
200 –10 –8
–6
–4
–2
2
lambda 4 6
200 8
10
0
–10 –8
–6
–4
–2
2
4
6
8
10
pi
–200
–200
–400
–400
Figure 1: Polynom charp
Figure 2: Polynom charp2
Na obr´azc´ıch 1 a 2 jsou zn´azornˇeny polynomy charp a charp2. > chareq:=det(B) = 0; chareq := −119 + 46 λ + λ2 − λ3 = 0 > solve(chareq, {λ});
Contents
First
Last
Prev
Next
Back
Close
Quit
) √ (1/3) −11188 + 12 I 324363 278 1 λ= , + + √ (1/3) 6 3 3 −11188 + 12 I 324363 ( √ (1/3) −11188 + 12 I 324363 139 1 λ=− − + + √ (1/3) 12 3 3 −11188 + 12 I 324363 !) √ (1/3) 1 √ 278 −11188 + 12 I 324363 + I 3 − , 2 6 3 %1(1/3) ( √ (1/3) −11188 + 12 I 324363 139 1 λ=− + − − √ (1/3) 12 3 3 −11188 + 12 I 324363 !) √ (1/3) 1 √ −11188 + 12 I 324363 278 − I 3 − √ (1/3) 2 6 3 −11188 + 12 I 324363 (
> evalf(%);
{λ = 5.435111408 − 0.1 10−8 I}, {λ = −7.395608304 + 0.1339745960 10−9 I}, {λ = 2.960496896 + 0.1866025404 10−8 I} > λ1 := 5.435111408 − .1e − 8 ∗ I; λ1 := 5.435111408 − 0.1 10−8 I > λ2 := −7.395608304 + .1339745960e − 9 ∗ I; λ2 := −7.395608304 + 0.1339745960 10−9 I > λ3 := 2.960496896 + .1866025404e − 8 ∗ I; λ3 := 2.960496896 + 0.1866025404 10−8 I Contents
First
Last
Prev
Next
Back
Close
Quit
> evalf(eigenvalues(A)); 5.435111408 − 0.1 10−8 I, −7.395608304 + 0.1339745960 10−9 I, 2.960496896 + 0.1866025404 10−8 I Oba postupy n´am tedy nalezly stejn´a vlastn´ı ˇc´ısla. Tato vlastn´ı ˇc´ısla jsou ”t´emˇeˇr” re´aln´a. Z obr´azku charakteristick´eho polynomu (Obr´azek 1, Obr´azek 2) vid´ıme, ˇze kdybychom poˇc´ıtali pˇresnˇe, mˇeli bychom z´ıskat tˇri re´aln´e koˇreny, a tedy tˇri re´aln´a (r˚ uzn´a) vlastn´ı ˇc´ısla. Nepˇresnost v´ ysledku zp˚ usobuje jednak pouˇzit´ı numerick´e metody pˇri v´ ypoˇctu, jednak zaokrouhlovac´ı chyby. Zkusme jeˇstˇe symbolick´ y v´ ypoˇcet napˇr´ıklad pro diagon´aln´ı matici: > DM:=array([[a,0,0],[0,b,0],[0,0,c]]); a 0 0 DM := 0 b 0 0 0 c > eigenvalues(DM); a, b, c Vid´ıme, ˇze v pˇr´ıpadˇe diagon´aln´ı matice jsou vˇsechna vlastn´ı ˇc´ısla diagon´aln´ı prvky dan´e matice. > eigenvectors(DM); [a, 1, {[1, 0, 0]}], [b, 1, {[0, 1, 0]}], [c, 1, {[0, 0, 1]}] V´ ysledek, ˇr´ık´a, ˇze a je jednoduch´e vlastn´ı ˇc´ıslo, kter´emu pˇr´ısluˇs´ı vlastn´ı vektor [1, 0, 0]. Obdobnˇe pro vlastn´ı ˇc´ısla b a c. > DM1:=array([[1,0,0],[0,1,0],[0,0,1]]);
Contents
First
Last
Prev
Next
Back
Close
Quit
1 0 0 DM1 := 0 1 0 0 0 1 >
eigenvectors(DM1);
[1, 3, {[1, 0, 0], [0, 0, 1], [0, 1, 0]}] Tedy matice DM1 m´a jedno vlastn´ı ˇc´ıslo rovno 1 s algebraickou n´asobnost´ı 3 a odpov´ıdaj´ıc´ı vlastn´ı vektory jsou vektory (1, 0, 0)T , (0, 1, 0)T , (0, 0, 1)T . Jak´e jsou vlastn´ı vektory matice A? > evalf(eigenvectors(A)); [5.435111408 − 0.1 10−8 I, 1., {[−0.179489876 + 0.5105777948 10−8 I, 0.127810768 + 0.1252888975 10−8 I, 1.]}] , [−7.395608304 + 0.1339745960 10−9 I, 1., {[1.79828530 + 0.1847745082 10−9 I, −5.298661502 + 0.3593745522 10−9 I, 1.]}], [2.960496896 + 0.1866025404 10−8 I, 1., {[7.524061680 − 0.4775368097 10−8 I, 2.742279288 − 0.1254671347 10−8 I, 1.]}] Vlastn´ı vektory matice A maj´ı opˇet ”zanedbatelnou” imagin´arn´ı ˇc´ast: > v1:=vector([1., -.712077918+.5394248717e-9*I, > -5.571345162+.2918274615e-8*I]); v1 := [1., −0.712077918 + 0.5394248717 10−9 I, −5.571345162 + 0.2918274615 10−8 I] > v2:=vector([1., -2.946507676+.1156248156e-9*I, > .556085283+.628998508e-10*I]);
Contents
First
Last
Prev
Next
Back
Close
Quit
v2 := [1., −2.946507676 + 0.1156248156 10−9 I, 0.556085283 + 0.628998508 10−10 I] > v3:=vector([1., .3644679428-.5489823192e-9*I, > .132906932-.3662972362e-8*I]); v3 := [1., 0.3644679428 − 0.5489823192 10−9 I, 0.132906932 − 0.3662972362 10−8 I] Zn´azornˇeme si jeˇstˇe nˇekter´e naˇse v´ ysledky graficky: > matrixplot(A,axes=boxed);
4 2 A 0 –2 –4 –6 1
1 1.5
1.5 column
2
2 2.5
2.5 3
>
row
3
matrixplot(A,heights=histogram,axes=boxed);
Contents
First
Last
Prev
Next
Back
Close
Quit
4 2 A 0 –2 –4 –6 1
1.5
2
column
> > > > > > > > >
2.5
3
3.5
4
4
3.5
3
2 2.5 row
1.5
1
a1 := arrow(
, shape=arrow, width=[0.02, relative], head_length=[0.1, relative], color=black):a2 := arrow(,shape=arrow, width=[0.02, relative], head_length=[0.2, relative], color=blue): a3 := arrow(,shape=arrow, width=[0.1, relative], head_length=[0.3, relative], color=cervena):display(a1,a2,a3, scaling=constrained, axes=FRAMED);
Contents
First
Last
Prev
Next
Back
Close
Quit
0 –1 –2 –3 –4 –5 –3 –2 –1 0
0 1
Je-li v1 vlastn´ı vektor pˇr´ısluˇsn´ y vlastn´ımu ˇc´ıslu λ1 matice A, pak vektor Av1 je jeho λ1−n´asobkem: > w1:=evalm(A&*v1);
> > > > >
w1 := [5.435111408 − 0.1300000000 10−8 I, −3.870222812 + 0.2600000000 10−8 I, −30.28088165 + 0.1567022282 10−7 I] p1 := arrow(<0,0,0>,, difference, color=black):p2 := arrow(<0,0,0>,,shape=arrow, width=[0.02, relative], head_length=[0.2, relative], color=blue): display(p1,p2,axes=FRAMED);
Contents
First
Last
Prev
Next
Back
Close
Quit
0 –5 –10 –15 –20 –25 –30 –3 –2 –1 0
5
4
3
2
1
0
Pˇ r´ıklady k procviˇ cen´ı 1. Najdˇete vlastn´ı ˇc´ısla a vlastn´ı vektory matice (graficky zn´azornˇete) 1 −6 3 1 0 . A= 1 2 0 1 2. Najdˇete vlastn´ı ˇc´ısla a vlastn´ı vektory matice (graficky zn´azornˇete) 1 1 2 A = −6 1 0 . 3 0 1 Contents
First
Last
Prev
Next
Back
Close
Quit
3. Najdˇete vlastn´ı ˇc´ısla a vlastn´ı vektory matice A a matice A2 (graficky zn´azornˇete) 1 1 A= . 6 0 4. Najdˇete vlastn´ı ˇc´ısla a vlastn´ı vektory matice 2 −3 1 −1 3 1 −2 0 . A= −5 2 0 1 0 2 −1 1 5. Najdˇete vlastn´ı ˇc´ısla a vlastn´ı vektory matice 2 1 A= 0 0
1 0 0 0 −1 2 . 0 1 −1 1 0 −1
6. Najdˇete vlastn´ı ˇc´ısla a vlastn´ı vektory matice 2 0 1 0 0 −1 1 0 A= 1 2 0 −1 0 −1 0 1 Contents
.
First
Last
Prev
Next
Back
Close
Quit
7. Najdˇete vlastn´ı ˇc´ısla a vlastn´ı vektory matice (graficky zn´azornˇete) 2 −1 0 3 −2 . A= 5 4 −1 1
Contents
First
Last
Prev
Next
Back
Close
Quit