Problem with quadratic forms constraint

Hi,

I am writing the following code using CVX,


clc
clear
close all
cvx_setup

A = [-1 0
     0 -2];
B1 = eye(2);
B2 = eye(2);
C = eye(2);
g2 = 3; g3 = -1;

cvx_begin
    variable k(2, 2)
    variable W(2, 2) semidefinite
    minimize (trace_inv(W));
    subject to
        (A - B1*k)*W+W*(A - B1*k)' == - B2*B2';
        trace(C'*W*C) <= g2;
        max(eig(A - B1*k)) <= g3;
cvx_end
k

but I am getting the following error,

Only scalar quadratic forms can be specified in CVX

Besides, I am going to define W variable as a positive definite matrix.

It’s appreciated if anyone helps.

Thanks
Mohammad

You are multiplying 2 matrix variables in the first constraint. That is not allowed in CVX. I will presume that the first constraint is non-convex unless you show otherwise.

Additionally, you need to change the last constraint to
lambda_max(A - B1*k) <= g3;
CVX will enforce that the argument of lambda_max is symmetric.

Thanks for your reply.

Is it possible to use “gram” command in CVX (to compute the controllability grammian)?

No. gram command cannot be used in CVX (on CVX variables or expressions). Controllability grammians are not my area, so I can’t help with model formulations. I leave it to you to determine whether you can formulate an appropriate LMI, which will be acceptable to CVX.