Search found 118 matches

by Manassaldi
5 years ago
Forum: Syntax
Topic: searching string in set
Replies: 11
Views: 10687

Re: searching string in set

Hi, I think that order doesn't matter when you defining an equation.

set tid /2000*2014/;

equationx(tid)$condition(tid).. "an equation"
by Manassaldi
5 years ago
Forum: Syntax
Topic: searching string in set
Replies: 11
Views: 10687

Re: searching string in set

Hi, to be able to compare them I think they should be defined as parameters.
Another possibility is to use auxiliary parameters.
To search for a string in a set, I usually use the "sameas" command.
Bye!
by Manassaldi
5 years ago
Forum: Syntax
Topic: Two Indexex [Maybe Alias problem]
Replies: 4
Views: 8072

Re: Two Indexex [Maybe Alias problem]

Hi, the problem is in set k at the end of the equation: ...V_NEG*dm(j,k)/sum(jj,dm(jj,k)); This is the equation exactly like the one in the image: eq_margen_1(j) .. sum(p,is(j,p))+ sum(i,th(j,i)*Y(i,j)) - sum(k,dm(j,k)) =G= sum(jj, sum(p,is(jj,p))+ sum(i,th(jj,i)*Y(i,jj)) - sum(k,dm(jj,k)))*V_NEG*dm...
by Manassaldi
5 years ago
Forum: Syntax
Topic: Binary Matrix
Replies: 2
Views: 2701

Re: Binary Matrix

Hi, you must specify that MM(i,k) is a binary variable.

Code: Select all

Binary Variable
MM(i,k) ;
Bye
by Manassaldi
5 years ago
Forum: Archive Google Group
Topic: maximum number of repetitions
Replies: 2
Views: 4336

Re: maximum number of repetitions

Hi, I think this can work. Maybe it should be modified for a greater generality Bye! set i your set i /1*55/ n number of pattern /p1*p6/ j your set j /40,50,60/ pattern(n,j) pattern definition /p1.40,p2.50,p3.60,p4.40,p4.50,p5.40,p5.60,p6.50,p6.60/ ; table D(i,j) 40 50 60 1 40 50 2 60 3 40 9 50 17 5...
by Manassaldi
5 years ago
Forum: Syntax
Topic: controling equations with subsets
Replies: 1
Views: 2810

Re: controling equations with subsets

Hi, you must always reference to the original set (i, j) for example: set i /i1*i10/ j /j1*j15/ h /h1*h40/ technology(i,j) subset_of_tech(i,j) ; technology(i,j)= some set definition subset_of_tech(i,j)= some set definition constraint(i,j,h)$(technology(i,j) and subset_of_tech(technology)).. var(i,j,...
by Manassaldi
5 years ago
Forum: Modeling
Topic: Linearization problem with three decision variables
Replies: 1
Views: 2562

Re: Linearization problem with three decision variables

Hello, do you need the product of three variables? If so, you can linearizing the product of two binary variables (Quality of production and Transportation area); this generate a new binary variable (suppose QT). Finally, you can linearizing the product of a binary and a continuous variable (QT and ...
by Manassaldi
5 years ago
Forum: Syntax
Topic: controling equations with subsets
Replies: 1
Views: 2810

Re: controling equations with subsets

Hi, I hope this can help you.
Bye

constraint(technology)$subset_of_tech(technology).. var(technology) =g= par(technology);
by Manassaldi
5 years ago
Forum: Modeling
Topic: To binary or not to binary...
Replies: 4
Views: 3896

Re: To binary or not to binary...

Hi, you can use a bounded continuous variable.
positive variable
T
;
T.lo=50;
T.up=150;

This works, except if you need that the variable take integer values.
Bye
by Manassaldi
5 years ago
Forum: Modeling
Topic: Xii >= Xij how to code in GAMS
Replies: 2
Views: 3324

Re: Xii >= Xij how to code in GAMS

Hi, it's simple

set i warehouse /1*3/;
alias(i,j);

eq(i,j)$(ord(i) ne ord(j)).. X(i,i) =g= X(i,j);


Bye