Search found 101 matches

by dirkse
5 days ago
Forum: Solvers
Topic: Using Branch and Bound in Cplex
Replies: 2
Views: 358

Re: Using Branch and Bound in Cplex

Hello,

Why does your instructor want you to solve with branch & bound?

-Steve
by dirkse
6 days ago
Forum: Syntax
Topic: Equation Set Condition
Replies: 1
Views: 110

Re: Equation Set Condition

Hello, What you have will work in principle, although you should use ord() and an 'or' instead of 'and': EQ2(i,j)$(ord(j) = 1) or (ord(j) = 4).. X(i,j)=e=B(i,j); to get the complement of the tuples from EQ1. If it is really your intention to cover all the i,j tuples using one of the two equations th...
by dirkse
1 week ago
Forum: Syntax
Topic: Sum of Rows = Sum of Columns
Replies: 5
Views: 172

Re: Sum of Rows = Sum of Columns

It would make it easier to help if you followed the posting rules:
app.php/rules
by dirkse
1 week ago
Forum: Syntax
Topic: Sum of Rows = Sum of Columns
Replies: 5
Views: 172

Re: Sum of Rows = Sum of Columns

Hi, Often, if you have a square matrix Q(i,j), the sets i and j are the same, e.g. you have alias(i,j). In this case, to force Q to be symmetric, you could do: equation forceSym(i,j); forceSym(i,j)$[ord(i) < ord(j)].. Q(i,j) =e= Q(j,i); Note that if you have such a constraint, you could enforce the ...
by dirkse
1 week ago
Forum: Modeling
Topic: Problem with constraint in MCP
Replies: 4
Views: 223

Re: Problem with constraint in MCP

Hello, Just following up on this issue. The problem has been analyzed and fixed by the PATH team (thanks Todd!). The fix will be available with PATH 5.0.2 released with the next GAMS distribution. Until that is released, please run this model with preprocessing turned off, as described earlier in th...
by dirkse
1 week ago
Forum: Modeling
Topic: Problem with constraint in MCP
Replies: 4
Views: 223

Re: Problem with constraint in MCP

Hi, I got the same results you did, and they didn't make sense to me either. I ran PATH without the preprocessor and then PATH returned a different (and consistent) solution. You can do the same thing by creating an option file path.opt with this line: preprocess 0 and tell PATH to use this option f...
by dirkse
2 weeks ago
Forum: Syntax
Topic: Subsets
Replies: 1
Views: 148

Re: Subsets

Gunners,

If you need to essentially have a subset of j defined for each value of i, the GAMS way to do this is with what I call a mapping set. The attached code illustrates what I mean.
mapping.gms
(223 Bytes) Downloaded 22 times
-Steve
by dirkse
3 weeks ago
Forum: Syntax
Topic: Error 2- Identifier Expected
Replies: 13
Views: 556

Re: Error 2- Identifier Expected

Zohreh, GAMS does its calculations in double-precision arithmetic - there is no calculating "up to 2 digits" or anything like that. However, the listing file displays values in rounded form. Also, solvers do their calculations with tolerances, so an equation like LHS <= RHS is not satisfied exactly,...
by dirkse
1 month ago
Forum: Archive Google Group
Topic: How to allocate unequal probability?
Replies: 2
Views: 519

Re: How to allocate unequal probability?

Lucas, There are two ways to view your question: 1. You want a guarantee that s <> t implies p(s) <> p(t). 2. You want to avoid the constant distribution, i.e. p(S) = 1 / card(S). If you mean the first, I can't really help. If you sample a continuous GAMS distribution like uniform(0,1) I would be su...
by dirkse
1 month ago
Forum: Modeling
Topic: Generation time takes too long
Replies: 4
Views: 245

Re: Generation time takes too long

Laurus, I notice the model you sent as opt.gms in your post is customized to work with GDXMRW. This works as long as you stay in a Matlab world, but now when you move to a larger forum, it becomes a problem. Potential avenues of help or discussion are closed off because your model is not a generic G...