exponential distribution constraint

Dear All,
I am trying to write a simple code for demand which has a exponential distribution function. I define all the sets, parameter. When I write the constraint,


CONSTRAINT

Z(i,j)=exp(-lambda(i,j)*T) … here how can I write this constraint or is this right way to write it. Since I have two time period and writing T in the equation does not look write. Could you please let me know if there is a better way to write this constraint?

Thank you.

Sets

P /P1*P2/

T periods in the planning horizon / t1*t2/

Alies(i,j)

PARAMETERS

Lambda (i,j) for product i at time period t

Z(i,j) demand for product i at each period j

Data

TABLE

Lambda(P,T,*) for different time period for each product

Lambda (i,j)

P1 .t1 0.008

P2 .t1 0.008

P1 .t2 0.01

P2 .t2 0.01

;




\

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/d/optout.

Hi Deniz

Note that T is a set with set elements, not with numbers, so you should convert these elements to numbers. This is done, for example, with the function ORD(t), or you define a parameter depending on T (e.g. coeff(t)), and initialize this parameter (coeff(t) = ORD(t)) and then adjust the equation accordingly:



Z(i,j)=exp(-lambda(i,j)*ord(T)) ;

Z(i,j)=exp(-lambda(i,j)*coeff(T));



Note that your constraint definition should be over i,j and t.



Cheers

Renger


\


Modelworks

Gewerbestrasse 15

3600 Thun – Switzerland

+41 79 818 53 73

Info@modelworks.ch

blog.modelworks.ch







From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of deniz
Sent: Thursday, October 23, 2014 6:42 AM
To: gamsworld@googlegroups.com
Subject: exponential distribution constraint



Dear All,

I am trying to write a simple code for demand which has a exponential distribution function. I define all the sets, parameter. When I write the constraint,



CONSTRAINT

Z(i,j)=exp(-lambda(i,j)*T) … here how can I write this constraint or is this right way to write it. Since I have two time period and writing T in the equation does not look write. Could you please let me know if there is a better way to write this constraint?

Thank you.



Sets

P /P1*P2/

T periods in the planning horizon / t1*t2/

Alies(i,j)

PARAMETERS

Lambda (i,j) for product i at time period t

Z(i,j) demand for product i at each period j

Data

TABLE

Lambda(P,T,*) for different time period for each product

Lambda (i,j)

P1 .t1 0.008

P2 .t1 0.008

P1 .t2 0.01

P2 .t2 0.01

;








\

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/d/optout.


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/d/optout.

On Wednesday, October 22, 2014 11:42:27 PM UTC-5, deniz wrote:

Dear All,
I am trying to write a simple code for demand which has a exponential distribution function. I define all the sets, parameter. When I write the constraint,


CONSTRAINT

Z(i,j)=exp(-lambda(i,j)*T) … here how can I write this constraint or is this right way to write it. Since I have two time period and writing T in the equation does not look write. Could you please let me know if there is a better way to write this constraint?

Thank you.

Sets

P /P1*P2/

T periods in the planning horizon / t1*t2/

Alies(i,j)

PARAMETERS

Lambda (i,j) for product i at time period t

Z(i,j) demand for product i at each period j

Data

TABLE

Lambda(P,T,*) for different time period for each product

Lambda (i,j)

P1 .t1 0.008

P2 .t1 0.008

P1 .t2 0.01

P2 .t2 0.01

;


Thank you so much Renger. I will try this way.

Regards.

\

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/d/optout.