问题
While using sympy
(current version) to solve an polynomial equation (polynom would be d² in this case):
from sympy import solve_poly_system
solve_poly_system(4*d**2*sin(a)**2*sin(b)/cos(b)**2 - d*cos(a) + 4, d**2*sin(a)**2*sin(b)/cos(b)**2 - d*cos(a) + 8, 3*d**2*sin(a)**2*sin(b)/cos(b)**2 - d*cos(a) + 3 ,d ,a, b)
I receive the following error:
PolynomialError: cos(a) contains an element of the generators set
What is the exact meaning of this error message. And why does it specifically points to the expression cos(a)?
回答1:
solve_poly_system
can only solve polynomial systems of equations. Since your equations have cos(a)
, they are not polynomials in a
.
来源:https://stackoverflow.com/questions/35252476/sympy-polynomialerror-cosa-contains-an-element-of-the-generators-set