I would like to use the Differential Evolution option of NMinimize
to find the "optimal" solution for the hyper-sphere function defined as follows,
f[1] = Compile[{{x, _Real, 1}}, Total[x^2]];
The input for the function is a vector of D real-valued components that are constrained by -100 and 100.
Is it possible to solve this (or similar) problem using NMinimize
?
Many thanks.
0.
and the use ofNMinimize
is unnecessary. (Perhaps more detail, or a nontrivial example, would help you get more help, if this comment is unsatisfactory.) $\endgroup$Block[{f, d = 99, vars, x}, vars = Array[x, d]; f[1] = Compile[{{x, _Real, 1}}, Total[x^2], RuntimeOptions -> {"EvaluateSymbolically" -> False, "WarningMessages" -> False}]; NMinimize[{f[1][vars], Thread[-100 < vars < 100]}, vars, Method -> "DifferentialEvolution"] ]
$\endgroup$NMinimize
with vectors and you have explained to me. Many thanks! $\endgroup$