Why Matlab/Mupad ignores absolute value when multiplying complex conjugate expressions

9 vues (au cours des 30 derniers jours)
Hello everyone,
Recently, I recognized that Matlab (as well as Mupad) ignores to take the absolute value when multiplying a variable with its complex conjugate. I'm currently trying to calculate the eigenvalues of an 4 x 4 Hermitian matrix and I believe that this issue results in wrong eigenvalues. Take for example the matrix (now in Mupad):
assume(x, Type::Real)
M := matrix([[0,conjugate(I*x),0,0], [I*x,0,0,0], [0,0,1,conjugate(I*x)], [0,0,I*x,1]])
then the eigenvalues from Mupad are linalg::eigenvalues(M) => {x, 1-x, -x, x+1}. That's wrong! It should be: {|x| 1-|x|, -|x|, x+1}.
Can anyone help ? Thanks.
Best regards
Bernhard
  3 commentaires
Bernhard Ihrig
Bernhard Ihrig le 10 Août 2015
Modifié(e) : Bernhard Ihrig le 10 Août 2015
Thanks for your comment Torsten. However, the problem with the matrix remains, because it seems that Mupad calculates sqrt(x^2) = x (?). If you calculate the eigenvalues of the example matrix M by hand, you will see what I'm intending to say, hopefully.
Best regards
Bernhard
Torsten
Torsten le 10 Août 2015
As eigenvalues of M I get: x, -x, 1-x and x-1.
Best wishes
Torsten.

Connectez-vous pour commenter.

Réponse acceptée

Steven Lord
Steven Lord le 10 Août 2015
If x is -1, then the eigenvalues returned by MuPAD are -1, 2, 1, 0. The eigenvalues you expected are 1, 0, -1, 2 (assuming you meant |x|+1 as your last expression.) They're the same, just in a different order.
More generally, since both |x| and -|x| are eigenvalues in your list of expected eigenvalues and you told MuPAD it can assume x is real, that's the same as including x and -x in the list of eigenvalues. They'll just be listed in a different order if x is negative. Similarly for real x, 1-|x| and 1+|x| are the same as 1-x and 1+x, just in a different order if x is negative.
Now if you assumed x was Type::Complex, and called:
simplify(linalg::eigenvalues(M))
then the sets {|x|, -|x|} and {x, -x} are NOT necessarily the same but in a different order. In that case, MuPAD knows it cannot eliminate the absolute value signs, and indeed when I make that modification to your assume call the results do include the absolute value signs.
  1 commentaire
Bernhard Ihrig
Bernhard Ihrig le 10 Août 2015
Hello Steven,
many thanks for your answer. For me it appears still weird, but hopefully I will now get the right eigenvalues.
Best regards
Bernhard

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Linear Algebra dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by