Zeros of complex function in SciPy

AI Thread Summary
The method scipy.optimize.Newton() can be used to find roots of complex functions, but it requires the first derivative to be specified. The documentation does not explicitly mention support for complex functions, which can lead to confusion. To successfully find complex roots, it's crucial that the initial guess has a non-zero imaginary part; otherwise, the method may fail to converge to a complex solution. A simple example provided is f(z) = 1 + z^2, which can illustrate the process. Proper usage of initial guesses is essential for effective application of Newton's method in complex analysis.
PeteyCoco
Messages
37
Reaction score
1
I've been told that the method scipy.optimize.Newton() will solve complex functions so long as the first derivative is provided. I can't make it work. The documentation for Newton() mentions nothing of complex functions. Could someone show me how one would find the roots of a function like f(z) = 1 + z^2 in SciPy? I need to solve something much more complex, but a simple example will help me immensely.
 
Physics news on Phys.org
Please read the forum rules. Double posts are not allowed.
 
phinds said:
Please read the forum rules. Double posts are not allowed.

I realized that I posted in the wrong forum, but can't delete the old thread. I reported it.
 
I don't know anything about Python, but if you want to find a complex root by Newton's method, make sure the imaginary part of your initial guess is non-zero. Otherwise, the iterations will probably never leave the real line, and therefore won't converge to a complex root.
 
Back
Top