Error of norm(x,y) (2 variables)


to change the form below into the form works in CVX
norm( [ max(x,1) , max(y,2) ] )<=3*x + y

I change it into 4 sets of inequation:
norm(x,2)<=3x+y; y<=2;
x+y; x<=1;
2<=3x+y; x<=1; y<=2;
x+y; 1<=x; 1<=y;

while for the last one returned the error:
Struct contents reference from a non-struct array object.

(Mark L. Stone) #2

You are making syntax errors with norm. Perhaps you meant norm([x y]) in the last line, and something other than norm(1,y) in the 2nd line.

However, I don’t think your overall approach is mathematically correct given how norm combines elements in its vector input. You will need to linearize max(x,1) and max(y,2) ; I don’t know whether you can do that without use of binary variables (using MIDCP capability) or is somehow your overall problem allows you to avoid binaries.


Oh I see, thank you for pointing that out! Yes I need to find the way to linearize the max in this one