sympy: PolynomialError: cos(a) contains an element of the generators set

让人想犯罪 __ 提交于 2019-12-11 10:44:42

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!