Search found 394 matches

1 month ago
Forum: Modeling
Topic: Reservoir Operation
Replies: 1
Views: 132

Re: Reservoir Operation

Hi
It looks like you either didn't buy a license or you didn't install the license in Gams root directory. The demo version has constraints on the number of variables and equations.
Cheers
Renger
2 months ago
Forum: Modeling
Topic: Problems with looping and indices
Replies: 10
Views: 443

Re: Problems with looping and indices

set counter Maximum size of all nodes /1*9/; parameter acti, actj; loop(trips, NEXTI.L = 1; loop(counter, loop(i\$(NEXTI.L = ord(i)), loop(j\$(x(i,j) = 1), actj = ord(j); acti = ord(i); xt(i,j,trips) = 1; x(i,j) = 0; NEXTI.L = ord(j); display xt, actj, acti, NEXTI.l; if(actj NE 1, break); ); ); if(ac...
2 months ago
Forum: Syntax
Topic: problem with syntax of the equation
Replies: 12
Views: 621

Re: problem with syntax of the equation

Hi Why do you want to have a transposed vector. Multiplying a vector with a matrix can be done in Gams without the use of transposing. set i /i1*i4/; set j /j1*j5/; parameter x(i), m(i,j); x(i) = uniform(0,1); m(i,j) = uniform(0,1); display x, m; * Multiplying m with x: parameter leftm(j); leftm(j) ...
2 months ago
Forum: Modeling
Topic: Problems with looping and indices
Replies: 10
Views: 443

Re: Problems with looping and indices

Try this one (you don't need the loop for the last node trip anymore: parameter acti, actj; loop(trips, NEXTI.L = 1; loop(i, loop(j\$(x(i,j) = 1), actj = ord(j); acti = ord(i); xt(i,j,trips) = 1; x(i,j) = 0; NEXTI.L = ord(j); if(actj < acti and actj NE 1, break); ); ); ); gives: i1.i2 1.000 i2.i6 1.0...
2 months ago
Forum: Syntax
Topic: problem with syntax of the equation
Replies: 12
Views: 621

Re: problem with syntax of the equation

Hi You could search in this forum: It will give you 16 pages with posts with the same answer... (and read the guidelines ). Cheers Renger PS. If you enter code in your post, use the code block (the symbol in the menu bar of the editor with the </> sign on it. This keeps the code nicely formatted and...
2 months ago
Forum: Modeling
Topic: Problems with looping and indices
Replies: 10
Views: 443

Re: Problems with looping and indices

Hi Sven Just replace the = sign by "<" and subtract 1 from NEXTI.L: ... loop(i\$(ord(i) > NEXTI.L-1), ... Solution ---- 62 PARAMETER xt 1 2 i1.i2 1.000 i2.i6 1.000 i3.i1 1.000 i3.i5 1.000 i4.i1 1.000 i5.i9 1.000 i6.i3 1.000 i9.i4 1.000 Cheers Renger
2 months ago
Forum: Syntax
Topic: Structuring of Excel output-file in GAMS
Replies: 26
Views: 707

Re: Structuring of Excel output-file in GAMS

Csv is easier for processing
2 months ago
Forum: Syntax
Topic: different dimension
Replies: 1
Views: 146

Re: different dimension

Hi
For this you need an alias

Code: Select all

alias(i,ii);
sum(ii,NW(ii,j))/NW(i,j)
I hope you were looking for that
Cheers
Renger
2 months ago
Forum: Syntax
Topic: problem with syntax of the equation
Replies: 12
Views: 621

Re: problem with syntax of the equation

Looks fine, and as long as you have at least as many equations as variables in your model, there is nothing wrong with using an implicit definition of this variable.
Cheers
Renger
2 months ago
Forum: Syntax
Topic: Error: overflow in + operation (addop)
Replies: 3
Views: 187

Re: Error: overflow in + operation (addop)

Hi Jarenka
As a rule, I scale my data (usually economic data from the Input-Output-Table) so the values are around 1, which is for my data than usual billion dollars. The precision of the solution is less than 1E-7, so around 100\$
Cheers
Renger