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

채택된 답변

Matt J
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
Apurva Suman
Apurva Suman 2021년 12월 3일
yes ,i realized that
Thanks.
Actually this is what i'm trying to do ,I need x = function of all other terms;
i.e an explicit solution for x
is it possible?
because with this i'm getting a 8 degree equation , even if i neglect higher order terms to get the roots ,i'm not getting satisfactory answer, i need x as a function of almost all other terms(i.e K A B C R) or at least 2 of them
Note: x will have a very small value, upto x^3 its not neglibile but terms with power above than that can be neglected
syms K A B C x R
eqn = ( ( (R^2)*K*( A - B - (C/R*(1- x)) )*((x^3)/(1-x)) )^2 ) == R*(1- x) ;
SS = solve(eqn,x,'MaxDegree',2,"ReturnConditions",true);
Matt J
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)
ans = 

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by