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.
Table[-1 <= d1[i] <= 1, {i, 1, d10}], changed10to10and your code runs.! – Ulrich Neumann May 21 '21 at 14:45NMaximize[{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 – user64494 May 21 '21 at 17:10{2., {c1[1] -> -0.350629, c1[2] -> 0.887276, c1[3] -> 0.354475, c1[4] -> -0.337351, c1[5] -> 0.108962, c1[6] -> -0.835742, c1[7] -> -0.5555, c1[8] -> -0.571501, c1[9] -> -1., c1[10] -> 0.384825, d1[1] -> 0.1141, d1[2] -> -0.439006, d1[3] -> 0.505844, d1[4] -> -0.986217, d1[5] -> -0.313406, d1[6] -> -0.37064, d1[7] -> 0.0101464, d1[8] -> 1., d1[9] -> 0.885465, d1[10] -> -0.13678}}– user64494 May 21 '21 at 17:10AccuracyGoal -> 5, PrecisionGoal -> 5options to the above code, you obtain{2., {c1[1] -> -0.350629, c1[2] -> 0.887276, c1[3] -> 0.354475, c1[4] -> -0.337351, c1[5] -> 0.108962, c1[6] -> -0.835742, c1[7] -> -0.5555, c1[8] -> -0.571501, c1[9] -> -1., c1[10] -> 0.384825, d1[1] -> 0.1141, d1[2] -> -0.439006, d1[3] -> 0.505844, d1[4] -> -0.986217, d1[5] -> -0.313406, d1[6] -> -0.37064, d1[7] -> 0.0101464, d1[8] -> 1., d1[9] -> 0.885465, d1[10] -> -0.13678}}without any messages. – user64494 May 21 '21 at 17:16AccuracyGoal -> 5, PrecisionGoal -> 5gguarantee enough precision. Second, I don't understand the purpose of your demand "And I want it to reach the specified number of Iterations ". Isn't it art for art's sake? – user64494 May 21 '21 at 17:44