Search found 639 matches

by Renger
7 years ago
Forum: Syntax
Topic: Read part of a table
Replies: 1
Views: 3519

Re: Read part of a table

Hi Stan You can build subsets like this set year ' 'Full set of years' /M1*M120/; year1(year) 'First half of all years' /M1*M12/, year2(year) 'Second half of all years' /M25*M36/; loop(year1, .... ); or loop over all years but constrain the loop to the first half loop(year$year1(year), .. ); If you ...
by Renger
7 years ago
Forum: Syntax
Topic: Cannot solve error 148
Replies: 1
Views: 2772

Re: Cannot solve error 148

Hi You have made the following errors: solve IMPREX USING DNLP maximize Old_demand(j,y,a); You are maximizing several variables at the same time (and if this would be possible, you should have written it like solve IMPREX USING DNLP maximize Old_demand; The maximand should be one-dimensional if you ...
by Renger
7 years ago
Forum: Modeling
Topic: Projected
Replies: 1
Views: 5077

Projected

Hi Since Version 24.8.1 the summary now also gives as information: "Projected". The release notes tell me "the number of variables and equations where the level was projected to one of the bounds (compare model attribute tolProj), if that number is greater than 0 ." Could any exp...
by Renger
7 years ago
Forum: Syntax
Topic: Error while reading four-dimensional data form excel
Replies: 2
Views: 5845

Re: Error while reading four-dimensional data form excel

Hi Ceepbit You shouldn't use the dot-notation. Every set element should be in its own cell in excel. In your case: BT AGR AGRI INDU 1 The gdxxrw command will then be: $CALL GDXXRW.exe x2017b.xlsx par=SAM rng=A1:E6 rdim=2 cdim=2 Two sets are found in the rows (rdim=2), two sets are found in the colum...
by Renger
7 years ago
Forum: Syntax
Topic: equaiton based on part of a set
Replies: 2
Views: 7182

Re: equaiton based on part of a set

Hi

sameas(a,b) expects both a and b in the equation, so they can be compared (e.g. eq1(a,b)$(not sameas(a,b)).

Example:

Code: Select all

set A/a1*a10/;
set B(A)/a2*a4/;
set C(A);
C(A)= not B(A);

parameter t(a,b);

t(a,b)$(not sameas(a,b)) = 1;

display t;
Renger
by Renger
7 years ago
Forum: Modeling
Topic: how to invert a variable
Replies: 1
Views: 3559

Re: how to invert a variable

Hi Mosalari

A quick search at gams.com https://www.gams.com/search/?q=invert points to topics that answer your question (so read the guidelines under "Rules" before you post ;) )

Renger
by Renger
7 years ago
Forum: Syntax
Topic: how to get any element from a set
Replies: 4
Views: 12752

Re: how to get any element from a set

Hi
If you want a specific set element, you can also use the ord and card functions:

Code: Select all

set 
A/a1,a2/;
parameter h(a);

* first element
h("a1")
h(a)$(ord(a) = 1)

* second element
h("a2") 
h(a)$(ord(a) = 2)

* last element
h(a)$(ord(a) eq card(a))

Cheers
Renger
by Renger
7 years ago
Forum: Solvers
Topic: Problem with the Model status with Antigone solver
Replies: 9
Views: 9497

Re: Problem with the Model status with Antigone solver

Hi Tiago
Unfortunately, the new forum was not yet ready to allow attachments. Please add your attachment once again.
Sorry
Renger