2

I am trying to calculate the symbolic eigenvalues and vectors of matrices of the form

[ a, c, 0]
[ c, b, e]
[ 0, e, f]

in matlab (replace a,b,c etc with some expressions containing x, y, z). When I have 4 off diagonal terms 0 then the program is succesful. But when the matrix has only two off diagonal elements zero (like as in the example), the program fails to find eigenvectors but can find eigenvectors (which is expected since it is third degree polynomial). The expression for the eigenvalues is ofcourse quite hectic. And when I try to calculate eigenvectors it gives the error

Warning: basis of eigenspace for eigenvalue - 1/2*((c^2*d^2*e^2 -...
Error: Unable to find eigenvectors. [mleigenvectors]
Error in ==> sym.eig at 74
S = mupadfeval('mleigenvectors',A);

I am using matlab R2009a. Is this a problem that can be solved by for instance R2009b or better servers or it is just to many calculations to try? This does not seem plausible to me since if you take the above matrix subtract LI (where K is for eigenvalue I is id matrix) from it and try to solve the eigenvector equation, you can even solve it by hand to get expressions containing L, a,b,c,e,f,g. Then what you have to do is to simply put in expressions for lambda. However ofcourse the result will be very long so I am wondering if this is some memory issue?

Thanks

Sina
  • 401
  • 5
  • 12
  • 1
    Not an answer, just a point of comparison. Mathematica solved the identical eigenvector problem in a fraction of a second. – Colin T Bowers Nov 29 '12 at 11:18
  • nasser I tried using the exact code line you have put but it does not work gives the same error. are you by chance using 64bit operating system? well maple seems to also to be able to calculate. however it is my first time using maple I find symbolic computation to be really frustrating. It will deny finding eigenvectors if matrices containing exponential functions because the function is not algebraic... I will see if I can find a computer with matlab 2012b. – Sina Nov 29 '12 at 12:58
  • yes it is very easy and convinient to use. the other ones are very twitchy and unhelpful about syntax. But in case it is incapable but mine is 32bit so maybe I will try it on 64 bit machine – Sina Nov 30 '12 at 11:06
  • okay I will try to find a one with 64bit memory. In another computer it gives the error: Error using mupadmex Error in MuPAD command: Out of memory. Evaluating: stdlib::normalNoExpand – Sina Nov 30 '12 at 12:02

1 Answers1

0

I tested in 2012a and 2010a 32bit, both worked nicely.

Interestingly, 2012a took 0.2s, while 2010a took 0.3s. If the following doesn't work I'd suspect an internal bug since they do update the symbolic handling heavily.

tic; syms a c b e f; A=[a c 0;c b e;0 e f]; [V,D]=eig(A); toc;

A search confirms this is a problem in 2008...

http://www.mathworks.com/matlabcentral/newsreader/view_thread/263921

Actuall Steven, in this case, the polynomials does simplify to cubics. Matlab symbolic does find the eigenvalues ok, but it fails on the eigenvectors (using my Matlab 2008b)

EDU>> values=eig(A); EDU>> simplify(values)

ans =

(too long to show)

But vectors fail:

EDU>> [vectors,values]=eig(A); Warning: basis of eigenspace for eigenvalue 1/3*a + 1/3*b + 1/3*c + (4/9*a^2 - 1/9*a*b - 1/9*a*c + 1/9*b^2 + 2/9*b*c + 1/9*c^2)/(4/9*a*b^2 + 1/9*a^2*b - 1/18*a*c^2 + 1/9*a^2*c - 7/18*b*c^2 + 1/9*b^2*c - 8/27*a^3 + 1/27*b^3 + 1/27*c^3 + (- 1/3*a^4*b^2 - 10/27*a^4*b*c - 1/27*a^4*c^2 + 1/9*a^3*b^3 + 2/9*a^3*... [linalg::eigenvectors] ??? Error using ==> mupadfeval at 28 Error: Unable to find eigenvectors. [mleigenvectors]

Error in ==> sym.eig at 74 S = mupadfeval('mleigenvectors',A);

I tried the same on Mathematica, and it finds the eigenvectors, (which I assume they are correct ;), here is the result (too large to post here also)

ccook
  • 5,869
  • 6
  • 56
  • 81