How to transform this convex objective function into cvx sentence?

a\left|\left\| w \right\|_2^2 - 1\right| +b \left(\left\| w \right\|_2^2 - 1 \right), where w is a complex vector.
I try to translate this one into cvx directly. However, it returns me ‘‘abs( convex )’’. Can some one help me?

cvx_begin
variable w(10) complex
expression f
f = 2abs(w’ * w-1) + 3(w’ * w-1);
minimize f
subject to
norm(w) <= 10;
cvx_end

The first term of the objective function is not convex. Just to make this readily apparent, consider it as a function of a scalar variable x (in place of w). Then the first term has a W shape when plotted as a function of x (the bottoms of the W are at x = -1 and x = 1), which is not convex.

If a >= 0, b >= 0, b >= a, as is the case in your example, then I believe the overall objective function is convex, and is equal to

(b-a)*(w'*w-1) if norm(w) < 1
(a+b)*(w'*w-1) if norm(w) >= 1


but I don’t know how to express that in CVX.

The condition you said is satisfied. a\ge 0, b \ge 0, b > a. The whole term is convex. But I want to solve it in cvx, that is probably the major challenge.

What about (b-a)*(sum_square(w)-1) + 2*a*max(sum_square(w)-1,0)? Or perhaps more efficiently:

z = sum_square(w) - 1;
f = (b-a) * z + 2 * a * max(z, 0);

I should have thought of that. Although I think you need sum_square_abs because w is complex.

Thank you very much!!

let Q=ww’, then w’w=trace(Q) and ( w’ * w-1)=trace(Q)-1. With the assumption that trace(Q)>1. Your problem can be reformulated as follows:

cvx_begin

variable Q(10,10) complex hermitian semidefinite
expression f
f = 2* (trace(Q)-1)+ 3*( trace(Q)-1);
minimize f
subject to
real(trace(Q))<= 10^.5
real(trace(Q))>=1

cvx_end

then you can calculate w from Q by using svd rank reduction

Actually, I don’t have that assumption.

Tray to relax your objective function by minimizing the upper bound in stead of the exact value. Your solution will be close to the optimal solution depending on the sharpness of your upper bound.