Ask Your Question

Is there an equivalent of NSolve of mathematica?

asked 2010-12-19 23:07:15 -0600

Shashank gravatar image

updated 2015-01-14 09:22:37 -0600

FrédéricC gravatar image

I am trying to solve a system of non-linear system of equations. Is there a equivalent of NSolve or FindRoot of mathematica in sage. I looked up on the net and there is a equivalent command nsolve in sympy. However, for some reason "from sympy import nsolve" gives a error.

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted

answered 2010-12-20 01:46:13 -0600

Felix Lawrence gravatar image

Scipy has quite a collection of numerical solvers in scipy.optimize. Does scipy.optimize.nonlin suit your needs?

edit flag offensive delete link more

answered 2010-12-20 00:30:03 -0600

Shashank gravatar image

I found a way around. I can define f=abs(f1)+abs(f2)+... and minimize f using the simplex algorithm. However, I have not been play with the tolerance and maximum number of iterations in minimize(). Is there is simple way of changing the tolerance for minimize with alogorithm="simplex"?

edit flag offensive delete link more

answered 2010-12-20 14:06:34 -0600

Eviatar Bach gravatar image

Here is the equivalent to FindRoot:

edit flag offensive delete link more


find_root works only in 1D I was actually trying to minimiize in 5D. I ended up using simplex algorithm from scipy it works pretty well.

Shashank gravatar imageShashank ( 2011-01-11 12:05:33 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2010-12-19 23:07:15 -0600

Seen: 955 times

Last updated: Dec 20 '10