Analytically finding the roots of polynomials with symbolic variables

21 ビュー (過去 30 日間)
Aleem Andrew
Aleem Andrew 2021 年 2 月 1 日
回答済み: James Tursa 2021 年 2 月 1 日
I am trying to solve a cubic equation with symbolic variables, but Matlab is not able to find an analytical solution.
syms a len
solve((35*len*a)/2 - 6125 == ((2*a - 35)^2*(60*a + 4200))/840, a)
ans =
root(z^3 + 35*z^2 - (7*z*((35*len)/2 + 1225/2))/2 + 42875, z, 1)
root(z^3 + 35*z^2 - (7*z*((35*len)/2 + 1225/2))/2 + 42875, z, 2)
root(z^3 + 35*z^2 - (7*z*((35*len)/2 + 1225/2))/2 + 42875, z, 3)
Can equations such as this be solved analytically in Matlab?

採用された回答

James Tursa
James Tursa 2021 年 2 月 1 日
Tell the solve( ) function that the max degree of the polynomial is 3 to force explicit solutions for the result:
syms a len
p = (35*len*a)/2 - 6125 - ((2*a - 35)^2*(60*a + 4200))/840
solve(p,a,'MaxDegree',3)
which gives
ans =
((245*len)/12 + 30625/36)/((((8575*len)/24 + 7674625/216)^2 - ((245*len)/12 + 30625/36)^3)^(1/2) - (8575*len)/24 - 7674625/216)^(1/3) + ((((8575*len)/24 + 7674625/216)^2 - ((245*len)/12 + 30625/36)^3)^(1/2) - (8575*len)/24 - 7674625/216)^(1/3) - 35/3
- ((245*len)/12 + 30625/36)/(2*((((8575*len)/24 + 7674625/216)^2 - ((245*len)/12 + 30625/36)^3)^(1/2) - (8575*len)/24 - 7674625/216)^(1/3)) - (3^(1/2)*(((245*len)/12 + 30625/36)/((((8575*len)/24 + 7674625/216)^2 - ((245*len)/12 + 30625/36)^3)^(1/2) - (8575*len)/24 - 7674625/216)^(1/3) - ((((8575*len)/24 + 7674625/216)^2 - ((245*len)/12 + 30625/36)^3)^(1/2) - (8575*len)/24 - 7674625/216)^(1/3))*1i)/2 - ((((8575*len)/24 + 7674625/216)^2 - ((245*len)/12 + 30625/36)^3)^(1/2) - (8575*len)/24 - 7674625/216)^(1/3)/2 - 35/3
- ((245*len)/12 + 30625/36)/(2*((((8575*len)/24 + 7674625/216)^2 - ((245*len)/12 + 30625/36)^3)^(1/2) - (8575*len)/24 - 7674625/216)^(1/3)) + (3^(1/2)*(((245*len)/12 + 30625/36)/((((8575*len)/24 + 7674625/216)^2 - ((245*len)/12 + 30625/36)^3)^(1/2) - (8575*len)/24 - 7674625/216)^(1/3) - ((((8575*len)/24 + 7674625/216)^2 - ((245*len)/12 + 30625/36)^3)^(1/2) - (8575*len)/24 - 7674625/216)^(1/3))*1i)/2 - ((((8575*len)/24 + 7674625/216)^2 - ((245*len)/12 + 30625/36)^3)^(1/2) - (8575*len)/24 - 7674625/216)^(1/3)/2 - 35/3

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFormula Manipulation and Simplification についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by