Search found 233 matches

by abhosekar
7 hours ago
Forum: Modeling
Topic: How to model a binary variable that can only happen once a year?
Replies: 1
Views: 39

Re: How to model a binary variable that can only happen once a year?

alias(t, tt); eq(tt)$(mod(ord(tt), 12) = 1).. sum(t $ (ord(t) >=ord(tt) and ord(t) <= ord(tt) + 12), b(t)) =l= 1; You can check the equations are correct by displaying all constraints using option limrow = 10. You can do much more complex set manipulations in GAMS separately and use those sets to d...
by abhosekar
1 week ago
Forum: Syntax
Topic: Erreur d exécution
Replies: 7
Views: 332

Re: Erreur d exécution

*Data IMO(tr)=DP("IMO",tr); EXO(tr)=DP("EXO",tr); Dde_LO(tr)=MCS("AC",tr,"PR",tr); this somehow tells me that IMO, EXO and Dde_LO are declared as parameters and not variables. Is that right? If this is right, then you are not allowed to add suffix to a parameter (lower bound on a parameter makes no...
by abhosekar
1 week ago
Forum: Syntax
Topic: Erreur d exécution
Replies: 7
Views: 332

Re: Erreur d exécution

Are you getting the error from the same line? You get this error when you try to impose bounds on parameters for example. If you have defined these 3 as variables, then there is no reason why you should get this error. Please make sure that the error is because of these lines. If the error persists,...
by abhosekar
1 week ago
Forum: Syntax
Topic: Negative exponential
Replies: 11
Views: 537

Re: Negative exponential

Sorry it is not clear to me anymore. Were you able to resolve your previous issue with "negative exponential"?
Are you now facing a different issue with infeasibility? Please open a new thread with a clearer description if that's the case.

- Atharv
by abhosekar
1 week ago
Forum: Syntax
Topic: Negative exponential
Replies: 11
Views: 537

Re: Negative exponential

To set ir based on some condition, this is usually handled using binary variables. Using big-M constraints you can do this without introducing additional nonlinearities. ir =g= 0.0055*qi**(-0.47) - M*binary ir =l= 4.65*Qf**(-0.67) + M * binary where M is a big constant (not too big). When binary is ...
by abhosekar
1 week ago
Forum: Syntax
Topic: Negative exponential
Replies: 11
Views: 537

Re: Negative exponential

Hi, First, note that there is an underlying equation and then there is how you implement it. if the equation is wrong, modeling cannot fix it. In your case, if Qi can be 0, your equation cannot be Qi**-0.47. It's just wrong. I see that you want ir(nn) =g= 0.0055*Qi(nn)**(-0.47) when Qi is not 0. It ...
by abhosekar
2 weeks ago
Forum: Syntax
Topic: Negative exponential
Replies: 11
Views: 537

Re: Negative exponential

It's not true that GAMS does not accept exponentials less than 1. It does not accept exponential less than 1 if the number you are raising to that power is negative. As you know negative number to fractional power is not defined (imaginary). The reformulation you have is clever but having something ...
by abhosekar
2 weeks ago
Forum: Syntax
Topic: Negative exponential
Replies: 11
Views: 537

Re: Negative exponential

what you show in equations and what you are writing in GAMS are two very different equations. Which one is right?
Based on what you wrote, your equation should be

Code: Select all

ir =g= 0.0055*qi**(-0.47)
ir =l= 4.65*Qf**(-0.67)
not sure how that translates to what you have in the code block.

- Atharv
by abhosekar
2 weeks ago
Forum: Syntax
Topic: Erreur d exécution
Replies: 7
Views: 332

Re: Erreur d exécution

The answer to this question can help you

viewtopic.php?f=9&t=12176

- Atharv
by abhosekar
2 weeks ago
Forum: Syntax
Topic: Map two sets via an intermediate set
Replies: 2
Views: 182

Re: Map two sets via an intermediate set

Good question. If I rephrase your question, it will become clearer: For a given b, you want ac to be true if ab(a, b) is true and bc(b, c) is true. Write that in the GAMS way and you are done: Sets a / j1*j2 / b / k1*k3 / c / h1*h3 / ab(a,b) / j1.k1, j2.k2, j2.k3 / bc(b,c) / k1.h1, k1.h2, k2.h3 / ; ...