Search found 491 matches

by Renger
3 days ago
Forum: Syntax
Topic: Looping over Different Excel Sheets
Replies: 15
Views: 958

Re: Looping over Different Excel Sheets

Hi

Sorry, I can't be of any help here. Perhaps you could search for ideas in this forum.

Renger

PS. If you add the option CheckDate at the end of your gdxxrw command, it checks if the excel file changed, if not, it doesn't read the data and saves you time.
by Renger
5 days ago
Forum: Modeling
Topic: division by 0
Replies: 4
Views: 500

Re: division by 0

Hi
You can set any level you want for this variable, as long as it solves.
Your second problem formulation doesn't solve (it is infeasible). Perhaps some of your constraints do now allow for an optimal solution.
Cheers
Renger
by Renger
5 days ago
Forum: Syntax
Topic: GAMS Extrinsic function
Replies: 1
Views: 316

Re: GAMS Extrinsic function

Hi You can't put a function directly into a table. Better to use it like in this example from the documentation: set t /t1*t24/; randx(t,"Weibull")= randweibull(2,6); table WD(t,*) All values table D(t,*) Duration values / Duration t1 0.684511.. t2 ... /; WD(t,"Duration") = randweibull(2,6); display...
by Renger
5 days ago
Forum: Solvers
Topic: gams2prm.gms
Replies: 4
Views: 697

Re: gams2prm.gms

Hi
I also don't have it and I work a lot with CGE models. I assume that this file was coded by another user and that it is not an official Gams file.
Cheers
Renger
by Renger
5 days ago
Forum: Syntax
Topic: Looping over Different Excel Sheets
Replies: 15
Views: 958

Re: Looping over Different Excel Sheets

Hi I am getting different errors, but anyway, here are my comments: In your Gams file you read over and over again the same parameters (e.g. FIXC) from different sheets in the same gdx-file. However, this would mean that you would overwrite these values each time you call gdxxrw. As you have everyth...
by Renger
5 days ago
Forum: Syntax
Topic: Looping over Different Excel Sheets
Replies: 15
Views: 958

Re: Looping over Different Excel Sheets

Hi
Please post your excel sheet or report the errors you get.
Cheers
Renger
by Renger
5 days ago
Forum: Modeling
Topic: Defining a binary variable set
Replies: 2
Views: 428

Re: Defining a binary variable set

Hi
I might have misunderstood you, but are this you are looking for (see here):

Code: Select all

binary variable
    myvar(t);
Cheers
Renger
by Renger
5 days ago
Forum: Modeling
Topic: division by 0
Replies: 4
Views: 500

Re: division by 0

Hi
If you don't initialize your model variables, GAMS assumes as a start value zero. The best way to avoid this is by setting all your variables to a value different from zero:
e.g. BWE.L = 10;

Cheers

Renger
PS. Next time you post code, put them in a code block (the </> button in the editor.
by Renger
1 week ago
Forum: Modeling
Topic: rolling horizon optimization
Replies: 1
Views: 379

Re: rolling horizon optimization

Hi
You could do this with a loop (see for example this post).
Cheers
Renger
by Renger
1 week ago
Forum: Modeling
Topic: ALIASING -Whether it increase no of constraints by assigning 2 scenarios to one constraint
Replies: 1
Views: 273

Re: ALIASING -Whether it increase no of constraints by assigning 2 scenarios to one constraint

Hi I would use a mapping, to constraint the equation: set mapYY(y,v) /high.high, high.low/; Your equation can then be written as follows: ic(v,y)$mapYY(v,y).. ((sum(x,p(x,v)*sqrt(w(x)))-d(v)) -(sum(x,p(x,y)*sqrt(w(x)))-d(y)))*dummy(v) =g= 0; If you then look in your listing, you will see that this r...