I’m trying to solve the following SOCP problem:
B(kn,n), Nin(n,3), lambda(1,1), p=ones(kn,1) are known, t(kn,1) and Nout(n,3) are variables to optimize
min p'*t s.t.
norm((B*Nout)(i,:))<=t(i)
norm(Nout(i,:)-Nin(i,:))<=lambda
the code I use is:
cvx_clear;
% cvx optimization
cvx_begin
% cvx_solver sedumi
cvx_solver gurobi
p=ones(kn,1);
variable Nout(n,3)
variable t(kn,1)
minimize(p'*t);
subject to
sum((Nout-Nin).^2,2)<=lambda;
sum((B*Nout).^2,2)<=t;
cvx_end
It can be solved by sedumi without problem. However, when I try to use gurobi for better performance, cvx give me the following error message:
Barrier solved model in 63 iterations and 266.48 seconds
Optimal objective 4.81483354e-02
Warning: to get QCP duals, please set parameter QCPDual to 1
------------------------------------------------------------
Status: Error
Optimal value (cvx_optval): NaN
Undefined function or variable 'need_duals'.
Error in D:\work\matlab\cvx\shims\cvx_gurobi.p>solve (line 499)
Error in D:\work\matlab\cvx\shims\cvx_gurobi.p>@(varargin)solve(grb,varargin{:}) (line 188)
Error in cvxprob/solve (line 427)
[ x, status, tprec, iters ] = shim.solve( At, b, c, cones, quiet, prec, solv.settings
);
Error in cvx_end (line 79)
solve( prob );
Error in cvx_wrapper (line 25)
cvx_end
Error in getall (line 48)
normals_new=cvx_wrapper(points,normals,k,lambda,true); % cvx version