0
|
6466 Views
|
11 Replies
|
0 Total Likes
View groups...
Share
GROUPS:

# how to diagonolize this matrix?

Posted 9 years ago
 m = {{0, 0, w}, {0, t, -w}, {w, -w, r}}  use equation P^(?1)A P, how to obtain P with Mathematica? Thanks!
11 Replies
Sort By:
Posted 9 years ago
 Hello everyone!Actually I used the answer from another friend (as he wrote):{vals, vects} = Eigensystem[m = {{0, 0, w}, {0, t, -w}, {w, -w, r}}, Cubics -> True];P = Transpose@vects; By the way, it is really confused for a beginner of mathematica to get familiar with something like this:'Root[-q^2 v + s^2 v + 2 s t v + t^2 v + 4 q^2 w + (q^2 - s^2 - 2 s t - t^2 + 2 q v - 4 q w) #1 + (-2 q - v) #1^2 + #1^3 &, 1]'
Posted 9 years ago
 I did this one by hand and had to complete the square to get two of the eigenvalues. You wind up with a polynomial in t and can move the m variable to the other side. Then you complete the square to get (Lambda by itself). The answer is a mess and I cannot see how you can work with this answer or how mathematica can know you have to complete the square. I do not know how the program works to do this, but I cannot see mathematica doing this. The eigenvalues have at the least three terms in them. I could not see trying to find the eigenvectors since the eigenvalues have three terms in them. I have never seen a problem like this come up in a real life situation. Even for Electromagnetism the B and E values are a tensor so you do not run into this problem.
Posted 9 years ago
 If you want to see a (very large) solution in terms of radicals, try Eigensystem[mat[t, w, r],Cubics->True]
Posted 9 years ago
 Problems like this arise all over the place. A 3 by 3 matrix is not that unusual. In the general case Mathematica presumably uses the general solution to the cubic. One can do it, similarly, by hand by taking down one's trusty dog-eared copy of Abramowitz & Stegun and plug in the values: http://people.math.sfu.ca/~cbm/aands/page_17.htm
Posted 9 years ago
 I gather that you are looking to diagonalize your matrix using a similarity transform. One approach is to use the SingularValueDecomposition function in Mathematica:http://reference.wolfram.com/language/ref/SingularValueDecomposition.htmlAnalytically, since the eigenvalue problem requires solving a cubic, the expressions in the symbolic case will involve Root expressions... they can be converted to analytical expressions using ToRadicals.However, assuming your parameters are real here is an equivalent approach. I am changing some of your notation to make things clear.First define a function to generate your matrix in general: mat[t_, w_, r_] := {{0, 0, w}, {0, t, -w}, {w, -w, r}} You can find the symbolic expressions for the eigenvalues and eigenvectors using something like Eigensystem[mat[t, w, r]] and you can change the Root objects to algebraic expressions using, for example, FullSimplify[ ToRadicals[Eigensystem[mat[t, w, r]]], {t \[Element] Reals, w \[Element] Reals, r \[Element] Reals}] However, to illustrate the diagonalizatoin process let's play with numerical values. Let's first create a random example of your matrix: testMatrix = mat[Random[], Random[], Random[]] Now generate the eigenvalues and eigenvectors for this matrix using eigens=Eigensystem[testMatrix] The similarity transform is the matrix of eigenvectors pMatrix = eigens[[2]] and you can see this by executing pMatrix.testMatrix.ConjugateTranspose[pMatrix] // Chop the Chop is there to remove machine number leftovers.This is also the same as pMatrix.testMatrix.Inverse[pMatrix] // Chop The same set of computations can (more generally) be done using SingularValueDecomposition.And I see that Ivan Morozov pointed you to JordanDecomposition, which is, of course, a simpler path... ;-)
Posted 9 years ago
 SVD is not really a similarity transform. The left and right m,ultipliers are not in general related.Eigensystem is the function for this. JordanDecomposition can be used to get one as close as possible, in cases where the matrix is not diagonalizable.
Posted 9 years ago
 Hi, Kouhei,Use JordanDecomposition[] function, here is a simple example: M = {{-1, 3, -1}, {-3, 5, -1}, {-3, 3, 1}} ; {P, A} = JordanDecomposition[M] ; A P.A.Inverse[P] I.M.
Posted 9 years ago
 You gave the matrix in Wolfram Language syntax, a good start. Your question is not completely clear. An equation has one side equal to the other side. Did you mean m == P^(?1) A P What is A?
Posted 9 years ago
 He is trying to diagonalize a matrix. In his format A would be the original matrix. P would be the matrix with the eigenvectors in it and inverse P is the inverse of the P matrix. I could not even get mathematica to give me the eigenvalues of this matrix, which would also be the values along the diagonal, since P^(?1)A P=(The diagonal eigenvalues). Numbers work but with letters, mathematica gives back answers that does not make sense. If he could just get the eigenvalues, that would be all he would need. If the original matrix does not have an inverse then it cannot be diagonalized.
Posted 9 years ago
 Take a look at my examples below. Mathematica does give eigenvalues in terms of Root objects which can be converted to algebraic expressions using ToRadicals.
Posted 9 years ago
 Thanks, I want to also know how to do this in mathematica. By hand it would take a long time, because we are working with letters and not numbers. I want to learn more about mathematica.