用數值方法求解非線性方程組

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]