Ask Your Question
1

Is there an equivalent of NSolve of mathematica?

asked 2010-12-20 06:07:15 +0100

Shashank gravatar image

updated 2015-01-14 16:22:37 +0100

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 08:46:13 +0100

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 21:06:34 +0100

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 19:05:33 +0100 )edit
0

answered 2010-12-20 07:30:03 +0100

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

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-20 06:07:15 +0100

Seen: 1,344 times

Last updated: Dec 20 '10