The object function is
where X is a matrix of N by M, and n is the row index, so Xn denotes the n-th row of X. g() denotes the hyperbolic tangent function (tanh). Since the X is optimized iteratively, so the value being not relevant to X is calculated out of the {cvx_begin…cvx_end} and passed in the {cvx_begin…cvx_end} as constants (constant vectors). The problem is how can I express the square of norms of each row of X? The code is as follows:
Qx1=constant_vector1;
Qx21 =constant_vector2;
Qx22 = constant_vector3;
cvx_begin quiet
variable x(N,M) complex
minimize(sum(Qx1+Qx21.*(norms(norms(X,2,2),2,1)-Qx22)));
subject to
norm(b - A*X,'fro') <= SNR_eps;
cvx_end
It reports the error:
Disciplined convex programming error:
Invalid computation: norms( {convex}, ... )
Would you please tell me the reason or provide another method to express correctly?
Regards!
Thank you very much! It works! But the optimization seems to be very slow and making it unappropriate for the iterative scheme. I wonder the main reasons affecting the efficiency of CVX. I used the embedded solver SDPT3 here. Will a commercial solver, say mosek, performs better?
p.s. Is there a handbook introducing functions specified for the cvx but not defined in MATLAB? Just like the help documentation in MATLAB.
Mosek is usually faster so it is worth trying.
Please read the CVX Users’ Guide http://cvxr.com/cvx/doc/ in its entirety. square_pos and norms are both documented in http://cvxr.com/cvx/doc/funcref.html#new-functions .
In some cases, more details are available, especially on argument restrictions, using the help command, even for built-in MATLAB functions which have been extended for cvx variable or expression arguments.
For instance:
help cvx/norm
Disciplined convex programming information:
norm is convex, except when P<1, so an error will result if
these non-convex "norms" are used within CVX expressions. norm
is nonmonotonic, so its input must be affine.