Analytically finding the roots of polynomials with symbolic variables

22 vues (au cours des 30 derniers jours)
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?

Réponse acceptée

James Tursa
James Tursa le 1 Fév 2021
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

Plus de réponses (0)

Catégories

En savoir plus sur Formula Manipulation and Simplification 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!

Translated by