Hi, I was running a gms.file for my research and I was douting if the value of TA(1,4) is correct or not (TA(1,4) = 101.000). From my thoughts, the value of TA(1,4) should be equal to CA(1,4,1,1,4), which is 1.000. I was confused by this for multiple days and I did not know how to debug the GAMS program since I was just a beginner user. Could somebody explain why TA(1,4) = 101.000 to me? I would appreciate it. Below is the partial report summary for CA and TA values and the GAMs file is attached to this post. Thank you very much!
DTA_AD_Forum.gms (4.38 KB)
Hi,
It seems that you may have forgotten to add the constraint total_arrival, in which TA occurs, to your model.
I hope this helps!
Fred
Hi Fred,
Thanks for your reply! I have been busy these two days and I will re-run the program on weekends. Yes, that could be the reason.
Also, is there any kind of “debugging” tool in GAMS or is there a sufficient way to address where the problem occurs in the code when the output is not right? Thanks!
Actually, the output was right. Your idea of what the output should be like was wrong. Hard to have this fixed by a debugging tool
When facing a problem as the one described in your initial post, it is often a good idea to have a look at the equation listing and column listing to check whether the generated model corresponds to your intentions
https://www.gams.com/latest/docs/UG_GAMSOutput.html#UG_GAMSOutput_TheEquationListing
https://www.gams.com/latest/docs/UG_GAMSOutput.html#UG_GAMSOutput_TheColumnListing
You probably had a reason to expect TA(1,4) = CA(1,4,1,1,4), e.g. because you defined a corresponding equation.
For you model, a look at the column listing shows at first sight that variable TA(1,4) occurs only in one equation
TA(1,4)
(.LO, .L, .UP, .M = 0, 0, +INF, 0)
(200) SystemEst_def
A look at equation SystemEst_def shows that this obviously does not result in your expectation TA(1,4) = CA(1,4,1,1,4).
I hope this helps!
Fred