Comparing fsolve results in python and matlab

I have the following mail question written a couple of days ago, thanks for the previous feedback:

Finding complex roots from a set of nonlinear equations in python

Now I got a set of non-linear equations set up in python, so fsolve will process the real and imaginary parts independently. However, there are still problems merging pfon "fsolve" with the correct solution. I have the same inputs that are used in Matlab, and after double checking the equation system is exactly the same. Matlab, no matter how I set the initial values, will always converge to the right solution. However, with python, each initial condition produces a different result and is never correct. After a split second, the following warning appears with python:

/opt/local/Library/Frameworks/Python.framework/Versions/Current/lib/python2.7/site-packages/scipy/optimize/minpack.py:227: 
RuntimeWarning: The iteration is not making good progress, as measured by the 
improvement from the last ten iterations.
warnings.warn(msg, RuntimeWarning) 

I was wondering if there are any known differences between fsolve in python and Matlab, and if there are some known performance optimization methods in python.

Many thanks

+4
1

, , . , , Matlab fsolve 'levenberg-marquardt', . Python scipy.optimize.fsolve MINPACK hybrd . Levenberg-Marquardt , . , Powell.

- , Matlab, , Levenberg-Marquardt, scipy.optimize.root, . , ?

+3

Source: https://habr.com/ru/post/1527732/


All Articles