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

Job Shop Multi Machine Multi Product MakeSpan Optimization

I am trying to develop a mathematical optimization model using GAMS. The problem is I have 6 machines and 4 items. Each item has its own sequence of operations. I have tried to define the machines that dont need to be visited as 0 processing time…
0
votes
1 answer

(GAMS mcp model) Is it possible to change the end value of sets automatically in a loop when solving a model?

I'm working with a model in GAMS that consists of a system of equations, whose values all depend on a set t (time) that is in the range /0*30/. So, for now, I'm solving the model based on the end value of the set being 30. However, I'd like to also…
MaxIsaac
  • 19
  • 2
0
votes
0 answers

Exec Error at line 170: division by zero (0) GAMS code

I have started the GAMS adventure after the R studio adventure. I am encountering an error while doing my modelling work, but I could not find it. I have a variable divided by 0, but I could not solve the problem. Problem: **** Exec Error at line…
0
votes
0 answers

GDX init failed: Could not load shared library libgdxdclib64.dylib: dlopen(libgdxdclib64.dylib, 2): image not found

I am using Matlab 2022a and GAMS 42.0 and the following error is displayed when running the trnsport problem: Error using gt_cmex_gdx_write GDX init failed: Could not load shared library libgdxdclib64.dylib: dlopen(libgdxdclib64.dylib, 2): image not…
林瀟泓
  • 1
  • 1
0
votes
1 answer

How to define a parameter recursively in GAMS?

I need to define a set of parameters that have a natural recursive relation. Here is a MWE where I try to define the factorial function over a set of (nine) parameters S: $title TitleOfProblem set S / s1*s9 /; alias(S, S1, S2); set…
Tyson Williams
  • 1,630
  • 15
  • 35
0
votes
0 answers

How to read part of a string in GAMS (reading only the 6 first digits of Harmonized system code classification)?

I have a dataset with Harmonized system level 8 (HS8) for good identification which mean there is 8 digits for the good specification. Here is an example of a part of my dataset: HS8 HS8 title 44189910 Beams and arches, laminated, of wood,…
0
votes
0 answers

Use a macro instead of a loop for faster execution in GAMS?

Consider the following code: set t / 1 * 300000 /; parameter pop(t) / 1 3456 / growth(t) ; growth(t) = 25; loop(t, pop(t+1) = pop(t) + growth(t); ); This takes pretty much time for GAMS to run. Instead of using…
Michael
  • 565
  • 4
  • 11
0
votes
0 answers

How to read csv files with multiple parameters in GAMS?

For example, I tried to read the csv files with these parameters. There are many rows. I tried the way that: $call csv2gdx lfp.csv id=dataPar index=1 values=5..lastRow useHeader=y checkDate=y but it doesn't work. Can anyone help me with that?…
0
votes
0 answers

MDP Model in GAMS - problems with parenthesis and missing ';'

I'm doing some MDP modeling in GAMS but can't get past two errors. I keep getting at the final display, a "767 Unexpected symbol will terminate the loop - symbol replaced by )" where 'smax' is & "409 Unrecognizable item - skip to find a new…
Don
  • 1
  • 1
0
votes
1 answer

Conditional expression for excluding equation from GAMS

I am using GAMS, and have defined two sets in the following way: Sets i index /a b C d / j /h k / I now wish to declare a variable of dimension (i,j) as X(i,j): Variables X(i,j); However, I do…
ChinG
  • 125
  • 7
0
votes
1 answer

How can I use IF and ELSE IF in looping and display 2 statements in GAMS?

I am a beginner level in this program. I try to improve this loop according to this condition. The details are as follows: When CUTI(k) = CUTI(k)-4 then, 1)If the result shows this CUTI(k) value greater than 0, then print this CUTI(k) value. 2)If…
Starwinwin
  • 11
  • 3
0
votes
0 answers

Flow Shop Scheduling with Unbalanced Worker Assignment

I have 3 jobs to be processed on each of the 6 operations in the production line. Each operation is processed by one machine. These machines need to be controlled by one worker. Processing times of jobs on machines are identical for every worker.…
Rozzi
  • 3
  • 3
0
votes
1 answer

How to run GAMS from python?

I am trying to run a GAMS file from a python file. I am using vscode on a macbook. So far, I have been able to open the desired GAMS file from Python using subprocess. To do this I have used the following block of code: import…
T_k
  • 1
  • 2
0
votes
0 answers

How to check if a set of nodes form edges in the network?

When running GAMS SHORTETS PATH; it returns the shortest route or lowest transport cost from each city to all others. I'm interested in finiding a set of all nodes that their distance from some source nodes are less than a predifined threshold.…
Rainbow
  • 171
  • 9
0
votes
1 answer

Is it possible to run just a single or few lines in GAMS?

I have a code of more than 400 lines, and it takes a long time to run it. I'm at the stage of debugging and was wondering whther its possible to just run only a display command in a particular line? I mean like the option we have in PyCharm that we…
Rainbow
  • 171
  • 9