0
$\begingroup$

I am using CVXOPT, particularly to solve a nonlinear convex optimization problem. Either the objective function or the constraints involve some functions that are only defined in a strict subset of $\mathbf R^n$. For example, the function is the logarithm $\ln$. It seems that the package may well use symmetric primal dual method which allows infeasible points during the iteration. However, that would generate domain error from the functions. Does extending function to the whole of the Euclidean space help? For the example of the logarithm, I extend it so that $\ln(x)=-\infty$ or $-M$, and $\frac1x=\infty$ or $M$ $\forall x\le0$ for some very large positive $M$. Is this the practice to get around the problem? What are the more efficient ways to handle the problem?


I present below the problem I am reduced from the actual problem I am dealing with. The size of the latter is much bigger than the former. $$z:=\begin{bmatrix}x \\ y\end{bmatrix}.$$ \begin{align} \min_{z\in \mathbf R^{+2}} &\frac12 (z-z_0)^TA(z-z_0) \\ & g(x,y):=xa^{\frac y x b}\le c \\ &\Longleftrightarrow f(x,y):= x\ln\frac xc+y\, b\ln a<0, \\ &z >0 \end{align} for some given $2\times 1$ matrix $z_0$ and positive $a, b, c$. Both $g$ and $f$ are convex with respect to $z$. So this is a convex optimization problem.

I am using the Python package CVXOPT to solve this problem. I currently adopt the logarithmic formulation for the constraint, i.e. $f$. CVXOPT requires me to supply the gradient and Hessian of the constraint. I list the nonzero partial derivatives up to the second order below. \begin{align*} \frac{\partial f}{\partial x} &= \ln\frac xc+1, \\ \frac{\partial f}{\partial y} &= b\ln a, \\ \frac{\partial^2 f}{\partial x^2} &= \frac1x. \end{align*}

$\endgroup$
9
  • $\begingroup$ It may hep if you show the whole optimization problem. $\endgroup$ Feb 23 at 23:56
  • $\begingroup$ @MarkL.Stone: I just added the problem in the reduced form. $\endgroup$
    – Hans
    Feb 24 at 0:23
  • 1
    $\begingroup$ You can formulate the constraint in CVXPY using ExpCone cvxpy.org/api_reference/… . Use the exponential form of constraint, except convert power to base e rather than base a to fit the form of ExpCone. Mosek, ECOIS, or SCS can be used as solver for this problem. This will be much better than the generic convex solver you planned to use. This will handle the exponential very robustly. $\endgroup$ Feb 24 at 2:05
  • 1
    $\begingroup$ Not that I know of, but I am not a CVXOPT user ... or CVXPY for that matter. . You can do the same thing with CVX or YALMIP under MATLAB, both of which i do use. You can ask for CVXPY help at groups.google.com/forum/#!forum/cvxpy . $\endgroup$ Feb 24 at 3:02
  • 1
    $\begingroup$ exp_cone in cvxr.com/cvx/doc/funcref.html#sets . The actual syntax, which is not clearly stated, is {x,y,z} == exponential(1) . x,y,z must all be affine expressions. Variables and constants are special cases of affine expressions. This should be similar in CVXPY, but with the actual syntax differing. $\endgroup$ Mar 3 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.