Complex representation of eigenvalues of a symbolic 2x2 matrix
2 views (last 30 days)
Show older comments
Creating following matrix
syms a
A = [0, 1;
-1, 2*cos(a)];
and taking out its eigenvalues
lambda = eig(A)
the result I get is
lambda =
cos(a) + ((cos(a) - 1)*(cos(a) + 1))^(1/2)
cos(a) - ((cos(a) - 1)*(cos(a) + 1))^(1/2)
but I expect to see
lambda =
cos(a) + sin(a)*1i
cos(a) - sin(a)*1i
What should I do?
0 Comments
Answers (2)
Star Strider
on 9 Oct 2021
This is likely as close as it is possible to get —
syms a
A = [0, 1;
-1, 2*cos(a)];
lambda = eig(A)
lambda = simplify(rewrite(lambda, 'sin'), 500)
.
0 Comments
Paul
on 9 Oct 2021
Is the expected result obtained only when a is real?
syms a
A = [0, 1;
-1, 2*cos(a)];
lambda = rewrite(simplify(eig(A),100),'sin')
simplify(lambda)
Now add the additional assumption on a:
assume(a,'real')
simplify(lambda)
0 Comments
See Also
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!