From what your described,
row TransportationBinary(liquid hydrogen,truck,g1,g3) looks like:
X(liquid hydrogen,truck,g1,g3) + X(liquid hydrogen,truck,g3,g1) ...
row TransportationBinary(liquid hydrogen,truck,g3,g1) looks like:
X(liquid hydrogen,truck,g3,g1) + X(liquid hydrogen,truck,g1,g3) …
so they are symmetrical.
Since you only need one of them, you can add a domain condition at the constraint index domain:
Constraint : TransportationBinary
Index domain: (i,l,g,g2) |ord(g)>ord(g2)
“|” is the condition operator, followed by the boolean formualtion.
And for your question to have condition of g≠g2, for example on variable x, you can add index domain as well
Variable : X
Index domain: (i,l,g,g2) | g <> g2
Hope this helps
From what your described,
row TransportationBinary(liquid hydrogen,truck,g1,g3) looks like:
X(liquid hydrogen,truck,g1,g3) + X(liquid hydrogen,truck,g3,g1) ...
row TransportationBinary(liquid hydrogen,truck,g3,g1) looks like:
X(liquid hydrogen,truck,g3,g1) + X(liquid hydrogen,truck,g1,g3) …
so they are symmetrical.
Since you only need one of them, you can add a domain condition at the constraint index domain:
Constraint : TransportationBinary
Index domain: (i,l,g,g2) |ord(g)>ord(g2)
“|” is the condition operator, followed by the boolean formualtion.
And for your question to have condition of g≠g2, for example on variable x, you can add index domain as well
Variable : X
Index domain: (i,l,g,g2) | g <> g2
Hope this helps
Thank you so much! Your suggestion helps in solving the error! I have one more question, for a constraint;
Qmin(i,l)*X(i,l,g,g2) <= Q(i,l,g,g2) ← Qmax(i,l)*X(i,l,g,g2) ∀(i,l,g,g2) ; g≠g2 (Transportation Constraint)
how do I write it down in the constraint definition? Because when I key in the whole equation as above, it states
“in an inclusion only the middle term is allowed to contain variables, however in the inclusion Qmin(i,l)*X(i,l,g,g2) $ X. domain (g,g2) <= Q(i,l,g,g2) $ Q. domain (g,g2) <= Qmax(i,l)*X(i,l,g,g2) $ X.domain(g,g2) the left term contains variables.”
For now I separate the Qmin and Qmax equation into two constraints but the solution given is nonbasic tfor Q(i,l,g,g2) variable]. So I was wondering if I put it in one constraint would it give me a different solution. Hope you can help!
Separating the orginal euqation to two constraints looks good to me. Do you get any unexpected solution? Like some of the constraints are violated?
I see. There are no other error or constraints violated after you’ve help given the solutions earlier. I was actually expecting AIMMS to give me numerical results on the Q(i,l,g,g2) variable (flow rate of hydrogen produced) but instead it only states “nonbasic” solution for the variable. So I am trying to explore other ways to find a different solution. Thank you again :)
I see. I suspect you looked at the data page of the constraint, instead the data of the variable. Would you check?
@Hazirah, you are seeing “Nonbasic” because your model has 0 as the best solution. For now, X has no ‘reason’ to be 1, since if it is 0 to all indexes, the three contraints are good.
Other note, TDC is empty, you need to set the objective function for the solve to run properly. With an objective function defined, I think you will start to see values for all the variables.
Let us know if it worked!
Hi @gabiservidone and @deannezhang ! First of all I just wanted to apologize for the late reply. I just recovered from dengue fever and was able to work on my problem this week. I feel obliged to let you both know that the program works as it gives me numerical results after I adjusted the TDC and objective function. Thank you so much!