Loop statement

Hi,

Could you please to help me how to solve my problem:

Sets t time /t1*t5/;
Parameter o(t) /t1=28,t2=28,t3=28,t4=28,t5=28/;
Parameter q(t) /t1=0.5,t2=0.5,t3=0.5,t4=0.5,t5=0.5/;
Parameter S(t) /t1=1900,t2=1900,t3=1900,t4=2000,t5=2000/;

Scalar E /1300/;
Scalar H /1600152/ ;
Scalar A /256/;
Scalar I_res /20/;
scalar Io /22/;

Variables I(t),z(t),k(t),obj;
Binary variable Y(t);

How to write on the “loop” and “if statement” when I have equation:

I(t)=Io+((q(t)AS(t)(o(t)-Io)/H))-((ES(t)*Y(t))/H);
J(t)=sum(I(t)-I_res)^2
J(t)=Sumk(t)
k=1 if J(t)>25
k=1 if J(t)<20
Else k=0
Please and thank so much


Marwan


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

hallo everyone,

it‘s me again, i think the code is not clearly enough and i poste all of them here. Any of the suggestion will be much appreciated.


sets

i supplier /L1*L3/
l diskount /R11,R12,R13,R21,R22,R23,R31,R32/


Table P(i,l) Preis

R11 R12 R13 R21 R22 R23 R31 R32
L1 50 48 45
L2 48 45 43
L3 49 45

Table QU(i,l) low bound of discount (quantity of goods)

R11 R12 R13 R21 R22 R23 R31 R32
L1 30 61 101
L2 40 81 121
L3 30 71

Table QO(i,l) high bound of discount

R11 R12 R13 R21 R22 R23 R31 R32
L1 60 100 inf
L2 80 120 inf
L3 70 inf



Parameters

QM(i) supply limit

/L1 28
L2 20
L3 15/

K(i) cost of supply

/L1 120
L2 110
L3 115/



Scalars d demand per Periode /35/
lz interest /0.03/ ;

Variables

q(i,l) supplied quantity
C costs;

integer Variable q ;

Equations

cost costs
NB1(i,l) low bound of quantity
NB2(i,l) high bound of quantity ;


cost… C =e= P(i,l)d + lz/2P(i,l)*q(i,l) + K(i)*d/q(i,l);
NB1(i,l)… q(i,l) =g= QU(i,l) ;
NB2(i,l)… q(i,l) =l= QO(i,l) ;



loop((i,l),
if((i =L1 and l= R11 or R12 or R13);

or
(i =L2 and l= R21 or R22 or R23);
or
(i =L3 and l= R31 or R32 or R33)

solve Bestellmenge using nlp minimizing C;
display q.l;
);


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.