I have implemented a mathematical model in GAMS whose code runs without errors. However, only the binary variables have the correct solution. All the rest are zero, which is not supposed to be. I think the problem is in the code and not in the mathematical formulation, but I can’t figure out what the problem is because given the data I entered I should have values for the positive variables. Does anyone have any idea what the problem could be?

It is hard to give any advice since the information you provided is quite limited.
One thing you could try is to make your model as small as possible, or make a simple toy example. This usually makes it easier to analyse the model’s behaviour.

Hi!
Since I am not very experienced in using GAMS, I can not understand what the problem is. I leave the code attached because maybe someone can help me. The data entered are validation data and not the real data. Untitled_5.gms (21.2 KB)
Thank you very much!

When I have a situation like yours I set the variable levels before the solve to an optimal solution. This can be done for a small problem by hand or by setting some key variables and then code to set the other variables. The latter might require to duplicate some of the equation code. Looking at these calculated values already might give you some idea where things go wrong. If your “optimal” solution you calculated looks good you can now have GAMS generate the model. For this turn the equation list on in full (modelname.limrow=1e9) and check the listing file for this “Equation Listing” section afterwards. If GAMS accepts the “solution” then the equation listing will have no “INFES” (infeasibility) markers for the input point. If it does, and that will the in your case, then your “solution” is not a solution for your model and the INFES marker tells you the exact equation that does not work. You can then work on this, but adjusting your “solution” or adjusting the model equation logic.

You probably won’t receive much concrete/detailed help for your model in this forum because you as the developer are the only one that (with reasonable effort) can debug your model. You know what it is supposed to do, others don’t. So we can only help you with advice how to debug, the debugging itself has to be done by you or you convince someone to invest heavily in your model (logic) which often goes together with some sort of payment.