1

I am trying to solve exercise 4.3(d) of the Additional Exercises for Convex Optimization. In this exercise, it is asked to express the following constraint in CVX, using the rules for disciplined convex programming (DCP).

$$ x + z \leq 1 + \sqrt{xy - z^2}, \qquad x \ge 0, \quad y \ge 0 \text{ (with implicit constraint $y>0$)}. $$

I am stuck and would appreciate if someone could help me.


For my first attempt, I noticed that inside the square root is the determinant of the symmetric matrix $$ X = \begin{pmatrix}x & z \\ z & y \end{pmatrix}. $$ So moving the $1$ to the left-hand side, then taking the logarithm of the inequality, yields the equivalent constraint $$ \log(x+z-1) \leq \frac12 \log\det X. $$ The right-hand side is fine, since it is concave. Alas, the left-hand side is also concave, so this does not work. For my second attempt, I tried removing the square root by squaring. This leads to a quadratic inequality $$ v^T P v + q^T v \leq 0, \qquad P = \begin{pmatrix} 1 & -1/2 & 1 \\ -1/2 & 0 & 0 \\ 1 & 0 & 2 \end{pmatrix} \qquad v = (x,y,z) $$ Unfortunately, $P$ is not positive semidefinite. So this approach also fails. Any hints, please?

tigre200
  • 225

1 Answers1

1

I think this is a solution. Taking inspiration from the definition of the square root, the original condition implies that there exists a $t$ such that $$ x + z = 1 + t $$ $$ t \ge 0 \\ $$ $$ t^2 \le xy - z^2. $$

But we can also verify that this new set of conditions implies the original condition. Thus, they are equivalent.

To implement it in CVXPY, in the last condition, we gather the squares on the left-hand side, then take the square root to obtain $$ \sqrt{t^2 + z^2} \le \sqrt{xy}. $$ The left-hand side is the euclidean norm, and the right-hand side is the geometric mean. The code in CVXPY is then:

x = cp.Variable()
y = cp.Variable()
z = cp.Variable()
t = cp.Variable()
cstr = [x + z == 1 + t,
        t >= 0,
        cp.norm(cp.vstack([t,z])) <= cp.geo_mean(cp.vstack([x,y]))]
tigre200
  • 225