7.4 Conic Exponential 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 exponential cones.

MOSEK supports two exponential cones, namely:

  • Primal exponential cone:

    Kexp={xR3:x0x1exp(x2/x1), x0,x10}.
  • Dual exponential cone:

    Kexp={sR3:s0s2e1exp(s1/s2), s20,s00}.

For example, consider the following constraint:

(x4,x0,x2)Kexp

which describes a convex cone in R3 given by the inequalities:

x4x0exp(x2/x0), x0,x40.

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.4.1 Example CEO1

Consider the following basic conic exponential problem which involves some linear constraints and an exponential inequality:

(7.6)minimizex0+x1subject tox0+x1+x2=1,x0x1exp(x2/x1),x0,x10.

The affine conic form of (7.6) is:

(7.7)minimizex0+x1subject tox0+x1+x2=1,IxKexp,xR3.

where I is the 3×3 identity matrix.

We start by creating the optimization model:

      using (Model M = new Model("ceo1"))
      {

We then define the variable x.

        Variable x = M.Variable("x", 3, Domain.Unbounded());

The linear constraint is defined using the sum operator Expr.Sum:

        // Create the constraint
        //      x[0] + x[1] + x[2] = 1.0
        M.Constraint("lc", Expr.Sum(x), Domain.EqualsTo(1.0));

The conic exponential constraint in this case is very simple as it involves just the variable x. The primal exponential cone is referred to via Domain.InPExpCone, and it must be applied to a variable of length 3 or an array of such variables. Note that this is a basic way of defining conic constraints, and that in practice they would have more complicated structure.

        // Create the exponential conic constraint
        Constraint expc = M.Constraint("expc", x, Domain.InPExpCone());

We only need the objective function:

        // Set the objective function to (x[0] + x[1])
        M.Objective("obj", ObjectiveSense.Minimize, Expr.Sum(x.Slice(0,2)));

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, respectively:

        // Get the linear solution values
        double[] solx = x.Level();
        // Get conic solution of expc
        double[] expclvl = expc.Level();
        double[] expcsn  = expc.Dual();
Listing 7.4 Fusion implementation of model (7.6). Click here to download.
using System;
using mosek.fusion;

namespace mosek.fusion.example
{
  public class ceo1
  {
    public static void Main(string[] args)
    {
      using (Model M = new Model("ceo1"))
      {

        Variable x = M.Variable("x", 3, Domain.Unbounded());

        // Create the constraint
        //      x[0] + x[1] + x[2] = 1.0
        M.Constraint("lc", Expr.Sum(x), Domain.EqualsTo(1.0));

        // Create the exponential conic constraint
        Constraint expc = M.Constraint("expc", x, Domain.InPExpCone());

        // Set the objective function to (x[0] + x[1])
        M.Objective("obj", ObjectiveSense.Minimize, Expr.Sum(x.Slice(0,2)));

        // Solve the problem
        M.Solve();

        // Get the linear solution values
        double[] solx = x.Level();
        Console.WriteLine("x1,x2,x3 = {0}, {1}, {2}", solx[0], solx[1], solx[2]);

        // Get conic solution of expc
        double[] expclvl = expc.Level();
        double[] expcsn  = expc.Dual();
        
        Console.Write("expc levels = {0}", expclvl[0]);
        for (int i = 1; i < expclvl.Length; ++i)
          Console.Write(", {0}", expclvl[i]);
        Console.WriteLine();

        Console.Write("expc dual conic var levels = {0}", expcsn[0]);
        for (int i = 1; i < expcsn.Length; ++i)
          Console.Write(", {0}", expcsn[i]);
        Console.WriteLine();
      }
    }
  }
}