用数值方法求解非线性方程组
import sympy as sy
x, y = sy.symbols("x y")
# nsolve needs the (in this case: two) equations, the names of the variables
# (x,y) we try to evaluate solutions for, and an initial guess (1,1) for the
# solution
print sy.nsolve((x**3+sy.exp(y)-4,x+3*y),(x,y),(1,1))
显示的结果将是 x 和 y 的解决方案:
[ 1.50281519319939]
[-0.500938397733129]