Search found 395 matches

by Renger
1 month ago
Forum: Syntax
Topic: Export listing files as pdf or Excel file
Replies: 1
Views: 91

Re: Export listing files as pdf or Excel file

Hi

Exporting your listing directly to pdf or excel is not possible in GAMS. You can of course print your listing as a pdf-file. If you want your results to be exported to Excel, you might want to look at the gdxxrw utility (see the GAMS documentation).

Hope this helps,

Renger
by Renger
1 month ago
Forum: Syntax
Topic: How to reach the benchmark?
Replies: 3
Views: 173

Re: How to reach the benchmark?

Hi Rodrigue I have a "3am-question" when teaching CGE. This is question that every student should be able to answer immediately and without hesitation when I would wake them at that time. The question is "What is the most important point when debugging your benchmark?" The answer is: set your iterat...
by Renger
1 month ago
Forum: Tools
Topic: Error 207 - A phantom element must have a zero value
Replies: 4
Views: 419

Re: Error 207 - A phantom element must have a zero value

Hi Tonanto
The last reply was 2 years ago, so it would be better to post your problem instead of relying on a continuation of this post.
Cheers
Renger
by Renger
1 month ago
Forum: Syntax
Topic: Error in the constraint writing
Replies: 6
Views: 290

Re: Error in the constraint writing

Hi Stef It would be better to attach the code..., but here some hints. Look always at the first error that appears. Following errors can be caused by the first error. In your case error 148 148 Dimension different - The symbol is referenced with more/less 148 indices as declared It looks like you de...
by Renger
1 month ago
Forum: Modeling
Topic: All elements of a set before a certain element
Replies: 1
Views: 150

Re: All elements of a set before a certain element

Hi Zack I don't know if this helps: set i /first, second, third, fourth/; parameter TT(i); TT('first')=0; TT('second')=0; TT('third')=1; TT('fourth')=0; parameter k(i); alias(i,j); K(i) = 1-sum(j$(ord(j) < ord(i)+1), TT(j));; display k; This gives: ---- 15 PARAMETER k first 1.000, second 1.000 Cheer...
by Renger
1 month ago
Forum: Syntax
Topic: problem with syntax of the equation
Replies: 12
Views: 621

Re: problem with syntax of the equation

Hi

It is not clear what you want to do with this equation. My advice: write it down as a proper mathematical expression, read how to use the sum in GAMS as well as the $-sign, and proceed from there.

Cheers

Renger
by Renger
1 month ago
Forum: Syntax
Topic: Problems opening GDXIN
Replies: 1
Views: 97

Re: Problems opening GDXIN

Hi

Run the gdxxrw command with trace=3 at the end. You will then see more information in the output window. It is hard to see what is going wrong, as you don't give the code that reproduces the error.
Cheers
Renger
by Renger
1 month ago
Forum: Syntax
Topic: Write and read a gdx file
Replies: 1
Views: 141

Re: Write and read a gdx file

Hi

This is well explained here. Or in the youtube videos (search for "gdxmrw" and you will find at least 3 videos).

Cheers
Renge
by Renger
1 month ago
Forum: Modeling
Topic: Help Regarding creating gdx/xls files inside a loop with different file name
Replies: 5
Views: 251

Re: Help Regarding creating gdx/xls files inside a loop with different file name

Hi Shamik Try another way: save the results in "results" indexed over the loops and write a stand-alone file which assigns the values of each loop to a parameter without the index (resultsi) with the put command. After the run that produces your results, you can then run the stand-alone file Here is...
by Renger
1 month ago
Forum: Modeling
Topic: Help Regarding creating gdx/xls files inside a loop with different file name
Replies: 5
Views: 251

Re: Help Regarding creating gdx/xls files inside a loop with different file name

Hi Shamik Perhaps this is an idea: generate an empty file "test.inc", so in compile phase Gams finds a file around and in the loop generate a new version of this file and include it. If you save your data in the same gdx file in the loop, you can write the data to an excel file with the the name "re...