Search found 306 matches

by Renger
3 hours ago
Forum: Syntax
Topic: Structuring of Excel output-file in GAMS
Replies: 3
Views: 7

Re: Structuring of Excel output-file in GAMS

How many elements does qab has? If it is over 1 million rows, you can't save it in Excel because of the maximum size of a sheet (otal number of rows and columns on a worksheet 1,048,576 rows by 16,384 columns).
Cheers
Renger
by Renger
6 hours ago
Forum: Syntax
Topic: Structuring of Excel output-file in GAMS
Replies: 3
Views: 7

Re: Structuring of Excel output-file in GAMS

Hi Jarenka
If I understand you correctly, you want to have the parameter written to the excel file with the 6 dimension in the columns. For this, you write cdim=6 (and no rdim or rdim=0).
Cheers
Renger
by Renger
1 day ago
Forum: Modeling
Topic: summation
Replies: 2
Views: 27

Re: summation

Hi Just use Y(i-1,r,t). Note however, that this means that you can't use this for the first i if there is no value for i-1. If it is a variable, you probably will have to fix the Y(i-1) to a certain value or you can define the equation for all i > 1 myeq(i,r)$(ord(i)>1)... Y(i,r,t) =L= sum(t, Y(i-1,...
by Renger
1 day ago
Forum: Syntax
Topic: Error 63 y Error 256
Replies: 1
Views: 45

Re: Error 63 y Error 256

Hi A few remarks: The chance getting an answer is higher if you post your question in English. If you submit your model, please attach it (or enter it as code), so the formatting remains as it is. If you don't, people willing to answer your question may lose a lot of time reformatting your code. Now...
by Renger
1 day ago
Forum: Modeling
Topic: GAMS summation
Replies: 2
Views: 57

Re: GAMS summation

Hi

Code: Select all

sum(t$(t.val > 2 and t.val<6), Y(i,r,t)
or, if the set consists of strings /a1*a6/;:

Code: Select all

sum(t$(ord(t) > 2 and ord(t)<6), Y(i,r,t);
Cheers
Renger
by Renger
1 day ago
Forum: Syntax
Topic: summation eliminating some elements
Replies: 2
Views: 45

Re: summation eliminating some elements

Hi

Code: Select all

set i /1,2,3,4,5,6/ ;

parameter x(i), mysum;
* assign some values
x(i) =ord(i);
mysum = sum(i$(i.val ne 1 and i.val ne 5), x(i));

display mysum;
Hope this helps
Renger
by Renger
1 day ago
Forum: Syntax
Topic: Scenarios in objective function
Replies: 2
Views: 87

Re: Scenarios in objective function

Hi
Have a look at the answer in this question.
Cheers
Renger
by Renger
6 days ago
Forum: Syntax
Topic: How to compare the two parameters
Replies: 6
Views: 131

Re: How to compare the two parameters

Hi Lucas This only might be possible like this: set i/1*5/ k(i); parameters a(i) /1 1,2 0,3 1,4 0,5 0/ b(i) /1 0,2 1,3 1,4 0,5 0/ c(i) /1 1,2 0,3 1,4 0,5 0/ d(i) /1 1,2 0,3 1,4 0,5 1/ e(i) /1 1,2 1,3 1,4 0,5 1/ ; set parset /a, b, c, d, e/; parameter allparam(parset,i) All parameters; allparam("a",i...
by Renger
6 days ago
Forum: Syntax
Topic: How to compare the two parameters
Replies: 6
Views: 131

Re: How to compare the two parameters

Hi Lucas

Perhaps I don't get the question correctly, but here is a simpler way for comparing two parameters

Code: Select all

parameter same;
same = sum(i, abs(a(i)-b(i)));
if(same > 0,
   display 'Parameter a is not equal to parameter b', same;);
Cheers
Renger
by Renger
6 days ago
Forum: Syntax
Topic: CEG Model
Replies: 7
Views: 205

Re: CEG Model

Hi Baud It is the same kind of problem. You have an equation with a power in it. You can't raise zero to the power, so there are variables or parameters that cause the base to be 0. You should always check the values in equations like that. In your case, you have imports equal to zero for the sector...