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

Write system date and time as string to gdx

I want to store the system date and time as a string to gdx when executing a script, preferably with a custom format. I tried the following: parameter exec_date execution date exec_time execution time ; exec_date = …
BdB
  • 471
  • 5
  • 18
1
vote
1 answer

Import parameters from Excel to GAMS: get all zeros

I have an Excel file GAMS2.xlsx with a spreadsheet GAMS, which contains data as shown at the picture In GAMS I wrote such code: Set t /t1*t5/; Parameters W(t); $call gdxxrw GAMS2.xlsx par=W rng=GAMS!A3:B7 rdim=1 dset=t rng=GAMS!A3:A7…
1
vote
1 answer

How to add a Condition with Variables GAMS

I'm beginner in GAMS. So, my question relates to use of variables in conditions. I supposed, that it's Programming Flow Control Features, but I cannot to find an example with variables, not parameters. In my task I have only one set (t) at the start…
1
vote
1 answer

Calculate relative optimality Gap in MIP Problem GAMS

I want to calculate relative optimality Gap of a MIP Problem also i want to abort runs at a certain run time. this method: F(1) abs(mymodel.objest - mymodel.objval)/max(abs(mymodel.objest),abs(mymodel.objval)) is not consistent with gap which…
1
vote
1 answer

Problems with GAMS model

I've been experiencing with GAMS but I still haven't got a clue what I'm doing. Can someone take a look at this short model and try to point me in the right direction? I have problems in the compilation at the equations, getting a few of these: …
rkza
  • 53
  • 3
1
vote
1 answer

How to read excel two dimensional parameter in Gams?

I have a Gams model and I want read sets and parameters from Excel to Gams.As shown below: How can I read this parameter in Gams? Thanks
n.e
  • 83
  • 1
  • 8
1
vote
1 answer

How can I fix Error 149 in Gams?(Uncontrolled set entered as constant)

I have this situation in GAMS: sets i index of resource location /i1*i6/ j index of disaster location /j1*j7/ ; ... binary variable x(i,j); parameter M(j) /j1 5,j2 4,j3 6,j4 7,j5 6,j6 2,j7 1/ ch(i) /i1 10,i2 5,i3 10,i4 15,i5 6,i6…
n.e
  • 83
  • 1
  • 8
1
vote
1 answer

Why does visual studio gives me error when I want to run the GAMS code via C#?

I want to run my GAMS code via c# by GAMS API. when I start Visual studio,I recieve this error in GAMSWorkspace ws = new GAMSWorkspace(); error: "Expected GAMS system to be 32 bit but found 64 bit instead. System directory:…
n.e
  • 25
  • 8
1
vote
2 answers

What is the most efficient set order in GAMS?

The documentation suggests that sets should appear in the same order to increase performance. If most of our variables share a set, is it better to have the common set first or last? I.e. which is more efficient? y[i,t] =E= a[t] * x[j,t]; or …
Martin Bonde
  • 536
  • 3
  • 11
1
vote
0 answers

During MIP marine inventory routing modelling, cannot assign a condition between decision variables

During modeling, y(i,j,t) and x(i,j,k,t) are decision variables, but I want to add a condition such as: if x(i,j,k,t) > 0, then y(i,j,t) = 1 else if x(i,j,k,t) = 0, then y(i,j,t) = 0 I tried to insert this constraint as below. con10(i,j,k,t)..…
Umut Sener
  • 11
  • 1
1
vote
1 answer

Is it possible to solve bi-objective model directly in GAMS?

Is there any command that can solve multi objective model directly? I mean, without using weighted sum or epsilon constraint methods, can we solve multi objective model in gams? Many thanks!
user9990604
1
vote
1 answer

gams solve lst file is too large to be opened

The model size of my GAMS model is too large. It can be solved, but the solve.lst file is too large to be opened. I need open it to check some results. Are there anyone meet this problems before? Please give me some ideas/hints to fix it.Thanks.
Harry
  • 331
  • 1
  • 4
  • 14
1
vote
0 answers

using uniform distribution to generate random data

is it possible to have a parameter like randP(j) such that ,5 element of randP select randomly then these elements fill with random-int , and other elements have value 0. set j/1*50/; parameter randP(j); *select 5 elements (5 location j)…
blue sky
  • 15
  • 6
1
vote
1 answer

The order (sequence) of set members imported into GAMS

I want to import elements or members into a GAMS set from other sources, say SQL DB. For example set p plant /p1,p2,p3.../ These elements are successfully imported, however, it seems that they are not ordered, because errors will be reported when I…
Harry
  • 331
  • 1
  • 4
  • 14
1
vote
0 answers

how to model IEEE 6-bus system unit commitment?

I'm trying to model the IEEE 6-bus system to minimize the cost, the code is working well but I have a problem in modeling start-up cost equation which can be found in equation number 12 and 13…
Anan Ayoub
  • 11
  • 1