I'm getting error as "First argument must be scalar" while finding roots of a 8 degree poynomial
조회 수: 5 (최근 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!