To find the roots of a polynomial, the command roots from
Numeric Python is useful (this is also available as roots).
To find a root of a set of non-linear equations, the command optimize.fsolve
is needed. For example, the following example finds the roots of the
single-variable transcendental equation
>>> def func(x): return x + 2*cos(x) >>> def func2(x): out = [x[0]*cos(x[1]) - 4] out.append(x[1]*x[0] - x[1] - 5) return out >>> from scipy.optimize import fsolve >>> x0 = fsolve(func, 0.3) >>> print x0 -1.02986652932 >>> x02 = fsolve(func2, [1, 1]) >>> print x02 [ 6.5041 0.9084]