Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Mathematica for physics research and I want to minimize a Hamiltonian equation with respect to two variables (I have also discretized the problem). I have a single constraint. When I plot the result from NMinimize for two variables, the end behavior for one of them is not very stable.

Is there a way of making NMinimize more precise, so I can get a stable solution?

share|improve this question
The first thing I'd try is to increase MaxIterations. – Rahul Jul 15 '14 at 3:10
I cannot upvote this question, because without a concrete example it is hard to help. On the other hand, someone with similar experience might be able to help you, that's why I don't vote to close this. Isn't it possible to create a very short example of a problem the behaves similarly? – halirutan Jul 15 '14 at 4:31
up vote 0 down vote accepted

You can increase "the precision used in internal computations" with the option WorkingPrecision. This should by default also increase the AccuracyGoal and the PrecisionGoal.
Using an other Method could potentially also help.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.