Search found 14 matches
- 4 years ago
- Forum: Tools
- Topic: urgent: Unable to open gdx file for $GDXIN
- Replies: 1
- Views: 3488
urgent: Unable to open gdx file for $GDXIN
When I do run my code in GAMS Studio I get this error. (When I do run it on GAMS IDE it doesn't appear) *** GDXIN failed C:\Users\ .... \j10 Instanz %InstanzNr%.gdx *** Msg: No such file or directory I have two parts of the model, the first one is: set InstanzNr / 001*050/; loop(InstanzNr, put_utili...
- 4 years ago
- Forum: Modeling
- Topic: Sum of a decision variable within an equation
- Replies: 2
- Views: 3113
Re: Sum of a decision variable within an equation
I decided to use a binary variable instead, because I couldn't find another solution.
z(s)=sum(zue, bV(s,zue) * zue(s))
with bV(s)=1 if zue has a value, bV(s)=0 else
and with zue > 0, which presents the value
therefore the sum in the equation is
z(s)=sum(zue, bV(s,zue) * zue(s))
with bV(s)=1 if zue has a value, bV(s)=0 else
and with zue > 0, which presents the value
therefore the sum in the equation is
Code: Select all
sum(s, bV(s));
- 4 years ago
- Forum: Modeling
- Topic: Sum of a decision variable within an equation
- Replies: 2
- Views: 3113
Sum of a decision variable within an equation
I need the number of z(s)>0 in "equation". But z(s) is a variable and is also part in other equations of the same model. My first idea was the following (shorter version): Equation .. sum( (s)$(z(s) > 0 ) ,1) =l= card(VN); But it leads to an error: 57 VAR operands relational or boolean Is ...
- 4 years ago
- Forum: Syntax
- Topic: loop - with "if current set element" inside
- Replies: 1
- Views: 1828
loop - with "if current set element" inside
Hi, I want to loop the set Abs. The if function should do some statements, if the current set element is "Basis1". What´s the Synatx for this? set Abs / "Basis1", "Basis2" /; loop (Abs, if ([b]HOW TO DO THE SYNTAX?[/b], ... ; ); ... ); Thank you very much!
- 4 years ago
- Forum: Syntax
- Topic: Path with variable inside
- Replies: 5
- Views: 3573
Re: Path with variable inside
Thank you very much! I do have some questions about the code you wrote. 1) The %gams.lo% in lo=%gams.lo%. What does it do? 2) Are my changes correct? I insert i.tl instead of t.tl and "fn=" infront of the path. 3) Do I have to declare fn somewhere? * The scenario driver set i / 001*100 /; ...
- 4 years ago
- Forum: Modeling
- Topic: Checking if an element is part of a set
- Replies: 2
- Views: 5013
Re: Checking if an element is part of a set
Thank you very much!
I tried, among others, the syntax if(i$sp(i), ...
I didn´t knew that it just has to be if(sp(i),..., when i is allready a fixed value because of the loop.
I tried, among others, the syntax if(i$sp(i), ...
I didn´t knew that it just has to be if(sp(i),..., when i is allready a fixed value because of the loop.
- 4 years ago
- Forum: Modeling
- Topic: Checking if an element is part of a set
- Replies: 2
- Views: 5013
Checking if an element is part of a set
I want to check if an set element is part of another set. I wrote it here into the code as a bold highlighted text, to show where the code should be. I tried some different things, but none worked. Does one of you have an idea how it could work? Notice that the set "bearbeitet" is a dynami...
- 4 years ago
- Forum: Syntax
- Topic: Set declatation with scalar inside
- Replies: 3
- Views: 2599
Re: Set declatation with scalar inside
Thanks for your reply.
So do I understand correctly that if t_max has to be calculated, it´s not possible to use it for the defintion of the set t?
That´s my current (not working) code:
So do I understand correctly that if t_max has to be calculated, it´s not possible to use it for the defintion of the set t?
That´s my current (not working) code:
Code: Select all
Dmax=sum(i,d(i));
scalar t_max;
t_max= Dmax+10 ;
set t / 0*t_max / ;
- 4 years ago
- Forum: Syntax
- Topic: Path with variable inside
- Replies: 5
- Views: 3573
Re: Path with variable inside
The paths are needed for loading some data. The code should look like this, while the bold highlighted Nummer in the path should be instead the intN value for (intN=1 to 100, $call gdxxrw "C:\Users\manue\Daten\i10 Instanz 001 .xlsm" Squeeze=N @C:\Users\manue\Daten\Index_det.txt $gdxin &quo...
- 4 years ago
- Forum: Syntax
- Topic: Set declatation with scalar inside
- Replies: 3
- Views: 2599
Set declatation with scalar inside
Hi,
I would like to do something like this, with t_max as a scalar:
set t /0*t_max/ ;
The problem is that this doesn`t work in GAMS. Is there a syntax which I could use?
Thanks in advance!
I would like to do something like this, with t_max as a scalar:
set t /0*t_max/ ;
The problem is that this doesn`t work in GAMS. Is there a syntax which I could use?
Thanks in advance!