How to find a complex eigenvalue of a matrix
Mostrar comentarios más antiguos
I want to find the highest complex eigenvalue of a matrix A. For example:
lambda = eig(A)
I'll get:
lambda =
2.6955 + 0.0000i
-1.1216 + 3.9723i
-1.1216 - 3.9723i
-1.7535 + 0.0000i
-0.1240 + 2.2553i
-0.1240 - 2.2553i
When I do:
[lambda_max, index_max] = max(real(lambda))
I'll get:
lambda_max =
2.6955
While I would like to have
-0.1240
How can I do this?
(sometimes the imaginairy part of complex eigenvalues can be zero)
10 comentarios
Walter Roberson
el 17 de Dic. de 2019
Why would you select that one? It does not have the most positive real component; it does not have the most positive imaginary component; it does not have the greatest absolute value; it does not have the least absolute value; it does not have the most negative real component; it does not have the most negative imaginary component.
To the extent that complex numbers can be said to be ordered, you would expect to pick out -1.1216 +/- 3.9723i which has an absolute value greater than 4, whereas the one you picked out has an absolute value less than 3.
MM
el 17 de Dic. de 2019
Walter Roberson
el 17 de Dic. de 2019
I want the largest real value of complex conjugates
Are you saying that you would discard the entries 2.6955 + 0.0000i and -1.7535 + 0.0000i because they are not part of a complex conjugate pair, and that once those are discarded, you would select -0.1240 +/- 2.2553i instead of -1.1216 +/- 3.9723i because -0.1240 > -1.1216 ?
MM
el 17 de Dic. de 2019
Walter Roberson
el 17 de Dic. de 2019
Yes, but seeing you questioning this, do you think I make some kind of mistake here?
The fault with your existing code is that you are not discarding the elements that are not complex conjugates.
Hmmm... let me see...
[real(lambda(:)), abs(imag(lambda(:)))]
If you were then to uniquetol() with 'byrows' and take the third output, that would be a grouping variable. You would look for duplicated grouping variables... Mumble, mumble, splitapply(@(V) {V}, lambda(:), Grouping_Variable) then throw away the entries with length 1 ?
MM
el 17 de Dic. de 2019
Walter Roberson
el 17 de Dic. de 2019
You cannot use == for this purpose, as you cannot be sure that the conjugates are bitwise identical except for sign. I mentioned uniquetol() rather than unique() in order to permit "close" values.
MM
el 18 de Dic. de 2019
Steven Lord
el 18 de Dic. de 2019
I think the cplxpair function may be of interest to you in making sure the complex conjugate pairs are grouped together.
Walter Roberson
el 18 de Dic. de 2019
lambda = [
2.6955 + 0.0000i
-1.1216 + 3.9723i
-1.1216 - 3.9723i
-1.7535 + 0.0000i
-0.1240 + 2.2553i
-0.1240 - 2.2553i];
[uniquegroups, ~, group] = uniquetol([real(lambda), abs(imag(lambda))], 'byrows', true);
groupcounts = accumarray(group, 1);
maxeigreal = max(real(uniquegroups(groupcounts>1,:)));
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Linear Algebra en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!