First time here? Check out the FAQ!

Ask Your Question
1

Is there an equivalent of NSolve of mathematica?

asked 14 years ago

Shashank gravatar image

updated 10 years ago

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.

Preview: (hide)

3 Answers

Sort by » oldest newest most voted
1

answered 14 years ago

Felix Lawrence gravatar image

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

Preview: (hide)
link
0

answered 14 years ago

Eviatar Bach gravatar image

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

Preview: (hide)
link

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 ( 14 years ago )
0

answered 14 years ago

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"?

Preview: (hide)
link

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: 14 years ago

Seen: 1,402 times

Last updated: Dec 20 '10