Search found 118 matches

by Manassaldi
3 months ago
Forum: Modeling
Topic: Suffix and Uncontrolled Set Errors
Replies: 1
Views: 6361

Re: Suffix and Uncontrolled Set Errors

Hi, this is not a valid equation.

Code: Select all

Constraint2.. Y(j)$(N (i,j)= 0) =e= 0;
You can start by trying the following constraint:

Code: Select all

Constraint2(i,j).. N (i,j) =l= Y(j)*BigM;
BigM is sufficient large number.
I think you also have other errors in the sets specification.
Best
by Manassaldi
7 months ago
Forum: Modeling
Topic: use of subset
Replies: 4
Views: 4072

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...
by Manassaldi
1 year ago
Forum: Syntax
Topic: Linearization of Non-Linear equations
Replies: 8
Views: 7915

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...
by Manassaldi
1 year ago
Forum: Modeling
Topic: How can I use only less than but not equal in constraint
Replies: 1
Views: 1489

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...
by Manassaldi
1 year ago
Forum: Modeling
Topic: converting an integer variable into a binary variable
Replies: 8
Views: 4991

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.
by Manassaldi
1 year ago
Forum: Modeling
Topic: converting an integer variable into a binary variable
Replies: 8
Views: 4991

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
by Manassaldi
1 year ago
Forum: Modeling
Topic: converting an integer variable into a binary variable
Replies: 8
Views: 4991

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!
by Manassaldi
1 year ago
Forum: Syntax
Topic: Conditional binary formulation for variable greater than 0
Replies: 4
Views: 4420

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
by Manassaldi
1 year ago
Forum: Syntax
Topic: Conditional binary formulation for variable greater than 0
Replies: 4
Views: 4420

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
by Manassaldi
1 year ago
Forum: Modeling
Topic: Solving a set of nonlinear equations
Replies: 2
Views: 4169

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...