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
0
votes
1 answer

Solving GAMS optimization for a specific range within a set

I'm trying to solve an optimization problem on GAMS, but only for a subset. Right now, i have a code that optimizes for all the elements of set t: t time in hours / 1 * 8760 / How do I run the optimization only for t from 1 to 3500,…
sbhn
  • 5
  • 2
0
votes
1 answer

A way to restrict the domain of a variable?

I have a code snippet for a transport problem like: set i /1*50/ d /1*10/ Alias(i,j,k) parameter edge(i,j) distance(i,j) possible(i,d) 'a collection of possible nodes for d' possible_edge(i,j,d) 'a…
Rainbow
  • 171
  • 9
0
votes
1 answer

Splitting GAMS equation using if else statements

I have a working GAMS optimization model using LP. I want to modify one of my equations so that it excludes one of the terms when t = 1. Here's the simplification of this problem: Set t "time in hours" / 1 * 8760/ ; If t =…
0
votes
1 answer

How to create a set to whose elements were added the first 4 letters of another set and the first 2 letters of the elements of another set?

How do I create a set to whose elements were added the first 4 letters of another set and the first 2 letters of the elements of another set? For example, I have 2 sets: one is composed of years and the other of quarters: SET TY /2019`*`2040/; `SET…
0
votes
0 answers

Is there an option to define a total sum over uniformly distributed parameter in GAMS?

I am trying to compare some results of my model with a certain parameter to the results with a uniformly distributed parameter (parameter is the number of passengers traveling from node i to node j). To make the objective function values comparable,…
Laura
  • 77
  • 1
  • 6
0
votes
0 answers

Obtaining Suboptimal Solutions with Benders in GAMS

I have the following Benders code for a maximization problem on GAMS. It happens that sometimes GAMS give an suboptimal solution even though it should find the exact solution, since no heuristics exist and Benders tolerance (BdTol= Upper Bound -…
0
votes
0 answers

Can I obtain all of the solutions to system of equations in GAMS?

I have a system of non-linear equations, which may or may not have a unique solution. The default GAMS mixed complementary problem (MCP) solver returns one solution to this system (when it exists). For example, the system x-y=0 x-y2=0 has two…
Chris
  • 1
  • 1
0
votes
1 answer

Unexplained error using GAMS as pyomo solver

I am planning to learn python and GAMS for my research. So, I am trying to solve an NLP problem using GAMS as a pyomo solver, but occasionally I am faced with puzzling errors. For example, I wrote the following program to determine the parameters of…
0
votes
0 answers

ImportError in GAMS Python API

I have just installed GAMS Python API on my macOS. However, whenever I run "import gamstransfer as gt" vscode throws this error: ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_gams2numpy.so,…
T_k
  • 1
  • 2
0
votes
1 answer

MIP status (119): Integer infeasible or unbounded in GAMS CPLEX

I am trying to solve a MIP problem in GAMS by using CPLEX Solver. The nature of the problem is large which involves large number of constraints, variables and equation. The model is successfully completed, however, it is not displaying any output…
Asad
  • 5
  • 2
0
votes
2 answers

Error 148 Dimension different - The symbol is referenced with more/less

I am not able to sort out the Error 148 in GAMS Studio 39.3 for my problem. 148 Dimension different - The symbol is referenced with more/less indices as declared following is the details: Sets EV 'EV unit'/ev1*ev1/ Asev1 'set ev…
Asad
  • 5
  • 2
0
votes
0 answers

Writing piecewise constraints in GAMS

I'm trying to solve the network problem below in GAMS Cplex. I have a piecewise constraint that depend on the node situations (whether a node is an origin (o) node, in between node, and destination (d) node). How do I write these piecewise…
0
votes
2 answers

How to map indices of different sets in pyomo?

I have two sets in Pyomo, the first one is G=/GD1,GD2,GD3/, And the second one is N=/N1,N2,N3,...,N32,N33/. Naturally they have symbolic representation here for the sake of simplicity. I would like to map G into N, in order to define the relation…
0
votes
1 answer

Pyomo Change Bounds of Existing Contraints

I have a simple example of Pyomo model as below: import pyomo.environ as pyo import pandas as pd df = pd.DataFrame({'x': [0, 1, 2]}) solver = pyo.SolverFactory('gams') solver.options['solver'] = 'SBB' model = pyo.ConcreteModel() model.x =…
Ang Yiwei
  • 91
  • 1
  • 1
  • 12
0
votes
0 answers

Trouble with importing gams module in Python 3.9

I'm having trouble with importing gams module into python program. I'm using python 3.9 via Anaconda. The problem seems to be due to gdxcc is not on the right path, but I do not know how to fix it. To create the gams module I simply run setup.py…
user496181
  • 141
  • 7