New to CVX and need to solve the problem

(Syed Tamoor Hassan) #1

Hi,

I am trying to find the feasible solution to the following problem but CVX generates error. Can anybody help me that the code is correct or not?

cvx_begin
m = 5
variables sbsdeltas(m,1) xsbs(m,1) T30(m,1)
maximize 0

subject to                                                                                                                                           
                T30 <= logSumkDelta + sum(sbsdeltas - sbsdeltask)./logSumkDelta;
                xsbs - log( sum(sbsdeltas) + (sbsdeltas.*B)*C )/log(2) + T30 <= 0;
                sum(sbsdeltas) <= constant;
                sbsdeltas >= 0;
                sbsdeltas <= 1; 
                T30 >= 0;

logSumkDelta, B, C and sbsdeltask are constant terms obtained through Taylor approximation. C is a constant value while B is a vector with values of order 1e+15. When i solved the problem, i got the following error:

Successive approximation method to be employed.
For improved efficiency, SDPT3 is solving the dual problem.
SDPT3 will be called several times to refine the solution.
Original size: 43 variables, 18 equality constraints
6 exponentials add 48 variables, 30 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Failed
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Solved

Status: Solved
Optimal value (cvx_optval): +0

I would like to know as to why CVX failed to find solution to the above problem.

(Mark L. Stone) #2

The first constraint should be on a separate line after subject to. As it is now, it will result in the CVX (syntax) error.

Error using subject
Too many input arguments.

And of course you will need to end the program with cvx_end .

You haven’t provided a reproducible problem, so I don’t know whether there are other errors. It is also possible that even if CVX accepts the problem without error message, an error will be encountered in attempting to solve it.

When you seek help, you should provide the exact error (messages) generated.

(Syed Tamoor Hassan) #3

I edited my post. Hopefully it is much clear now.

(Mark L. Stone) #4

That is not an error. The “failed” was just for an intermediate step. CVX did solve the problem.

If N has values of the order 1e15, that may not be a good thing. Search the forum for posts about scaling.

Also read this section of the Users’ Guide http://cvxr.com/cvx/doc/advanced.html#the-successive-approximation-method .If you encounter difficulties, you may wish to follow the directions in CVXQUAD: How to use CVXQUAD's Pade Approximant instead of CVX's unreliable Successive Approximation for GP mode, log, exp, entr, rel_entr, kl_div, log_det, det_rootn, exponential cone. CVXQUAD's Quantum (Matrix) Entropy & Matrix Log related functions .

(Syed Tamoor Hassan) #5

I will try to install and fix it.

Regarding the comment about higher value of B, I am not sure whether that is a problem or not because log will scale these values to around 40.