my name is Leonardo from Italy. I'm a gams beginner. Reading the online doucmentation I have came up with this model I would like to employ to optimize the production planning process of my company. I'm attaching here a sample of the model (data has been taken randomly):

Here are my questions:
1) Sometimes the program reports "Integer Infeasible". Is that because the model is wrongly written or just because a solution really doesn't exist?
2)Is there any way to add a constraint for the minum dimension of batch assigned to each supplier? For example, in the case of new products I would like to set k(pp,forn)*y(pp,forn) =g= 5, but I guess the program doesn't accept that because I can't maximize a variable in function of another dependent variable.

if the solver reports "integer infeasible" then there is no feasible solution for the data you have provided. However, the model being infeasible does not mean the problem you want to solve is infeasible. You might have just modelled the reality too restrictive.
One way to avoid having the solver report "integer infeasible" is by adding non-negative slack variables to your equations and punishing them from taking nonzero values by subtracting them with some reasonably large factor from your objective function. This way you get a better understanding why your problem is infeasible and there might be compromises in the real world that are not reflected in your model but you could apply to make the problem you want to solve feasible.

Regarding your second question: Your model is of type MIP, which forces it to be a linear model. Thus, you can not multiply endogenous variables. However, you can use your binary variables and write the equations like this: y(pp,forn) =g= k(pp,forn) *5

if the solver reports "integer infeasible" then there is no feasible solution for the data you have provided. However, the model being infeasible does not mean the problem you want to solve is infeasible. You might have just modelled the reality too restrictive.
One way to avoid having the solver report "integer infeasible" is by adding non-negative slack variables to your equations and punishing them from taking nonzero values by subtracting them with some reasonably large factor from your objective function. This way you get a better understanding why your problem is infeasible and there might be compromises in the real world that are not reflected in your model but you could apply to make the problem you want to solve feasible.

Regarding your second question: Your model is of type MIP, which forces it to be a linear model. Thus, you can not multiply endogenous variables. However, you can use your binary variables and write the equations like this: y(pp,forn) =g= k(pp,forn) *5

Hope this helps,
Freddy

Hello Freddy,

thank you very much for your answer. You definitely solved my second question, I would have never thought about using the dummy variable in such that clever way!

About the first question: I think I didn't get exactly your point. I understood it is kind of debugging process, but I didn't get how it would work. How would I practically add that "non-negative slack variables"? Could you please provide me with a short example?

. This way, your model becomes less restrictive (i.e. the original equation can now be violated by the slack variable taking on non-negative values). However, this violation is punished in your objective function. Of course you need to be careful with this technique as it adds extra variables to your problem and thus makes it more complex.
The point I wanted to make is that you are always modelling a subset of the reality. Thus, even though your model is infeasible, there might be a solution in reality that is not reflected in your model.