Skip to main content

Questions tagged [gams]

For questions related to GAMS (General Algebraic Modeling System), a high-level modeling system for mathematical optimization.

Filter by
Sorted by
Tagged with
1 vote
1 answer
46 views

custom branch and bound on cplex or GAMS

Does anyone have an idea how to create a custom B&B on CPLEX or GAMS? In my work, I need to add custom cuts on integer solutions in certain conditions by adding only one branch. Also, I need to ...
BADJARA Mohamed el Amine's user avatar
0 votes
0 answers
55 views

How to initialize a parameter (belonging to the first stage model) in a two stage model, taking its value from second stage model?

I am working on a two stage approach in order to reduce the complexity of a scheduling model which is an NP-hard problem. I have to implement a while loop in order to repeat solving the models in case ...
Baghban's user avatar
  • 131
2 votes
1 answer
154 views

How to pass the values of a variable of the first model to a parameter of the second model?

I am working on a scheduling problem which is NP-hard problem. Therefore, I decided to implement two-stage strategy to speed up the solution process. I need to pass the values of a variable from the ...
Baghban's user avatar
  • 131
3 votes
2 answers
225 views

Convex equivalent of a constraint

I have a constraint as follows in my MILP model: $$ \sum_{e} (a_1(e) - a_2(e))^2 \leq M $$ Where, $a_1(e)$ and $a_2(e)$ are binary variables. Would you please guide me how can I find the equivalent ...
Mohammad Reza Salehizadeh's user avatar
-2 votes
1 answer
121 views

How to print/display a specific element of a set in GAMS?

I have the follwoing set in GAMS set i /10,13,15/; how can I display the second element of this set ?
Optimization team's user avatar
1 vote
0 answers
20 views

Using Neos Server to submit GAMS file

When I submit a GAMS file along with a GDX file to the Neos Server upon clicking the submit button I don't get any error but the following webpage which is not loading and nothing is displayed. I ...
Andrew's user avatar
  • 163
3 votes
5 answers
745 views

Convert MCP model from GAMS to Pyomo

I have a Mixed Complementarity Problem (MCP) that represents a market under perfect competition. The model is written in GAMS and works as expected. But when translating it to Python, using Pyomo, the ...
Solver Max's user avatar
2 votes
1 answer
300 views

gams syntax issue - "set identifier or quoted element expected"

Writing some GAMS code, getting some syntax errors: Anyone recognize the problem?
Alexander Mills's user avatar
2 votes
1 answer
190 views

How to solve infeasible cplex model in GAMS?

I am facing this kind of error "Row 'eq1(14)' infeasible, all entries at implied bounds" in a problem that a GAMS script gets data from MATLAB. I have seen some posts about conflict ...
Panos S's user avatar
  • 21
2 votes
1 answer
54 views

Piecewise constraints in GAMS

I'm trying to solve the network problem below in GAMS Cplex. I have a piecewise constraint that are depending on the node situations (whether a node is an origin (o) node, inbetween node, and ...
Michelle Gunawan's user avatar
2 votes
1 answer
154 views

multiple solutions to a nonlinear problem in GAMS

Good afternoon, I have the following doubts Is there a command in GAMS that lets me know when my problem has multiple optimal solutions? Suppose my nonlinear optimization problem has multiple global ...
David Morante's user avatar
4 votes
3 answers
2k views

Is it better to use GAMS or Python for Optimization Models?

I have been using GAMS for several years, and I would like to do my new research in Python programming language. It is simple to do coding stuff in GAMS, however, it takes much time in complex ...
dozgunay's user avatar
  • 139
3 votes
2 answers
594 views

Write constraints with relationship sets in Pyomo

I would like to write the following constraint in the most compact form possible using Pyomo. $$\sum_{o\in O}y_{n,o} = \sum_{o\in O} \sum_{n'\in LN}y_{n',o}\qquad \forall n$$ Where, the important part,...
Daniel V.'s user avatar
2 votes
0 answers
134 views

Defining a highly non-linear function of integer variables

I have a complicated non-linear objective function of positive integer variables subject to linear constraints: $\mathop {Min}\limits_{\underline x} f(\underline x)$ s.t. $A\underline x\leq \underline ...
Johnthemathematician's user avatar
1 vote
0 answers
59 views

Ordering a set in GAMS

I'm trying to solve a problem very similar to this one, where I'm trying to find an optimal order. How would I actually plug this into GAMS? It gives out a single value rather than an ordering. I ...
adg's user avatar
  • 11
2 votes
0 answers
259 views

Building model takes so much time in Cplex

I am a beginner in CPLEX. I have a model with about 1 million constants and 800k rows and 1.6 million columns. I implemented in both GAMS and CPLEX (C# as the platform). The final solution for both is ...
pouria arsalani's user avatar
2 votes
1 answer
121 views

Any good resource for solving power system optimization in GAMS?

I am looking for some resources to learn the modelling tricks of GAMS in power system optimisation problems.
Optimization team's user avatar
0 votes
1 answer
255 views

GAMS summing over subset

I am trying to sum over a subset between $t+1$ and $t+U-1$ as follows $$y_i^t+\sum_{k=t+1}^{t+Ut_i-1}z_i^k\le1$$ but I could not define the condition within sum. ...
Tamam's user avatar
  • 9
4 votes
1 answer
217 views

GAMS: Is there a way to retrieve the gap from the final solve statement

Good evening, I am looking for a way to retrieve information from the final solve statement. Lower bound and Gap would be nice. I am working with the python api but i can only get the final obj. value ...
Eddiee's user avatar
  • 533
3 votes
2 answers
415 views

GAMS default Solver doesn't use much of my RAM and CPU

I noticed that when I run the solver via the GAMS IDE or Python API I don't use more than ~33% of my RAM. Is there an artificial barrier which I can put up or disable?
Eddiee's user avatar
  • 533
2 votes
2 answers
453 views

CPLEX output log

Whats the difference between MIP solution and Final Solve? I am trying to benchmark some solution approaches and I am not sure which of those is the more significant... sometimes they have the same ...
Eddiee's user avatar
  • 533
-1 votes
1 answer
126 views

GAMS CPLEX solver solves big problem instances suspiciously fast

I am having trouble with my Problem Instances, which seem to be not "complicated" enough.. Is there a way to find out what the problem is? It is being solved in a matter of seconds even if ...
Eddiee's user avatar
  • 533
1 vote
1 answer
473 views

How can one iterate over all instances and solve them in GAMS?

I wrote my model down in GAMS: all sets parameter obj. function constraints and used $include in order to feed the model differently sized data... I am currently using ...
Eddiee's user avatar
  • 533
0 votes
1 answer
321 views

GAMS export to excel in a loop

I am looking for a way to write data from several iterations during a loop process into my excel. How can i change the location it is written to during every loop iteration? those 2 lines would keep ...
Eddiee's user avatar
  • 533
1 vote
1 answer
137 views

Looking for an example of a heuristic implementation in GAMS

I am new to GAMS and the documentation is not helping me to make fast progress. I am looking for an example implementation similar to Relax and Fix heuristic where in several iterations subsets of ...
Eddiee's user avatar
  • 533
1 vote
0 answers
54 views

How to automatize instance generation for GAMS?

Gams problem instances can be saved in a .inc file what is basically just a .txt file and u can make gams read from that, but how can i automatize the generation process for those problem instances? I ...
Eddiee's user avatar
  • 533
3 votes
1 answer
2k views

How to build a GAMS model in python

I looked at the GAMS python API but the documentation only describing already predefined models (run .gms with some tweaking options). My question is now: Can I somehow build a gams model from scratch ...
Eddiee's user avatar
  • 533
2 votes
1 answer
1k views

How to set solver options in Pyomo with GAMS Python API?

Did anyone have experiences with Pyomo and GAMS as solver? I had looked into the pyomo documentation (GAMSShell Solver) and in the CPLEX Manuals, but doesnt find the correct syntax. My Code looks like:...
Tim's user avatar
  • 21
5 votes
0 answers
88 views

Quantifying Feasibility

I have a scheduling model formulation ( experimental setup) that takes in product states as input (sample points) and checks the model status (response) and returns feasible or infeasible. My plan is ...
Dare Badejo's user avatar
2 votes
2 answers
1k views

GAMS Sum over a subset

I have the following sets, variables, and parameters in a GAMS model. set \quad h/1*3/; alias (h,t); Positive variables are $p_d(h)$, $p_c(h)$ and $e(h)$. ...
S_Scouse's user avatar
  • 803
53 votes
15 answers
14k views

Are Python and Julia used for optimization in industry?

I am giving a small computer exercise that aims at teaching students the basics of a modelling language to model small optimization problems. So far I have been using the modelling language GAMS as ...
PeterBe's user avatar
  • 1,652
10 votes
2 answers
822 views

Modeling and solvers

I have just started to dive into OR world on my work. Currently we are using GAMS with Gurobi but some of us have strong programming background and would like to have more programmatic approach to OR. ...
aurelije's user avatar
  • 203
5 votes
1 answer
301 views

Tolerance for equality in GAMS/CPLEX

Is there an option in GAMS that sets the tolerance for declaring two real numbers to equal? For example, how can I tell GAMS or GAMS/CPLEX that $0.999100 = 0.99909$? Thank you for your help!
Clement's user avatar
  • 2,252
3 votes
0 answers
77 views

How can I do this in GAMS?

I am mimicking a GAMS model that was introduced in Soler et al. (2013)1 to compare my new model with its results. In a nutshell, assume we have a variable $t$ that is supposed to only take certain ...
Math is fun's user avatar
7 votes
1 answer
221 views

Is this formulation linear or non-linear?

Can you help me figure out if this formulation constitutes a non-linear problem? I believe It is a linear problem but my solver (GAMS) is unable to produce a acceptable solution. $x,y$ and $\text{...
MiguelL's user avatar
  • 81
6 votes
1 answer
75 views

Issue interpreting sets of constraints in AMPL

I'm new to AMPL and am trying to model the following constraints. \begin{align}y_{ij3}&\le\sum_\ell X_{j\ell2}\quad(m=2,k=3)\\y_{ijk}&\le\sum_\ell\sum_mx_{j\ell m},\quad\forall i\in I,\forall ...
george's user avatar
  • 135
7 votes
1 answer
152 views

Get a MPS file using NEOS/GAMS web interface

I'm trying to use Neos/GAMS to solve an optimization problem. I will need to get a MPS file from the model. With using GAMS IDE it is easy to use an option file to get it but, it needs a licence file ...
A.Omidi's user avatar
  • 8,950
14 votes
1 answer
1k views

Comparison of Algebraic modelling languages and general programming languages

Some optimization software/frameworks (commercial or open-source) such as AMPL, GAMS, Cplex, ... have a specific Algebraic modelling language. Some of them have another type of programming that uses ...
A.Omidi's user avatar
  • 8,950