0

In FMINCON, nonlinear constraints can be provided as a function argument (nonlcon). I tried to use a similar method in CVX

cvx_begin
   variable x(n)
   minimize( somefunc(x))
   subject to
      nonlcon(x)
cvx_end

But I get an error:

Disciplined convex programming error:
Cannot perform the operation: {real affine} ./ {real affine}

In the nonlcon, there is an element-wise division operation. It gives the error at that line and I can't change the constraint to any other way. Is there a way to handle this?

Leo 254
  • 181
  • 1
  • 8
sprajagopal
  • 322
  • 1
  • 4
  • 20
  • `cvxopt` is python, not Matlab, correct? If so, your question is tagged wrong. – horchler Jun 12 '13 at 15:26
  • @horchler No, it's matlab. There are two different codes. I'm talking about this one: (http://cvxr.com/cvx/) – sprajagopal Jun 12 '13 at 15:34
  • I think I should have said CVX instead of CVXOPT, You're right. – sprajagopal Jun 12 '13 at 15:35
  • @horchler Actually I have made some progress and now my error is regarding mtimes in cvx. Is there no way to do a vector x vector in cvx? – sprajagopal Jun 12 '13 at 15:36
  • Wow, that's in Matlab? Well, it looks like they're doing a lot of stuff to support this very un-Matlab-like "modeling syntax". I wouldn't be surprised if they haven't bothered to figure out how to support Matlab's native functions and vectorization. I'm guessing that you'll get much better support in [their forums](http://ask.cvxr.com/questions/) than here. – horchler Jun 12 '13 at 15:48
  • I have already posted there. There are, like, 3 people who are active in that forum. So, not gonna have much luck there. – sprajagopal Jun 12 '13 at 16:03

0 Answers0