Gurobi options in GAMS - gurobi

I've recently moved to Gurobi and we use GAMS.
Have been struggling to implement Gurobi options, is there a way to use Gurobi options directly? With a file or something like that.
For instance, I want to use the following options and have not found a GAMS correspondence:
Scaleflag;
MIPFocus;
Thank you in advance,

Related

Line search method of scipy optimize minimize function

I am conducting research on optimization using scipy library, and have a question regarding with default line search method implemented in this library. I would like to write a description of the optimization method including what kind of line search method was applied. I run the optimization code using default options (BFGS) with unconstrained nonlinear objective function. Anyone who knows if scipy minimize function uses wolfe line search as a default? Thanks in advance!
Looking at the source code reveals that they use the _line_search_wolfe12 function. So yes, it uses Wolfe line search.

how to solve quadratic objective in CPLEX optimization studio?

I've implemented my problem in IBM ILOG CPLEX Optimization Studio.
Now i would like to modify the objective function to be quadratic and solve the problem. However, it shows an Error 5002:objective is not convex.->problem can be solved to global optimality with solution target 3->.
I have read the user guide and manual and the different topics in stackoverflow, and I beleive version 12.8 can solve mixed-integer quadratic problems.
modify my objective from this
dexpr float overallcost[f in cars] = holdingTime[f];
to this
dexpr float overallcost[f in cars] = holdTime[f]*holdTime[f];
Error 5002:objective is not convex.->problem can be solved to global optimality with solution target 3->.
As suggested by the error message you should try setting the solution target parameter to 3 to force CPLEX to solve your model.
More details about this can be found in this chapter of the user manual and here is the documentation of the respective parameter.
To set this parameter in the IDE create/add a settings file to your project and then go to
Mathematical Programming -> General -> Type of solution to compute
and choose "Global optimal solution".
See
https://www.ibm.com/support/knowledgecenter/SSSA5P_12.9.0/ilog.odms.cplex.help/CPLEX/Parameters/topics/OptimalityTarget.html
In order to set that parameter in order to solve quadratic objectives.
In your model, you may add:
execute
{
cplex.optimalitytarget=3;
}

Debugger tool in GAMS

I want to find my mistake in GAMS model. I don't have any errors , but my model doesn't work well
Is there any debugging tools in GAMS ?( like debugger tools in other software, e.g MATLAB)
Best
Unfortunately, I have not come across any.
If you have no errors in GAMS, it rather points to a modelling problem rather than a GAMS one. GAMS is like any other programming/modelling software, what you put in is what you get out. However, there are some commands and some intuitive ways you can find out the problem with your model:
One common way is by using the display and $stop commands. If you have loops within your GAMS code, it is best to track the progress of the loop by displaying some key variables either to your .lst file or using put utility (also a nice tool). I use the put utility, and write the code to display key variables at each point of my code to identify where things may have gone wrong.
The $stop command terminates your GAMS code at the line in which it is written.
Hope this helps.

Starting solution in CPLEX Optimization Studio

I am solving a MIP in IBM ILOG CPLEX Optimization Studio. I would like to first generate a solution where the main decision variables need not be integers, which will then be used as a starting solution to solve the model where the decision variables should be integers.
What should I type in my .mod file to obtain this?
Thank you!
You will probably need to use a main() function to control the sequence of solves. This can be done either all in one .mod file or with the main() in a separate .mod file that controls the process of using/solving the others. This is described in the documentation. There are examples in the OPL samples folder; see mulprod or LangrangianRelaxation. Give it a go, and when you have something concrete that doesn't work, come back and ask again.

Turning off Presolve option in CPLEX OPL

Does anyone know how to disable "presolve" in CPLEX? (without using Java, C++, etc.)
My CPLEX Version is 12.4, in case it makes a difference.
Thanks in advance,
Although the question was asked for OPL, it is also useful to know how to do this in Java/CPP/interactive optimizer.
Solution: set parameter preind to false
Java: IloCplex.Param.Preprocessing.Presolve E.g. java: cplex.setParam(IloCplex.BooleanParam.PreInd, false);
CPP: IloCplex::Param::Preprocessing::Presolve
C: CPXPARAM_Preprocessing_Presolve
.net: Cplex.Param.Preprocessing.Presolve
Iteractive optimizer: preprocessing presolve
See: http://www-01.ibm.com/support/knowledgecenter/SSSA5P_12.6.2/ilog.odms.cplex.help/CPLEX/Parameters/topics/PreInd.html
After trying to find how certain parameters can be changed in CPLEX, I have found the answer to my own question.
To change parameters (using CPLEX only) you don't need to type in any code. All you have to do is creating a "Settings" file within your project file.
You can follow these steps:
In the "OPL Projects" window right click and select "New->Settings"
Give a name to your settings file and click OK.
Change the parameters as you wish (to find the related setting you can type in the name of the parameter in the search bar, in my case it worked when i searched for "Preprocessing". From the menu that appeared I unchecked the box called "Presolve indicator")
Add the "Settings" file to your desired Run Configuration file to apply changes. In this case, CPLEX uses the parameters in your Settings file instead of the default values.
And that is all :)