Why my cvx solution is unbounded

` Here is my code.`

``````> function [ Bh ] = mfn(A,Rx,gamma,eps,stopband_low,stopband_high,passband_low,passband_high)
>
>     A1 = [A(:,1:stopband_low+91) A(:,stopband_high+91:181)];
>     [n,k1] = size(A1);
>     A2 = A(:,passband_low+91:passband_high+91);
>     k2 = size(A2,2);
>     %n indicates sensor_number or the dimension of a snapshot, k1 indicates the length of out-of-sector directions
>     %k1 indicates the length of passband directions
>     m = n^2; %the total complex elements of the matrix filter
>
>     % gamma 阻带最小衰减
>     % eps 通带最大衰减
>
>     %tr（B'*rx*B）<-tao
>
>     G = sqrtm(Rx);
>     H1 = kron(G,eye(n));
>     F1 = [zeros(m,1) real(H1) -imag(H1); zeros(m,1) imag(H1) real(H1)];
>
>
>     %||BhA-A||f<e
>     H2 = kron(A2.',eye(n));
>     h = size(H2,1);
>     F2 = [zeros(h,1),real(H2),-imag(H2);zeros(h,1),imag(H2) real(H2)];
>     A2 = [real(A2(:));imag(A2(:))];
>
>     p = [1 zeros(1,2*m)];
>     cvx_begin
>         variable y(2*m+1)
>         maximize p*y;
>         subject to
>
>         for i=1:k1
>             H = kron((A1(:,i)).',eye(n));
>             F = [zeros(n,1) real(H),imag(H);zeros(n,1) imag(H) real(H)];
>             { -F*y,gamma } <In> lorentz(2*n);
>         end
>         { F1*y,y(1)} <In> lorentz(2*m);
> %         { F2*(y-A2), eps } <In> lorentz(2*k2*n);
>         { F2*y-A2, eps } <In> lorentz(2*k2*n);
>     cvx_end
>
>     Bh = reshape(y(2:m+1)+1i*y(m+2:2*m+1),[n,n]);%the designed matrix in complex form
> end

indent preformatted text by 4 spaces
> Calling SDPT3 4.0: 12604 variables, 2049 equality constraints
>    For improved efficiency, SDPT3 is solving the dual problem.
> ------------------------------------------------------------
>
>  num. of constraints = 2049
>  dim. of socp   var  = 12604,   num. of socp blk  = 124
> *******************************************************************
>    SDPT3: Infeasible path-following algorithms
> *******************************************************************
>  version  predcorr  gam  expon  scale_data
>     NT      1      0.000   1        0
> it pstep dstep pinfeas dinfeas  gap      prim-obj      dual-obj    cputime
> -------------------------------------------------------------------
>  0|0.000|0.000|2.3e+01|6.9e+01|2.5e+05| 2.263147e+02  0.000000e+00| 0:0:01| spchol  1  1
>  1|0.966|0.972|7.9e-01|1.9e+00|7.0e+03| 1.914851e+02  2.346456e+02| 0:0:02| spchol  1  1
>  2|0.343|0.445|5.2e-01|1.1e+00|3.7e+03|-4.895620e+02  9.263783e+02| 0:0:03| spchol  1  1
>  3|0.034|0.043|5.0e-01|1.0e+00|3.8e+03|-4.023848e+03  2.904841e+04| 0:0:04| spchol  1  1
>  4|0.003|0.027|5.0e-01|1.0e+00|2.5e+04|-7.365689e+03  5.420284e+07| 0:0:05| spchol  2  3
>  5|0.000|0.000|5.0e-01|1.0e+00|2.7e+05|-7.443855e+03  6.601273e+08| 0:0:06| spchol
>   linsysolve: Schur complement matrix not positive definite
>   switch to LU factor. splu 19 ^ 2
>  6|0.000|0.000|5.0e-01|1.0e+00|2.8e+05|-7.503411e+03  6.644437e+08| 0:0:08| splu 25 ^ 6
>  7|0.000|0.000|5.0e-01|1.0e+00|2.8e+05|-7.513244e+03  6.666954e+08| 0:0:09| splu 19 ^ 4
>  8|0.000|0.000|5.0e-01|1.0e+00|3.6e+06|-7.973681e+03  9.247046e+09| 0:0:10| splu 11 ^ 8
>  9|0.000|0.000|5.0e-01|1.0e+00|3.6e+06|-8.223510e+03  9.273346e+09| 0:0:12| splu 11 ^146
> 10|0.000|0.000|5.0e-01|1.0e+00|3.7e+06|-1.275325e+04  9.374706e+09| 0:0:14| splu 11 ^ 2
> 11|0.000|0.000|5.0e-01|1.0e+00|3.7e+06|-1.287467e+04  9.405316e+09| 0:0:15| splu 11 ^14
> 12|0.000|0.000|5.7e-01|1.0e+00|3.7e+06|-1.281202e+04  9.430516e+09| 0:0:17| splu 11 ^15
> 13|0.000|0.000|5.8e-01|1.0e+00|3.7e+06|-1.210191e+04  9.529248e+09| 0:0:18| splu 11 ^ 3
> 14|0.000|0.000|5.7e-01|1.0e+00|3.7e+06|-1.215342e+04  9.623059e+09| 0:0:20| splu 11 ^ 4
> 15|0.000|0.000|5.7e-01|1.0e+00|3.7e+06|-1.218166e+04  9.669238e+09| 0:0:21| splu 19 ^ 3
> 16|0.000|0.000|5.7e-01|1.0e+00|3.9e+06|-1.214932e+04  1.007884e+10| 0:0:22| splu 19 ^ 2
> 17|0.000|0.000|5.8e-01|1.0e+00|3.9e+06|-1.229787e+04  1.049593e+10| 0:0:24| splu 11 ^26
> 18|0.000|0.000|5.8e-01|1.0e+00|3.9e+06|-1.207022e+04  1.049775e+10| 0:0:25| splu 15 ^ 4
> 19|0.000|0.000|5.8e-01|1.0e+00|3.9e+06|-1.197234e+04  1.052645e+10| 0:0:27| splu 11 ^ 7
> 20|0.000|0.000|5.6e-01|1.0e+00|3.9e+06|-1.211047e+04  1.061349e+10| 0:0:28| splu 11 ^29
> 21|0.000|0.000|5.6e-01|1.0e+00|3.9e+06|-1.211312e+04  1.068253e+10| 0:0:30| splu 11 ^23
> 22|0.000|0.000|5.7e-01|1.0e+00|3.9e+06|-1.276207e+04  1.084509e+10| 0:0:31| splu 11 ^13
> 23|0.000|0.000|1.0e+01|1.0e+00|3.8e+06|-1.327584e+04  1.112537e+10| 0:0:33| splu 11 ^ 5
> 24|0.000|0.000|9.5e+00|1.0e+00|3.8e+06|-1.334990e+04  1.113392e+10| 0:0:34| splu 11 ^ 5
> 25|0.000|0.000|9.5e+00|1.0e+00|3.8e+06|-1.324361e+04  1.115198e+10| 0:0:35| splu 11 ^13
> 26|0.000|0.000|9.5e+00|1.0e+00|3.9e+06|-1.332957e+04  1.128603e+10| 0:0:37| splu 11 ^13
> 27|0.000|0.000|9.8e+00|1.0e+00|3.9e+06|-1.333828e+04  1.133112e+10| 0:0:38| splu 11 ^ 4
> 28|0.000|0.000|9.9e+00|1.0e+00|3.9e+06|-1.339540e+04  1.138619e+10| 0:0:39| splu 11 ^14
> 29|0.000|0.000|9.9e+00|1.0e+00|3.9e+06|-1.340010e+04  1.139132e+10| 0:0:41| splu 11 ^18
> 30|0.000|0.000|9.9e+00|1.0e+00|3.9e+06|-1.350976e+04  1.161405e+10| 0:0:42| splu 13  248
> 31|0.000|0.000|9.9e+00|1.0e+00|3.9e+06|-1.358463e+04  1.162153e+10| 0:0:46| splu 18 ^ 4
> 32|0.000|0.000|9.9e+00|1.0e+00|3.9e+06|-1.426497e+04  1.162325e+10| 0:0:48| splu 11 ^ 7
> 33|0.000|0.000|9.9e+00|1.0e+00|3.9e+06|-1.463301e+04  1.166088e+10| 0:0:49| splu 21 ^22
> 34|0.000|0.000|9.9e+00|1.0e+00|3.9e+06|-1.502559e+04  1.183405e+10| 0:0:50| splu 35
>   stop: steps in predictor too short: pstep = 1.52e-06,  dstep = 9.59e-07
>
> 35|0.000|0.000|9.9e+00|1.0e+00|3.9e+06|-1.502559e+04  1.183405e+10| 0:0:52|
>   prim_inf,dual_inf,relgap = 9.94e+00, 1.00e+00, 3.30e-04
>   sqlp stop: primal problem is suspected of being infeasible
> -------------------------------------------------------------------
>  number of iterations   = 35
>  residual of primal infeasibility
>  certificate (y,Z)      = 4.91e-09
>  reldist to infeas.    <= 5.70e-13
>  Total CPU time (secs)  = 51.81
>  CPU time per iteration = 1.48
>  termination code       =  1
>  DIMACS: 5.7e-01  0.0e+00  1.9e+01  0.0e+00  -1.0e+00  3.6e-04
> -------------------------------------------------------------------
>
> ------------------------------------------------------------
> Status: Unbounded
> Optimal value (cvx_optval): +Inf
``````

It returnes a variable, and according to the guide book, it represents an unbounded direction. But I don’t konw what it means. I’m new to this and any help is appreciated.

SDPT 3 and CVX have determined to be unbounded. Actually, SDPT3 solved the dual problem and determined it to be infeasible, which corresponds to your problem as entered being unbounded.

Given that you are maximizing, that means the optimal objective value is infinity. In order to prevent that, you need to impose additional or tighter constraints and/or modify the objective function. Please read https://yalmip.github.io/debuggingunbounded/ , for which the advice applies also to CVX, even though it is written for YALMIP>