Hi all,

I have a set kk in my model. I am trying to write a loop for kk and do some calculations for each elements of kk. For example, first kk=3 and I have equations for kk={1,2,3}. Then I need to have kk=4 and have the same equations for kk={1,2,3,4}. I need to increase kk=20 and run the model for kk={1,…,20}. I tried to use a dynamic set to update the set kk and then use the dynamic set in the loop, something like this:

```
set kk /1*20/ ;
.
.
.
objective...
.
.
.
constraint1(kk,t).. sp(t,t+ord(kk)) + slack(t,t+ord(kk),sow,f) =e= acr1* yield;
.
.
.
alias (kk,ka);
alias (kk,ka1);
$onempty
set k(kk) // ;
loop(ka1, k(ka1) = yes ;
loop(ka$k(ka) , display k;
solve mymodel using mip maximizing objective;
.
.
.
));
```

But this does not what I want to do. It does not update the value of objective and variables in the model for different kks.

Does anyone have any idea how to fix it?

Thanks in advance,

Sirin