Search found 406 matches

by Renger
1 month ago
Forum: Syntax
Topic: How to execute many "programs" at one time?
Replies: 6
Views: 809

Re: How to execute many "programs" at one time?

Hi Irena No, it is just a text file that runs in a dos window (like the one you can start from the Gams editor) using DOS commands (you could also do it with the newer script tool in Windows called powershell). I could write the following batch file named "run.bat": cd directory1a call gams line1a_i...
by Renger
1 month ago
Forum: Syntax
Topic: GDX and GDXXRW
Replies: 2
Views: 143

Re: GDX and GDXXRW

Hi
I noticed that you include test.gdx, however, the gdx file that is saved according to your code is the name of the excel file with gdx as extension.
If you want to save the results in test.gdx you should add "o=test.gdx" to your gdxxrw command.
Cheers
Renger
by Renger
1 month ago
Forum: Syntax
Topic: How to execute many "programs" at one time?
Replies: 6
Views: 809

Re: How to execute many "programs" at one time?

Hi Jarenka You could use a file with all commonly used parameters in an include file at the root. Then you could use a dos batch file and walk through the subfolders, like cd subfolder1 call gams modelsub1 cd.. cd subfolder2 call gams modelsub2 cd.. etc. Is that what you are looking for? Cheers Renger
by Renger
1 month ago
Forum: Syntax
Topic: Set with dynamic size
Replies: 1
Views: 154

Re: Set with dynamic size

Hi If I understand you correctly, the size can have any number of elements between 100 and 200, e.g. /1*167/. If that is what you mean, you could do this as follows: * Define a maximum set set n /1*200/; parameter sizeb Size of dynamic set; sizeb = uniformInt(100,200) set b(n) Dynamic set; b(n)$(n.v...
by Renger
1 month ago
Forum: Syntax
Topic: DSGE
Replies: 3
Views: 245

Re: DSGE

Hi Some remarks: - Scale your SAM to values around 1 (you otherwise want to solve your model with a precision of e.g. 0.00001 EU). - If you define variables that should be positive (like LDC and KDC) do so. - Check your initialization by setting the iteration limit to zero. I haven't worked with DSG...
by Renger
1 month ago
Forum: Syntax
Topic: how to use an expression as a subscript
Replies: 2
Views: 186

Re: how to use an expression as a subscript

]Hi Rina Note that set elements even if they are numbers, are not treated as numbers but like strings. Therefore, you can't do the typical operations like i+j. The trick is to use either the ord operator (gives you the position of the set element as integer) or the value of the set element by adding...
by Renger
1 month ago
Forum: Modeling
Topic: neative values problem
Replies: 2
Views: 194

Re: neative values problem

Hi THis has to do how Gams treats equations: it puts all stuff on the LHS setting it equal to zero. If you have your variable on the right-hand side, it will have a minus sign in front of it. Have a look at this dummy model where I put the variable X on the left and right-hand side in the same equat...
by Renger
1 month ago
Forum: Syntax
Topic: MIP modelling
Replies: 1
Views: 221

Re: MIP modelling

Hi
If you want help, you have to more speficic (please read the guidelines of this forum on how to).
Cheers
Renger
by Renger
1 month ago
Forum: Syntax
Topic: Size of a Table
Replies: 2
Views: 230

Re: Size of a Table

Hi No, there is no command for that, however, you can find it out using some code: If the table is defined over known sets, you can do something like this: set i /i1*i4/, j /j1*j5/; parameter a(i,j); a(i,j) = uniform(0,1); parameter dimension; dimension("a","row") = sum(i,1); dimension("a","col") = ...
by Renger
1 month ago
Forum: Syntax
Topic: Problem with the OF when replacing =g= with =e=
Replies: 7
Views: 392

Re: Problem with the OF when replacing =g= with =e=

Hi Hard to say: your model is infeasible so it might have no solution with the specifications you give. The constraint 7 seems to be a problem. You should btw always check the model status in the solve summary: S O L V E S U M M A R Y MODEL loadflow OBJECTIVE OF TYPE LP DIRECTION MINIMIZE SOLVER CPL...