I'm using NMinimize to find the minimum solution for a non-linear objective function. As I change the set of constraints, most of times NMinimize cannot yield a solution, because there is none subject to the constraints that I'm using. Hence, I want to use a While loop, which keeps going until NMinimize ultimately returns a solution.

However, I don't know how to determine whether NMinimize can yield a solution or not at each iteration of the While loop. Any idea would be appreciated!

  • $\begingroup$ Can you provide an example of your objective function and a few sets of constraints that you are working with? It is hard to say anything meaningful in such a general scenario. $\endgroup$ – MarcoB Sep 29 '15 at 16:34
  • 1
    $\begingroup$ From the docs If NMinimize determines that the constraints cannot be satisfied, it returns {Infinity,{x->Indeterminate,\[Ellipsis]}}. $\endgroup$ – N.J.Evans Sep 29 '15 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.