Fourer
socp
MOSEK
AMPL
short
0;
param c {1..n} > 0, = Uniform(0,100);
param d {1..n} > 0, = Uniform(0,10);
var X {1..n} >= 0, <= 2;
var Y {1..n} >= 0, <= 2;
var ZX >= 0;
var ZY >= 0;
var Obj;
maximize ObjDef: Obj;
subject to SumX: sum {j in 1..n} j * X[j] >= 17;
subject to SumY: sum {j in 1..n} j * Y[j] >= 17;
subject to SumXY: sum {j in 1..n} (X[j] + Y[j]) = 7;
subject to ZXdef: ZX = (sum {j in 1..n} c[j]*X[j]);
subject to ZYdef: ZY = (sum {j in 1..n} d[j]*Y[j]);
subject to Zdef: Obj^2 <= ZX * ZY;
let n := 10;
solve;
]]>