# Simple convex optimization problem fails in CVX

## Recommended Posts

I am using the CVX tool from Boyd for convex optimization.

I need to implement the convex function $\frac{1}{xy}$ for positive numbers.

I figured one way which is the same method used when convexifying a Geommetric Program. However for some reason it fails to do a simple case. The code in matlab is:

cvx_begin

variables p q r

minimize( r )

p<=log(2)

q<=log(3)

0<=p+q+r

cvx_end

$\exp{r}$ is $\frac{1}{2*3}$. However it fails and says

??? Index exceeds matrix dimensions.

Error in ==> cvxprob.eliminate at 215

temp = reshape(ndxs(temp),size(temp));

Error in ==> cvxprob.solve at 14

[ At, cones, sgn, Q, P, dualized ] = eliminate( prob, true );

Error in ==> cvx_end at 77

solve( prob );

## Create an account

Register a new account

×

• #### Activity

×
• Create New...