Dear all,

The following CVX implementation of a SOCP problem:

```
> N = 4; w = randn(N,1) + 1i*randn(N,1);
> w = w/norm(w); cvx_begin
> variable u(N)
> maximize( real(w'*u) )
> subject to
> abs(u(1))==1
> abs(u(2))==1
> abs(u(3))==1
> abs(u(4))==1
>
> cvx_end
```

Gives me the following error:

```
Disciplined convex programming error:
Invalid constraint: {convex} == {real constant}
```

Do you know how can I rewrite the problem so that this is admitted in CVX? I have been googling but still no clue.

Thank you in advance

Your constraints are not convex. FAQ: Why doesn’t CVX accept my problem? [READ THIS FIRST] . I’m not sure where your quadratic inequality constraints, if any, are, but you haven’t shown any. Why are you calling this a SOCP?

They are convex indeed. Equality constraints can be constructed by two inequalities.

With one dimension, your constraint is abs(u ) == 1. u = 1 and u = -1 are solutions, but u = 0, which is a convex combination of those solutions, is not a solution. That shows the constraint is not convex. Try reading http://stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf .

mcg
(Michael C. Grant)
February 2, 2015, 2:36pm
5
Mark is, of course, correct.