# Problem 1 [45 points] Geometric programming¶

The standard form of geometric program (GP) given in Lec. 11, p. 19 is

$$\underset{x\in\mathbb{R}^{n}_{>0}}{\text{minimize}}\qquad f_{0}(x)\\ \text{subject to}\quad f_{i}(x) \leq 1, \quad i=1,...,m, \\ \qquad\qquad h_{j}(x) = 1, \quad j=1,...,p,$$

where $f_{0}, f_{1}, ..., f_{m}$ are posynomials, and $h_{1}, ..., h_{p}$ are monomials. This standard form is not a convex optimization problem. But we can transform it exactly to a convex optimization problem, by logarithmic change-of-variable $y_{i} = \log x_{i}$ (so $x_{i} = \exp(y_{i})$), followed by applying the monotone function $\log(.)$ to the objective and to the both sides of the constraints:

$$\underset{y\in\mathbb{R}^{n}}{\text{minimize}}\qquad \log\left(f_{0}(\exp(y))\right)\\ \text{subject to}\quad \log(f_{i}(\exp(y))) \leq 0, \quad i=1,...,m, \\ \qquad\qquad \log(h_{j}(\exp(y))) = 0, \quad j=1,...,p,$$

where $\exp(y)$ denotes elementwise exponential of the vector $y\in\mathbb{R}^{n}$. Clearly, the above optimization problem and the original GP are equivalent.

## (a) [10 points] A simple case of the transformed problem¶

To understand why the transformed problem is convex, consider the simple case: $m=p=1$, and that $$f_{0}(x) = \sum_{k=1}^{K_{0}}\alpha_{k}x_{1}^{\beta_{1,k}}...x_{n}^{\beta_{n,k}}, \qquad f_{1}(x) = \sum_{k=1}^{K_{1}}a_{k}x_{1}^{b_{1,k}}...x_{n}^{b_{n,k}}, \qquad h_{1}(x) = c x_{1}^{d_{1}} x_{2}^{d_{2}} ... x_{n}^{d_{n}}, \qquad \alpha_{k}, a_{k}, c> 0.$$ Prove that the transformed problem has the form $$\underset{y\in\mathbb{R}^{n}}{\text{minimize}}\qquad \log\left(\displaystyle\sum_{k=1}^{K_{0}}\exp(p_{k}^{\top}y + q_{k})\right)\\ \text{subject to} \qquad\log\left(\displaystyle\sum_{k=1}^{K_{1}}\exp(r_{k}^{\top}y + s_{k})\right) \leq 0,\\ \quad u^{\top}y = t.$$

In other words, derive the transformed problem data $p_{k}, q_{k}, r_{k}, s_{k}, u, t$ as function of the original problem data: $\alpha_{k}, \beta_{1,k}, ..., \beta_{n,k}, a_{k}, b_{1,k}, ..., b_{n,k}, c, d_{1}, ..., d_{n}$.

## Solution for part 1(a):¶

Rewriting the GP problem in the given transformed form yields $$p_{k} = \begin{pmatrix} \beta_{1,k}\\ \vdots\\ \beta_{n,k}\end{pmatrix}, \quad q_{k} = \log\alpha_{k}, \quad r_{k} = \begin{pmatrix}b_{1,k}\\ \vdots\\ b_{n,k} \end{pmatrix}, \quad s_{k} = \log a_{k}, \quad u = \begin{pmatrix}d_{1}\\ \vdots\\ d_{n}\end{pmatrix}, \quad t = -\log c.$$

## (b) [20 points] Establishing that the transformed problem is convex¶

Prove that the transformed problem derived in part (a) is indeed a convex optimization problem.

(Hint: First show that log-sum-exp is a convex function using second order condition. Then think operations preserving function convexity.)

## Solution for part 1(b):¶

That log-sum-exp is convex follows from showing the Hessian is positive semidefinite (see p. 74 in textbook). Since convex composed with affine is convex, therefore the objective function appearing in the tranformed form given in (c.1) is a convex function.

The inequality constraints appearing in the tranformed form given in (c.1) is zero sub-level set of a convex function, therefore it is a convex set. The equality constraint appearing in the tranformed form given in (c.1) is a hyperplane (which is a convex set). Since intersection of convex sets is convex, hence the constraint set in the tranformed form given in (c.1) is convex.

Thus, the tranformed form given in (c.1) is minimization of a convex function over a convex set, which is a convex optimization problem.

## (c) [15 points] Buying suitcase for holiday travel¶

While making air travel plans for the coming holidays, Alice realizes that she needs to buy a new travel suitcase of maximum volume. The decision variables are the height $h$, width $w$, and the depth $d$, which define the shape of a 3D rectangular suitcase.

However, the airlines has put some regulations on the shape of the check in luggage as follows. The airlines website specifies an upper bound $A_{\text{wall}}$ for the total wall area $2(hw + hd)$. It also specifies an upper bound $A_{\text{floor}}$ for the floor area $wd$. Furthermore, it specifies bounds for the aspect ratios $h/w$ and $w/d$ as

$$\alpha \leq h/w \leq \beta, \qquad \gamma \leq w/d \leq \delta.$$

Using the data $A_{\text{wall}}, A_{\text{floor}}, \alpha, \beta, \gamma, \delta$ from the airlines website, Alice needs to find the optimal suitcase, i.e., the tuple $(h,w,d)$ that maximizes the volume while respecting the shape constraints.

Clearly formulate the optimization problem Alice needs to solve in GP standard form given in Lec. 11, p. 19. Explain all the details.

## Solution for part 1(c):¶

Since volume equals to $hwd$, the optimization problem under consideration is

However, the above is not in GP standard form given in Lec. 11, p. 19. We now transcribe it to the standard form as:

# Problem 2 [55 points] Transformation of problems to SDP¶

The motivation for the following problems comes from the inclusion diagram in Lec. 9, p. 22.

## (a) [10 points] LP as SDP¶

Given $A\in\mathbb{R}^{m\times n}$, $b\in\mathbb{R}^{m}$, $c\in\mathbb{R}^{n}$, rewrite the LP (Lec. 10, p. 1) $$\underset{x\in\mathbb{R}^{n}}{\text{minimize}}\quad c^{\top}x\\ \text{subject to}\quad Ax \preceq b,$$ as the SDP $$\underset{x\in\mathbb{R}^{n}}{\text{minimize}}\quad c^{\top}x\\ \text{subject to}\quad F(x) \succeq 0,$$

that is, write the matrix $F(x)$ appearing in the linear matrix inequality (LMI) constraint of the SDP (see Lec. 10, p. 7) in terms of the data of the LP.

## Solution for part 2(a):¶

We write the elementwise vector inequality $Ax \preceq b$ as the LMI $F(x) \succeq 0$, with the $m\times m$ matrix

$$F(x) = {\rm{diag}}\left(b - Ax\right) = {\rm{diag}}\left(b_{1} - (Ax)_{1}, ..., b_{m} - (Ax)_{m}\right).$$

## (b) [10 points] QP as SDP¶

Given $A \in \mathbb{S}^{n}_{+}$, $b\in\mathbb{R}^{n}$, $c\in\mathbb{R}$, $P\in\mathbb{R}^{m\times n}$, $q\in\mathbb{R}^{m}$, rewrite the QP (Lec. 10, p. 2) $$\underset{x\in\mathbb{R}^{n}}{\text{minimize}}\quad \frac{1}{2}x^{\top}Ax + b^{\top}x + c\\ \text{subject to}\quad Px \preceq q,$$ as the SDP $$\underset{x\in\mathbb{R}^{n}}{\text{minimize}}\quad f^{\top}x\\ \text{subject to}\quad F(x) \succeq 0,$$

that is, write the vector $f$ and the matrix $F(x)$ appearing in the linear matrix inequality (LMI) constraint of the SDP (see Lec. 10, p. 7) in terms of the data of the QP.

## Solution for part 2(b):¶

Similar to part 2(a), we have $Px \preceq q \:\Leftrightarrow {\rm{diag}}\left(q-Px\right)\succeq 0$. Now express $A\in\mathbb{S}^{n}_{+}$ as $A = WW^{\top}$ where $W\in\mathbb{R}^{n\times k}$ (from linear algebra, we know this is always possible).

To make the objective linear in $x$, apply the epigraph form (Lec. 11, p. 2) by letting $\frac{1}{2}x^{\top}A x \leq t$. Then the objective becomes $$\underset{(x,t)\in\mathbb{R}^{n}\times\mathbb{R}}{\text{minimize}}\quad t + b^{\top}x + c.$$ The constraint $\frac{1}{2}x^{\top}A x = \frac{1}{2} \parallel W^{\top}x \parallel_{2}^{2} \leq t$, by Schur Complement Lemma (Lec. 8, p. 6), becomes

$$G(x,t) := \begin{pmatrix} I & W^{\top}x\\ x^{\top}W & 2tI \end{pmatrix} \succeq 0.$$

Let $z := \begin{pmatrix}x\\ t\end{pmatrix}$ be the new decision vector (that is, $z$ becomes the new $x$). Then the new objective is to minimize $f^{\top}z$ with $f = \begin{pmatrix}b\\ 1\end{pmatrix}$. Notice that the constant $c$ doesn't matter since it will not change the argmin, but will only shift the minimum value. Finally, collecting the LMIs together:

$$F(z) \equiv F(x,t) = {\rm{diag}}\left(G(x,t), {\rm{diag}}\left(q-Px\right)\right) \succeq 0.$$

## (c) [10 points] QCQP as SDP¶

Given $A \in \mathbb{S}^{n}_{+}$, $b\in\mathbb{R}^{n}$, $c\in\mathbb{R}$, $P\in\mathbb{R}^{p\times n}$, $q\in\mathbb{R}^{p}$, and $\left(M_{i},n_{i},r_{i}\right)\in\mathbb{S}^{n}_{++}\times\mathbb{R}^{n}\times\mathbb{R}$ for all $i=1,...,m$, rewrite the QCQP (Lec. 10, p. 3) $$\underset{x\in\mathbb{R}^{n}}{\text{minimize}}\quad \frac{1}{2}x^{\top}Ax + b^{\top}x + c\\ \qquad\qquad\qquad\qquad\qquad\quad\text{subject to}\quad \frac{1}{2}x^{\top}M_{i}x + n_{i}^{\top}x + r_{i} \leq 0, \quad\text{for all}\;i=1,...,m,\\ \qquad\quad Px \preceq q,$$ as the SDP $$\underset{x\in\mathbb{R}^{n}}{\text{minimize}}\quad f^{\top}x\\ \text{subject to}\quad F(x) \succeq 0,$$

that is, write the vector $f$ and the matrix $F(x)$ appearing in the linear matrix inequality (LMI) constraint of the SDP (see Lec. 10, p. 7) in terms of the data of the QCQP.

## Solution for part 2(c):¶

As in part 2(b), let $A = W_{0}W_{0}^{\top}$ and $M_{i}=W_{i}W_{i}^{\top}$ for all $i=1,...,m$.

Also let $t:=(t_{0},t_{1},...,t_{m})^{\top} \in\mathbb{R}^{m+1}$, and $\frac{1}{2}x^{\top}A x = \frac{1}{2} \parallel W_{0}^{\top}x \parallel_{2}^{2} \leq t_{0}$, $\frac{1}{2}x^{\top}M_{i} x = \frac{1}{2} \parallel W_{0}^{\top}x \parallel_{2}^{2} \leq t_{i}$ for $i=1,...,m$.

Define $z := (x,t)^{\top} \in \mathbb{R}^{n+m+1}$. Following the same procedure as in part 2(b), we then get

$$G_{i}(z) \equiv G_{i}(x,t) := \begin{pmatrix} I & W_{i}^{\top}x\\ x^{\top}W_{i} & 2t_{i}I \end{pmatrix} \succeq 0 \quad\forall\;i=0,...,m, \qquad G(z) := {\rm{diag}}\left(G_{0}(z), G_{1}(z), ..., G_{m}(z)\right)\succeq 0.$$

We also have the constraints $t_{i} + n_{i}^{\top}x + r_{i} \leq 0 \:\Leftrightarrow\: \begin{pmatrix}n_{i}\\ 0_{1\times 1}\\ e_{i}^{m}\end{pmatrix}^{\top} \begin{pmatrix}x\\ t\end{pmatrix}\leq -r_{i}$, where $e_{i}^{m}$ is the $i$th standard basis vector in $m$ dimensions. Letting $r:=(r_1, ..., r_{m})^{\top}$, and $H$ to be the matrix with rows $\begin{pmatrix}n_{i}\\ 0_{1\times 1}\\ e_{i}^{m}\end{pmatrix}^{\top}$, we can write these constraints as a single inequality:

$$H \begin{pmatrix}x\\ t\end{pmatrix} \preceq -r \quad\Leftrightarrow\quad {\rm{diag}}\left(-r - Hz\right) \succeq 0.$$

Collecting the LMIs together,

$$F(z) \equiv F(x,t) := {\rm{diag}}\left(G(z), {\rm{diag}}\left(-r - Hz\right), {\rm{diag}}\left(q-Px\right)\right) \succeq 0.$$

The objective of our SDP is $f^{\top}z$ where $$f := \begin{pmatrix}b\\e_{1}^{m+1}\end{pmatrix}.$$

## (d) [10 points] SOCP as SDP¶

Given $f\in\mathbb{R}^{n}$, $A_{i}\in\mathbb{R}^{(n_{i}-1)\times n}$, $b_{i}\in\mathbb{R}^{n_{i}-1}$, $c_{i}\in\mathbb{R}^{n}$, $d_{i}\in\mathbb{R}$, $P\in\mathbb{R}^{p\times n}$, $q\in\mathbb{R}^{p}$, rewrite the SOCP (Lec. 10, p. 5)

$$\underset{x\in\mathbb{R}^{n}}{\text{minimize}}\qquad f^{\top}x\\ \qquad\qquad\qquad\qquad\text{subject to}\quad \parallel A_{i}x + b_{i}\parallel_{2}\;\leq\; c_{i}^{\top}x + d_{i}, \quad i=1,...,m,\\ \qquad\qquad\qquad\qquad Px \preceq q,$$

as the SDP $$\underset{x\in\mathbb{R}^{n}}{\text{minimize}}\quad f^{\top}x\\ \text{subject to}\quad F(x) \succeq 0,$$

that is, write the matrix $F(x)$ appearing in the LMI constraint of the SDP in terms of the data of the SOCP.

## Solution for part 2(d):¶

For any vector $u$, from the Schur Complement Lemma, we know that $$\parallel u \parallel \leq t \quad \Leftrightarrow \quad \begin{bmatrix} tI & u\\u^{\top} & t\end{bmatrix} \succeq 0.$$ Applying this to the given SOCP constraints result in the LMIs: $$G_{i}(x) := \begin{bmatrix} \left(c_{i}^{\top}x + d_{i}\right)I & A_{i}x + b_{i}\\\left(A_{i}x + b_{i}\right)^{\top} & c_{i}^{\top}x + d_{i}\end{bmatrix} \succeq 0, \quad i=1, ..., m,$$ which are equivalent to the single LMI: $$G(x) = {\rm{diag}}\left(G_{1}(x), ..., G_{m}(x)\right) \succeq 0,$$ since a block diagonal matrix is positive semidefinite if and only if each of the diagonal block is positive semidefinite.

Therefore, $F(x) = {\rm{diag}}\left({\rm{diag}}\left(q-Px\right), G(x)\right)$.

## (e) [15 points] A nonlinear optimization problem as SDP¶

Given $A\in\mathbb{R}^{m\times n}$, $b\in\mathbb{R}^{m}$, and symmetric matrices $P_{0},P_{1}, ..., P_{n}\in\mathbb{S}^{m}$, define

$$P(x) := P_{0} + x_{1}P_{1} + ... + x_{n}P_{n}, \qquad x\in\mathbb{R}^{n}.$$

Rewrite the nonlinear optimization problem

$$\underset{x\in\mathbb{R}^{n}}{\text{minimize}}\quad (Ax + b)^{\top}\left(P(x)\right)^{-1}(Ax + b)\\ \text{subject to}\quad P(x) \succ 0,$$

as the SDP $$\underset{x\in\mathbb{R}^{n}}{\text{minimize}}\quad f^{\top}x\\ \text{subject to}\quad F(x) \succeq 0,$$

that is, write the vector $f$ and the matrix $F(x)$ appearing in the SDP in terms of the data of the nonlinear problem.

Hint: Think epigraph form Lec. 11, p. 2.

## Solution for part 2(e):¶

Following the hint, the epigraph form results in constraint $(Ax + b)^{\top}\left(P(x)\right)^{-1}(Ax + b) \leq t$, which by Schur Complement Lemma (Lec. 8, p. 6, last line), is equivalent to the LMI $$F(x,t) := \begin{pmatrix} P(x) & (Ax+b)\\ (Ax+b)^{\top} & t \end{pmatrix} \succeq 0.$$

Therefore, we get a standard form SDP in variable $z:=(x,t)^{\top}$ with $f:=\begin{pmatrix}0_{n\times 1}\\ 1\end{pmatrix}$ and $F(z)\equiv F(x,t)$ given above.