Why does EIG not return normalized eigenvectors when the input is a symbolic matrix in Symbolic Math Toolbox?

When EIG is called with a symbolic matrix it does not return the normalized eigenvectors.
For example, when I execute the following commands:
x= [1 2 3;1 2 3;1 2 3];
xsym =sym(x)
[a,b] = eig(x)
[c,d] = eig(xsym)
The columns of a are normalized eigenvectors (i.e. their norm is 1). This is not the case for the columns of c.

 Accepted Answer

The function EIG is overloaded in the Symbolic Math toolbox. When the input argument to the function EIG is symbolic, it is this function that is being called. The documentation for this function can be accessed by typing
doc symbolic/eig
at the MATLAB command prompt. When you access the documentation for the EIG function in base MATLAB by typing
doc eig
at the MATLAB command prompt, a message is displayed stating this function is overloaded in the Symbolic Math Toolbox.
The algorithms used by the two EIG functions are not the same. In particular, the algorithm used by the symbolic EIG function is not designed to return the normalized eigenvectors.
If your symbolic matrix contains no symbolic variables and you wish to get normalized eigenvectors, you can use the VPA function in conjunction with the EIG function.
A = sym([2 1; 1 2])
[V,D] = eig(vpa(A))

1 Comment

The symbolic representation of eigenvectors is already pretty complicated. Dividing by the norm() of the result would be even more complicated. Considering that eigenvectors can be scaled by arbitrary non-zero constant, it is far from clear that it is beneficial to routinely do the normalization.
If your calculation depends upon the eigenvectors being normalized, then normalize them in a post step.

Sign in to comment.

More Answers (0)

Categories

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!