cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

## Symbolic and numeric bugs on one page  15-Moonstone

## Symbolic and numeric bugs on one page

I've met something very strange.... MC15 file is attached

1 ACCEPTED SOLUTION

Accepted Solutions  24-Ruby V
(To:ifomenko)

Just a suggestion to avoid the confusion - overlay the function "eigenvec" by a userdefined function: 7 REPLIES 7  16-Pearl
(To:ifomenko)

Your problem is probably related to the fact that the symbolic eigenvalues are listed in reverse order to those of the numeric eigenvalues. Alan  24-Ruby V
(To:ifomenko)

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:   15-Moonstone
(To:Werner_E)

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?  24-Ruby V
(To:ifomenko)

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.  24-Ruby V
(To:ifomenko)

Just a suggestion to avoid the confusion - overlay the function "eigenvec" by a userdefined function:   15-Moonstone
(To:Werner_E)

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.  21-Topaz II
(To:ifomenko)

Hi,

It should be noted that the procedure is valid only for symmetric matrices. 