How do I add constraints to two matrix variables

Uncategorized
Apr 22, 2021
L

image


How do I put a constraint or an assignment on Y=y*y’

M

You can’t put a constraint or assignment on y*y' in CVX, because y*y' is non-convex. (8b) is a semidefinite relaxation of Y = y*y', and the constraint capturing that relaxation is in your code.

L
Replying to #2

thanks, it will warning This linear matrix inequality appears to be unsymmetric. This is
very likely an error that will produce unexpected results. Please check
and the result of y(5:8) are not what i expected . maybe is F’s problem?

M

You need to declare Y to be symmetric, because by default, it is full.

variable Y(8.8) symmetric

Also, i recommend you not use quiet until you are sure everything is working correctly. By not using quiet, you will see all the solver and CVX output.

L

the warning is disappeared,but the outout become
Status: Failed
Optimal value (cvx_optval): NaN

M

Perhaps you can show us all the solver and CvX output.

L

(upload://txvcx0aWJGIUjzKMrr3X419CpQI.png)
sometimes it can get a result ,but sometimes, the outcome become NaN

L
Replying to #7

)

M

Perhaps the input data scaling is bad, such as having some very large numbers. Try to re-scale (change units of variables) so that non-zero input data is within a small number of orders of magnitude of one.

You can also try using Mosek if you have access to it.

I recommend not using CVX_precision best no matter what solver you use.

L

real thanks for you help i have solved this problem. now i want to set a range for the value of my variable y, how should i do. It seems wrong to put it directly in the constraint

M

If
lower_bound <= y <= upper_bound
is what you want, then use it.