# How to determine whether NMinimize returns a solution or not?

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!

• 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. – MarcoB Sep 29 '15 at 16:34
• From the docs If NMinimize determines that the constraints cannot be satisfied, it returns {Infinity,{x->Indeterminate,\[Ellipsis]}}. – N.J.Evans Sep 29 '15 at 16:38