Use cvx to solve convex problem

Uncategorized
Mar 12, 2014
N

RSS is matrice,as is a vector,Why the solution turns out to be infeasible and wrob is a NaN vector,what’s the problem?

cvx_begin
              variables wrob(n);
              variable u(1);
              minimize((wrob)'*Rss*(wrob));
              subject to
                     u==wrob'*as;
                     imag(wrob'*as)==0;
                     u>=3*norm(wrob)+1;
                     
  cvx_end
E

What does the matrix Rss look like? Are you certain that it is positive definite?

M

If it weren’t positive definite, CVX would have rejected the problem.

M

Looks to me like you intended for wrob to be complex, but you did not declare it as complex. (Otherwise, why have imag(wrob'*as)==0?

M

What is your evidence that this is feasible?

M

Well, to be a stickler, CVX would have rejected the problem if RSS was not positive semi-definite.

E

Is it possible that the matrix is just barely positive semi-definite? Enough to not throw an error, but not enough to prevent numerical problems?

M

I’m not sure the solvers are sensitive in that manner.

N

Another error appeared every time I declare" variable wrob(n) complex;",it said “??? Error using ==> variable at 133
Index exceeds matrix dimensions.”

N

For n=10; “imag(wrob’as)==0" is for "u>=3norm(wrob)+1;”, or it may appear “complex> constant” as a error, right?

M

No because u is real. CVX assumes a variable is real until you tell it otherwise. You cannot force a variable to be complex by putting it an equality constraint; it will instead force the complex part to have a zero imaginary part.

M

As for the odd error message I suggest you submit a bug report to http://support.cvxr.com with a small snippet of code that reproduces the error,