Algosim documentation: eigenvectors

eigenvectors

Computes eigenvalues and eigenvectors of a matrix.

Syntax

Description

If A is a square matrix, then eigenvectors(A) tries to compute eigenvalues and eigenvectors of A. eigenvectors(A) is an assignment list containing the vector of all eigenvalues and a matrix whose columns are corresponding eigenvectors.

The function tries to make the matrix of eigenvectors orthonormal.

Examples

A non-symmetric matrix

A ≔ ❨❨1, −1, −1, 1❩, ❨−1, 0, 0, 1❩, ❨−1, 0, 2, 0❩, ❨1, 0, 0, 2❩❩
⎛ 1  −1  −1   1⎞
⎜−1   0   0   1⎟
⎜−1   0   2   0⎟
⎝ 1   0   0   2⎠
Λ, U ≔ eigenvectors(A)
 ⎛3 ⎞  ⎛  0.57735026919                0    0.57735026919   0.377964473009⎞
 ⎜2 ⎟  ⎜              0   0.408248290464    0.76980035892  −0.755928946018⎟
e⎜−1⎟  ⎜ −0.57735026919   0.408248290464    0.19245008973   0.377964473009⎟
 ⎝1 ⎠  ⎝  0.57735026919   0.816496580928   −0.19245008973  −0.377964473009⎠
defuzz(U ⋅ diag(Λ) ⋅ U^−1)
⎛ 1  −1  −1   1⎞
⎜−1   0   0   1⎟
⎜−1   0   2   0⎟
⎝ 1   0   0   2⎠

A symmetric matrix

A ≔ ❨❨2, −2, 6, 1❩, ❨−2, 2, 0, 1❩, ❨6, 0, 2, 2❩, ❨1, 1, 2, 2❩❩
⎛ 2  −2   6   1⎞
⎜−2   2   0   1⎟
⎜ 6   0   2   2⎟
⎝ 1   1   2   2⎠
Λ, U ≔ eigenvectors(A)
 ⎛8.84007170783 ⎞  ⎛ 0.673132037203   0.697804105019   0.181712762859   0.164143727644⎞
 ⎜−4.35419040647⎟  ⎜−0.157160718108   0.208318086983  −0.757894177948   0.597913453898⎟
e⎜3.29323039947 ⎟  ⎜ 0.669779412365  −0.681543232662  −0.110680937035   0.273210707991⎟
 ⎝0.22088829918 ⎠  ⎝ 0.271273492894   0.071915420233  −0.616706264784   −0.73546736662⎠
IsOrthogonal(U)
true
defuzz(U ⋅ diag(Λ) ⋅ U*)
⎛ 2  −2   6   1⎞
⎜−2   2   0   1⎟
⎜ 6   0   2   2⎟
⎝ 1   1   2   2⎠

See also