Hi, you can try this.
object.. z =e= sum ((i,j)$(not sameas(i,j)),T(i,j)*X(i,j));
I see other errors in the code, but this must be only part of the problem
bye!
Search found 119 matches
- 1 week ago
- Forum: Syntax
- Topic: I'm trying to make i is not equal to j
- Replies: 1
- Views: 397
- 5 months ago
- Forum: Modeling
- Topic: Suffix and Uncontrolled Set Errors
- Replies: 1
- Views: 6680
Re: Suffix and Uncontrolled Set Errors
Hi, this is not a valid equation.
You can start by trying the following constraint:
BigM is sufficient large number.
I think you also have other errors in the sets specification.
Best
Code: Select all
Constraint2.. Y(j)$(N (i,j)= 0) =e= 0;
Code: Select all
Constraint2(i,j).. N (i,j) =l= Y(j)*BigM;
I think you also have other errors in the sets specification.
Best
- 9 months ago
- Forum: Modeling
- Topic: use of subset
- Replies: 4
- Views: 4800
Re: use of subset
Hello, I think you should define a subset that relates s with i for example: sets i /i1*i64/ s /s1*s8/ sector(s,i) ; parameter SC(i) /i1 .. i2 .. . . . i64 .. / pi /1/ ; loop(s, sector(s,i)$(ord(i) ge pi and ord(i) le pi+7)=yes; pi=pi+8; ); You must rearrange the 8x8 matrix into a 64-position vector...
- 1 year ago
- Forum: Syntax
- Topic: Linearization of Non-Linear equations
- Replies: 8
- Views: 9400
Re: Linearization of Non-Linear equations
Hi, you can try replacing the products with a new variable and then linearize each one of them. Ttargetgap(t).. (V25_T25(t) + V35_T35(t)) - Ttarget(t)*(V25(t)+V35(t)) =E= Ttarget_p_V25(t) + Ttarget_p_V35(t) - Ttarget_n_V25(t) - Ttarget_n_V35(t); for example: V25_T25(t) is a new variable and a linear...
- 1 year ago
- Forum: Modeling
- Topic: How can I use only less than but not equal in constraint
- Replies: 1
- Views: 1939
Re: How can I use only less than but not equal in constraint
Hello, I think you can try a BigM reformulation: con(i,k) is a binary varible con1(i,k).. sum((j),a(j,k)* b(j)*x(i,j,k)) =g= d(i,k) - BigM*(1-con(i,k)); con2(i,k).. sum((j),a(j,k)* b(j)*z(i,j,k)) =l= d(i,k) + BigM*con(i,k); then, if con(i,k) takes the value of one, equation con1 is satisfied and equ...
- 1 year ago
- Forum: Modeling
- Topic: converting an integer variable into a binary variable
- Replies: 8
- Views: 5896
Re: converting an integer variable into a binary variable
Hi, I don't know where to find this. But, You can try to implement the proposed models in GAMS.
Best.
Best.
- 1 year ago
- Forum: Modeling
- Topic: converting an integer variable into a binary variable
- Replies: 8
- Views: 5896
Re: converting an integer variable into a binary variable
Hi, I don't think you can change the nature of a problem. It is possible that there is an alternative LP version but I don't think so. Otherwise nobody would solve MIP models.
I hope I have been helpful
best
I hope I have been helpful
best
- 1 year ago
- Forum: Modeling
- Topic: converting an integer variable into a binary variable
- Replies: 8
- Views: 5896
Re: converting an integer variable into a binary variable
Hi, solving the relaxed problem the binary variables become continuous. Try solving the model as RMIP instead of MIP.
Cheers!
Cheers!
- 1 year ago
- Forum: Syntax
- Topic: Conditional binary formulation for variable greater than 0
- Replies: 4
- Views: 6024
Re: Conditional binary formulation for variable greater than 0
It's hard with a continuous variable. You can try putting a small lower bound
For example:
X =L= Xup*B
X =g= 1e-6*B
Hope this can help you
Best
For example:
X =L= Xup*B
X =g= 1e-6*B
Hope this can help you
Best
- 1 year ago
- Forum: Syntax
- Topic: Conditional binary formulation for variable greater than 0
- Replies: 4
- Views: 6024
Re: Conditional binary formulation for variable greater than 0
Hi, try this bigM reformulation
X =L= BbigM*B
if you propose a lower and upper bound you can use the following:
X =L= Xup*B
X =g= Xlo*B
best
X =L= BbigM*B
if you propose a lower and upper bound you can use the following:
X =L= Xup*B
X =g= Xlo*B
best