我正在尝试使用 SymPy 在 python 中求解一个方程。我有一个生成的方程(类似于function = y(8.0-(y**3.0))
我使用 SymPy 来创建一个像这样的新方程:eq = sympy.Eq(function, 2)
输出y(8.0-(y**3.0)) == 2
. 但sympy.solve(eq)
似乎不起作用。
>>> from sympy import Eq, Symbol as sym, solve
>>> y = sym('y')
>>> eqa = Eq(y(8.0-(y**3.0)), 8)
>>> solve(eqa)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/pymodules/python2.6/sympy/solvers/solvers.py", line 332, in solve
result = tsolve(f, *symbols)
File "/usr/lib/pymodules/python2.6/sympy/solvers/solvers.py", line 716, in tsolve
raise NotImplementedError("Unable to solve the equation.")
NotImplementedError: Unable to solve the equation.
谢谢阅读。