# Help regarding solving an SDP

(Bodhibrata Mukhopadhyay) #1

I am using CVX to solve an SDP problem. CVX fails to solve the problem and shows an error msg " lack of progress in infeas ". The matlab output I am getting are as follows

## ----------------------------------------Output----------------------------------------------------- Calling SDPT3 4.0: 18 variables, 10 equality constraints For improved efficiency, SDPT3 is solving the dual problem.

num. of constraints = 10
dim. of sdp var = 6, num. of sdp blk = 2
dim. of socp var = 6, num. of socp blk = 1

SDPT3: Infeasible path-following algorithms

## number of iterations = 12 primal objective value = -1.07606623e+00 dual objective value = -1.06859448e+00 gap := trace(XZ) = 1.57e-04 relative gap = 4.99e-05 actual relative gap = -2.38e-03 rel. primal infeas (scaled problem) = 9.23e-06 rel. dual " " " = 2.30e-06 rel. primal infeas (unscaled problem) = 0.00e+00 rel. dual " " " = 0.00e+00 norm(X), norm(y), norm(Z) = 1.5e+00, 3.9e+02, 3.9e+02 norm(A), norm(b), normÂ© = 6.0e+00, 3.0e+00, 2.8e+00 Total CPU time (secs) = 0.15 CPU time per iteration = 0.01 termination code = 0 DIMACS: 9.2e-06 0.0e+00 3.2e-06 0.0e+00 -2.4e-03 5.0e-05

Status: Solved
Optimal value (cvx_optval): +0.0685945

----------------------------------------------------end----------------------------------------------

However, when I am multiplying the objective function by 10^4 cvx is able to solve the SDP accurately. Then the output is

## -----------------------------------output------------------------------------------------ Calling SDPT3 4.0: 18 variables, 10 equality constraints For improved efficiency, SDPT3 is solving the dual problem.

num. of constraints = 10
dim. of sdp var = 6, num. of sdp blk = 2
dim. of socp var = 6, num. of socp blk = 1

SDPT3: Infeasible path-following algorithms

## number of iterations = 22 primal objective value = -9.99999991e+03 dual objective value = -1.00000000e+04 gap := trace(XZ) = 1.00e-04 relative gap = 5.02e-09 actual relative gap = 5.02e-09 rel. primal infeas (scaled problem) = 2.91e-15 rel. dual " " " = 2.80e-12 rel. primal infeas (unscaled problem) = 0.00e+00 rel. dual " " " = 0.00e+00 norm(X), norm(y), norm(Z) = 1.4e+04, 1.4e+05, 8.8e+04 norm(A), norm(b), normÂ© = 6.0e+00, 2.0e+04, 2.8e+00 Total CPU time (secs) = 0.20 CPU time per iteration = 0.01 termination code = 0 DIMACS: 2.9e-15 0.0e+00 3.9e-12 0.0e+00 5.0e-09 5.0e-09

Status: Solved
Optimal value (cvx_optval): +1.2115e-05
--------------------------------------------end----------------------------------------------------------------------

Please help me to understand why it is happening. Thankyou

(Mark L. Stone) #2

Your problem likely has poor scaling. Perhaps you could get more specific guidance if you showed a reproducible problem, complete with input data.

(Bodhibrata Mukhopadhyay) #3

Thank you sir. I am attaching my code below.

-----------------------------Matlab Code --------------------------------------

``````cvx_begin  sdp
total_connections=size(anchor_connected,2);
variable h(total_connections)
variable x(2,1)
variable z
minimize 1*( (h.*lambda_source_anchor_connected' -  alpha1 )' ...
*(h.*lambda_source_anchor_connected' -   alpha1 ) )

for j=1:total_connections
h(j)==[anchor_connected(:,j); -1]' * [eye(2) x;x' z] * [anchor_connected(:,j); -1];
end
[eye(2) x;x' z]>=semidefinite(3);
cvx_end
``````

Given parameters are: alpha1= 0.0056; lambda_source_anchor_connected = [1.1246e-06 1.1245e-06 1.1248e-06 1.1246e-06]; anchor_connected=[ 0 0 100 100; 0 100 0 100];

I am estimating the value of x.

(Mark L. Stone) #4

Your objective function is a square, so the optimal objective value must be >= 0 if the optimization problem were solved exactly.

All your solutions (also true using SeDuMi) produce an optimal objective value of zero, within solver tolerance. There are an infinite number of combinations of x and z which satisfy the semidefinite constraint and produce optimal objective value of zero.

So it appears that your problem may not be very well formed.

Note: Your use of `[eye(2) x;x' z]>=semidefinite(3);` in SDP mode is undocumented. The documented syntax would be `[eye(2) x;x' z] >= 0`.
Or `[eye(2) x;x' z] == semidefinite(3);` if not in SDP mode. Your syntax appears to produce the correct result in this case, although I am not sure if that will always be the case.

(Bodhibrata Mukhopadhyay) #5

Thanks a lot for you help. I will change my syntax. The whole SDP starts to produce correct answer once I scale the objective function by 10^4.

(Mark L. Stone) #6

What you call the â€ścorrectâ€ť answer is just one of many â€śanswersâ€ť to this poorly specified problem.

(Bodhibrata Mukhopadhyay) #7

Thank you sir for your kind help. I will try to work rephrase the problem.