Urgent help needed

Dear friends,



I have a MINLP model.



I have a set called t (t=1,2,3,…365) which indicates days.



I have a integer variable called T (ordering Period) which is obtained during model solving procedure.



I have a binary variable set called X(t) .



I do not know how to define suitable equation that assigns correct value to X(t) variables if we have:

X(t)=1 for t=nT (n:integer)
X(t)=0 otherwise

For example if T=3 then X(1)=0,X(2)=0,X(3)=1

X(4)=0,X(5)=0,X(6)=1

And so on…


Waiting for your warm-hearted help…


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Hello,

I send you the following code but with parameters:

set t/1*360/
sub(t);
sub(t)$(mod(ORD(t),3) EQ 0)=yes;
parameter X(t), Y(t);
X(t)=ORD(t);
Y(sub)=1;

display X, Y;

I have the same set t (for the time) with values from 1 to 360.

I construct a subset (called sub) where only the integers that are multiples of 3 (in your case T) will take a value of 1.

If you run it you will see ( parameter Y) that only 3, 6, 9 and so on will take a value of 1 while all the others 0.

Adjusting the previous to your binary variables you have:

  • Here you state that binary variable X(t) equals 1 when mod(ORD(t),T)=0 otherwise it is 0

BIN(t)… X(t)$( ord(t) EQ ord(sub) )=E=1;

where as

set t/1*360/
sub(t);
sub(t)$(mod(ORD(t),3) EQ 0)=yes;

Hope that helps


Konstantinos Petridis

PhD Student


Τη Σάββατο, 21 Δεκεμβρίου 2013 10:05:15 μ.μ. UTC+2, ο χρήστης Passerby έγραψε:


Dear friends,



I have a MINLP model.



I have a set called t (t=1,2,3,…365) which indicates days.



I have a integer variable called T (ordering Period) which is obtained during model solving procedure.



I have a binary variable set called X(t) .



I do not know how to define suitable equation that assigns correct value to X(t) variables if we have:

X(t)=1 for t=nT (n:integer)
X(t)=0 otherwise

For example if T=3 then X(1)=0,X(2)=0,X(3)=1

X(4)=0,X(5)=0,X(6)=1

And so on…


Waiting for your warm-hearted help…


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Dear Konstantinos,

Thank you for your consideration. but there are some problems as following:

As you know T (supposed to be in your example 3) is a variable that its level is determined while model solving procedure and by GAMS rules we could not use variables in sets and subsets.
My model is MINLP and MINLP solvers do not permit using $ conditions.
Mod function encounters MINLP models whith some problems.

I would be so thankful if you let me know in case I am making any mistakes.
Thanks


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Hello,

is variable T subjected to any constraints? (normally it should be, otherwise how can GAMS provide a value of T).

An alternative way that I would recomend is to solve a smaller problem that contains the constraints and variables associated with T, fix this variable (using T.fx=T.l) and then pass it to the bigger problem (this is what I would do, but it is just a guess as I do not have the whole picture).

Hope that helps,

Konstantinos Petridis


Τη Δευτέρα, 23 Δεκεμβρίου 2013 10:37:52 π.μ. UTC+2, ο χρήστης Passerby έγραψε:

Dear Konstantinos,

Thank you for your consideration. but there are some problems as following:

As you know T (supposed to be in your example 3) is a variable that its level is determined while model solving procedure and by GAMS rules we could not use variables in sets and subsets.
My model is MINLP and MINLP solvers do not permit using $ conditions.
Mod function encounters MINLP models whith some problems.

I would be so thankful if you let me know in case I am making any mistakes.
Thanks


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Hello,

Yes, T is used in some other constraints and even in the objective function and obtaining its value separately in another smaller problem is impossible in my problem.
I looks like a simple constraint but I have difficulties to formulate it in GAMS actually and now I am really confused. Thank you for your help my friend.

All the best

On Monday, December 23, 2013 3:25:16 PM UTC+3:30, Κωνσταντίνος Πετρίδης wrote:

Hello,

is variable T subjected to any constraints? (normally it should be, otherwise how can GAMS provide a value of T).

An alternative way that I would recomend is to solve a smaller problem that contains the constraints and variables associated with T, fix this variable (using T.fx=T.l) and then pass it to the bigger problem (this is what I would do, but it is just a guess as I do not have the whole picture).

Hope that helps,

Konstantinos Petridis


Τη Δευτέρα, 23 Δεκεμβρίου 2013 10:37:52 π.μ. UTC+2, ο χρήστης Passerby έγραψε:

Dear Konstantinos,

Thank you for your consideration. but there are some problems as following:

As you know T (supposed to be in your example 3) is a variable that its level is determined while model solving procedure and by GAMS rules we could not use variables in sets and subsets.
My model is MINLP and MINLP solvers do not permit using $ conditions.
Mod function encounters MINLP models whith some problems.

I would be so thankful if you let me know in case I am making any mistakes.
Thanks


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

No ideas?.. Please…



On Saturday, December 21, 2013 11:35:15 PM UTC+3:30, Passerby wrote:


Dear friends,



I have a MINLP model.



I have a set called t (t=1,2,3,…365) which indicates days.



I have a integer variable called T (ordering Period) which is obtained during model solving procedure.



I have a binary variable set called X(t) .



I do not know how to define suitable equation that assigns correct value to X(t) variables if we have:

X(t)=1 for t=nT (n:integer)
X(t)=0 otherwise

For example if T=3 then X(1)=0,X(2)=0,X(3)=1

X(4)=0,X(5)=0,X(6)=1

And so on…


Waiting for your warm-hearted help…


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.