My program in GAMS is working, but some results are not what I was expecting. I need to check some of my equations line by line, to see what value each variable has in every iteration. So I need a report in excel, which I know will be done with the put command. What I want to see for example is this :
Thank you very much! It works that way, however it’s not very easy to read, since all the values of K are printed first, then sumK, Pline etc… Thus can’t check each equation. Ideally what I want to see is :
Thank you again. It’s getting better and better every time
How come it works correctly since you used only the f argument inside the loop? Also how can you put labels for the sets as well?
Hi
I only use the f loop because you use K(i,t) in an equation with the additional index f. i and t are on both sides of the assignment but f is missing on the right:
loop(f,
eq_net9("K", i,f,t) = K.L(i,t);
);
If K was also defined over f, you don’t have to use a loop to assign values and this would do the job:
eq_net9("K", i,f,t) = K.L(i,f,t);
You can’t easily export the labels, however, you can define your sets more explicitly. For example:
i /Sector1*Sector12/, j /Iter1*Iter24/
instead of
i /1*12/, j /1*24/
.
You will than have “Sector1” , “Iter1”, etc. instead of 1, 1 in your excel table.