Search found 24 matches

by Gideon Kruseman
5 months ago
Forum: Solvers
Topic: Can someone help me with GAMS Error 148
Replies: 4
Views: 612

Re: Can someone help me with GAMS Error 148

Use the loop function.

Example in the attached file.

Gideon
by Gideon Kruseman
1 year ago
Forum: Syntax
Topic: Reading from CSV Files
Replies: 4
Views: 1328

Re: Reading from CSV Files

reading csv files Spreadsheets and other programs can read and write CSV (comma separated value) files. Therein commas separate fields and text items can be in quotes. GAMS can also include such files using the $ command $Ondelim and $Offdelim. Table Data(*.* $ondelim $include DC03092018.csv $offdel...
by Gideon Kruseman
1 year ago
Forum: Syntax
Topic: uncontrolled set
Replies: 1
Views: 448

Re: uncontrolled set

It looks like you are trying to use subsets. You need to define diferencias_1 and diferencias_2 as such

sets
diferencias_1(yearr) / 2013, 2014, 2015 /

diferencias_2(yearr) / 2014, 2015, 2016 /

;
by Gideon Kruseman
1 year ago
Forum: Syntax
Topic: How can I force GAMS to compile this code in its written order?
Replies: 4
Views: 854

Re: How can I force GAMS to compile this code in its written order?

$gdxin is a compile time statement display is an execute time statement trying to link them is bound to give you problems, unless this is the only thing you are doing in the model. The two $gdxin statements basically mean that that the second overrules the first. unless you assign the values of z to...
by Gideon Kruseman
1 year ago
Forum: Syntax
Topic: Loop over strings
Replies: 2
Views: 917

Re: Loop over strings

Won't work like that. The $include is a compile time statement and the loop ( ); is an execute time statement. You can load data before the loop sets i "data sets" j "model set" ; parameter data(i,j); parameter modelparameter(j) include alldata.inc loop(i, modelparameter(j)=0; modelparameter(j)=data...
by Gideon Kruseman
2 years ago
Forum: Syntax
Topic: Domain filtering
Replies: 3
Views: 1002

Re: Domain filtering

set time /t1*t4/;
set t(time) /t1*t3/;

Variables
A(time)
Equations
Eq1(time)$t(time).. A(time+1)-A(time) =E= 1;
by Gideon Kruseman
2 years ago
Forum: Solvers
Topic: Computational time of model extremely increased
Replies: 9
Views: 3126

Re: Computational time of model extremely increased

$echo mipemphasis 0 > cplex.opt
modelname.optfile = 1;


The first statement writes the cplex options file
the second statement tells gams to use the cplex options file
by Gideon Kruseman
2 years ago
Forum: Syntax
Topic: LOOP
Replies: 2
Views: 1272

Re: LOOP

When you reach 20 the calculation is not executed so a(i+1) is equal to zero. which means it is below 20 and the process starts over again. so you will need to build in a switch that tells you, you have reached your threshold level. Something along these lines will work. Cheers, Gideon Set i /0*100/...