Search found 23 matches

by Gideon Kruseman
3 weeks ago
Forum: Syntax
Topic: Reading from CSV Files
Replies: 4
Views: 111

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
4 months ago
Forum: Syntax
Topic: uncontrolled set
Replies: 1
Views: 147

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
4 months ago
Forum: Syntax
Topic: How can I force GAMS to compile this code in its written order?
Replies: 4
Views: 337

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
7 months ago
Forum: Syntax
Topic: Loop over strings
Replies: 2
Views: 499

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
9 months ago
Forum: Syntax
Topic: Domain filtering
Replies: 3
Views: 631

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
10 months ago
Forum: Solvers
Topic: Computational time of model extremely increased
Replies: 9
Views: 1694

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
10 months ago
Forum: Syntax
Topic: LOOP
Replies: 2
Views: 796

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/...
by Gideon Kruseman
11 months ago
Forum: Syntax
Topic: how to model abs(variable) linearly
Replies: 20
Views: 2573

Re: how to model abs(variable) linearly

Hi Phallylka,
That's why you use the Steve and I described, so your system remains linear.
Best, Gideon