MATLAB Matlab eigenvectors of symbolic matrix not working

AI Thread Summary
Finding eigenvectors of symbolic matrices in MATLAB can yield inconsistent results, particularly with non-standard rotation matrices. While the eigenvectors and eigenvalues work for a typical 3x3 rotation matrix, errors arise when using matrices that do not rotate about a unit axis. The specific error indicates that MATLAB's symbolic toolbox struggles to compute explicit eigenvectors for certain configurations. Alternatives such as Maple or Wolfram Alpha are suggested for handling these symbolic calculations more effectively. Users experiencing similar issues should consider these alternatives for better results.
Maxong091
Messages
4
Reaction score
0
Hi all,

I'm trying to find the eigenvectors of a symbolic 3x3 rotation matrix in MATLAB, it appears to work for some inputs but not all, for example:

A =[ cos(q), -sin(q), 0]
[ sin(q), cos(q), 0]
[ 0, 0, 1]

[V,lambda]=eig(A)

V =[ 0, -i, i]
[ 0, 1, 1]
[ 1, 0, 0]

lambda =[ 1, 0, 0]
[ 0, cos(q) - sin(q)*i, 0]
[ 0, 0, cos(q) + sin(q)*i]

this works fine, however if I try something which is not a rotation about a unit axis I get the following error:

A =[ cos(q), -sin(q), 0]
[ 0, 0, -1]
[ sin(q), cos(q), 0]

>> [V,lambda]=eig(A)
Warning: basis of eigenspace for eigenvalue cos(q)/3 - (cos(q)^2/3 + cos(q)^3/27 + sin(q)^2/2 + ((cos(q)/3 - cos(q)^2/9)^3 +
(cos(q)^3/27 + cos(q)^2/3 + sin(q)^2/2)^2)^(1/2))^(1/3)/2 + (cos(q)/3 - cos(q)^2/9)/(2*(cos(q)^2/3 + cos(q)^3/27 + sin(q)^2/2 +
((cos(q)/3 - cos(q)^2/9)^3 + (cos(q)^3/27 + cos(q)^2/... [linalg::eigenvectors]
? Error using ==> mupadmex
Error in MuPAD command: Unable to find explicit eigenvectors.

Error in ==> sym.sym>sym.mupadmexnout at 2003
out = mupadmex(fcn,args{:});

Error in ==> sym.eig at 68
[V,D,p] = mupadmexnout('mllib::eigenvectors',A);


Any help would be appreciated
Thanks
Max
 
Physics news on Phys.org
Back
Top