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

Compare vector values in GAMS

Is it possible to compare two vectors in GAMS directly? For example, set i 'plants' /i0*i9/ parameter a(i),b(i); a(i)=uniformint(1,9); b(i)=uniformint(1,9); if(a(i)=b(i), display a; else display b; ); Directly using this code will result in errors.…
Sophia Yao
  • 11
  • 1
0
votes
2 answers

Conditional binary variable logic in gams model

This is for a model in gams, I have a binary variable (B(N)) and a real variable (u(N)), where N is a set. I want the binary variable to equal zero when u is zero, and to equal one when u isn't zero. This would be easy if I could use 'if' statements…
John B
  • 1
  • 4
0
votes
1 answer

writing tables and parameters in gams

I am an absolute beginner in using GAMS and, although my question might seem obvious I could really use some help. The situation is the following: I have three sets: I,J and TR. I is the coordinate of the origin; J is the coordinate of the…
0
votes
2 answers

Defining poisson distribution in GAMS

I have this OR model in GAMS and i need to define a parameters which has poisson distribution, my code is: Scalar Landa 'mean for poisson distribution' /3/; Parameter L; L=Poisson; I get the error $140 which means unknown symbol Does anybody know…
Sepideh Gh
  • 97
  • 6
0
votes
1 answer

how to write a summation in gams?

I wrote a model in gams but it's infeasible. I suspect to this constraint, I think I didn't write it truly: In my model: c6(i,e)$(ord(e)<>0).. sum(f$(ord(f)<=ord(e)-1),z(i,f))=l=ord(e)*(1-(z(i,e)-z(i,e-1))); i, e are sets alias(e,f); binary…
Omid
  • 1
  • 1
  • 2
0
votes
0 answers

Disable Pre-processing in GAMS

When solving a non-linear problem (NLP) in GAMS, I would like to disable pre-processing of equations, because I believe the procedure may be improperly underestimating my feasible space. Is there an option flag to do so?
Qi Chen
  • 1,648
  • 1
  • 10
  • 19
0
votes
1 answer

Sets and Indexing in GAMS

I am trying to solve a mathematical optimization model. I want to define a set in my model, say, i and I want it to be from 0 to 15. Is it possible? Or I have to define from 1 to 16? I am using the demo version of GAMS (General Algebraic Modeling…
Gobryas
  • 346
  • 2
  • 8
0
votes
1 answer

Import 5 dimensions from Excel into GAMS

I have a parameter with 4 dimensions which I would like to import in Excel. Currently I have a series of Excel sheets with each over 500,000 rows. The columns are: Parcel, Farm, Year, Species, Class, Surface Ideally I would like to have a…
LouisM
  • 1
0
votes
2 answers

GAMS, domain violation for set

balance(i).. Sum(k,X(k,i)) - Sum(j,X(i,j)) =G= 0 I have this equation in GAMS, I understand why this is a domain violation. Yet I need to express this. I can not think of any other way of expressing this constraint in GAMS. Any help would…
Matrona
  • 1
  • 1
  • 2
0
votes
0 answers

(L)BNF grammar for GAMS

Is there a place I can find Backus–Naur Form (BNF) grammar for General Algebraic Modeling System (GAMS)? I have searched the web but have turned up empty handed. I figure it must exist somewhere.
ebergq
  • 11
  • 1
  • 1
0
votes
2 answers

Loading GAMS Java API in JRuby

I'm working on a Java/JRuby project which needs to be able to be able to interact with GAMS. I know we can use the Java API, but I would really like to be able to access it using JRuby if possible, since we're hoping to eventual add a DSL and some…
Wikk
  • 63
  • 1
  • 10
0
votes
2 answers

linking c++ to gams software

I want to link c++ to GAMS software using createprocess() function. I used this code but it just opens the GAMS software. I want that the programe run a file.gms automatically after openning the GAMS software: STARTUPINFO si; PROCESS_INFORMATION…
Nahid
  • 11
-1
votes
0 answers

GAMS Equation not balance

enter image description here Please I need help on how to balance the above equations in GAMS I have been try to solve it and his given me headache since, please help to solve it ? I am waiting for you guys response. Thanks
-1
votes
1 answer

How to establish a constraint in GAMS for specific example

Can anyone help me figure out how to introduce these constraints in GAMS software? Thanks. enter image description here Xijkl = 0, i ={3}, j={1,2}, for all k that belong to K, for all l that belong to L Xijkl = 0, i ={2}, j={3}, for all k that…
-1
votes
1 answer

How to limit the count of nonzero variables in GAMS mixed-integer nonlinear programming?

The background of the problem: There are 25 candidates on Neo blockchain that receive votes. Every voter except me has voted. The candidates ranked 1st to 7th each will give 200 dollars, proportionally to people who vote for them. And the 8th to…
1 2 3
24
25