I have several questions and comments:
1) xpos(tp,t) and ypos(tp,t) are not declared in your model description. They are only unsed in the equations. Is it not necessary to define them?
2) Basically I have to admit that I do not understand much of your code and I am confused (I spend many hours trying to understand). What are eq1, eq2 and eq3 ensuring? On the left side of eq1 and eq2 your are counting the number of times x(t)=1 until t. But on the right side you are using tp which I don't understand. When xpos(tp,t) =0, eq1 and eq2 ensure that the sum equals ord(tp). Let's say tp=1000 and t is any number (lets say t=1010) and xpos(tp,t)=1, then eq1 and eq2 - according to my understandig - force the sum of x(t)=1 for t in [0,..., 1005] to be 1000. That means that x(t) is almost always 1. But when I have constraints that forbid something like this there will not be a feasible solution.
3) I guess I have to insert equations for every timeslot and every binary variable, meaning that I have to insert - taking your suggestion - at least 4*1440 = 5760 equations manually. This is also not really doable for me. It would take a fairly long time and there will surely be mistakes in several of those equations which I'll not be able to find.

I know that this question is a fairly difficult one. But I at least want to try to solve it. This is why I really appreciate your input (and the inputs of others)

Hi Peter,
I forgot to define the variables because I wrote them fast in the browser without checking them in GAMS.
xpos(tp,t) and ypos(tp,t) are binary variable

For example,
if xpos('1','4')=1 this mean thats the first time of x it happen in the fouth order (tp=1 and t=4)
if xpos('2','10')=1 this mean thats the second time of x it happen in the tenth order (tp=2 and t=10)
.
.
.
if xpos('50','1000')=1 this mean thats the fiftieth time of x it happen in the thousandth order (tp=50 and t=1000)

But, if for the rest of restriction x it happen only 50 time, the rest of the variables xpos take a values of 0
( xpos('51',t)=xpos('52',t)=xpos('53',t)=...=xpos('1440',t)=0 )

I think that the first formulation of the problem is better than the BigM.
In the first approximation you must to type more equation but the final size is lower.
Maybe, if you could found a compact way to express the first formulation the model will result small an easy to implement.

If an upper bound is proposed for the number of time in which x=1 (an upper bound not the exact number of time in which x=1) you can reduce the model size significantly.
For example: maximum number of time in which x=1 --> 50

2) Just a general question: x(t) and y(t) should still be binary decision variables. Ist it possible to addconstraints that only refer to x(t) and y(t) and not to xpos(tp, t) and ypos (tp, t)? For example the one I asked two weeks ago in this forum (https://forum.gamsworld.org/viewtopic.php?f=9&t=10040) and other constraints

Hi,
1) In your first formulation I think you have to insert equations for all timeslots and the number of time in which x is has to be know in
advance. Is that correct?

You have to propose the maximum number of time in which x=1, this is an upper bound. You don't has to know the number of time in which x=1 in advance, just only an upper bound.
So, if this upper bound is equal to 50 you have to insert 50 equation for x and 50 for y.
Later, if x is equal 1 only forty time, xfortyone(t), xfortytwo(t),... and xfifty(t) will be equal zero.

2) Just a general question: x(t) and y(t) should still be binary decision variables. Ist it possible to addconstraints that only refer to x(t) and y(t) and not to xpos(tp, t) and ypos (tp, t)? For example the one I asked two weeks ago in this forum (viewtopic.php?f=9&t=10040) and other constraints

xpos(tp, t) and ypos(tp,t) are auxiliary variable only to identifies the order
Anyway, i suggest to you that use the first approximation

So, if this upper bound is equal to 50 you have to insert 50 equation for x and 50 for y.

I don't really have an upper bound. The only upper bound I have is the number of timeslots,which is 1440. So I have to insert 1440 *2= 2880 equations when using the first approximation? What about the BigM-relaxation? Do I also have to use thousands of equations there?

Hi Peter,
no, for bigM reformultation you don't have to use thousands of equations. The model that I showed was complete, but when is expanded is very bigger.
As i say previously, if you could found a compact way to express the first formulation of the problem the model will result more small and easy to implement.

Two question regarding this:
1) Does the first approximation generate a smaller model which does not need to much memory? Or do you know any other way how to reduce the required memory size?

2) Is there a way to roughly estimate how much memory this BigM formulation of my model needs? Because I could use other computers which have more than 8GB memory. But I should only use them if I know that it will be useful