I am interested in using CVX to solve a quadratically constrained program which has just arisen in my work. I think I have got CVX to solve the optimization problem correctly, after following the quickstart guide. However,

CVX is spending too much time (about 100 seconds) analyzing the constraints of the problem before passing it onto MOSEK, which requires only 8 seconds to solve the program.

I would like to know a better way to rewrite my problem in the CVX framework so that MOSEK can be called immediately after declaring the program.

My optimization problem has the following 2T+1 unknowns, where T, a constant, is ~16000:

$$\beta = (\lambda_{r1}, \ldots, \lambda_{rT}, \lambda_{s1}, \ldots, \lambda_{sT}, z)$$

My optimization problem is

```
min z
```

subject to

A_r \lambda_r − A_s\lambda_s = b_r

A_s \lambda_r + A_r \lambda_s = b_s

0 \leq z

and

\forall 1\leq j \leq T

\lambda_{rj}^2 + \lambda_{sj}^2 - z \leq 0

| \lambda_{rj} | \leq 1 and | \lambda_{sj} | \leq 1

In the above program, A_r and A_s are pre-computed dense constant matrices of dimensions 2 \times T and b_r and b_s are constant vectors of size 2\times 1.

I am not sure if this is helpful, but the quadratic constraints can be written as β^t P_j β −z ≤ 0, where P_j is a (2T + 1) matrix of zeroes with its (j,j) th and (T +j,T +j) th entry being 1, which means that the P_j matrix is positive semidefinite. Since all these quadratic constraints are

sparse, can we rewrite the code below to “directly” indicate to CVX the

structure of the problem?

The CVX code that I am using (and would like to speed up) is as follows.

```
cvx_solver mosek
cvx_begin
variable lambda_r(T)
variable lambda_s(T)
variable z
minimize( z )
subject to
-1*ones(T,1) <= lambda_r <= ones(T,1);
-1*ones(T,1) <= lambda_s <= ones(T,1);
0 <= z;
A_r*lambda_r - A_s*lambda_s == b_r;
A_s*lambda_r + A_r*lambda_s == b_s;
lambda_r.^2 + lambda_s.^2 - z*ones(T,1) <= 0;
cvx_end
```

I am using CVX Version 2.1 on a Windows 7 machine.