Search found 639 matches
- 4 years ago
- Forum: Modeling
- Topic: Solving without Min or Max
- Replies: 3
- Views: 3276
Re: Solving without Min or Max
Hi You could make it an optimization problem by adding following: variable OBJ objective equation dummy Dummy objective; dummy.. OBJ =E= 1; Then solve the model maximizing OBJ. GAMS will find OBJ being equal to 1 solves the problem while at the same time solving the other equations. I hope this help...
- 4 years ago
- Forum: Syntax
- Topic: Division by Zero error
- Replies: 2
- Views: 2133
Re: Division by Zero error
Hi Judith If GAMS tells you that there is a division by zero, you can bet on it that there is one, so you should display the divisor. One problem is that zero values are not shown in the output. You can check this by adding EPS to the parameter (after checking I should remove it). RO(k,j) = RO(k,j) ...
- 4 years ago
- Forum: Syntax
- Topic: Summing over specific range
- Replies: 4
- Views: 17976
Re: Summing over specific range
Hi Sorry, my mistake. Here a solution: you split the equation in three parts and use the conditions on those parts p(s,h).. A(s,h) =E= 12$(ord(h) = 1 )$(ord(h) eq 1) + 10$(ord(h) > 1 and ord(h) < card(h)); 8$(ord(h) = card(h); THis will result in A(s,h) begin 12 in the first hour, 10 in the in-betwe...
- 4 years ago
- Forum: Syntax
- Topic: Summing over specific range
- Replies: 4
- Views: 17976
Re: Summing over specific range
Hi
Yould define a parameter as follows:
Cheers
Renger
Yould define a parameter as follows:
Code: Select all
alias(h,ah);
parameter hnr(h) Hour ord;
hnr(h) = ord(h);
p(s,h,ah)$(ord(h) eq hnr(h))..
Renger
- 4 years ago
- Forum: Syntax
- Topic: GAMS Sum over a subset
- Replies: 2
- Views: 17793
- 4 years ago
- Forum: Modeling
- Topic: Solving consequent models
- Replies: 2
- Views: 2079
Re: Solving consequent models
Hi Your question is a little bit too general, but I would say that this is just solving your model, and if the second part has the same variables, no initialization is needed and just solve the second one after the first solve. If the second part has other variables that should use the solution of t...
- 4 years ago
- Forum: Syntax
- Topic: Loop for objective function
- Replies: 34
- Views: 314219
Re: Loop for objective function
Hi Hakeem
I am not sure if this is what you are looking for Cheers
Renger
I am not sure if this is what you are looking for Cheers
Renger
- 4 years ago
- Forum: API
- Topic: Passing a tuple from Matlab to GAMS
- Replies: 1
- Views: 3056
Re: Passing a tuple from Matlab to GAMS
Hi
Although I am not fluent in Matlab, I noticed that your values are a 26x2 matrix, but the dimension of your sets is different 26 and not 2.
I hope this helps
Cheers
Renger
Although I am not fluent in Matlab, I noticed that your values are a 26x2 matrix, but the dimension of your sets is different 26 and not 2.
I hope this helps
Cheers
Renger
- 4 years ago
- Forum: Syntax
- Topic: Loop for objective function
- Replies: 34
- Views: 314219
Re: Loop for objective function
Hi
I think you could do without t in H(i,t). Then, if in year x, H(i) becomes 1, you fix it to that level and it will stay like this in all t afterwards.
Cheers
Renger
I think you could do without t in H(i,t). Then, if in year x, H(i) becomes 1, you fix it to that level and it will stay like this in all t afterwards.
Code: Select all
if(h(i) = 1; h.FX(i) = 1;);
Renger
- 4 years ago
- Forum: Syntax
- Topic: Loop for objective function
- Replies: 34
- Views: 314219
Re: Loop for objective function
Same procedure:
replace the parameter or variable with one without the index t, remove the sum and, if it is a parameter, initialize it in the loop with the value for period t
Cheers
Renger
replace the parameter or variable with one without the index t, remove the sum and, if it is a parameter, initialize it in the loop with the value for period t
Cheers
Renger