Questions tagged [gams-math]

GAMS (General Algebraic Modeling System) is a high-level modeling system for mathematical optimization.

The General Algebraic Modeling System (GAMS) is a high-level modeling system for mathematical optimization. GAMS is designed for modeling and solving linear, nonlinear, and mixed-integer optimization problems.

References:

368 questions
1
vote
1 answer

How Display some of 2 dimension parameter?

I have a parameter t(i,j) , and set i,j /1*100/ , I want to display only positive t(I,j) . My try Display$(t(I,j)>0), t; I read following answer too Display only something When I write my command like abow answer , I have error "…
user9990604
1
vote
1 answer

Floyd–Warshall algorithm in GAMS

I want implement the Floyd–Warshall algorithm in GAMS . i need to find shortest paths in a weighted graph with positive weight . Below is the algorithm in C++ void Floyd_Warshal(int graph[MAX][MAX], int D[MAX][MAX], int P[MAX][MAX], int…
ilen
  • 107
  • 10
1
vote
1 answer

GAMS Binary Variable Logic Decision

i got a problem with my GAMS modelling (linear problem, no multiplication of binary variables allowed). I'd like to have three binary variables where the first value depends on the other two. The value table is given below (v1=x if (v2=y and v3=z)) …
Sebastian
  • 13
  • 4
1
vote
2 answers

How can I augment this MILP by using equations with IFF conditions as cuts in GAMS?

So I am trying to implement an algorithm in GAMS by augmenting a master problem with cuts after every iteration. The master problem is, minimize w =-x - 10z s.t. -25x + 20z ≤ 30 x + 2z ≤ 10 2x - z ≤ 15 -2x - 10z ≤ -15 w >= -26 w…
1
vote
1 answer

call a MATLAB function in GAMS

Is it possible to use a function of MATLAB in GAMS code. I have a matrix in my GAMS cod , and I need to have inverse and determinant of matrix , is it possible to call a Determinant function of Matlab in GAMS ? If it's possible How?
user9990604
1
vote
1 answer

why my symmetric difference is not true?

i want to calculate symmetric difference between two set V(i,ip) and v(ipp,ippp) i have set i={1,3,4,6} and j={1,2,..,10} i have set T(i,j) and , 3 set V,W,b too , that T(1)={2,5,10} T (3)={7,10} T (4)={2,5,6} T (6)={2,5} and…
user9990604
1
vote
0 answers

Implement an incremental optimization for MILP

I am trying to implement an incremental optimization where I can feed my MILP model with new constraint/variables and remove some other constraints/variables as time passes. Not to mention solved variables should be treated as fixed values as long…
1
vote
1 answer

Functions in GAMS

In GAMS, I need to put an equation in a function. Look at this example $ontext minimize 5x^2+3x-12 subject to 4x+2x^2<10 $offtext variable OF, x; equation obj,cons; obj .. OF=E=5*x*x+3*x-12; cons .. 4*x+2*x*x=L=10; model this /all/; solve this…
1
vote
1 answer

Conditional Equations with Variable in GAMS

I need your help to solve this "Little" problem I'm having programming with GAMS. In my objective function I have this member that is z = [...]-TWC(j)*HS(j). Where HS(j)is a variable. Now, TWC(j) should be a parameter that works like this: TWC(j) =…
Gigi Botte
  • 11
  • 3
1
vote
0 answers

Installation error of GAMS API for Python

In order to use GAMS from Python, I installed GAMS 24.8.5 x32 and Python 3.6.5 x32. I followed the instruction for intalling GAMS API for Python from GAMS web page C:\GAMS\apifiles\Python\api_36>python setup.py install && cd .. running…
MrOta
  • 11
  • 1
1
vote
1 answer

Minimum Network Flow in GAMS

I am trying to solve below network problem in GAMS Cplex. I am unable to get the desired output as the GAMS is giving the arcs which doesnt exist as output. Could you please help me in correcting this. Program: Set i supply nodes…
mvk
  • 13
  • 3
1
vote
1 answer

time limit exceeded in GAMS

I write my MIP model in GMAS, and the solver indicates that there are 1535272 rows, 3287490 columns, and 8425140 nonzeros in my model(I'm not sure if it is too big for GAMS). After 899677 iterations(1:26:36 running time), GAMS shows RESOURCE USAGE,…
Jiawei Lu
  • 509
  • 6
  • 16
1
vote
0 answers

GAMS : Avoid Scan of obviously wrong solutions in CPLEX

I have the following problem in GAMS I implemented a location routing problem. While checking the .log file I noticed something that could speed up the calculation time immensly if I fixed it. Let me state an example first: Let's assume that we have…
Adam92
  • 11
  • 2
1
vote
0 answers

Latex listings package: How to define comments not by delimiters but by their position

I am using the listings package for LaTex to include GAMS-Code in my LaTex-file. The package does not support GAMS as a language. So I have to define the language like descriped in this article. In GAMS, after declaring a symbol there is place for…
Niclas von Caprivi
  • 709
  • 1
  • 7
  • 12
1
vote
1 answer

Import a scalar from Excel to Gams

I need to import a scalar (say d=240) number from excel to GAMS. parameter d; $CALL GDXXRW mydata.xlsx par=d rng=Sheet1!a1 $GDXIN mydata.gdx $LOAD d $GDXIN display d; But never display the correct value. Always d=0. I can import a matrix from…
Morteza
  • 85
  • 1
  • 6