Dear all,

I’m optimizing the following problem

``````    cvx_begin  quiet
variable p(N,1)

subject to
quad_form( p , G )  <= 1;
quad_form( p , J)  <= 1;

cvx_end
``````

where H, G, and J are semidefinite positive matrices. However, I obtain the following error message:

The second argument must be positive or negative semidefinite.

Error in pSCA (line 30)
quad_form( p , J) <= 1;

How can I express this problem? Just for the completeness, eigs(J) provides

ans =

1.0000
-0.0000 - 0.0000i
-0.0000 + 0.0000i
0.0000
-0.0000 + 0.0000i
-0.0000 - 0.0000i

Based on the output you show, it looks like J has slightly negative eigenvalues, which is what is causing the error message.

How are you constructing or getting J? Either improve the way it is constructed, or modify it to be psd, such as by adding a small multiple of the identity matrix.

And don’t use the quiet option until your program is running well and reliably.

Thanks Mark,

Based on your comment, I updated Ji= Ji + alpha*eye(N,N);

And only when alpha >= 1, the error disappears. Even for alpha= 1e-1 it remains. I think I’d re-write the problem somehow. In any case, I think it’s important to find another way to tunning how CVX considers a matrix to be undefined.

Thanks in any case,

You only showed the result of `eigs` , which if run with default settings, displays the 6 largest magnitude eigenvalues.

Is `N` larger than 6? If so, perhaps you have significantly negative eigenvalue(s). What is the result of `min(eig(J))` ? If that is about -1, then “updating” J by adding eye(N,N) is resulting in your solving a different problem than what you originally specified. If so, you need to rethink/reexamine your problem formulation.

N is lower than 6.

min(eig(J)) equals to zero

J = [1 0 0 -1; 0 0 0 0; 0 0 0 0; 0 0 0 0;];