Search found 9 matches

by ayledith
5 months ago
Forum: Modeling
Topic: Converting to Mixed Inter
Replies: 1
Views: 417

Converting to Mixed Inter

Is there a way to rewrite this as a mixed integer program? I want to have a set of real numbers where all but a certain count are forced to zero.

x_s ∈ R
y_s ∈ R
b_s = 0 ∪ 1
y_s = b_s * x_s
∑b_s ≤ 50
by ayledith
5 months ago
Forum: Syntax
Topic: Sum of Rows = Sum of Columns
Replies: 5
Views: 562

Re: Sum of Rows = Sum of Columns

I think I may be missing something. The line "forceSym(i,j)$[ord(i) < ord(j)].. Q(i,j) =e= Q(j,i);" results in the error: "Domain violation for set"
by ayledith
5 months ago
Forum: Syntax
Topic: Sum of Rows = Sum of Columns
Replies: 5
Views: 562

Re: Sum of Rows = Sum of Columns

Is there also a way to write Q(i,j) = Q(j,i), IE Flow from i to j equals flow from j to i?
by ayledith
5 months ago
Forum: Syntax
Topic: Sum of Rows = Sum of Columns
Replies: 5
Views: 562

Sum of Rows = Sum of Columns

I have a variable xij, and I want to code essentially: ∑xi(j=n)=∑x(i=n)j for all values of n. I tried using the line eq6(i,j).. sum(i, Q(i,j)) =e= sum(j, Q(i,j)); which is not correct.
Another way of saying this is that I want to code Input = Output

What is the correct way to write this in GAMS?
by ayledith
6 months ago
Forum: Syntax
Topic: Reading in Large Tables
Replies: 1
Views: 308

Reading in Large Tables

I'm trying to load in tables. It works perfectly fine when I use 24 parameters but when I try to use 720, I get two errors that show up. First: "Error = Error 87: The parameter is incorrect" followed by: "Error reading listing file." Am I supposed to add a line that tells GAMS it can use more memory?
by ayledith
6 months ago
Forum: Syntax
Topic: Averaging out GAMS Runs Within
Replies: 1
Views: 290

Averaging out GAMS Runs Within

Is there a way to loop through LP problems and output the average of the decision variable for each LP solution?
by ayledith
6 months ago
Forum: Syntax
Topic: GAMS Leave One Out
Replies: 1
Views: 285

GAMS Leave One Out

I'm hoping to use Leave On Out Cross Validation (https://en.wikipedia.org/wiki/Cross-validation_(statistics)#Leave-one-out_cross-validation) with GAMS. Is there a way to tell GAMS to ignore particular values in a table? Say I have some set k / k1*k76 / is there a way to write only include k /k1*k25 ...
by ayledith
9 months ago
Forum: Syntax
Topic: Least Squares Notation
Replies: 1
Views: 302

Least Squares Notation

I'm having a hard time interpreting what i, 'x', and 'y' are on this page: https://www.gams.com/latest/docs/S_LS.html.

How do I format this accordingly?
objectiveFunction.. tc =e= sum((k,tau), sqr(a(k,tau) - e(k,tau)) );
by ayledith
9 months ago
Forum: Syntax
Topic: Loading 4D Tables
Replies: 2
Views: 440

Loading 4D Tables

I'm familiar with loading 2D tables into GAMS, IE c_ij (cost of i going to j). But I need to do some analysis where the cost is from location i to location j at time t for station k. Is there a recommended way for loading high dimensional tables into GAMS?