User Tools

Site Tools


solver:setting_the_sub_solvers

Setting the sub solvers

Q: I would like to set sub-solvers (LP and NLP) for BARON solver when I tried to solve MINLP problem. I define solvers I want to use as follows:

   option minlp = baron;
   option lp = minos;
   option nlp = snopt;

However, it seemed to me that BARON always use cplex for LP solver and minos for NLP solver all the times no matter how I defined solvers.

To specify which LP and NLP solvers, use the BARON options lpsol and nlpsol in your baron.opt file. The options are documented in BARON solver manual.

If you have not used a baron.opt file before, create a new file of that name and save it in the same directory as your GAMS source file. If you want the options to appear in your GAMS source code, you can use the following code fragment as an example to choose CLP as LP and IPOPT as NLP solver for BARON:

Model process /all/ ;
Option MINLP = BARON;
$onecho > baron.opt
lpsol 2
nlpsol 9
$offecho
process.OptFile = 1;
Solve process maximizing pr using minlp ; 

Don't forget to tell GAMS to tell BARON to read the options file by adding a line m.OptFile = 1; right before your Solve statement (m is the name of your model). You can also add OptFile 1 to the command line (text field to the right of the run button in the IDE).

You'll find some extra information about using an option file here and at Solver Usage.

solver/setting_the_sub_solvers.txt · Last modified: 2017/09/02 17:43 by support