Integer eigenvalues in Matlab
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am trying to write a Matlab program which decides if a given (integer) matrix A has integer eigenvalues and if this is the case calculates the eigenvalues and their multiplicities. Any ideas how to get started?
0 Commenti
Risposte (3)
Bjorn Gustavsson
il 15 Ott 2021
Since you have a matrix and want the eigenvalues then the best approach seems to be to actually calculate the eigenvalues. For that use the eig function, see the corresponding help and documentation. For simple extraction of the eigenvalues on the diagonal of the eigenvalue-matrix if you also ask for the eigenvector-matrix have a look at the help and documentation of diag. Then you simply have to check if any of the returned eigenvalues are integers.
HTH
1 Commento
Walter Roberson
il 15 Ott 2021
The requirement seems to be to evaluate whether it could have integer eigenvalues first, and only calculate the actual eigenvalues if it turns out that they are possible.
Walter Roberson
il 15 Ott 2021
Take the symbolic determinant of (matrix minus lambda) . Ask to factor() that. Look for the entries of the form (lambda +/- integer)
If you are not permitted to factor the polynomial directly, then do a long division by lambda - x, which would give you a sequence of terms. But every one of the terms must be integer, so you might be able to start using the Euclid algorithm or a relative of it to try to construct integers that the terms could hold for (waving hands vaguely here.)
0 Commenti
Paul
il 15 Ott 2021
Asusming that "a given (integer) matrix A" means that you know the values of the elements of A, then you can just use eig on the symbolic form of the matrix:
M = sym([ 8, -1; 6, 3]);
e = eig(M)
isAlways(in(e,'integer')) % check in case it's not obvious from the solution.
M =sym([148544940, 4981764, -15351401, -3212785;
1508678, 105952055, 20746052, 8186704;
616678, -35314190, 162859163, 9445151;
5802184, 13354270, -16966896, 130282468]);
e=eig(M)
isAlways(in(e,'integer'))
I'm not sure that is "writing a program." If not, you could use it to compare to what you do write. I don't know how big symbolic M can get before eig() starts having trouble. i tested a 7 x 7 and it was no problem.
0 Commenti
Vedere anche
Categorie
Scopri di più su Linear Algebra in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!