eigenvalues of matrices and pencils
evals=spec(A) [R,diagevals]=spec(A) evals=spec(A,B) [alpha,beta]=spec(A,B) [alpha,beta,Z]=spec(A,B) [alpha,beta,Q,Z]=spec(A,B)
real or complex square matrix
real or complex square matrix with same dimensions as
A
real or complex vector, the eigenvalues
real or complex diagonal matrix (eigenvalues along the diagonal)
real or complex vector, al./be gives the eigenvalues
real vector, al./be gives the eigenvalues
real or complex invertible square matrix, matrix right eigenvectors.
real or complex invertible square matrix, pencil left eigenvectors.
real or complex invertible square matrix, pencil right eigenvectors.
returns in vector evals
the
eigenvalues.
returns in the diagonal matrix evals
the
eigenvalues and in R
the right
eigenvectors.
returns the spectrum of the matrix pencil A - s B, i.e. the roots of the polynomial matrix s B - A.
returns the spectrum of the matrix pencil A- s
B
,i.e. the roots of the polynomial matrix A - s
B
.Generalized eigenvalues alpha and beta are so that the
matrix A - alpha./beta B
is a singular matrix.
The eigenvalues are given by al./be
and if
beta(i) = 0
the ith eigenvalue is at infinity.
(For B = eye(A), alpha./beta
is
spec(A)
). It is usually represented as the pair
(alpha,beta), as there is a reasonable interpretation for beta=0,
and even for both being zero.
returns in addition the matrix R
of
generalized right eigenvectors of the pencil.
returns in addition the matrix L
and
R
of generalized left and right eigenvectors of
the pencil.
returns the matrix Z
of right
generalized eigen vectors.
returns the matrices Q
and Z
of right and left generalized
eigen vectors.
For big full / sparse matrix, you can use the Arnoldi module.
Matrix eigenvalues computations are based on the Lapack routines
DGEEV and ZGEEV when the matrix are not symmetric,
DSYEV and ZHEEV when the matrix are symmetric.
A complex symmetric matrix has conjugate offdiagonal terms and real diagonal terms.
Pencil eigenvalues computations are based on the Lapack routines DGGEV and ZGGEV.
It must be noticed that the type of the output variables, such as evals or R for example, is not necessarily the same as the type of the input matrices A and B. In the following paragraph, we analyse the type of the output variables in the case where one computes the eigenvalues and eigenvectors of one single matrix A.
Real A matrix
Symmetric
The eigenvalues and the eigenvectors are real.
Not symmetric
The eigenvalues and eigenvectors are complex.
Complex A matrix
Symmetric
The eigenvalues are real but the eigenvectors are complex.
Not symmetric
The eigenvalues and the eigenvectors are complex.
// MATRIX EIGENVALUES A=diag([1,2,3]); X=rand(3,3); A=inv(X)*A*X; spec(A) x=poly(0,'x'); pol=det(x*eye(3,3)-A) roots(pol) [S,X]=bdiag(A); clean(inv(X)*A*X) // PENCIL EIGENVALUES A=rand(3,3); [al,be,R] = spec(A,eye(A)); al./be clean(inv(R)*A*R) //displaying the eigenvalues (generic matrix) A=A+%i*rand(A); E=rand(A); roots(det(A-%s*E)) //complex case | ![]() | ![]() |