I'm getting error as "First argument must be scalar" while finding roots of a 8 degree poynomial
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Matt J
le 3 Déc 2021
Modifié(e) : Matt J
le 3 Déc 2021
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 commentaires
Matt J
le 3 Déc 2021
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)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Linear Algebra dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!