7.3 Power Cone Optimization

The structure of a typical conic optimization problem is

minimizecTx+cfsubject tolcAxuc,lxxux,Fx+gD,

(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:

    Pnαk={xRn : i=0n1xiβij=nn1xj2, x0,xn10}

    where s=iαi and βi=αi/s, so that iβi=1.

  • Dual power cone:

    (Pnαk)={xRn : i=0n1(xiβi)βij=nn1xj2, x0,xn10}

    where s=iαi and βi=αi/s, so that iβi=1.

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

P3α,1α={xR3:x0αx11α|x2|, x0,x10}.

which has the corresponding dual cone:

For example, the conic constraint (x,y,z)P30.25,0.75 is equivalent to x0.25y0.75|z|, or simply xy3z4 with x,y0.

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

7.3.1 Example POW1

Consider the following optimization problem which involves powers of variables:

(7.3)maximizex00.2x10.8+x20.4x0subject tox0+x1+12x2=2,x0,x1,x20.

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

(7.4)maximizex3+x4x0subject tox0+x1+12x2=2,(x0,x1,x3)P30.2,0.8,(x2,1.0,x4)P30.4,0.6.

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

(7.5)[100000100000010001000000000001][x0x1x2x3x4]+[000010]P30.2,0.8×P30.4,0.6.

We start by creating the optimization model:

  Model::t M = new Model("pow1"); auto _M = finally([&]() { M->dispose(); });

We then define the variable x corresponding to the original problem (7.3), and auxiliary variables appearing in the conic reformulation (7.4).

  Variable::t x  = M->variable("x", 3, Domain::unbounded());
  Variable::t x3 = M->variable();
  Variable::t x4 = M->variable();

The linear constraint is defined using the dot product operator Expr.dot:

  // Create the linear constraint
  auto aval = new_array_ptr<double, 1>({1.0, 1.0, 0.5});
  M->constraint(Expr::dot(x, aval), Domain::equalsTo(2.0));

The primal power cone is referred to via Domain.inPPowerCone with an appropriate list of variables or expressions in each case.

  // Create the conic constraints
  M->constraint(Var::vstack(x->slice(0,2), x3), Domain::inPPowerCone(0.2));
  M->constraint(Expr::vstack(x->index(2), 1.0, x4), Domain::inPPowerCone(0.4));     

We only need the objective function:

  auto cval = new_array_ptr<double, 1>({1.0, 1.0, -1.0});
  M->objective(ObjectiveSense::Maximize, Expr::dot(cval, Var::vstack(x3, x4, x->index(0))));

Calling the Model.solve method invokes the solver:

  M->solve();

The primal and dual solution values can be retrieved using Variable.level, Constraint.level and Variable.dual, Constraint.dual. Here we just display the primal solution

  ndarray<double, 1> xlvl   = *(x->level());
  std::cout << "x,y,z = " << xlvl << std::endl;

which is

[ 0.06389298  0.78308564  2.30604283 ]
Listing 7.3 Fusion implementation of model (7.3). Click here to download.
#include <iostream>
#include "fusion.h"

using namespace mosek::fusion;
using namespace monty;

int main(int argc, char ** argv)
{
  Model::t M = new Model("pow1"); auto _M = finally([&]() { M->dispose(); });

  Variable::t x  = M->variable("x", 3, Domain::unbounded());
  Variable::t x3 = M->variable();
  Variable::t x4 = M->variable();

  // Create the linear constraint
  auto aval = new_array_ptr<double, 1>({1.0, 1.0, 0.5});
  M->constraint(Expr::dot(x, aval), Domain::equalsTo(2.0));

  // Create the conic constraints
  M->constraint(Var::vstack(x->slice(0,2), x3), Domain::inPPowerCone(0.2));
  M->constraint(Expr::vstack(x->index(2), 1.0, x4), Domain::inPPowerCone(0.4));     

  auto cval = new_array_ptr<double, 1>({1.0, 1.0, -1.0});
  M->objective(ObjectiveSense::Maximize, Expr::dot(cval, Var::vstack(x3, x4, x->index(0))));

  // Solve the problem
  M->solve();

  // Get the linear solution values
  ndarray<double, 1> xlvl   = *(x->level());
  std::cout << "x,y,z = " << xlvl << std::endl;
}