and solve the model with the two constraints. Here there is the first problem: changing the inizialization, e.g. fs2(j,p) = fs1(j,"2"); the solution changes, but I don't know why since I am just coping a constraint of constraint1(i), namely constraint1("1") in the second constraints. The model doesn't change. Moreover, I would like to implement a branch and cut approach, introducing a dynamic set dynset(p) and redefining the second constraints as

set dynamic(p) ;
dynset(p) = no ;

constraintA2(dynset).. sum((j,m), w(j,m) * fs1(j,dynset)) =g= 0 ;

I again initialize fs2(j,p) = fs1(j,"1"), I solve the model. Then, I have a loop over p: in each iteration I construct the cut defining the value of the parameter

fs2(j,dynset) $(dynset.val = p.val) = ...

and set dynset(p) = yes and solve the problem again. But it seems that there is something wrong in the updating phase. I really appreciate all you help.

Hi Luca
It looks obvious that you have different solutions as you choose different values for the parameters.
The question on the dynamic set is hard to answer without the code to run the model and the exact error.
Cheers
Renger

Thanks very much for your answer. It is true that I have different value for the parameters, but the second equations are just the copy-paste of one of the equation in the first set. I have all the equation I need in the first group of constraints, while in the second one I have always a constraint that I already have in the previous set. If I set fs2(j,p) = fs1(j,"1"); I copy the first constraint, if I set fs2(j,p) = fs1(j,"2"); I copy the second one and so on. I still do not get why gams gives different solutions.

If you want an answer to your question, you have only to post a running (and hopefully minimal) example that reproduces the issue. I feel sure this will get you a helpful response. There is also a good chance that putting this together will lead you to the solution of your own problem.

Here there is the code. I have a master problem, PROBLEM1, whose constraints are dynamically added by solving PROBLEM2. The syntax is correct, but the code has a strange behaviour (I am not sure I use the dynamic set in the right way). Thanks very much for all your suggestions.

Hi Luca
If you are sure that the equations are the same, make a check by writing a report parameter that looks at the differences between solutions (just write out the matrix fssol for every solve and compare them.
Thy dynamic set works fine (one element of the set is added in every run).
Cheers
Renger

Thanks for the answer. I have already check the difference between fsSOL matrix and apparently all is ok.
But, when I solve the problems (which apparently are the same), I obtain different solutions.
-- Luca