bmibnb status -6, wrong result

12 views
Skip to first unread message

vr7

unread,
Sep 1, 2018, 10:49:29 AM9/1/18
to YALMIP
hello, 

I'm trying to solve this problem with yalmip.
Here I attach the function.

function  [ z, status ] = zetaVector_yalmip(Hk, Q, Qp, log_const, Q_jl, P)

yalmip('clear')
n = size(Qp, 2);
N = size(Q, 1);

alpha = sdpvar(size(log_const, 1), 1);
z = sdpvar( n, 1 , 'full', 'complex' );
qi = sdpvar( N, 1 , 'full', 'complex' );

obj = real( sum(log2(1 + alpha.*log_const))  + log2(1 + norm(Hk'*Qp*z)^2) );
cons = [alpha >= 0, qi == Qp*z];
for m = 1:N 
    cons = [cons ,...
            alpha.*Q_jl(:, m) + imag( qi(m, 1) )^2 + real( qi(m , 1) )^2 <= P ]; 
end

sol = optimize(cons, -obj, sdpsettings('solver','bmibnb'));
status = sol.problem;


z = value(z);
alpha = value(alpha);

end

If I do not specify any solver the solution is for z vector is zero, otherwise with 'bmibnb' status is -6.
Could you please give some hints in order to solve the problem?

Thank you in advance

Johan Löfberg

unread,
Sep 1, 2018, 10:55:39 AM9/1/18
to YALMIP
since you haven't supplied reproducible code, all I can say is that you haven't added bounds on all variables involved in nonlinear expressions

vr7

unread,
Sep 1, 2018, 11:26:56 AM9/1/18
to YALMIP
I apologize, here hou find the file with all the variables you need.

Thanks again
variables.mat

Johan Löfberg

unread,
Sep 1, 2018, 12:01:56 PM9/1/18
to YALMIP
As I said, you have to add bounds (testing with tighter tolerances to see if the solution with default tolerances is off, but it doesn't appear to be so, z=qi=0 appears to be optimal)

optimize([cons,-1000<=[z;qi;alpha] <= 1000], -obj, sdpsettings('solver','bmibnb','bmibnb.absgaptol',1e-6,'bmibnb.relgaptol',1e-6))


Johan Löfberg

unread,
Sep 1, 2018, 12:03:45 PM9/1/18
to YALMIP
btw, real on log2 operator is redundant as yalmip assumes log2 is real-valued

vr7

unread,
Sep 1, 2018, 12:35:57 PM9/1/18
to YALMIP
Thank you very much, I've tried to do this way and the result is different from zero

cons = [0 <= alpha <= 1000000000, qi == Qp*z ];

sol = optimize([cons,-100000 -1i*100000<=[z;qi] <= 100000 + 1i*100000], -obj, sdpsettings('solver','bmibnb','bmibnb.absgaptol',1e-6,'bmibnb.relgaptol',1e-6);

because z and qi are complex..

Johan Löfberg

unread,
Sep 1, 2018, 12:42:48 PM9/1/18
to YALMIP
ah yea. note though that bounds on the order of 10^5 easily can lead to numercal issues, so have them relevant

Johan Löfberg

unread,
Sep 1, 2018, 12:46:05 PM9/1/18
to YALMIP
...although yalmip pretty quickly would strengthen your bounds in presolve , the last constraint immediately leads to bounds on the order of 0.1 on qi

Johan Löfberg

unread,
Sep 1, 2018, 12:48:07 PM9/1/18
to YALMIP
indeed, those bounds aren't even required since they can be found easily

optimize([cons,-1000<=[z;alpha] <= 1000], -obj, sdpsettings('solver','bmibnb','bmibnb.absgaptol',1e-6,'bmibnb.relgaptol',1e-6,'bmibnb.upper','knitro'))
Reply all
Reply to author
Forward
0 new messages