I have a maximization model with 10 constraints from x(1) to x(10) each constarints has different limits like x(1)>5 x(1)<10, x(2)>11 x(2)<19...

is there any way I can specify these x(1)..x(10) in the form of "for" loop? like we do for(i in DATA) something like that? Is it possible?

The reason I am doing this is to atuomate the model by reading from a text file than hard coding the x's.

This is how you could state such a loop with Mosel:

declarations

R=1..10 ! Index set

x: array(R) of mpvar ! Decision variables

L,U: array(R) of real ! Lower and upper bound values

end-declarations

! ... input your data ...

forall(i in R) do

x(i) >= L(i) ! State the bound constraints

x(i) <= U(i)

end-do