Guys
I have 2 questions and appreciate if anyone answer

there is a function that can pick the Largest value among all arguments. Do u know any function that can be used in equations?

i want to write a<x<b in equations (a,x,b are variables). the common way is that use 2 equations(one for a<x and one for x<b). is there any way to write both side in one equation?

For indexed arguments, or rather parameter values, one can use the smin() operation, which works similar to sum() operation.
For equations, you can use the max() function. Goes something like max(arg1,arg2,arg3).

a<x<b is actually two separate inequalities, and should be written as such.

thank u for your answer.
i want to find the maximum value of g(i), g is a variable and i is set, in an equation. i should write sth like this : max(i,g(i)) ???

Almost, you write smax(i,g(i)). A warning: the resulting models will be highly non-convex, so local solvers will most likely miss the global optimum. For example:

set i / 1,2 /;
Table idat
c up
1 2 50
2 1 200;
variable z; positive variable x(i);
equation e; e.. z =e= smax(i,idat(i,'c')*x(i));
model m /e/;
x.up(i) = idat(i,'up');
solve m using dnlp max z;

Local solvers like Conopt and MINOS will find the solution (50,0) with objective 100. Only global solvers will give you (*,200) with objective 200. But many global solvers (Antigone, Baron, Couenne) don’t like max or smax. The only ones in the GAMS portfolio are LindoGlobal and SCIP. LindoGlobal can also reformulate min, max, abs, etc with linear constraints and additional binary variables, so LindoGLobal actually will finally solve a MIP (from the LindoGlobal log):

The problem is a MILP
Startpoint info (not feasible):
Objvalue : 0.000000e+00 (startpoint)
Infeasibility of solution : 1.0e+02
Integer infeasibility of solution: 0.0e+00
Ori. size (m, n, nz, nip): 6, 6, 14, 2