【CVX】SDP and conic form problems

Basic model

LMIs and SDPs with one variable. The generalized eigenvalues of a matrix pair ( A , B ) (A, B) (A,B), where A , B ∈ S n A, B\in\mathcal{S}^n A,BSn, are defined as the roots of the polynomial det ⁡ ( λ B − A ) \det(\lambda B-A) det(λBA).
Suppose B B B is nonsingular, and that A A A and B B B can be simltaneously diagonalized by a congruence, i.e., there exists a nonsingular, and that A A A and B B B can simultaneously diagonalized by a congruence, i.e, there exists a nonsingular R ∈ R n × n R\in\mathbb{R}^{n\times n} RRn×n such that
R T A R = d i a g ( a ) R T B R = d i a g ( b ) R^TAR=diag(a)\\ R^TBR=diag(b) RTAR=diag(a)RTBR=diag(b)
where a , b ∈ R n a, b\in\mathbb{R}^n a,bRn.
Moreover, a sufficient condition for this to hold is that there exists t 1 , t 2 t_1, t_2 t1,t2 such that t 1 A + t 2 B ≻ 0 t_1A+t_2B\succ 0 t1A+t2B0.

Try to find the optimal t t t that would maximize c ∗ t c*t ct while A − t ∗ B A-t*B AtB is still P.S.D, we could solve the following SDP:
min ⁡ c ∗ t s . t . t B ≺ A \min c*t\\ s.t.\quad tB\prec A mincts.t.tBA

cvx code

%% generate input data
rng(1);
n = 4;
A = randn(n); A = 0.5*(A'+A);
B = randn(n); B = B'*B;
c = -1;

%% cvx
cvx_begin sdp
    variable t
    minimize c*t
    t*B<=A;
cvx_end

disp('the optimal t obtained is');
disp(t);

yalmip code

%% yalmip
t = sdpvar;
F = [t*B<=A];
obj = c*t;
optimize(F, obj);

disp('the optimal t obtained is');
disp(value(t));

A simple QP with inequalities constraints

Prove that x ∗ = ( 1 , 1 / 2 , − 1 ) x^*=(1, 1/2, -1) x=(1,1/2,1) is optimal for the optimization problem
min ⁡ ( 1 / 2 ) x T P x + q T x + r s . t . − 1 ≤ x i ≤ 1 , i = 1 , 2 , 3 \min (1/2)x^TPx+q^Tx+r\\ s.t.\quad -1\leq x_i\leq 1, i=1,2,3 min(1/2)xTPx+qTx+rs.t.1xi1,i=1,2,3
where
P = [ 13 12 − 2 12 17 6 − 2 6 12 ] q = [ − 22.0 − 14.5 13.0 ] r = 1 P=\left[ \begin{matrix} 13 & 12 & -2\\ 12 & 17 & 6\\ -2 & 6 & 12 \end{matrix} \right]\quad q=\left[ \begin{matrix} -22.0\\ -14.5\\ 13.0 \end{matrix} \right]\quad r=1 P=13122121762612q=22.014.513.0r=1

cvx code

%% cvx: QP
cvx_begin
    variable x(n)
    minimize ((1/2)*quad_form(x, P)+q'*x+r);
    x>=-1;
    x<=1;
cvx_end

yalmip code

%% yalmip
x = sdpvar(n, 1);
F = [-1<=x<=1];
obj = (1/2)*x'*P*x+q'*x+r
optimize(F, obj);

Reference

Convex Optimiztion S.Boyd Page 203, 215

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Quant0xff

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值