Issues with Results of the Same Problem with Different Formulation - Quadratic Form


(Royi) #1

Hello,

I have the following code:

paramN = 3;
paramB = 10;

vA = [2; 3; 9];
vA = sort(vA, 'ascend');

v1 = ones([paramN, 1]);
v0 = zeros([paramN, 1]);

cvx_begin('quiet')
    cvx_precision('best');
    variables vLambda(paramN) paramNu
    % maximize( -0.25 * sum_square(vLambda + (paramNu * v1)) - (vLambda.' * vA) - (paramNu * paramB) ) %<! Doesn't Work!
    % maximize( -0.25 * sum_square_abs(vLambda + (paramNu * v1)) - (vLambda.' * vA) - (paramNu * paramB) ) %<! Doesn't Work!
    maximize( -0.25 * square_pos(norm(vLambda + (paramNu * v1))) - (vLambda.' * vA) - (paramNu * paramB) )
    subject to
        vLambda >= v0;
cvx_end

You can see there are 3 versions of the same Objective Function (With % for the first 2).
In this example of numbers the first 2 fails to supply an answer whole the third succeeds.
In other numeric examples they all converge.

I know it is suggested to Eliminate Quadratic Forms, but is this normal?

Thank You.


(Mark L. Stone) #2

I recommend you not use the quiet option when trying to assess and diagnose solution difficulties. Then you’ll be able to see the solver output.

I solved all 3 variants with both sdpt3 and sedumi, achieving cvx_optval = 38. Things were looking a little precarious with the solvers when using cvx_precision(‘best’), but looked fine with default precision.


(Royi) #3

But when you Copy & Paste what I wrote above, do you see the problem I got as well?

Is it some kind of a bug or something?


(Mark L. Stone) #4

I did copy and paste. Then did edits, such as not doing quiet, changing which objective was uncommented, and changing precision and cvx_solver. My results are as I described above.


(Royi) #5

Hi,

I meant with cvx_precision(‘best’) do you see the same issues as I did?
If you did, since it doesn’t happen in default precision, it is not something of CVX translation but solvers issue?

I wonder if it happens on the commercial solvers as well.

Thank You.


(Mark L. Stone) #6

As I wrote above

Things were looking a little precarious with the solvers when using cvx_precision(‘best’), but looked fine with default precision.


(Royi) #7

@mcg, Any chance addressing this issue?

Thank You.


(Michael C. Grant) #8

I’m afraid it’s not likely unless someone supplies a patch. The fact that it works without cvx_precision('best') certainly reduces any priority I might place on it.


(Royi) #9

@mcg, Does the setting cvx_precision('best') make any difference to CVX (The model it generates) or only a parameter passed to the solver?

Anyone could verify if it happens on all solvers (Free + Commercial)?
Can we just spot where the issue is?

Thank You.


(Michael C. Grant) #10

I simply don’t have the time to investigate this in that manner. If you or any other volunteers can, please report your findings here.