Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Eigenvalues of 12*12 symbolic matrix

  1. Feb 14, 2013 #1
    Hi dear friends
    I have a 12*12 symbolic matrix in terms of x y z d that I want its eigenvalues
    but not mathematica nor matlab can do it for me.My mathematica is "7" so If you have a newer version or even in matlab , would you mind checking my matrix in your software?
    this is my matrix in mathematica and matlab:

    Attached Files:

  2. jcsd
  3. Feb 14, 2013 #2
    In[1]:= LeafCount[Eigenvalues[{{a,b},{c,d}}]]
    Out[1]= 55

    In[2]:= LeafCount[Eigenvalues[{{a,b,c},{d,e,f},{g,h,i}}]]
    Out[2]= 268

    In[3]:= LeafCount[Eigenvalues[{{a,b,c,d},{e,f,g,h}, {i,j,k,l},{m,n,o,p}}]]
    Out[3]= 1657

    In[4]:= LeafCount[Eigenvalues[{{a,b,c,d,e},{f,g,h,i,j}, {k,l,m,n,o},{p,q,r,s,t},{u,v,w,x,y}}]]
    Out[4]= 11916

    In[5]:= LeafCount[Eigenvalues[{{a,b,c,d,e,f}, {g,h,i,j,k,l},{m,n,o,p,q,r},{s,t,u,v,w,x}, {y,z,a1,b1,c1,d1},{e1,f1,g1,h1,i1,j1}}]]
    Out[5]= 97411

    In[6]:= Fit[Map[Log,{55,268,1657,11916}],{1,x},x]
    Out[6]= 2.1100 + 1.7957*x

    In[7]:= Show[Plot[2.1100+1.7957 x,{x,1,5}],ListPlot[Map[ Log,{55,268,1657,11916,97411}], Joined->True]]
    Out[7]= ...plotSnipped...

    In[8]:= E^(2.1100+1.7957 x)/.x->12
    Out[8]= 1.8817*10^10

    So for this somewhat simpler approximation of an n by n symbolic matrix the number of elements making up the eigenvalues grows just a bit faster than E^(2.11+1.8x) and thus you would have about 18 billion elements making up the result.

    Now your matrix is "banded" and has some zeros, which will help, but probably not enough. You could try replacing all your 2d/3 by d and each of your unique -2 Cos functions by other simple fabricated variables. That might reduce the size of your task by perhaps a factor of 3 or 4. But even if your zeros and banding help more than I expect, I doubt your result will have less than a billion elements. Maybe with 64 gigabytes of memory and unlimited time you might get an answer to the simplified problem, but that is just a guess and I would not be surprised if I were wrong.
  4. Feb 15, 2013 #3
    thanks for your help But I made it more simplify by renaming identical elements and matrix became in the form of below:
    but still mathematica cannot calculate its eigenvalues.please help me !

    Attached Files:

  5. Feb 15, 2013 #4
    Did you try this on a computer with 64 gigabytes of memory?

    Did you try solving this problem for 8x8 and 9x9 and 10x10 matricies and use the Mathematica function MaxMemoryUsed[] with a fresh start for each of your smaller problems. See how much memory is needed for the smaller problems and how this is growing and whether you can then estimate how much memory will be needed for the 12x12 matrix. With the banding of your matrix I am not sure how to use smaller matricies and still get memory measurements that will correctly estimate what your 12x12 matrix will require.
    Last edited: Feb 15, 2013
  6. Feb 15, 2013 #5
    Sorry but what do you mean by computer with 64 gigabytes of memory?

    and also generally in calculating eigenvalues forexample for 4*4 symbolic matrix, mathematica gives "ROOT[......]" so what should I do for solving these roots and arrive to my eigenvalues?
    Last edited: Feb 15, 2013
  7. Feb 15, 2013 #6
    If you have an old or inexpensive computer you may only have 256 megabytes of memory. If you have a newer or better computer you may have one gigabyte or two gigabytes of memory. Your eigenvalue calculation will have billions of terms in the result. So I asked if you were able to use a computer that does not have one or two gigabytes of memory, but instead to use one with 64 or 128 gigabytes of memory. Perhaps that will be enough to be able to calculate your result.

    Now Root[]. Cubic and quartic equations, those with x^3 or x^4 in them and you want to find all the roots, are sometimes very large. Mathematica will sometimes give you a smaller way of displaying the result. It will give Root[equation, 1] for the "first" root of the equation and Root[equation, 2] for the "second" root, etc. These are usually much smaller and sometimes you can see the information you need from this.

    If you want to see all the details of what each root is you can try ToRadicals[Root[equation,1]] and see if it can display the solution you wish. Here is the documentation on this.


    It is possible that there is no way for ToRadicals to find what you want.
  8. Feb 15, 2013 #7
    thanks but my pc is new with core i 7 and 8gig ram and 500gig memory but still it cannot give its eigenvalues! I really dont Know how can I solve my problem anymore !
  9. Feb 15, 2013 #8
    In[2]:= aa = a //. {(2*d)/3 -> d, (-2*d)/3 -> -d, -2*Cos[(x + z)/4] -> -e, -2*Cos[(y + z)/4] -> -f, -2*Cos[(x + y)/4] -> -g, -2*Cos[(x - y)/4] -> -h, -2*Cos[(y - z)/4] -> -i, -2*Cos[(x - z)/4] -> -j}

    Out[2]= {
    {d, d, d, -e, 0, 0, -f, 0, 0, -g, 0, 0},
    {d, d, d, 0, -e, 0, 0, -f, 0, 0, -g, 0},
    {d, d, d, 0, 0, -e, 0, 0, -f, 0, 0, -g},
    {-e, 0, 0, d, -d, -d, -h, 0, 0, -i, 0, 0},
    {0, -e, 0, -d, d, d, 0, -h, 0, 0, -i, 0},
    {0, 0, -e, -d, d, d, 0, 0, -h, 0, 0, -i},
    {-f, 0, 0, -h, 0, 0, d, -d, d, -j, 0, 0},
    {0, -f, 0, 0, -h, 0, -d, d, -d, 0, -j, 0},
    {0, 0, -f, 0, 0, -h, d, -d, d, 0, 0, -j},
    {-g, 0, 0, -i, 0, 0, -j, 0, 0, d, d, -d},
    {0, -g, 0, 0, -i, 0,0, -j, 0, d, d, -d},
    {0, 0, -g, 0, 0, -i, 0, 0, -j, -d, -d, d}}

    In[3]:= aaa=Eigenvalues[aa];

    There you have it, the eigenvalues, but not printed out. How big is it?

    In[4]:= LeafCount[aaa]
    Out[4]= 424921

    In[5]:= aaa[[1]]
    Out[5] = stunninglyHugeRootObject and there are 11 more of those

    I am astonished it was able to complete. I did not believe this could be done.
    Please check all this very carefully to make certain I have made no errors.
    With your computer you should easily be able to reproduce this.
    Then you have to understand the twelve roots of this huge polynomial.
    There may or may not be a solution in radicals for these.
    Last edited: Feb 15, 2013
  10. Feb 16, 2013 #9
    Really thanks for your complete guidence
    But how can understand the twelve roots of this huge polynomial? by ToRadicals of aaa[[1]] ?
    thank you alot
  11. Feb 16, 2013 #10
    I do not believe ToRadicals[aaa[[1]]] will be able to find a solution for you, but you can try it and see what happens. Or perhaps there is some other method to at least partly factor the result. Or perhaps there are common subexpressions that appear several times in the large polynomial and you can see some meaning in those. Perhaps there is something about your original problem that will tell something about the polynomial. But it is so large that I believe it will be very difficult for you to make any sense of.
  12. Feb 16, 2013 #11


    User Avatar
    Science Advisor
    Homework Helper

    Assuming Out[2] in post #8 is correct, this has a huge amount of internal structure. You only need to diagonalize the 3x3 diagonal blocks to make it effectively a 4x4 symmetric matrix where each "element" is a 3x3 diagonal matrix.

    Doing something along those lines will probably give you a lot more understanding than getting "the answer" by brute force.
  13. Feb 16, 2013 #12
    yes you are right my matrix is infact a 4*4 matrix where each "element" is a 3x3 diagonal matrix
    But I have one question
    If I diagonalize each of 16 blocks seperately and then put them in the matrix and after obtaining a symmetric matrix,find its eigenvalues, does this procces preserve the form of first matrix eigenvalues? I mean the finall symmetric matrix will have the same eigenvalues of the first matrix?

  14. Feb 16, 2013 #13
    http://math.fullerton.edu/mathews/n2003/QRMethodMod.html [Broken]
    Last edited by a moderator: May 6, 2017
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook