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

ampl vs gams MINLP portfolio optimization syntax

I am looking for a MINLP optimizer to solve portfolio optimisation problem which minimizes x'.S.x where x is a vector S is a given matrix. There are integer constraints which x elements depend on ex; x[i] = g[i].K[i] where g[i] is an integer and…
adam
  • 655
  • 1
  • 10
  • 31
0
votes
0 answers

What is primal infeasible solution in GAMS?

I am using GAMS for solving a MILP problem which includes binary variables. However there is a problem in the solution. Surprisingly, I have seen that one of the binary variables in the solution has a found value of "-1" another one "2". That is not…
iman
  • 11
  • 1
  • 4
0
votes
1 answer

Equation containing a matrix power

I have an equation on the form A^n*b =e= c where A is a matrix and b & c are column vectors. n is a fixed number for my model determined by a constant. It will most likely be in the hundreds and be changed for different solutions. A is a matrix of…
Bomaz
  • 1,871
  • 1
  • 17
  • 22
0
votes
1 answer

How to leave GAMS loop like using "break" in other languages?

I was wondering if any of you know how to leave a loop using a command such as "break" in other languages.
Hao
  • 43
  • 1
  • 5
0
votes
1 answer

Is the equation below means in a MIP model

As the title mentioned sum((r,l), Mer.l(e,r) * Mel(e,l)) =e= 0; I use a GAMS mip model to solve a problem, and Mer(e,r) and Mel(e,l) are both binary variables, and if I did not write the .l suffix, the compile will give Endogenous relational…
Patrick
  • 181
  • 1
  • 1
  • 11
0
votes
1 answer

How can I write a loop like this equation in GAMS?

I tend to write some codes in GAMS that include a loop that exclude some indices ,how can I write some a loop like with exception? u("p1","j1")*o1("p1","j2") - sum(t,v("p1","j1",t)*I1("p1","j2",t))=l=0; u("p1","j1")*o1("p1","j3") -…
iman
  • 11
  • 1
  • 4
0
votes
1 answer

Downloading CSV_GDX_tools.exe package

I have to work with GAMS and R to extract data however I am a new R user and never have used GAMS before. I need to download a package called CSV_GDX_tools.exe and I have no idea what that is... When I try to install it in R, I get this error…
0
votes
1 answer

How can I get one element from a set in GAMS?

I have a set I workers /W1,W2,W3/ and variable T(I) time Wi does his work I need to write a function T1<=T2, so I need to get first and second elements of set I. How can I do this? this EQUATIONS eq1; eq1 .. T(I('1')) =le= T(I('2')) doesn't…
Daria
  • 1
  • 1
0
votes
1 answer

Install and run GAMS in Fedora

I want to use GAMS in Fedora (23). I have read the information on how to install GAMS in Unix (https://www.gams.com/help/index.jsp?topic=%2Fgams.doc%2Fuserguides%2Fuserguide%2F_u_g__i_n_s_t_a_l_l.html&cp=0_1). I have downloaded the file to a folder…
RM-
  • 986
  • 1
  • 13
  • 30
0
votes
1 answer

Three asterisks (***) in GAMS

I have some questions about the three asterisks (***) in GAMS that may be shown at the end of an individual equation listing. I know they are a warning that the constraint is infeasible at the starting point. I have a model that after solving it by…
saeed
  • 1
  • 1
0
votes
1 answer

GAMS: card operator over subset

I am trying to model a Cross Dock Problem. It has the following sets: j for Outbound Trucks, s for sorting stations and l for Outbound Docks. And moreover there is a binary variable z(j,s), which is one, if Outbound Truck j is assigned to sorting…
Natascha
  • 1
  • 1
0
votes
1 answer

how can I model the incremental summation of one variable

how can I model the incremental summation of one variable in GAMS constraints like the following: y(t) is variable; t is period index that t=1,…,4; in constraints section I want this summation in each period: t=1 : y(t=1) < t * 10 t=2 : y(t=2) < t *…
0
votes
1 answer

export data from gams to excel

I have a mathematical model and I want to run it 10 times automatically with different data sets which are generated randomly(when the first model stops, start another model automatically). for this purpose I have written the solve statement in a…
m. bk
  • 27
  • 1
  • 5
0
votes
1 answer

Execute Gams in background on Python 2.7

I need to call and run gams at background from a Python script. I'm using: import subprocess subprocess.check_call([r"C:\GAMS\win64\24.4\gams.exe",r"F:\Otim\Interface\ElGr.gms"]) And it gives me this error: Traceback (most recent call last): …
0
votes
1 answer

convert two dimensional array into one dimensional in GAMS

I have a two-dimensional array in gams, which i'd like to convert into a one-dimensional array. I.e. I have set i /i1*i100/ set j /j1*j100/ parameter array(i,j) And now I'd like something like: set n /n1*n10000/ parameter one_dim_array(n) And…
nonick
  • 3
  • 3