Search found 13 matches

by martinagherardi
1 year ago
Forum: Syntax
Topic: How to define a variable on different intervals
Replies: 1
Views: 1388

How to define a variable on different intervals

Hi, I would like to define a variable on a set that varies based on another set: x is my variable that depends on the generator g and on the discretization index q: x(g,q) q takes values from 1 to n, where n is based on the generator g considered. For example: 2 generators: set G /A,B/; For generato...
by martinagherardi
1 year ago
Forum: Modeling
Topic: Fixed binary variables
Replies: 7
Views: 2926

Re: Fixed binary variables

The method (if<0.1, set binary to 0) works because 1.386...e-8 is equal to 0.00000001 and hence <0.1 but round is still correct because the nearest integer value is 0. Your suggestion for the iterative model works perfectly!!! Thanks again, I couldn't have pulled this off without you. Martina
by martinagherardi
1 year ago
Forum: Modeling
Topic: Fixed binary variables
Replies: 7
Views: 2926

Re: Fixed binary variables

I’m using an if statement that sets all those binaries to 0 if are <0.1 but I can try with your method ☺️ May I ask a closely related question? Are there instructions for change the declaration of a variable into a parameter? I want to solve a problem itaratively, where I have the bilinear term a*b:...
by martinagherardi
1 year ago
Forum: Modeling
Topic: Fixed binary variables
Replies: 7
Views: 2926

Re: Fixed binary variables

Thank you Michael. Yes, there is more: I have a 2 stages model. After step 1 (first resolution of the MIP), I want to fix the values of some continuous variables (the variables of the first stage) and the values of all the binaries to the optimal values obtained in Step 1 in order to ask for the ext...
by martinagherardi
1 year ago
Forum: Modeling
Topic: Fixed binary variables
Replies: 7
Views: 2926

Fixed binary variables

Hi everyone, How can I arrange the GAMS code in order to do the following step? 1. Solve MIP problem 2. Fix binaries to the values obtained in 1. 3. Solve LP problem With the binary variable alfa, I tried this solve Model using MIP minimizing z; loop ((k,time), alfa.fx(k,time)=alfa.l(k,time) ; ); so...
by martinagherardi
2 years ago
Forum: Syntax
Topic: Saving result on MAC
Replies: 7
Views: 3023

Re: Saving result on MAC

Hi Michael,
many thanks for the reply.

I saw that in the reshuffle you didn't write year. How can I deal with values for multiple years? so for example if the set of years contains 2017 and 2018
by martinagherardi
2 years ago
Forum: Syntax
Topic: Saving result on MAC
Replies: 7
Views: 3023

Re: Saving result on MAC

Hi Michael I am still having problems with csv, please bear with me... I followed a lot of examples but I can’t import a multidimension parameter (3 dim) defined in the following CSV FUEL_PRICE-Stoc 2.csv The code is the following Table fuel_price(year,fuel,scen); $call csv2gdx "/Users/martinag...
by martinagherardi
2 years ago
Forum: Syntax
Topic: Saving result on MAC
Replies: 7
Views: 3023

Re: Saving result on MAC

Many thanks Bussieck to reply,

there is an alternative for working only with mac?
I saw that it is possible to work with CSV but I did not find any example for exporting results
by martinagherardi
2 years ago
Forum: Syntax
Topic: Saving result on MAC
Replies: 7
Views: 3023

Saving result on MAC

Hi,

How can I write my GAMS result using a mac?

For the import of the data, I create GDX files with Windows but for saving the results I don't know how to do it.
The command
execute 'gdxxrw.exe result.gdx o=result.xlsx par=result'
doesn't work.

Thank you in advance
by martinagherardi
2 years ago
Forum: Syntax
Topic: Option non-convex for GUROBI solver
Replies: 4
Views: 2183

Re: Option non-convex for GUROBI solver

Yes
I only have this old version of GUROBI and I didn't know about the recent update of GUROBI.
Since i can't use the solver, I have to linearize the bilinear terms :roll:

Thank you anyway for your help!