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

Declaration of Decision variables and equations in GAMS

In my Power Control Cptimization problem I have only power vector P(I) as decision variable. However, it involves in the calculation of SINR and system total power thus, my question is: do I need to declar SINR and system total power as variables…
Meriame
  • 11
  • 5
0
votes
1 answer

track value changement in GAMS

I have a variable named Lambda and I want to track how this value change at each iteration. I used dynamic set in GAMS and I defined the following variable: test1.l(S)=(trackvalue.l(S-1)+trackvalue.l(S))/trackvalue.l(S); I could not use this in a…
Meriame
  • 11
  • 5
0
votes
1 answer

CPLEX Error 3019: Failure to solve MIP subproblem

I have written my Mixed-Ineteger model (MIP) in GAMS and trying to solve it with CPLEX. I encountered this error: CPLEX Error 3019: Failure to solve MIP subproblem I have 4 cores and 16 GB RAM on my PC. The optimality gap is set to 1%. After a lot…
PM0087
  • 123
  • 1
  • 9
0
votes
1 answer

How to import data from multiple excel sheets in GAMS using loops?

I want to import the data for a three-dimensional parameter p(i,j,k) that is stored in in k excel sheets but GAMS does not let me use dollar control statements in loops. Is there any way to do that using loops or other flow control statements like…
0
votes
1 answer

sum+sum equation issue in GAMS

I defined the following equation to calculate the sum of total power consumed by the system: TotalPower.. systemPower =e= sum(J,P(J)) + sum(I,CP(I)); However, the variable systemPower gets only the result of the second sum and not both!. The…
Meriame
  • 11
  • 5
0
votes
1 answer

write sum in gams not for all member of set

i want to write sum in gams like this: sets s/A,B,C/ R(machinery,food) . . . machinery_product..sum(Destination,x(machinery,A,Destination))=e=0 but program give me error because A and machinery arent set and they are member of set how can i write…
0
votes
1 answer

how to define exponential expression for a set in GAMS

I want to use the expression 2^P(I) in GAMS. I tried the following: PFUN.. P(I) =e=(2**P(I)); But I always get an error 149: Uncontrolled set entered as constant. Can anyone help me to define that expression properly in GAMS? Thank you in advance.
Meriame
  • 11
  • 5
0
votes
1 answer

initialize decision variables in GAMS in form of a set + equation gives errors

I am trying to model a problem using GAMS. I have 2 questions: 1) How to initialize the decesion value P? it supose to be in the following form P(I)/ i1 25 i2 33 / 2) I am trying to calculate SINR as in SINR(I) =e= hh(I)*P(I) /…
Meriame
  • 11
  • 5
0
votes
1 answer

re-use the same set name multiple times in Gams

I defined a set in GAMS to represent users number. I need to use the set multiple times to define transmission power for each user, the channel quality...etc. However, I think in GAMS you can not use the name of the set for different variables, My…
Meriame
  • 11
  • 5
0
votes
1 answer

How to extract an array from a matrix in GAMS?

i'm trying to extract an array from a matrix in GAMS. For example, i want an array that is just one column (or one row) of the matrix. Is possible to do it?
0
votes
1 answer

counting infeasible solutions in GAMS software

I want to run several mathematical models in GAMS and count the number of infeasible solutions. How should I write the condition of IF statement?
0
votes
1 answer

GAMS: Why is the value of the parameter pp(ss,ii) coming out as zero?

I have written the following code below in GAMS and it may not be the best in the world but I don't see why it keeps returning the value of the parameter pp(ss,ii) as all zeros when it should be a matrix of exactly 2 ones in each row. Could you…
0
votes
2 answers

How to write a while loop in GAMS

Can anyone help me with this problem please. I want to add to i one by one and put the amount of x(i) equal to 1 in each step, so i wrote it as below but it's not working loop(i, x('0')=1; t('0')=1; while(t>m, ord(i)=ord(i)+1; …
Sepideh Gh
  • 97
  • 6
0
votes
1 answer

Defining Probability in GAMS

Does anybody know how to define the below probability in GAMS? Z=P(x
Sepideh Gh
  • 97
  • 6
0
votes
1 answer

Using decision variables in data definition - GAMS

I am trying to make a matrix (currently as a table) in which I have constant values and values depending on a decision variables defined later. It kind looks like this: table g(i,j) limits 1 2 1 1 0.5*x("1",j) 2 1 …
Sebastian E
  • 135
  • 5