program-EV Charge Scheduling error
Description Resource Path Location Type CPLEX(default) cannot extract expression: forall(i in 0..11, j in 0..4) if ( soc[i][j] > 0.7 ) pevch[i][j] == soc[i][j]*100000; else true. model.mod /singlebus 36:1-38:33 E:\Haripriya\cplexoutput\singlebus\model.mod OPL Problem Marker Program
range t=0..11;
range n=0..4;
int j=0;
//forcasted load at 0..4
float pl[t]=[10000000,7000000,9000000,6000000,12000000,6000000,4000000,15000000,9000000,12000000,6000000,8000000];
//soc of ev at 0..11
float soc[n][t] = [[0.2,0.1,0.9,0.7,0.6,0.9,0.2,0.6,0.8,0.75,0.85,0.95],
[0.2,0.1,0.9,0.7,0.6,0.9,0.2,0.6,0.8,0.75,0.85,0.95],
[0.2,0.1,0.9,0.7,0.6,0.9,0.2,0.6,0.8,0.75,0.85,0.95],
[0.2,0.1,0.9,0.7,0.6,0.9,0.2,0.6,0.8,0.75,0.85,0.95],
[0.2,0.1,0.9,0.7,0.6,0.9,0.2,0.6,0.8,0.75,0.85,0.95]];
//generation
float pg[t]=[10000000,9500000,8500000,11000000,600000,7500000,10000000,9500000,8500000,11000000,600000,7500000];
//target load at 0..11
float pt[t]=[10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000,10000000];
//bus voltage at 0..11
float v[t]=[5,4,3,2,1,5,4,3,2,1,5,4];
//bus voltage at
// target bus voltage at 0..11
float vt[t]=[4,4,4,4,4,4,4,4,4,4,4,4];
//decision variable charging power ev
dvar float pevch[t][n];
//decision variable discharging power of ev
dvar float pevdis[t][n];
//objective function
minimize sum(i in t)((pt[i]-pl[i])+sum(j in n)-pevch[i][j]+sum(j in n)pevdis[i][j]);
subject to
{
forall(i in t, j in n)
if(soc[i][j]>0.7)
pevch[i][j]==soc[i][j]*100000;
}
Solution to tackle this error