I'm getting error as "First argument must be scalar" while finding roots of a 8 degree poynomial
1 次查看(过去 30 天)
显示 更早的评论
root([2*A*B*K^2 - B^2*K^2 - A^2*K^2, - 4*A*B*K^2*R + 2*B^2*K^2*R + 2*A^2*K^2*R + 2*B*C*K^2 - 2*A*C*K^2, - 2*B*C*K^2*R + 2*A*C*K^2*R + 2*A*B*K^2*R^2 - B^2*K^2*R^2 - A^2*K^2*R^2 - C^2*K^2, -1, + 5*R, - 10*R^2, + 10*R^3, -5*R^4, R^5])
%this is what i'm doing , actually i needed all real roots in terms of variables, but i'm getting error that says first argument must be scalar
0 个评论
采纳的回答
Matt J
2021-12-3
编辑:Matt J
2021-12-3
You have 2 problems.
First, you are trying to find analytical expressions for the roots of an 8-degree polynomial, which is mathematically impossible.
Second, you are confusing the syntaxes of the two different commands root() and roots(). You can find the roots of an 8-degree polynomial with the roots() command, but not with symbolic input variables.
2 个评论
Matt J
2021-12-3
x will have a very small value, upto x^3 its not neglibile but terms with power above than that can be neglected
But all of the polynomial coefficientsterms below x^5 depend on R only:
syms K A B C x R
P= ( ( (R^2)*K*( A - B - (C/R*(1- x)) )*((x^3)/(1-x)) )^2 ) - R*(1- x) ;
P=simplify( simplifyFraction(P*(x - 1)^2),'Steps',5);
Coeffs=coeffs(P,x,'All');
Coeffs(end-5:end)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Algebra 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!