I am trying to do my first MINLP problem using PYOMO and CPLEX - although I am not committed to using CPLEX, but it was recommended to me. To my understanding you need to formulate your problem in terms of matricies. However, In my own problem I have an exponential term which is a function of three other variables - the equation is a type of growth function for context:

$$I^{(i,j)}_{\,t+1,pre} \!= R_t I^{(i,j)}_{\,t,pre}\;e^{-\beta\bigl(J^{(i,j)}_{\,t+1}+I^{(i,j)}_{t}+I^{(i,j)}_{\,t-1}\bigr)}$$

In PYOMO I could probably code the constraint something like the following:

# Define the index sets for the grid and time horizons. 

# Defining the maximum value that the index can take. e.g. j = {1, 2, 3, ... , model.Jmax}
model.Imax = Param(within=NonNegativeIntegers) # Value = 10
model.Jmax = Param(within=NonNegativeIntegers) # Value = 10
model.Tmax = Param(within=NonNegativeIntegers) # Value = 7

# Constructing the actual indicies used for the problem.
model.Iset = RangeSet(1, model.Imax) #e.g i = {1, 2, 3, ... , model.Imax=10}
model.Jset = RangeSet(1, model.Jmax)
model.Tset = RangeSet(1, model.Tmax)

# Constraint 
def Ipre_Recruitment(model):
   return model.Ipre == model.R * exp([EXPRESSION])

model.Ipre_constraint = Constraint(rule = Ipre_Recruitment)

While the code is not by any means accurate, the idea is that I could more easily code up the constraint as it is in contrast to figuring out how to generate a matrix formulation.

The question I have then is if I am able to keep coding my MINLP in PYOMO in the manner that I have shown above, would you need to use a different solver to code it in this way, or do I need to restart somehow?

  • 4
    $\begingroup$ The only nonlinearities CPLEX can handle are quadratics (and second order cone constraints). So unless you can reduce it to such a form by taking log, or something, you will need a different solver. $\endgroup$ – Mark L. Stone Aug 10 '19 at 19:37
  • 1
    $\begingroup$ Okay. But let's suppose that I find a solver that can handle the exponential function, call it SOLVR for the sake of a name. Would the way in which I go about writing the model in PYOMO be okay or would I need to explicitly define things in terms of a matrix. $\endgroup$ – GrayLiterature Aug 10 '19 at 19:43
  • 3
    $\begingroup$ I will leave that to someone knowledgeable in PYOMO. $\endgroup$ – Mark L. Stone Aug 10 '19 at 19:44

As mentioned in the comments, CPLEX cannot handle MINLP problems which are not Mixed-Integer Second-order cones (MISOCP) and Mixed-integer quadratic or quadratically constrained programs (MIQP and MIQCP). Given that you have a general nonlinear constraint, you cannot write it in a matrix was, meaning that you cannot express the exponential constraint $g(x)=\exp(x) \leq 0$ as a matrix (in)equality $Ax \leq b$. Fortunately, Pyomo allows you to write down general nonlinear optimization problems using the expressions' syntax as you can check here.

Regarding the solution methods, you have available in Pyomo for MINLP both open-source (BONMIN, COUENNE, MindtPy) and commercial (KNITRO, BARON) solvers. Finally keep in mind that your model (as it is right now) is nonconvex and some of the solvers can only give you local optimality guarantees (BONMIN, MindtPy, KNITRO).

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.