> of days and hours.
> My problem is to make a predecessor/sucessor relation between those x
> variables. E.g. I have to model the difference between two neighboring
> x variables like:
> delta(d,h) =e= x(d,h) - x(pred(d,h)) ;
> delta(d,g) =l= constant ;
> Are there any ideas how to make this in an easy and elegant way?
In general it is much easier to work with one time index. I.e. use a single index t instead of two indices (d,h). This will make your model much simpler and easier to maintain.
If you want to print in the final reports in terms of (d,h) then use:
d / d1*d10 /
h / h1*h24 /
t / t1 * t240 /
e(t).. delta(t)$(ord(t)>1) =e= x(t) - x(t-1) ;
mapper(d,h,t)$([ord(d)-1]*card(h)+ord(h) = ord(t)) = yes;
x.l(t) = uniform(0,1);
xreport(d,h) = sum(mapper(d,h,t),x.l(t));