# 6.4 Power Cone Optimization¶

The structure of a typical conic optimization problem is

$\begin{split}\begin{array}{lccccl} \mbox{minimize} & & & c^T x+c^f & & \\ \mbox{subject to} & l^c & \leq & A x & \leq & u^c, \\ & l^x & \leq & x & \leq & u^x, \\ & & & Fx+g & \in & \D, \end{array}\end{split}$

(see Sec. 12 (Problem Formulation and Solutions) for detailed formulations). Here we discuss how to set-up problems with the primal/dual power cones.

MOSEK supports the primal and dual power cones, defined as below:

• Primal power cone:

$\POW_n^{\alpha_k} = \left\{ x\in \real^n ~:~ \prod_{i=0}^{n_\ell-1} x_i^{\beta_i} \geq \sqrt{\sum_{j=n_\ell}^{n-1}x_j^2},\ x_0\ldots,x_{n_\ell-1}\geq 0 \right\}$

where $$s = \sum_i \alpha_i$$ and $$\beta_i = \alpha_i / s$$, so that $$\sum_i \beta_i=1$$.

• Dual power cone:

$(\POW_n^{\alpha_k}) = \left\{ x\in \real^n ~:~ \prod_{i=0}^{n_\ell-1} \left(\frac{x_i}{\beta_i}\right)^{\beta_i} \geq \sqrt{\sum_{j=n_\ell}^{n-1}x_j^2},\ x_0\ldots,x_{n_\ell-1}\geq 0 \right\}$

where $$s = \sum_i \alpha_i$$ and $$\beta_i = \alpha_i / s$$, so that $$\sum_i \beta_i=1$$.

Perhaps the most important special case is the three-dimensional power cone family:

$\POW_3^{\alpha,1-\alpha} = \left\lbrace x \in \real^3: x_0^\alpha x_1^{1-\alpha}\geq |x_2|,\ x_0,x_1\geq 0 \right\rbrace.$

which has the corresponding dual cone:

For example, the conic constraint $$(x,y,z)\in\POW_3^{0.25,0.75}$$ is equivalent to $$x^{0.25}y^{0.75}\geq |z|$$, or simply $$xy^3\geq z^4$$ with $$x,y\geq 0$$.

For other types of cones supported by MOSEK, see Sec. 15.9 (Supported domains) and the other tutorials in this chapter. Different cone types can appear together in one optimization problem.

## 6.4.1 Example POW1¶

Consider the following optimization problem which involves powers of variables:

(6.12)$\begin{split}\begin{array} {lrcl} \mbox{maximize} & x_0^{0.2}x_1^{0.8} + x_2^{0.4} - x_0 & & \\ \mbox{subject to} & x_0+x_1+\frac12 x_2 & = & 2, \\ & x_0,x_1,x_2 & \geq & 0. \end{array}\end{split}$

We convert (6.12) into affine conic form using auxiliary variables as bounds for the power expressions:

(6.13)$\begin{split}\begin{array} {lrcl} \mbox{maximize} & x_3 + x_4 - x_0 & & \\ \mbox{subject to} & x_0+x_1+\frac12 x_2 & = & 2, \\ & (x_0,x_1,x_3) & \in & \POW_3^{0.2,0.8}, \\ & (x_2,1.0,x_4) & \in & \POW_3^{0.4,0.6}. \end{array}\end{split}$

The two conic constraints shown in (6.13) can be expressed in the ACC form as shown in (6.14):

(6.14)$\begin{split}\left[\begin{array}{ccccc}1&0&0&0&0\\0&1&0&0&0\\0&0&0&1&0\\0&0&1&0&0\\0&0&0&0&0\\0&0&0&0&1\end{array}\right] \left[\begin{array}{c}x_0\\x_1\\x_2\\x_3\\x_4\end{array}\right] + \left[\begin{array}{c}0\\0\\0\\0\\1\\0\end{array}\right] \in \POW^{0.2,0.8}_3 \times \POW^{0.4,0.6}_3.\end{split}$

Setting up the linear part

The linear parts (constraints, variables, objective) are set up using exactly the same methods as for linear problems, and we refer to Sec. 6.1 (Linear Optimization) for all the details. The same applies to technical aspects such as defining an optimization task, retrieving the solution and so on.

Setting up the conic constraints

In order to append the conic constraints we first input the matrix $$\afef$$ and vector $$\afeg$$ which together determine all the six affine expressions appearing in the conic constraints of (6.13)

    let pc1 = task.append_primal_power_cone_domain(3, &[0.2, 0.8])?;
let pc2 = task.append_primal_power_cone_domain(3, &[4.0, 6.0])?;

// Create data structures F,g so that
//
//   F * x + g = (x(0), x(1), x(3), x(2), 1.0, x(4))
//
task.put_afe_f_entry_list(&[0, 1, 2, 3, 5],         // Rows
&[0, 1, 3, 2, 4],         // Columns
&[1.0, 1.0, 1.0, 1.0, 1.0])?;

// Append the two conic constraints
&[0, 1, 2],           // Rows from F
&[0.0,0.0,0.0])?;     // Unused
&[3, 4, 5],           // Rows from F
&[0.0,0.0,0.0])?;     // Unused


Following that, each of the affine conic constraints is appended using the function Task.append_acc. The first argument selects the domain, which must be appended before being used, and must have the dimension matching the number of affine expressions appearing in the constraint. In the first case we append the power cone determined by the first three rows of $$\afef$$ and $$\afeg$$ while in the second call we use the remaining three rows of $$\afef$$ and $$\afeg$$.

Variants of this method are available to append multiple ACCs at a time. It is also possible to define the matrix $$\afef$$ using a variety of methods (row after row, column by column, individual entries, etc.) similarly as for the linear constraint matrix $$A$$.

For a more thorough exposition of the affine expression storage (AFE) matrix $$\afef$$ and vector $$\afeg$$ see Sec. 6.2 (From Linear to Conic Optimization).

Source code

Listing 6.5 Source code solving problem (6.12). Click here to download.
extern crate mosek;
use mosek::*;

const INF : f64 = 0.0;

fn main()  -> Result<(),String> {
let numcon : i32 = 1;
let numvar : i32 = 5;

// Since the value infinity is never used, we define
// 'infinity' symbolic purposes only

let cval = vec![ 1.0, 1.0, -1.0 ];
let csub = vec![ 3,   4,    0 ];

let aval = vec![ 1.0, 1.0, 0.5 ];
let asub = vec![ 0, 1, 2 ];

/* Create the optimization task. */
Some(e) => e,
None => return Err("Failed to create task".to_string()),
}.with_callbacks();
// Directs the log task stream to the user specified
// method msgclass.streamCB

/* Append 'numcon' empty constraints.
The constraints will initially have no bounds. */

/* Append 'numvar' variables.
The variables will initially be fixed at zero (x=0). */

/* Set up the linear part of the problem */

/* Add a conic constraint */
let pc1 = task.append_primal_power_cone_domain(3, &[0.2, 0.8])?;
let pc2 = task.append_primal_power_cone_domain(3, &[4.0, 6.0])?;

// Create data structures F,g so that
//
//   F * x + g = (x(0), x(1), x(3), x(2), 1.0, x(4))
//
task.put_afe_f_entry_list(&[0, 1, 2, 3, 5],         // Rows
&[0, 1, 3, 2, 4],         // Columns
&[1.0, 1.0, 1.0, 1.0, 1.0])?;

// Append the two conic constraints
&[0, 1, 2],           // Rows from F
&[0.0,0.0,0.0])?;     // Unused
&[3, 4, 5],           // Rows from F
&[0.0,0.0,0.0])?;     // Unused

// Print a summary containing information
// about the solution for debugging purposes
/* Get status information about the solution */

assert!(solsta == Solsta::OPTIMAL);

let mut xx = vec![0.0; numvar as usize];
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://docs.mosek.com/latest/rustapi/tutorial-pow-shared.html", "fetch_time": 1716605788000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2024-22/segments/1715971058770.49/warc/CC-MAIN-20240525004706-20240525034706-00129.warc.gz", "warc_record_offset": 182025205, "warc_record_length": 8187, "token_count": 2309, "char_count": 6421, "score": 3.5625, "int_score": 4, "crawl": "CC-MAIN-2024-22", "snapshot_type": "latest", "language": "en", "language_score": 0.615774393081665, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00022-of-00064.parquet"}