Search found 119 matches
- 1 year ago
- Forum: Modeling
- Topic: Solving a set of nonlinear equations
- Replies: 2
- Views: 4997
Re: Solving a set of nonlinear equations
Hi, you should use "power(x,2)" instead of "x**2" Since your system is square, you can also solve using "cns" Try: solve dummy using cns; Best variables z_1, z_2, z_3, z_4, z_5, y_12, y_23,y_34, y_41, y_45, x_1, x_2, x_3, x_4, x_5; equations eq1, eq2, eq3, eq4, eq5, eq6...
- 1 year ago
- Forum: Syntax
- Topic: Re-solve model Fixing Variables
- Replies: 3
- Views: 3487
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...
- 1 year ago
- Forum: Syntax
- Topic: Linearization of Non-Linear equations
- Replies: 8
- Views: 9784
Re: Linearization of Non-Linear equations
Hello, you can also try this alternative:
Best
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
- 1 year ago
- Forum: Syntax
- Topic: Using a variable in a equations condition
- Replies: 4
- Views: 4903
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!
- 1 year ago
- Forum: Modeling
- Topic: Power, rPower, Sum Functions
- Replies: 7
- Views: 3171
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!
best!
- 1 year ago
- Forum: Modeling
- Topic: Power, rPower, Sum Functions
- Replies: 7
- Views: 3171
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!
Best!
- 1 year ago
- Forum: Modeling
- Topic: Power, rPower, Sum Functions
- Replies: 7
- Views: 3171
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...
- 2 years ago
- Forum: Modeling
- Topic: Fixed binary variables
- Replies: 7
- Views: 3488
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
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
- 2 years ago
- Forum: Modeling
- Topic: Modeling the equation with lots of sums
- Replies: 1
- Views: 1189
Re: Modeling the equation with lots of sums
hello, this is an example. You must define the necessary variables and sets
in GAMS:
sum((i,j,q,p),X(i,j,q,p)*C1(i,j,q,p))
best
in GAMS:
sum((i,j,q,p),X(i,j,q,p)*C1(i,j,q,p))
best
- 2 years ago
- Forum: Modeling
- Topic: Constraint Variable Implementation via EmbeddedCode Facility
- Replies: 1
- Views: 1785
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
https://www.gams.com/33/docs/UG_ExtrinsicFunctions.html
Regards,
Juan