# Overriding AccuracyGoal in NMinimize

How can I override the AccuracyGoal parameter in NMinimize? Instead of the evaluation stopping at the required Accuracy, I want it to stop after a specific number of iterations, even if the AccuracyGoal is not reached. I tried the following example code, but it doesn't stop after 100 iterations.

NMaximize[{Norm[Array[c1, 10], Infinity]+Norm[Array[d1, 10], Infinity],
And @@ Table[-1 <= c1[i] <= 1, {i, 1,10}] && And @@ Table[-1 <= d1[i] <= 1, {i, 1, 10}]},
Flatten[{Array[c1, 10], Array[d1, 10]}],Method -> "SimulatedAnnealing",MaxIterations -> 100];


This question is similar to my query, but is yet to be answered.

• There is a typo in Table[-1 <= d1[i] <= 1, {i, 1, d10}] , change d10 to 10 and your code runs.! May 21, 2021 at 14:45
• Yes, the code runs, but it doesn't stop after 100 iterations. May 21, 2021 at 14:56
• That means NMaxmize doesn't need 100 iterations to find the solution! May 21, 2021 at 15:01
• Yes for this particular toy example. But for a much more complex problem, I would like to stop the evaluation after say N iterations. May 21, 2021 at 15:06
• NMaximize[{Norm[Array[c1, 10], Infinity] + Norm[Array[d1, 10], Infinity], And @@ Table[-1 <= c1[i] <= 1, {i, 1, 10}] && And @@ Table[-1 <= d1[i] <= 1, {i, 1, 10}]}, Flatten[{Array[c1, 10], Array[d1, 10]}], Method -> "SimulatedAnnealing", MaxIterations -> 10] performs a warning "NMaximize::cvmit: Failed to converge to the requested accuracy or precision within 10 iterations" and May 21, 2021 at 17:10