Ask Your Question
1

Is there an equivalent of NSolve of mathematica?

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

Shashank gravatar image

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

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
1

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

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
0

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

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
0

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

Eviatar Bach gravatar image

Here is the equivalent to FindRoot: http://www.sagemath.org/doc/reference...

edit flag offensive delete link more

Comments

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 -0500 )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

Stats

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

Seen: 727 times

Last updated: Dec 20 '10