Search found 118 matches

by Manassaldi
1 year ago
Forum: Syntax
Topic: Re-solve model Fixing Variables
Replies: 3
Views: 3293

Re: Re-solve model Fixing Variables

Hi, this was discussed here: https://forum.gamsworld.org/viewtopic.php?f=9&t=12390 After solving I recommend you to fix (with .fx) the binary variables in this way: solve yourmodel using mip min z x.fx(i)$(x.l(i) ge 0.99) = 1; x.fx(i)$(x.l(i) le 0.01) = 0; solve yourmodel using mip min z x is yo...
by Manassaldi
1 year ago
Forum: Syntax
Topic: Linearization of Non-Linear equations
Replies: 8
Views: 8173

Re: Linearization of Non-Linear equations

Hello, you can also try this alternative:

Code: Select all

objF.. obj =e= 10*x1 + 12*x2 - 20*z1 - 25*z2 - 10*w
eq1.. 1 - z1 + 1 - z2 + w =g= 1
eq2.. z1 + 1 - w =g= 1
eq3.. z2 + 1 - w =g= 1
Best
by Manassaldi
1 year ago
Forum: Syntax
Topic: Using a variable in a equations condition
Replies: 4
Views: 3776

Re: Using a variable in a equations condition

Hello, I suggest you make a manually "big M" or convex hull reformulation or try with the indicator constraint. Best!
by Manassaldi
1 year ago
Forum: Modeling
Topic: Power, rPower, Sum Functions
Replies: 7
Views: 3106

Re: Power, rPower, Sum Functions

Hi, i think there are no problems in the equation "constraint1". I can't tell you if the model is ok or not because I don't know the problem.
best!
by Manassaldi
1 year ago
Forum: Modeling
Topic: Power, rPower, Sum Functions
Replies: 7
Views: 3106

Re: Power, rPower, Sum Functions

Hi, when I can I will observe what you shared. But, remember that it is an NLP problem so the equations shown by the lst file are a linear approximation of them.
Best!
by Manassaldi
1 year ago
Forum: Modeling
Topic: Power, rPower, Sum Functions
Replies: 7
Views: 3106

Re: Special case for constraints

Hi, i don't have too much information but you can try this sets k 1 to 18?? /1*18/ j 1 to 3?? /1*3/ n 1 to 18?? /1*18/ ; alias(n,t) ; constraint1(k,n).. D_p(k,n) =e= rPower(sum(j,w(j)*power(((a(k,j))-y(n,j)),p)),(1/p)); constraint2(k,n,t)$(ord(t) ne ord(n)).. D_p(k,n)-e(k) =l= D_p(k,t)-r; please che...
by Manassaldi
1 year ago
Forum: Modeling
Topic: Fixed binary variables
Replies: 7
Views: 2785

Re: Fixed binary variables

Hi, you can try this simple implementation:

alfa.fx(k,time)$(alfa.l(k,time) ge 0.99)=1 ;
alfa.fx(k,time)$(alfa.l(k,time) le 0.01)=0 ;

best
by Manassaldi
2 years ago
Forum: Modeling
Topic: Modeling the equation with lots of sums
Replies: 1
Views: 1171

Re: Modeling the equation with lots of sums

hello, this is an example. You must define the necessary variables and sets
image.png
image.png (7.23 KiB) Viewed 1164 times
in GAMS:
sum((i,j,q,p),X(i,j,q,p)*C1(i,j,q,p))

best
by Manassaldi
2 years ago
Forum: Modeling
Topic: Constraint Variable Implementation via EmbeddedCode Facility
Replies: 1
Views: 1759

Re: Constraint Variable Implementation via EmbeddedCode Facility

Hi, maybe extrinsic functions can help you... but I'm not sure this is what you're looking for.
https://www.gams.com/33/docs/UG_ExtrinsicFunctions.html
Regards,
Juan
by Manassaldi
2 years ago
Forum: Modeling
Topic: Help in writing linear equations based on conditionality in GAMS (9 variables)
Replies: 6
Views: 4257

Re: Help in writing linear equations based on conditionality in GAMS (9 variables)

Hi, I don't know if I have the correct answer. I only try to help you based on what you comment. There is no single way to solve problems. try adding these restrictions eq1.. sum(i,z(i)) =l= 1 + M*x; eq2.. sum(i,z(i)) =g= 2 - M*(1-x); eq3.. sum(i,z(i)) + 1 - x =g= 1; eq4(i).. 1 - z(i) + sum(j$(ord(j...