Hi
For ct23, if you want do use a subset of period that starts today and if today is an int then you could write
c23=forall(t in period, i in customer:t>=today) DCsum[i][t]==sum(t in period:t>=today) dem[i][t];
the following code works fine (I replaced ... by random data)
int N=2;
//number of customers
int T=10;
//number of periods
int K=2;
//number of vehicle
int C=2;
//production capacity
int Q=2;
//capacity of each vehicle
int f=2;
//setup cost at production facility
int V=2;
//variable mileage cost
int hP=2;
//holding cost at the production facility
int inventPmax=2;
//maximum inventory at production facility
int inv0=2;
//initial inventory=0
//indices range demands=0..N;
//including 0 for depot range customer=0..N;
//customers only range period=1..T; range period0=0..T; range period1=0..T-1; range period2=1..T-1;
//variable with indices
int dem[c in customer][p in period0]=c+p;
//demand of customer i on day t
int inventCmax[c in customer]=c;
//maximum inventory of customer i
float dist[d in demands][d2 in demands]=d*d2;
//distance ij
int hC[c in customer]=c;
//unit holding cost at customer i
int Dmax[period0];
int DCmax[customer][period0];
int DCsum[customer][period0];
int Dsum[customer][period0];
//variables for writing program
int k1;
//demand at day 0
int kk;
int kz;
float Z1;
float Z2;
float Z3;
float inventC0;
float inventP0;
float inventcost;
float f0;
float Z;
//decision variables dvar
int x[customer][customer][period0];
// {0,1} dvar
int y[customer][period0];
//load on a vehicle immediately before making a delivery to customer i on day t dvar
int P[period0];
//production quantity on day t dvar
int zp[period0];
// {0,1} for production dvar
int inventP[period0];
//inventory at the production facility at the end of day t dvar
int inventC[customer][period0];
//inventory at customer i at the end of day t dvar
int w[customer][period0];
//amount delivered to customer i on day t constraint c1; constraint c2; constraint c3; constraint c4; constraint c5; constraint c6; constraint c7; constraint c8; constraint c9; constraint c10; constraint c11; constraint c12; constraint c13; constraint c14; constraint c15; constraint c16; constraint c17; constraint c18; constraint c19; constraint c20; constraint c21; constraint c22; constraint c23; constraint c24; constraint c25; constraint c26; constraint c27; constraint c28;
//objective function minimize sum(t in period, i in demands, j in demands) (dist[i][j]*x[i][j][t]) + sum(t in period) (f*zp[t]) + sum(t in period1) (hP*inventP[t]) + sum(i in customer, t in period2) (hC[i]*inventC[i][t]) ;
//constraints subject to
{
//non negativity constraints c1=forall(t in period2) inventP[t]>=0; c2=forall(t in period2) inventP[t]<=inventPmax; c3=forall(i in customer, t in period2) inventC[i][t]>=0; c4=forall(i in customer, t in period2) inventC[i][t]<=inventCmax[i]; c5=forall(t in period) inventP[T]==0; c6=forall(i in customer, t in period) inventC[i][T]==0; c7=forall(i in demands, j in demands, t in period) x[i][j][t]>=0; c8=forall(i in demands, j in demands, t in period) x[i][j][t]<=1; c9=forall(t in period) zp[t]>=0; c10=forall(t in period) zp[t]<=1; c11=forall(i in demands,t in period) y[i][t]>=0; c12=forall(i in demands, t in period) y[i][t] <=Q; c13=forall(t in period) P[t]>=0; c14=forall(i in demands, t in period) w[i][t]>=0; c15=forall(t in period) inventP[t]==inventP[t-1]+P[t]-sum(i in customer, t in period0)w[i][t]; c16=forall(i in customer, t in period) inventC[i][t]==inventC[i][t-1]+w[i][t]-dem[i][t]; c17=forall(t in period) sum(i in customer) w[i][t]<=inventP[t-1]; c18=forall(t in period1) P[t]<=(C*zp[t]); c19=forall(t in period0) P[0]>=sum(i in customer) (dem[i][1]-inventC[i][0]); c20=forall(i in customer, t in period) sum(j in demands) x[i][j][t]<=1; c21=forall(j in customer, t in period) sum(i in demands) x[i][j][t]==sum(i in demands) x[j][i][t]; c22=forall(t in period) sum(j in customer) x[0][j][t]<=K; c23=forall(t in period, i in customer) DCsum[i][t]==sum(t in period) dem[i][t]; c24=forall(i in customer, t in period) DCmax[i][t]==minl(Q,DCsum[i][t]); c25=forall(t in period,i in customer) Dsum[i][t]== sum(i in customer, t in period) dem[i][t]; c26=forall(t in period,i in customer) Dmax[t]== minl(Q, Dsum[i][t]); c27=forall(i in customer, j in demands, t in period) y[j][t]<=y[i][t]-w[i][t]+((Dmax[t])*(1-x[i][j][t])); c28=forall(i in customer, t in period) w[i][t]<=DCmax[i][t]*sum(j in demands) x[i][j][t] ;
}
//end of constraints
Besides are you sure that you want DCsum and DCmax to be data and not decision variables?
You could still improve your model.
Regards
#DecisionOptimization#OPLusingCPLEXOptimizer