energy-modelling-toolkit / Dispa-SET

The Dispa-SET unit-commitment and optimal dispatch model, developed at the JRC
European Union Public License 1.2
83 stars 38 forks source link

run with Gurobi solver #75

Closed felipefeijoo closed 2 years ago

felipefeijoo commented 3 years ago

Hello

I have a GAMS licence for GUROBI (not cplex) and I have not been able to run the model. Is there an option to change the default solver? I know PYOMO can be done, but i'd like to run with from GAMS using Gurobi, if possible.

Thanks

felipefeijoo commented 3 years ago

I replaced the optfile = 1 by optfile = 0 (in UCM_h, and UCM_simple) and set the mip and lp to Gurobi (options mip = gurobi). This seems to be working fine. Is there a more appropriate way of doing this?

MPavicevic commented 3 years ago

Dear Felipe,

Unfortunately for you cplex is hard coded as the default solver. But I see that you already found your way around and figured the most simple workaround. I hope that this solution is good enough for your needs.

Best

felipefeijoo commented 3 years ago

Got it, thanks. My solution worked fine. The python code can be modified to write a gurobi.opt file rather than a cplex.opt file. This, along with setting te optfile to either 0 or 1 works fine (on windows). Also, I noticed that when I run dispaset on Linux, this is not a problem, and gams takes whatever solver is set as default (gurobi in my case).

Felipe.

MPavicevic commented 2 years ago

Duplicate of #91