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
0 answers

Using GAMS in Julia: GAMS executable not found in VScode (but can be found in terminal)

I'm trying to use GAMS in Julia for an optimization problem. I already installed GAMS and was able to use GAMS with python successfully in VScode. However, I kept getting "GAMS executable not found" in Julia. I'm using an M1 chip MacBook. So in…
user496181
  • 141
  • 7
1
vote
0 answers

Nurse rostering - Assigned shifts cost

I have a MILP model regarding nurse rostering. The cost function is the objective function. I'm minimising cost. There are 3 shifts per day. One shift has a cost of 1€, two shifts in one day have a cost of 1.5€. (It is cheaper to have two shifts…
1
vote
0 answers

Showing some input errors when used in GAMS software

On working with GAMS software there shows some errors like dimension different ,illegal data element in the input part of code SETS i /15/ j /110/ k /13/ l /13/; PARAMETERS d(i,j) Distance between demand point i and installation j /1 5 8 7 10 6…
1
vote
1 answer

Creating a binary variable that changes value when other variable hits limit

I don't have much experience with defining the limits of my binary variables. In basic terms, I want my binary variable to switch from 1 to 0, when my other value (called base) hits its upper limit at 379900. What I wish is this: base >= 379900 …
1
vote
0 answers

Gurobi options in GAMS

I've recently moved to Gurobi and we use GAMS. Have been struggling to implement Gurobi options, is there a way to use Gurobi options directly? With a file or something like that. For instance, I want to use the following options and have not found…
Jonix
  • 21
  • 2
1
vote
0 answers

Can anyone help me to express this condition in Gams?

I have this condition and want to express it in Gams! But Really dont Know How to do it! If (t'+L(d)*(1-alfa)=t) ---> Y=1 Otherwise ---> Y=0 Y is a Binary variable, alfa is a continuous variable L(d) is a parameter, t and t' are…
Saeede
  • 11
  • 3
1
vote
1 answer

excluding a certain element set in GAMS

In this case: sets m /m1*m5/ v /v1*v4/ I want to use just elements from "v1" to "v3" for a particular variable: positive variables Q(m,v) R(m,v) And in the following objective function or equations, these variables are calculated as just excluded…
Alexander
  • 39
  • 6
1
vote
1 answer

How do I loop excel sheet names inside quotes in GAMS 'GDXXRW?

I would like to define a string set in GAMS to loop to read different xlsx sheet names in gdxxrw. However, I didn't find the appropriate code in the help documentation using string formatting and String Substitution as keywords. ''' SET sheets…
James
  • 21
  • 4
1
vote
0 answers

GAMS - MINLP model has no feasible solution, while, there is an optimal solution when the model is considered as RMINLP

I have a MINLP model which includes binary variables, linear objective function, and linear and nonlinear constraints. Nonlinear constraints are coded as following: Loc1(s,t,ieq)$(tt(s,t) AND ORD(t)
nkh7293
  • 11
  • 3
1
vote
2 answers

Removing specific equation from GAMS

I am working with the software, GAMS, and would appreciate some insight in a problem I am facing. Assume that we have the following structure (grossly simplified for exposition): Sets i index /i1 'Index 1' i2 'Index 2' …
Kwame Brown
  • 131
  • 7
1
vote
0 answers

Any automatic code formatting tool for GAMS (stand-alone or IDE-integrated)?

I am mainly working in the python ecosystem and am used to automatic code formatters (e.g. Black). For a new project I have to work with GAMS and a lot of legacy GAMS code. The GAMS code is by multiple people and without any consistent formatting…
euronion
  • 1,142
  • 6
  • 14
1
vote
1 answer

Defining a dynamic set in GAMS, General Algebraic Modeling System

I want to define a dynamic set in GAMS, General Algebraic Modeling System. For example, consider the next line: Set i "Customers" /1*100/; Sometimes it will be /1x50/ and sometimes /1x100/. For this aim, I wrote something like /1*I/ where I will be…
Aydin
  • 167
  • 1
  • 7
1
vote
1 answer

Set up gams module for python on Linux

I'm sure this problem is pretty basic but this is my first time trying to run gams via python on Linux so I'd appreciate some help. My problem seems to be that I cannot properly link the GAMS directory. When I tried to from gams import * I got an…
user496181
  • 141
  • 7
1
vote
1 answer

Multiply matrix with vector in GAMS

Consider the following table in GAMS: Set i /i1*i4 /; Table a(i,j) 'original matrix' i1 i2 i3 i4 i1 2 0 0 0 i2 0.272727 2 0.727273 0 i3 0 0.8 2 …
Michael
  • 565
  • 4
  • 11
1
vote
0 answers

How can I transfer my results from GAMS to Python?

I built my first GAMS code, but I don't know how to transfer the results from the lst file to Python in order to process. If anyone could help with the issue I would be very grateful. For example, for the transportation problem how can I transfer…
1 2
3
24 25