.

Hello everyone!

I have a problem with multiple conditions over one equation and hope you can help me with this.

I have a production flow rate on several equipment types that is limited by the individual equipment type capacity. Since there is no inventory inbetween steps, the maximum flow rate of the line has to be determined by the bottleneck equipment flow rate. I therefore compair all flow rates of each equipment type and constrain them to be equal. You can see the conceptual math in the picture.

t is the period index

s is a site index

k is a production stage index (production decoupling point)

p is the product index

e is the equipment type index and containts all possible equipment types

e(k,p) is a multi dimensional set that gives me only the equipment types that I need for producing product p in stage k, because this varies for different products and the stage they are in.

The bottleneck constraint holds for every period t at every site s in every stage k for every product p.

Epsilon is an alias for e and contains the same values. I need epsilon so that I can compare the different equipment types with each other. I give an example:

product 1 needs equipment type 1 and 2 in stage 1

product 2 needs equipment type 1,2 and 3 in stage 1

e contains {1,2,3,4} so there are in total 4 types of equipment

the equation should do this: (I leave out indexes t,s because they are irrelevant)

x(k=1,p=1,e=1) = x(k=1,p=1,e=2)

x(k=1,p=1,e=2) = x(k=1,p=1,e=1)

x(k=1,p=2,e=1) = x(k=1,p=2,e=2)

x(k=1,p=2,e=1) = x(k=1,p=2,e=3)

x(k=1,p=2,e=2) = x(k=1,p=2,e=1)

x(k=1,p=2,e=2) = x(k=1,p=2,e=3)

x(k=1,p=2,e=3) = x(k=1,p=2,e=1)

x(k=1,p=2,e=3) = x(k=1,p=2,e=2)

I know some of the equations are redundant, but I figured this was still the best solution.

This is what I have written in GAMS

t “time period index” / 0*6 /
s “site index” / 1,2,3 /
p “product index on SKU level” / 1,2 /
k “production stage index” / 1,2 /
e “equipment type index” / 1*6 / (I just made an example with 1*4 but there are more types)

ekp (k,p,e) “equipment types needed to produce p in stage k” /

1.1. (1,2,3)

2.1. (5,6)

1.2. (1,2,3,4)

2.2. (5,6) /

alias (e, epsilon)

pprocess1(t,s,k,p,e,epsilon) " 3.1 bottleneck constraint site level"

pprocess1(t2,s,k,p,e,epsilon)$ekp(k,p,e)… x1(t2,s,k,p,e) =e= x1(t2,s,k,p,epsilon) ;

*t2 is a subset of t which doesn’t contain 0, but is irrelevant for the problem

And here is what the solver does: (again t,s left aside; I will give example for k=1 and p=1)

x(e=1) = x(e=2)

x(e=1) = x(e=3)

x(e=1) = x(e=4)

x(e=1) = x(e=5)

x(e=1) = x(e=6)

x(e=2) = x(e=1)

x(e=2) = x(e=3)

x(e=2) = x(e=4)

…

So e only takes the values that are in ekp(k,p,e) which are 1,2,3 and e and epsilon are different from each other for each equation. Epsilon however is not constrained over only elements of ekp(k,p,e), but takes all values of e which are 1,2,3,4,5,6. I don’t know how to limit this as well.I tried the $ condition like this pprocess1(t,s,k,p,e$ekp(k,p,e),epsilon$ekp(k,p,epsilon)), but I read in this forum that the constrain has to be behind equation() and also the compiler gave errors.

Can someone help on this? Would be very glad

Nice day to you all

Niko

–

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.