Search found 50 matches

by GFA
1 year ago
Forum: Syntax
Topic: model solve status in conditional statement
Replies: 7
Views: 3411

Re: model solve status in conditional statement

Dear Christine, GAMS doesn't work this way as GAMS distinguishes between compiltation and exectution time, see: https://www.gams.com/latest/docs/UG_GamsCall.html#UG_GamsCall_TwoPass Control variables (e.g. $setglobals) are executed at compile time and the solve statment is executed at execution time...
by GFA
1 year ago
Forum: Syntax
Topic: Error 246 Code
Replies: 1
Views: 4412

Re: Error 246 Code

You can not declare ‘positive variable z’ as GAMS will complain: Objective variable is not a free variable. But you can define z as "normal" variable and assign a lower bound of 0: ‘z.lo = 0;’.
by GFA
1 year ago
Forum: Syntax
Topic: results from comparative analysis
Replies: 7
Views: 5274

Re: results from comparative analysis

Dear M07a2M3D, There are multiple ways to do this, but one would be to remove the S-index of Output parameter and save the scenario number as a parameter value: if( TC.l < OptimalCost, Output("S","")${saveTC(S)} = ORD(S); Output("M",t) = M(t) ; Output("TC",&qu...
by GFA
1 year ago
Forum: Syntax
Topic: results from comparative analysis
Replies: 7
Views: 5274

Re: results from comparative analysis

Hello GFACSPLSP.gms I thought that you don't need all of the code I attached the file thank you Dear M07a2M3D , The problem is that the values you assign to the output parameter (M, TC, etc.) are not stored per loop, therefore after the last solve they are assigned the value from this last solve. T...
by GFA
1 year ago
Forum: Syntax
Topic: results from comparative analysis
Replies: 7
Views: 5274

Re: results from comparative analysis

Hi M07a2M3D,
Your code is not running, seems like you only posted some parts of it. This is not very helpful as it is not possible to reproduce your problem.
Cheers,
GFA
by GFA
2 years ago
Forum: Syntax
Topic: GAMS calling GAMS, compilation & Execution phases
Replies: 7
Views: 3092

Re: GAMS calling GAMS, compilation & Execution phases

Hi Abhi, It is impossible to run your code as you didn't provide all the necessary files, so best one can do is give some guesses. For a lot of commands in compile time there is also an equivalent command for execution time. Maybe you want to use execute_load (which is in execute time) instead of $g...
by GFA
2 years ago
Forum: Syntax
Topic: GAMS calling GAMS, compilation & Execution phases
Replies: 7
Views: 3092

Re: GAMS calling GAMS, compilation & Execution phases

Hi Abhi,

You might want to use the $call-statement to run NG_nonConvex.gms instead of execute-statement. Have a look here: https://support.gams.com/gams:call_gams_within_gams

Cheers,
GFA
by GFA
2 years ago
Forum: Syntax
Topic: divison by zero
Replies: 3
Views: 2885

Re: divison by zero

Hi, Because of the $include the numbering in the IDE is not correct. Have a look at the listing file where all of your code is printed (including $include files) and the numbering is correct. It shows that the problem is in "augm_obj" equation. It seems like the value of "maxobj"...
by GFA
2 years ago
Forum: Syntax
Topic: divison by zero
Replies: 3
Views: 2885

Re: divison by zero

Hi,

Unfortunately it is not possible to run your code without the Excel-file.

Regards,
GFA
by GFA
2 years ago
Forum: Syntax
Topic: Import a text file
Replies: 1
Views: 1597

Re: Import a text file

Hi, You need to declare your parameter (put "parameter" in front). Also, add the set-elements on the same row as the values, then GAMS knows which values belong to which set-elements. parameter prices(n)/ n1 4522, n2 4395 /; See also: https://www.gams.com/35/docs/UG_DataEntry.html section ...