Search found 50 matches

by GFA
3 years ago
Forum: Syntax
Topic: load data from excel with specific structure
Replies: 3
Views: 4003

Re: load data from excel with specific structure

Dear dasa,

Try using "" for example:
g("1","2","a")

Also have a look here for more information on GAMS syntax: https://www.gams.com/latest/docs/UG_MAI ... nvironment

Best,
GFA
by GFA
3 years ago
Forum: Syntax
Topic: load data from excel with specific structure
Replies: 3
Views: 4003

Re: load data from excel with specific structure

p.xlsx Hi dasa, See code below, should be working with attached XLSX. Made some small changes, but most important is that every dimension needs its own column/row in Excel. Regards, GFA set m /1*3/; alias (m,n); parameter g(*,*,*) ; $onecho> p.txt Par=g rng=S1!B4:E7 rdim=2 cdim=1 $offecho $call GDX...
by GFA
3 years ago
Forum: Modeling
Topic: Iterate existing “loop” until convergence
Replies: 1
Views: 3784

Re: Iterate existing “loop” until convergence

Hi,

You can try (in the case all conditions need to be met): converged = A + B + C (when using "iter$(not converged),")
EDIT: or maybe better: converged$(A + B + C <= 0.01) = 1;

Regards, GFA
by GFA
3 years ago
Forum: Syntax
Topic: Unable to open gdx file
Replies: 2
Views: 3388

Re: Unable to open gdx file

Hi, there might be some problems with your GDXXRW statement, if thats the case data is not read correctly from Excel and GDX is not created. You can add a statement to your GDX call which makes a log file which might give some clues: $call gdxxrw.exe demand.xls par=Demand rng=A1:B672 rDim=1 log=log....
by GFA
3 years ago
Forum: Modeling
Topic: mip solution and final solve different
Replies: 3
Views: 3237

Re: mip solution and final solve different

Not an expert on this, but once I had this problem too and rescaling helped a lot.
Also have a look here: https://www.ibm.com/support/knowledgece ... kappa.html
by GFA
3 years ago
Forum: Syntax
Topic: Cost from table
Replies: 1
Views: 2341

Re: Cost from table

Don't think I understand your problem correctly (would be easier if you can post your full GAMS code), but it seems like if you minimize the cost (or costtub(nn)) L(nn) can be 0. If that is the case than costtub is 0 too.
Maybe try to write down your mathematical model first.

GFA
by GFA
3 years ago
Forum: Syntax
Topic: Retrieve data from merged gdx files
Replies: 1
Views: 2480

Re: Retrieve data from merged gdx files

Not sure if I understand your question correctly, but you might find your answer here: https://www.gams.com/latest/docs/T_GDXMERGE.html
by GFA
4 years ago
Forum: Modeling
Topic: uncontrolled set as a constant error
Replies: 2
Views: 1885

Re: uncontrolled set as a constant error

location..z=e=sum ( (ir,jr), t(ir,jr)*(k(ir)/c(ir)) ) *d(jr); Your summation ends before the multiplication with d(jr) (and Z does not have an index). Not sure what you want to achieve with your function, but changing to: location..z=e=sum ( (ir,jr), t(ir,jr)*(k(ir)/c(ir))*d(jr) ) ; should solve the...
by GFA
4 years ago
Forum: Syntax
Topic: Looping over Different Excel Sheets
Replies: 15
Views: 10781

Re: Looping over Different Excel Sheets

Hi Luqman,

In your GDXXRW call you also have to specify an output file (GDX):

$CALL GDXXRW.EXE Pakdata.xlsx @Pakdata.txt Pakdata.gdx

Hope this helps.

GFA
by GFA
4 years ago
Forum: Syntax
Topic: Looping over Different Excel Sheets
Replies: 15
Views: 10781

Re: Looping over Different Excel Sheets

Hi, Maybe you can do your parameter declaration first: Parameters FixC(u,k) VarC(u,k) GrsC(u,k) * etc. ; *And then make a text file of all your parameters + ranges + dimensions you want to read in: $onecho > GDXXRW.txt par=FixC rng=S2018!b120:c184 rdim=1 par=VarC rng=S2018!f120:g184 rdim=1 par=GrsC ...