As a student on dissertation stage, I am working on a model for cost minimization in train shunting.
As a brief clarification of model; there are arriving train units, departing train units and shunting lines on which are used for coupling and decoupling of train units. Mathematical model was first described by Schrijver.
Could you please help me to figure out this error? Thanks in advance. MinShuntingCost_MathematicalModel.pdf (219 KB) MinShuntingCost.gms (2.17 KB)

If you want to use GAMS at a dissertation level, you need to invest more in learning the tool. Your errors are of very fundamental nature:

You need to make some sets subsets of i adn j:

itoj(i) 'arriving train units to be assigned to departing train units'/i7,i17,i27/
jtoi(j) 'departing train units to be matched with arriving train units'/j2,j12,j22/

The construct ord(j)-‘1’ makes no sense in GAMS. But you pdf does not help much either. The J_i and the I_j seem critical in your description. It’s a nice set notation. In GAMS you often do this as maps Ji(j,i). Perhaps this is what you tried with the itoj and jtoi.

If you give a proper reference to Lex paper or provide the pdf of the relevant part of the paper there is a chance that someone here can help. I only found https://homepages.cwi.nl/~lex/files/PlanningOfShuntTracks.pdf but can find little overlap with your pdf.

Thanks for your prompt response.
As you mentioned, I have a lot to learn in GAMS. I am quite beginner.
For your first comment, it worked properly, thanks for your help.
And for second one, your understanding about subsets is correct. With ord(j)-‘1’ expression, I am trying to check the previous train unit in subsets in order to avoid any crossing. I provide a little bit clarification about crossing in train shunting as in attached file.

There are big differences in the algebra in your write-up and the GAMS model, e.g. equation 6. I think I understand what the math does, but your equation does not implement the math and you try to make some arguments why the GAMS algebra also prevents crossing (true or not) but it does not implement the math! Your write-up is also missing the definition of some symbols (e.g. \tau_i, I guess this is the time the trains leaves or arrives) and is sloppy with symbol names (e.g. WL as train length in the text, but the algebra has l_i). I suggest that you do a proper mathematical write-up of the problem have a tables with the data in word and then try to implement exactly this math in GAMS. If you run into trouble with that I am sure you will find some help here.