Hard to tell as you donâ€™t send the complete code.

Here code that does what you want. However, note that the variable U is not defined in the equation over i3, so I define over i and set a dollar control over i3

I set of remaining life /0*3/

T set of planning time /0*7/

i1(i)/1*3/

i2(i)/0*2/

i3(i)/1*2/

t1(t)/1*7/

t2(t)/0*6/

t3(t)/7/

t4(t)/1*6/

t5(t)/2*7/

t6(t)/6/

t7(t)/0*5/

;

variable U(i,t),OBJ,V(i,t),S(i,t);

equations const6, dummy;

const6(i,t6,t3)$i3(i)…

U(i-1,t6)=e= V(i,t3)+S(i,t3);

dummy…

sum((i,t), S(i,t)) =E= OBJ;

model test /all/;

solve test maximizing OBJ using nlp;

---- const6 =E=

const6(1,6,7)… U(0,6) - V(1,7) - S(1,7) =E= 0 ; (LHS = 0)

const6(2,6,7)… U(1,6) - V(2,7) - S(2,7) =E= 0 ; (LHS = 0)

Cheers

Renger

From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of deniz

Sent: Sonntag, 22. Februar 2015 22:07

To: gamsworld@googlegroups.com

Subject: subset-constraint does not start from right number-URGENT HELP

Dear All,

I am trying to define a constraint with a subset but unfortunately this constraint does not start from initial subset values.

My set and subset values and the constraint formulation are;

Sets

I set of remaining life /0*3/

T set of planning time /0*7/

i1(i)/1*3/

i2(i)/0*2/

i3(i)/1*2/

t1(t)/1*7/

t2(t)/0*6/

t3(t)/7/

t4(t)/1*6/

t5(t)/2*7/

t6(t)/6/

t7(t)/0*5/

const6(i1,t6,t3)…U(i1-1,t6)=e= V(i1,t3)+S(i1,t3);

I want this constraint starts from

U(0,6)-V(1,7)-S(1,7)=E=0

but when I run the model, model formulation shows that it is starting from

Gams output

---- const6 =E=

const6(1,6)… U(1,6) - V(2,7) - S(2,7) =E= 0 ; (LHS = 0)

const6(2,6)… U(2,6) - V(3,7) - S(3,7) =E= 0 ; (LHS = 0)

Can you please let me know what am I missing?

Thank you in advance.

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.

–

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.