特征多项式的根和特征值不相同 [英] The roots of the characteristic polynomial and the eigenvalues are not the same
本文介绍了特征多项式的根和特征值不相同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是矩阵B
B = [1 2 0 ; 2 4 6 ; 0 6 5]
eig(B)
的结果是:
{-2.2240, 1.5109, 10.7131}
和此链接的B
的特征多项式是
syms x
polyB = charpoly(B,x)
x^3 - 10*x^2 - 11*x + 36
但是solve(polyB)
的答案是
133/(9*(3^(1/2)*5492^(1/2)*(i/3) + 1009/27)^(1/3)) + ((3^(1/2)*5492^(1/2)*i)/3 + 1009/27)^(1/3) + 10/3
(3^(1/2)*(133/(9*(3^(1/2)*5492^(1/2)*(i/3) + 1009/27)^(1/3)) - ((3^(1/2)*5492^(1/2)*i)/3 + 1009/27)^(1/3))*i)/2 - 133/(18*(3^(1/2)*5492^(1/2)*(i/3) + 1009/27)^(1/3)) - ((3^(1/2)*5492^(1/2)*i)/3 + 1009/27)^(1/3)/2 + 10/3
10/3 - 133/(18*(3^(1/2)*5492^(1/2)*(i/3) + 1009/27)^(1/3)) - ((3^(1/2)*5492^(1/2)*i)/3 + 1009/27)^(1/3)/2 - (3^(1/2)*(133/(9*(3^(1/2)*5492^(1/2)*(i/3) + 1009/27)^(1/3)) - ((3^(1/2)*5492^(1/2)*i)/3 + 1009/27)^(1/3))*i)/2
我不知道它是什么,但我希望它是B
的特征值.有什么问题吗?
which I don't know what it is while I expect it to be the eigenvalues of B
. What is the problem?
推荐答案
我不明白为什么要添加x
和符号数学,它们不是您的任务所必需的.
I do not understand why you add x
and symbolic maths, they are not required for your task.
B = [1 2 0 ; 2 4 6 ; 0 6 5]
cp=charpoly(B)
eig2=roots(cp)
返回:
eig2 =
10.7131
-2.2240
1.5109
但是,如果出于某种原因您坚持使用符号(对于数字任务则不应使用),则可以这样做
However, if for some reason you insist in using symbolic (which you should not for a numerical task), you can do
double(solve(polyB))
ans =
10.7131 + 0.0000i
-2.2240 - 0.0000i
1.5109 - 0.0000i
(注意虚部为零)
这篇关于特征多项式的根和特征值不相同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文