Forum Discussion
FICO
3 years agoCommunity Manager
combining mmxprs and/or nlsolv with mmquad or mmnl
I have two questions about combining mmxprs and/or nlsolv with mmquad or mmnl in Mosel: If I use the Xpress solver (mmxprs), can I trust that it will always detect that a constraint or objective is ...
FICO
3 years agoCommunity Manager
Hi Michal,
Firstly, mmnl and mmquad are not compatible with each other: these modules provide two different ways to model quadratic constraints, and you should choose one of them. We recommend using mmnl if possible, since it provides a more general nonlinear programming interface and integrates better with the other modules like nlsolv. This incompatibility is the cause of the error you mentioned about redefining the @* symbol.
mmxprs and mmquad will both detect whether an nlctr/qexp is linear or quadratic and load it into the Optimizer accordingly, i.e. the problem will not be considered quadratic unless there is an actual quadratic constraint or objective. The problem must be convex or the Optimizer will abort the solve with an error.
You can export a QP as an .lp or .mps file by using the loadprob function (which accepts an nlctr or qexp as the objective) followed by the writeprob function. Both of these functions are provided by mmxprs.
I would not recommend using nlsolv, unless you particularly want to use an external solver other than Xpress. The mmxprs/mmnl/mmquad/mmxnlp modules are much better integrated with the Xpress solver. However, if you do use nlsolv to write a .nl file and then solve this with Xpress, the Optimizer will recognise if the problem is linear or quadratic and solve it accordingly. But in this case, if your problem is nonconvex the Optimizer may try to solve it using a general nonlinear solver, if your license allows for this.
Chris

