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

Defining extrinsic function in GAMS

Please tell me how i can use the cdfpoisson function in GAMS? I wrote the code as below but i get the Unknown symbol error for M which is a variable that has been calculated from some other things. Thanks *Re(t,d)=Reliability of accepting emergency…
Sepideh Gh
  • 97
  • 6
1
vote
0 answers

Poisson cumulative distribution in GAMS

Can anyone help me with this? I defined a Parameter N and then defined the chance of N being less than M(a variable), but it's not working, could you please take a look at this? *Number of emergency patients arriving at time period t on day d …
Sepideh Gh
  • 97
  • 6
1
vote
0 answers

Chance/Probability in GAMS

I would appreciate it if anyone could help me with this problem of mine, I have a random variable N which is following Poisson distribution and another Variable named M which is calculated based on other things and I know it is being calculated…
Sepideh Gh
  • 97
  • 6
1
vote
1 answer

How to determine which items are on the critical path in GAMS?

This is my current code on GAMS. Yes, I know it can be more concise, but bear with me here: set activity /a*q/; parameter duration (activity) "in days" /a 15, b 4, c 5, d 10, e 4, f 15, g 15, h 5, i 5, j 10, k 4, l 3, m 4, n 20, o 5, p 2, q…
1
vote
1 answer

How to filter elements with identical indices in GAMS?

I have a GAMS model where I have Set i / 1*6 /; Alias (i,ip,il) ; Variables x(i,ip) ; And I want to generate equations which operates on the scalar products of all vectors in x, excluding the product of the same vector. Something…
user3917718
  • 85
  • 2
  • 13
1
vote
1 answer

GAMS maximum element

I have to get GAMS to find the maximum element of a set. This should result in some linear regression model, where the objective is not the least squares but the least maximum deviation. My data points are the (x(p), y(p)) points (There is Set p /…
LDericher
  • 295
  • 1
  • 3
  • 12
0
votes
1 answer

how to write a loops within a loop in GAMS

I have a deterministic model and I want to run my model several times each time changing two parameters Var1 and Var2in order to see how they affect the results. I can summarize my model like this: ... equations obj,a,b; obj... Ax+By=e=cost; a... …
Anna
  • 83
  • 1
  • 7
  • 17
0
votes
2 answers

Gams how to write equations?

I want to write these equations: X21+X22+X23+X24=55 X11+X12+X13+X14=90 X11+X21<=H1*Y11+H2*Y21+H3*Y31 I know I should use SUM function but I don't know it exactly but i can't convert them. how can I write them in equation section? here…
Nickool
  • 3,662
  • 10
  • 42
  • 72
0
votes
2 answers

Minimizing the workflow and distance between department and stations

I wrote code for a project. But line 96 has too many errors. The aim of my project is to minimize material flow and distance between departments and stations in a factory. Obviously, the aim is to reduce the time loss in the material flow by…
0
votes
1 answer

need help writing index in equation in GAMS for a transportation network problem

I have the following code , but due to indexing error in equation 3 and 4 cant run the problem , need help writing them in a correct way / minimize travel time in multiple origin destination pair sets a "links" /l1l19/ b "path sets" /p1*p25/ r…
yousuf
  • 1
  • 1
0
votes
0 answers

how to have a three-dimensional table in gams?

I have a table with an index of rows and then the columns grouped in different blocks in csv, like this: scenario 1 scenario 2 scenario 3 dog cat mouse dog cat mouse dog cat mouse…
Santi
  • 3
  • 2
0
votes
0 answers

How to write MILP model in MATLAB? How to adapt the constraints and objective function written in GAMS program to MATLAB?

In the images below, there is a mathematical model written in the GAMS program. I want to write this model in MATLAB program and solve the problem in MATLAB. Examples of models in MATLAB, which I found on the Internet, include variables with a…
user2018
  • 43
  • 4
0
votes
1 answer

Exporting data from Excel into GAMS

I want to load data from excel sheet into GAMS, each excel sheet has one column and 8760 rows (where each row has a values), and I am using the below code, `Parameter PV_Available(k); $call gdxxrw "C:\Users\omarr\OneDrive\Desktop\GAMS\Model…
Omar
  • 1
0
votes
1 answer

how to retrieve certain values from a varaibles?

I am developing a pricing model, where I need to determine the price of selling electricity. The pricing scheme should determine three pricing values where each value corresponds to a pricing period. Each pricing period consist of a set of number of…
Omar
  • 1
0
votes
0 answers

How to define conditional statement with variable in Gams equations part - optimisation problem

I'm trying to implement conditional statements in the equations part of GAMS non-linear optimisation. I know that $ statements or for loops are not allowed. I also tried big M method but also failed. What I need is something like…