On Fri, Jan 13, 2017 at 1:54 PM, Дмитрий Фролов <kain9...@gmail.com> wrote:
> Hellow! I have problem: I need to solve equation with one variable, but
> solution must be complex number. "find_root()" and "root()" in
> scipy.optimize can't do it. Help me please.
root() from scipy.optimize should work:
F.ex. to find the root of f(z) = z^2 + 1, write z = x + iy
so that f(x,y) = (x^2-y^2+1, 2*xy).
Following the example in:
import numpy as np
import scipy.optimize as opti
f = [x**2 - x**2 + 1, 2*x*x]
# The Jacobian:
df = np.array([[2*x, -2*x], [2*x, 2*x]])
return f, df
sol = opti.root(func, [0.5, 0.5], jac=True, method='lm')
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to email@example.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.