# 8.4 General Convex Optimization¶

MOSEK provides an interface for general convex optimization which is discussed in this section.

Warning

Using the general convex optimization interface in MOSEK is (very) complicated. It is recommended to use the conic solver, the quadratic solver or the scopt interface whenever possible. Alternatively GAMS or AMPL with MOSEK as solver are well-suited for general convex optimization problems.

## 8.4.1 The problem¶

A general nonlinear convex optimization problem is to minimize or maximize an objective function of the form

$f(x) + \half \sum_{i=0}^{n-1} \sum_{j=0 }^{n-1} q_{i,j}^o x_i x_j + \sum_{j=0}^{n-1} c_j x_j + c^f$

subject to the functional constraints

$l_k^c \leq g_k(x) + \half \sum_{i=0}^{n-1} \sum_{j=0}^{n-1} q_{i,j}^k x_i x_j + \sum_{j=0}^{n-1} a_{k,j} x_j \leq u_k^c, \quad k=0,\ldots ,m-1,$

and the bounds

$l_j^x \leq x_j \leq u_j^x, \quad j=0,\ldots ,n-1.$

Please note that this problem is a generalization of linear and quadratic optimization. This implies that the parameters $$c$$, $$A$$, $$Q^o$$, $$Q$$, and so forth denote the same data as in the case of linear and quadratic optimization. All linear and quadratic terms should be inputted to MOSEK as described for these problem classes. The general convex part of the problems is defined by the functions $$f(x)$$ and $$g_k (x)$$, which must be general nonlinear, twice differentiable functions.

## 8.4.2 Assumptions About a Nonlinear Optimization Problem¶

MOSEK makes two assumptions about the optimization problem.

The first assumption is that all functions are at least twice differentiable on their domain. More precisely, $$f(x)$$ and $$g(x)$$ must be at least twice differentiable for all $$l^x < x < u^x$$.

The second assumption is that

$f(x) + \half x^T Q^o x$

must be a convex function if the objective is minimized. Otherwise if the objective is maximized it must be a concave function. Moreover,

$g_k(x) + \half x^T Q^k x$

must be a convex function if

$u_k^c < \infty$

and a concave function if

$l_k^c > -\infty .$

Note in particular that nonlinear equalities are not allowed. If these two assumptions are not satisfied, then it cannot be guaranteed that MOSEK produces correct results or works at all.

## 8.4.3 Specifying General Convex Terms¶

MOSEK receives information about the general convex terms via two call-back functions implemented by the user:

These call-back functions are passed to MOSEK using MSK_putnlfunc. For an example of using the general convex framework see Sec. 8.3 (Dual Geometric Optimization).