I've met something very strange....
MC15 file is attached
Solved! Go to Solution.
Your problem is probably related to the fact that the symbolic eigenvalues are listed in reverse order to those of the numeric eigenvalues.
To put it short - the problem is the different results you get when you evaluate R either symbolically or numerically:
The problem is a different handling of eigenvec in numerics and symbolics. As you possibly know the eigenvector for a given eigenvalue is not unique and numerics and symbolics chose different vectors for this. The numerics will always chose a unitvector but the symbolics doesn't.
So you get the correct result if you stay completely within symbolics
or if you stay completely within numerics:
Thank you all,
I know all these specific things about the differences between symbolic and numeric calculations.
Werner, you wrote, "The numerics will always chose a unitvector but the symbolics doesn't."
For this reason, I always use eigenvec(R, lambda) function instead of simple eigenvecs(R), the first one works well and returns unit vector.
But anyway, why two last numeric calculations gave a different results?
I always use eigenvec(R, lambda) function instead of simple eigenvecs(R), the first one works well and returns unit vector.
No!! Using eigenvec instead of eigenvecs gives you control about the order of the vectors (which is also differently in numerics and symbolics as Alan had pointed out), but eigenvec WILL NOT evaluate to a unitvector symbolically:
And thats the reason for all the confusion.
You define matrix R using the function eigenval(C,lambda). Now it depends upon if you evaluate R numerically or symbolically if you get the matrix you expect, the one where the columns are unit vectors.
If you evaluate R*C.l*R^T symbolically, R gets the wrong values and you get a wrong result.
Before the last numeric evaluation you assigned R the symbolic result and so consequently the numeric R*C.l*R^T is wrong, too.
Thank you very much, Werner!!!
I finally understood the problem: I always checked the norm of eigenvector numerically and got a unit. But it is not unit in symbolic case.