Hi, I have to indices
one from product p
an one productfamily f
and I want to implement a mathematical equation, where p is Indice from f and I don’t declare f for the equation.
In the following picture you can see the wanted Equation.

How can I implement the f and p as indices in GAMS.

You do this via a mapping set: pf(p,f). You also need this for P_m:

set m /m1*m3/, g /g1*g5/, p /p1*p5/, f /f1*f5/;
set pf(p,f) / #p:#f /, mp(m,p) / m1.(p1,p2,p3), m2.(p2,p3,p4), m3.(p3,p4,p5) /;
variable B(m,p,g), A(m,f,g);
equation e(p,m,g);
e(p,m,g)$mp(m,p).. B(m,p,g) =l= sum(pf(p,f), A(m,f,g));

The sum(pf(p,f), …) is not a real sum since pf is a one-to-one mapping, so it just selects the f for the active p.

if we have the condition that is in photo how can we write the k in sum symbol. İs sum(k$M(j,k), x(i,j,k))=e=1; true. M is set of machines, k is indices of machines and j is indices of jobs.