## Search found 54 matches

1 year ago
Forum: Syntax
Topic: Continued Equality for Condition
Replies: 3
Views: 1108

### Continued Equality for Condition

Hi all, Long time no see! I have one question about the implementation of continued equality for a break condition of my algorithm. I want to achieve the following pseudocode: If: a(1) = a(2) = a(3) = ... = a(n), then Break; else: Continue; In a GAMS code manner: loop(n, ... break\$(a(1)=a(2) and a(1...
1 year ago
Forum: Modeling
Topic: fixing binary variable
Replies: 1
Views: 411

### Re: fixing binary variable

The former one is simple and efficient. I never use the latter method to do this so I do not know which one performs better w.r.t. running time. But the former one is simply good and easy to implement. Execution time of the solver might not be influenced with how you define the variable. But the lat...
1 year ago
Forum: Modeling
Topic: Generate Equation and Column Listing without solving
Replies: 3
Views: 509

### Re: Generate Equation and Column Listing without solving

I'm also interesting in this issue :idea: After checking the documentation, I know that 'solve' statement takes the role of importing and generating all the equations and columns in the predefined model ( https://www.gams.com/latest/docs/UG_GAMSOutput.html#UG_GAMSOutput_TheEquationListing ). Thus an...
1 year ago
Forum: Modeling
Topic: HELP! Augmenting master problem with cuts: GAMS does not permit conditional equations
Replies: 5
Views: 537

### Re: HELP! Augmenting master problem with cuts: GAMS does not permit conditional equations

I can't understand. As you say, the 3rd iteration constraint "2.5 <= x <= 8" will be added iff z result in the 2nd iteration is <= 1, but z reaches its optimum 2 in 2nd iteration. So the constraint will not be triggered. You can observe the Equation list in .lst file to check the constraints appear...
1 year ago
Forum: Modeling
Topic: HELP! Augmenting master problem with cuts: GAMS does not permit conditional equations
Replies: 5
Views: 537

### Re: HELP! Augmenting master problem with cuts: GAMS does not permit conditional equations

I can't understand. As you say, the 3rd iteration constraint "2.5 <= x <= 8" will be added iff z result in the 2nd iteration is <= 1, but z reaches its optimum 2 in 2nd iteration. So the constraint will not be triggered. You can observe the Equation list in .lst file to check the constraints appeare...
1 year ago
Forum: Modeling
Topic: HELP! Augmenting master problem with cuts: GAMS does not permit conditional equations
Replies: 5
Views: 537

### Re: Augmenting master problem with cuts: GAMS does not permit conditional equations

Hi Anby, First of all, your model is apparently infeasible because you have w <= 22 and w >= 26, which is contradictory. Then the way you add your constraint is weird. But it is still doable in GAMS. I have written the code for you, which shows integer infeasible. Positive Variable x; Integer Variab...
1 year ago
Forum: Syntax
Topic: How to keep it compact
Replies: 1
Views: 415

### Re: How to keep it compact

Hi, If you only need to reduce the times you write the term "Parameter", it is very easy: Parameter AH Maximum absolute humidity in hood in g water.(kg dry air)-1 l(c) latent heat for the steam condensation at pr(c) in kJ.kg-1; l(c)= 1.6807*pr(c)*pr(c)-40.975*pr(c)+2270.9 ; AH = 4.8101*exp(0.0577*dp...
1 year ago
Forum: Modeling
Topic: Altering the standard transportation problem
Replies: 3
Views: 516

### Re: Altering the standard transportation problem

Suggest you to post your code which others can run, either using BBcode or attachment Then we are more convenient and comprehensive to help you!

Best,
Gabriel
1 year ago
Forum: Syntax
Topic: binary variable fixed value for 1 place - solution searched
Replies: 1
Views: 393

### Re: binary variable fixed value for 1 place - solution searched

solution is simple

Code: Select all

``````ow.fx('w1') = 1;
``````
Suggest you to search relevant documentation first when encountering problem

Cheers.
Gabriel
1 year ago
Forum: Modeling
Topic: how to use a loop statement into dynamic recursive model?
Replies: 2
Views: 538

### Re: how to use a loop statement into dynamic recursive model?

Hi Rodrigue, To store/use values in each loop, I recommend two alternatives. 1. Define a global parameter to store the value and update it in each iteration. An illustrative example is shown below. Set k /1*100/; Parameter store(n); store(n) = *something initial*; loop(k, param(n) = store(n); * para...