Analytically finding the roots of polynomials with symbolic variables

20 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Polynomials 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by