# Cvx_optval changes over iteration

Dear everyone,
Why the optimal value is rapidly increasing after only 2 iterations ?

loop | N | M | iteration
1 | 3 | 10 | 1

## Calling SDPT3 4.0: 38 variables, 17 equality constraints

num. of constraints = 17
dim. of socp var = 38, num. of socp blk = 10

SDPT3: Infeasible path-following algorithms

## number of iterations = 23 primal objective value = -5.26988306e-01 dual objective value = -5.26988324e-01 gap := trace(XZ) = 1.90e-08 relative gap = 9.24e-09 actual relative gap = 8.98e-09 rel. primal infeas (scaled problem) = 2.18e-15 rel. dual " " " = 2.18e-12 rel. primal infeas (unscaled problem) = 0.00e+00 rel. dual " " " = 0.00e+00 norm(X), norm(y), norm(Z) = 3.8e+02, 8.6e-01, 9.5e-01 norm(A), norm(b), norm© = 7.5e+00, 1.0e+02, 1.4e+00 Total CPU time (secs) = 0.26 CPU time per iteration = 0.01 termination code = 0 DIMACS: 2.2e-15 0.0e+00 2.5e-12 0.0e+00 9.0e-09 9.2e-09

Status: Solved
Optimal value (cvx_optval): +0.526988

## Calling SDPT3 4.0: 64 variables, 16 equality constraints

num. of constraints = 16
dim. of socp var = 24, num. of socp blk = 8
dim. of free var = 40
*** convert ublk to linear blk

SDPT3: homogeneous self-dual path-following algorithms

## number of iterations = 32 primal objective value = -4.76141742e-01 dual objective value = -4.76141298e-01 gap := trace(XZ) = 1.09e-08 relative gap = 7.36e-09 actual relative gap = -2.28e-07 rel. primal infeas = 3.85e-08 rel. dual infeas = 2.52e-09 norm(X), norm(y), norm(Z) = 7.1e+02, 8.6e-01, 9.5e-01 norm(A), norm(b), norm© = 1.5e+01, 1.1e+00, 4.0e-01 Total CPU time (secs) = 0.63 CPU time per iteration = 0.02 termination code = -7 DIMACS: 3.8e-08 0.0e+00 2.5e-09 0.0e+00 -2.3e-07 5.6e-09

Status: Inaccurate/Solved
Optimal value (cvx_optval): +0.526988

rate1 =

``````     0    3.7511
``````

rate2 =

``````     0    4.1794
``````

rate3 =

``````     0    2.2208
``````

1 | 3 | 10 | 2

## Calling SDPT3 4.0: 38 variables, 17 equality constraints

num. of constraints = 17
dim. of socp var = 38, num. of socp blk = 10

SDPT3: Infeasible path-following algorithms

## number of iterations = 18 primal objective value = -1.33849763e+02 dual objective value = -1.33849765e+02 gap := trace(XZ) = 2.10e-06 relative gap = 7.83e-09 actual relative gap = 7.79e-09 rel. primal infeas (scaled problem) = 4.50e-14 rel. dual " " " = 2.15e-12 rel. primal infeas (unscaled problem) = 0.00e+00 rel. dual " " " = 0.00e+00 norm(X), norm(y), norm(Z) = 6.8e+02, 2.6e+02, 2.6e+02 norm(A), norm(b), norm© = 8.5e+00, 1.0e+02, 2.2e+01 Total CPU time (secs) = 0.15 CPU time per iteration = 0.01 termination code = 0 DIMACS: 4.5e-14 0.0e+00 2.4e-12 0.0e+00 7.8e-09 7.8e-09

Status: Solved
Optimal value (cvx_optval): +133.85

## Calling SDPT3 4.0: 64 variables, 16 equality constraints

num. of constraints = 16
dim. of socp var = 24, num. of socp blk = 8
dim. of free var = 40
*** convert ublk to linear blk

SDPT3: homogeneous self-dual path-following algorithms

## number of iterations = 34 primal objective value = 1.22880805e+02 dual objective value = 1.22880804e+02 gap := trace(XZ) = 4.12e-08 relative gap = 3.33e-10 actual relative gap = 3.04e-09 rel. primal infeas = 1.09e-08 rel. dual infeas = 7.22e-09 norm(X), norm(y), norm(Z) = 6.7e+02, 2.6e+02, 2.6e+02 norm(A), norm(b), norm© = 9.4e+01, 2.5e+01, 6.5e+01 Total CPU time (secs) = 0.31 CPU time per iteration = 0.01 termination code = 0 DIMACS: 1.1e-08 0.0e+00 7.2e-09 0.0e+00 3.0e-09 1.7e-10

Status: Solved
Optimal value (cvx_optval): +133.85

Are you doing SCA? Almost anything can happen. Consider yourself lucky if it converges to anything, let alone a global, or even local optimum of the original problem.

Yes,I’m doing SCA. So it’s basically equivalent to rolling a die?

If you’re Stephen Boyd, the dice are probably loaded in your favor.

If you’re a random poster who implemented an unsafeguarded SCA, ,applied it to a new problem (not one solved in Stephen Boyd’s lecture notes), and has no experience implementing or understanding robust non-convex solvers, the dice are probably not loaded so much in your favor.

But I’ve tried a couple of methods to convert my problem into convex one,like fractional programming and SDP. All failed but SCA. Maybe I chose wrong model at first time.

Dear Mark,
Can I limit the output value of cvx_optval within magnitude 1?

Maybe you should use an off-the-shelf- non-convex optimizer, as available for instance, under YALMIP.