Search found 136 matches

by dirkse
3 days ago
Forum: Syntax
Topic: results multiplied by 10^4
Replies: 2
Views: 48

Re: results multiplied by 10^4

Ece, So, you have a model and know a solution to this model, but when you code it in GAMS, you get a different solution. There are several possible causes for this, including: 1. The model has multiple solutions. Both the a priori solution and the GAMS-computed solution could be good. 2. The GAMS mo...
by dirkse
4 days ago
Forum: Syntax
Topic: MCP - Exit code 3
Replies: 1
Views: 61

Re: MCP - Exit code 3

Please don't include your model in the message body: attach the .gms file instead.

Also, if you want feedback about the error, attach the .lst file and the log output from your run. The command line option lo=2 or lo=4 is useful for getting your log output in a file.

-Steve
by dirkse
2 weeks ago
Forum: Syntax
Topic: EXIT CODE =3 , the equation is infes
Replies: 11
Views: 411

Re: EXIT CODE =3 , the equation is infes

Douglas, Your first question is basically, "Why do I have to match variables and equations in MCP?" Essentially, the bounds you set on the variables and the matching you choose between variables and equations influences the set of solutions for the MCP model. If you choose one matching, you get one ...
by dirkse
3 weeks ago
Forum: Syntax
Topic: $ifthen with $else code block issue
Replies: 3
Views: 165

Re: $ifthen with $else code block issue

Andrew C, It would be helpful to attach your GAMS source: don't include it in the text. Also, attach the complete .lst and .log files. And if you feel the source is too big to attach, then create a copy and cut, cut, cut until you have a small reproducible example. Probably you will find the solutio...
by dirkse
1 month ago
Forum: Syntax
Topic: Usage of bratio in GAMS/CPLEX to pass the optimal basis of one model to the other
Replies: 5
Views: 235

Re: Usage of bratio in GAMS/CPLEX to pass the optimal basis of one model to the other

Nia, Basis information is stored not only in GAMS variables but also in GAMS equations. For example, if you resolve the same model, it uses 0 iterations. Here's some code to do that: Solve ex1 using LP maximizing z; file log /''/; put log; putclose ' ' / 'Iterations: ', ex1.iterusd / ' ' /; Solve ex...
by dirkse
2 months ago
Forum: Syntax
Topic: matrix error the objective variable has vanished from the model
Replies: 8
Views: 1466

Re: matrix error the objective variable has vanished from the model

Kamal,

You'll probably get a better response if you start a new thread instead of using an unrelated thread from a year ago.

-Steve
by dirkse
2 months ago
Forum: Solvers
Topic: MINOS infeasible but CPLEX optimal
Replies: 2
Views: 333

Re: MINOS infeasible but CPLEX optimal

jch, This happens occasionally and can be very frustrating. Sometimes the feasibility of a model can depend on tolerances: if CPLEX uses looser tolerances, that might lead to feasibility. Another issue is scaling. If you have very large numbers in your model (variable levels, coefficients, RHS) it c...
by dirkse
2 months ago
Forum: Tools
Topic: Convert Gams files to *.mpi or *.mps
Replies: 6
Views: 4077

Re: Convert Gams files to *.mpi or *.mps

Grace,

If you include the .log file from the run you'd make it easier to help you.

I can only guess now: perhaps you are not using the most recent GAMS version. The Jump output from convert is a fairly new feature.

-Steve
by dirkse
3 months ago
Forum: Syntax
Topic: Logical Syntax
Replies: 2
Views: 257

Re: Logical Syntax

Paulo, We don't use strict inequalities in optimization. Google strict inequality math programming for a wealth of reasons why, perspectives, examples, etc. You could use a Big-M method: given a binary variable y, use x-y <= M * y y-x <= M * (1-y) if M is large enough, the constraint x-y<=0 is on wh...
by dirkse
4 months ago
Forum: Modeling
Topic: Problem with set declaration
Replies: 4
Views: 453

Re: Problem with set declaration

Rodrigue, If I understand correctly, you have a set of activities a1*a43, and these activities belong to one of the following 4 types: agr, ind, ser, sad. You want to make this assignment and use it. This is a very standard thing to do. You should use a multi-dimensional set as described here: https...