# Why do I get NMinimize::nrnum error?

I have this minimization program and although I've restricted my variables to be non negative, I get a nrnum error in the NMinimize step. I'm guessing this is what is causing the misaligned yellowish point in the plot (the other ones seem to be right, although it's hard to tell).

ClearAll["Global*"]
A = {{1, 4}, {2, 2}, {4, 1}};
qVec = Array[q, 3];
onesVec = ConstantArray[1, 3];
optimalweights =
Table[Table[qVec /. NMinimize[{qVec^(1/a).A.{surf, 1 - surf},
qVec.onesVec == 1, Thread[1 >= qVec >= 0]}, qVec,
Reals][[2]], {surf, 0, 1, 1/10}], {a, {1/2, 2/3}}];
ListPointPlot3D[optimalweights, ViewPoint -> {100, 100, 100} ,
Axes -> None, Boxed -> False, BoxRatios -> {1, 1, 1}]


Also, Initially I used Minimize and it worked fine for the a=1/2 case. When I tried it with a=2/3 I ended up aborting the evaluation after it had ran for over 24 hours without producing an output.

• Remove Realsinside NMinimize! Mar 31 at 12:34
• @UlrichNeumann I removed it, but the problem persists Mar 31 at 12:58
• Your code works on v12.2 . Perhaps you should restart your Mtahematica session? Mar 31 at 13:06
• @UlrichNeumann I'm using v11.3. Perhaps is high time I update. Any idea about why Minimize takes so long? Mar 31 at 13:25
• optimalweights is computed in 0.049824 sec. for me (Mac M1, V13.0.1). Mar 31 at 14:37

After removing Reals inside NMinimize your code evaluates

ClearAll["Global*"]
A = {{1, 4}, {2, 2}, {4, 1}};
qVec = Array[q, 3];
onesVec = ConstantArray[1, 3];
optimalweights =
Table[Table[qVec /. NMinimize[{qVec^(1/a).A.{surf, 1 - surf},
qVec.onesVec == 1, Thread[1 >= qVec >= 0]}, qVec,
Reals][[2]], {surf, 0, 1, 1/10}], {a, {1/2, 2/3}}];
ListPointPlot3D[optimalweights, ViewPoint -> {100, 100, 100} ,
Axes -> None, Boxed -> False, BoxRatios -> {1, 1, 1}]