# 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

subject to the functional constraints

and the bounds

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

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

must be a convex function if

and a concave function if

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:

`MSKnlgetspfunc`

: Provides structural information about \(f\) and \(g\).`MSKnlgetvafunc`

: Provides numerical information about \(f\) and \(g\).

These call-back functions are passed to **MOSEK** using `MSK_putnlfunc`

. For an example of using the general convex framework see Section 8.3.