-1

Description Resource Path Location Type Name "tavail" does not exist. soclevel.mod /socvariation 12:10-16 E:/Haripriya/cplexoutput/socvariation/soclevel.mod OPL Outline Problem Marker

int t=24;
int n=20;
range t=1..tavail;
range number =1..n;
float soc[1][number]=[0.6,0.3,0.2,0.7,0.8,0.9,0.3,0.6,0.5,0.9,0.5];
//forcasted load at 0..4
float pl[tavail]=[10000000,7000000,9000000,6000000,12000000,6000000,4000000,15000000,9000000,12000000,6000000,8000000,10000000,7000000,9000000,6000000,12000000,6000000,4000000,15000000,9000000,12000000,6000000,8000000];
//target load at 0..11
float pt[tavail]=[10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000];
//bus voltage at 0..11
float v[tavail]=[240,232,229,233,230,235,228,234,227,229,231,230,226,232,233,230,236,233,231,232,232,233,233,230];
//bus voltage at 
target bus voltage at 0..11
float vt[tavail]=[230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230];

//decision variable charging power ev
dvar float pevch[tavail][number] in 0..100000;
//decision variable discharging power of ev
dvar float pevdis[tavail][number] in 0..100000;
dvar float soc[tavail][number] in 0..100000;
//objective function
minimize sum(i in tavail)((pt[i]-pl[i])+sum(j in number)-pevch[i][j]+sum(j in number)pevdis[i][j]);
subject to

 forall(i in tavail,j in number)
 if(pt[i]-pl[i]<0 && 0.7<soc[j][i]<0.9&& v[i]<vt[i])
pevdis[i][j]==soc[j][i]*100000;
 soc[j][i+1]==0.8*soc[j][i];}
 else
 {pevdis[i][j]==0 ;
 soc[j][i+1]==soc[j][i];}



 forall(i in tavail,j in number)
 if(pt[i]-pl[i]>0 && 0.3<= soc[j][i]<=0.7 && v[i]>vt[i])
 {pevch[i][j]==soc[j][i]*800000;
 soc[j][i+1]==1.1*soc[j][i];}
 else
 {pevch[i][j]==0;

 soc[i][j]==soc[i][j];}
 }

1 Answers1

0

Many errors in your model.

The following works better and can help you:

//int t=24;
int n=20;
int tavail=24;
range t=1..tavail;
range number =1..n;
float soc[t][number]=[[0.6,0.3,0.2,0.7,0.8,0.9,0.3,0.6,0.5,0.9,0.5]];
//forcasted load at 0..4
float pl[t]=[10000000,7000000,9000000,6000000,12000000,6000000,4000000,15000000,9000000,12000000,6000000,8000000,10000000,7000000,9000000,6000000,12000000,6000000,4000000,15000000,9000000,12000000,6000000,8000000];
//target load at 0..11
float pt[t]=[10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000];
//bus voltage at 0..11
float v[t]=[240,232,229,233,230,235,228,234,227,229,231,230,226,232,233,230,236,233,231,232,232,233,233,230];
//bus voltage at target bus voltage at 0..11
float vt[t]=[230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230];

//decision variable charging power ev
dvar float pevch[t][number] in 0..100000;
//decision variable discharging power of ev
dvar float pevdis[t][number] in 0..100000;
//dvar float soc[t][number] in 0..100000;
//objective function
minimize sum(i in t)((pt[i]-pl[i])+sum(j in number)-pevch[i][j]+sum(j in number)pevdis[i][j]);
subject to
{
 forall(i in t,j in number:i!=tavail)
 if(pt[i]-pl[i]<0 && 0.7<soc[i][j]<0.9&& v[i]<vt[i])
{pevdis[i][j]==soc[i][j]*100000;
 soc[i+1][j]==0.8*soc[i][j];}
 else
 {pevdis[i][j]==0 ;
 soc[i+1][j]==soc[i][j];}



 forall(i in t,j in number:i!=tavail)
 if(pt[i]-pl[i]>0 && 0.3<= soc[i][j]<=0.7 && v[i]>vt[i])
 {pevch[i][j]==soc[i][j]*800000;
 soc[i+1][j]==1.1*soc[i][j];}
 else
 {pevch[i][j]==0;

 soc[i][j]==soc[i][j];}
 }

An array is indexed by a range not by a number in OPL.

Alex Fleischer
  • 9,276
  • 2
  • 12
  • 15
  • Description Resource Path Location Type Exception from IBM ILOG CPLEX: CPLEX Error 1016: Community Edition. Problem size limits exceeded. Purchase at http://ibm.biz/error1016.->. socvariation Unknown OPL Problem Marker showing like this – Haripriya M R Nov 18 '22 at 11:37
  • At some point you could either buy CPLEX or go on with using free CPLEX https://www.linkedin.com/pulse/what-free-ibm-cplex-alex-fleischer/ – Alex Fleischer Nov 18 '22 at 12:57