0
$\begingroup$

I am new to Mathematica. What is the mistake I am making in the following code snippet?

NMinimize[{y, 
  x*Norm[Array[c1, 10], Infinty] - Norm[Array[c1, 10], Infinty]^2 - 
     y <= 0 && 
   x*Norm[Array[d1, 10], Infinty] - Norm[Array[d1, 10], Infinty]^2 - 
     y <= 0 && 0 <= x <= 1 && 
   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], x, y}], 
 Method -> {"SimulatedAnnealing"}, MaxIterations -> 1000]
$\endgroup$
2
  • 1
    $\begingroup$ Infinty is not spelled correctly. It should be Infinity or the symbol \[Infinity] or . The incorrect spelling of Infinty should also be highlighted in blue in your notebook, making it somewhat obvious that it's not defined. $\endgroup$
    – flinty
    May 19 at 18:13
  • $\begingroup$ Thank you for the help. This is the first time I am using the notebook. Still figuring out how it works. $\endgroup$ May 19 at 18:16
0
$\begingroup$

Let us put z=Norm[Array[c1, 10], Infinity] and t=Norm[Array[d1, 10], Infinity]. These variables satisfy z >= 0 && z <= 1 and 0<= t && t <= 1, so (four variables instead of 22 variables)

NMinimize[{y, x*z - z^2 - y <= 0 && x*t - t^2 - y <= 0 && 0 <= x <= 1 && z >= 0 &&
z <= 1 && t >= 0 && t <= 1},{x, y, z, t}, Method -> {"SimulatedAnnealing"},MaxIterations -> 1000]

{-1., {x -> 1.2904*10^-9, y -> -1., z -> 1., t -> 1.}}

I leave the rest on your own.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.