Search found 12 matches

by Bahar_Mdi
2 months ago
Forum: Syntax
Topic: defining a subset in GAMS
Replies: 2
Views: 252

Re: defining a subset in GAMS

Thanks a lot for your help.
by Bahar_Mdi
2 months ago
Forum: Syntax
Topic: defining a subset in GAMS
Replies: 2
Views: 252

defining a subset in GAMS

Dear all, I want to determine a subset based on the indices of elements. for example, I have a set i /0,4,3,1,5,2,6/ and the order of elements in this set is important to me. I want to define a subset that contains the third element of i to the sixth element. In more details, I want the subset to be...
by Bahar_Mdi
2 months ago
Forum: Syntax
Topic: index of elements in an unordered subset
Replies: 2
Views: 264

Re: index of elements in an unordered subset

Thanks a lot for your help.
by Bahar_Mdi
2 months ago
Forum: Syntax
Topic: index of elements in an unordered subset
Replies: 2
Views: 264

index of elements in an unordered subset

Dear all, I want to determine the index of elements in an unordered subset in GAMS and I need some help. for example, I have a set i /1*6/ and I get subset(i) from MATLAB software based on an algorithm that I designed for my problem. a subset(i) contains some elements of i that are sorted in a speci...
by Bahar_Mdi
3 months ago
Forum: Syntax
Topic: defining a parameter in GAMS
Replies: 9
Views: 618

Re: defining a parameter in GAMS

thanks a lot. sorry, I think subV_T(j) Which I have used is misleading. It refers to a subset on j. we can drop this. consider the following example: let c is: 1 0 1 1 0 1 1 1 subV_T(j) contains j=1 and j=2. I want to check c(i,j) for all i and j that belongs to subV_T(j) and if I find that c(i,j) i...
by Bahar_Mdi
3 months ago
Forum: API
Topic: Linking GAMS and Matlab
Replies: 0
Views: 974

Linking GAMS and Matlab

Hi all, I am trying to link GAMS and MATLAB. I do the first step and when I write what gams in MATLAB, I do not get any error. but I have a model in GAMS entitled Transport. when I write gams('Transport');, I get the following error: Error using gams abnormal GAMS termination running C:\GAMS\win64\2...
by Bahar_Mdi
3 months ago
Forum: Syntax
Topic: defining a parameter in GAMS
Replies: 9
Views: 618

Re: defining a parameter in GAMS

thanks a lot. I have another problem related to this topic: by the following statement c_afterProcess(i,j) will ba change, c_afterProcess(i, j) $(c(i, j)$subV_T(j) eq 1) = no; but I want to put c_afterProcess(i, j) for all i if c(i, j)$subV(j) eq 1. more precisely I want to change the value of all t...
by Bahar_Mdi
3 months ago
Forum: Syntax
Topic: defining a parameter in GAMS
Replies: 9
Views: 618

Re: defining a parameter in GAMS

thanks a lot for your help. but I want an output such as the following example: for example for customer 1 we have d(1,1)=1, d(1,2)=0, d(1,3)=1 so C(1) would be {1,3}. because in my constraints I want to have sum p(j)>=1 for each customer i; in which p is a binary variable and the summation is on al...
by Bahar_Mdi
3 months ago
Forum: Syntax
Topic: defining a parameter in GAMS
Replies: 9
Views: 618

Re: defining a parameter in GAMS

thanks for your reply. I will provide more clear information in the following: let i is the set of customers and j is the set of some locations. I define parameter d(i,j) as a binary parameter which is 1 if the distance from the customer i to location j is less than a predefined parameter R, otherwi...
by Bahar_Mdi
3 months ago
Forum: Syntax
Topic: defining a parameter in GAMS
Replies: 9
Views: 618

defining a parameter in GAMS

Dear all,
how can I define the following parameter in GAMS?

C(i) is the set of j that d(i,j)=1

I have defined parameter d but I do not know how can I define C(i) in GAMS?

I appreciate it if someone can help me.
Thanks and regards,
Bahar