Aller au contenu

Mathc matrices/a156

Un livre de Wikilivres.


La décomposition spectral

E1 b1r1 + E2 b2r2 + E3 b3r3 = A

Copy/Paste into the octave window
% A property of spectral decomposition:
%
%       E1 V1 V1' +  E2 V2 V2' + E3 V3 V3' = A
%       E1 b1 r1  +  E2 b2 r2  + E3 b3 r3  = A
%
% V (b) : The columns of the eigenvectors of A
% V'(r) : The rows of the eigenvectors of the inverse of A
%         (Here the transpose: see the first example)
%
%    E : The eignvalues of A.
%
% V1V1' (b1r1) is obtained by multiplying the first column of the eigenvector
%              of A by the first row of the eigenvector of the inverse of A


clear, clc

A = round(10*randn(3));    %% A matrix 3x3
A = A'*A                   %% A symetric matrix

% Eigenvectors, Eigenvalues
[Evectors,Evalues] = eigs(A);

V1 = Evectors(:,1);
V2 = Evectors(:,2);
V3 = Evectors(:,3);

Evalues = diag([Evalues]);

E1 = Evalues(1);
E2 = Evalues(2);
E3 = Evalues(3);

E1b1r1 = E1.*V1*V1';
E2b2r2 = E2.*V2*V2';
E3b3r3 = E3.*V3*V3';

A = E1b1r1 + E2b2r2 + E3b3r3

%%
Nous voyons une des propriètés de la décomposition spectral:

 E1*b1r1 + E2*b2r2 + E3*b3r3 = A
 
E1 est la première valeur propre, E2 la deuxième et E3 la troisième.

b1r1 est obtenue en multipliant la première colonne de la matrice des vecteurs propres par la première ligne de la matrice inverse des vecteurs propres.