簡體   English   中英

CPLEX 無法提取表達式

[英]CPLEX cannot extract the expression

程序-EV充電調度錯誤

描述資源路徑位置類型 CPLEX(默認)無法提取表達式:forall(i in 0..11, j in 0..4) if ( soc[i][j] > 0.7 ) pevch[i][j] ==社會[i][j]*100000; 否則為真。 model.mod /singlebus 36:1-38:33 E:\Haripriya\cplexoutput\singlebus\model.mod OPL 問題標記程序

 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;
 }

解決此錯誤的解決方案

你可能混合了 i 和 j

如果你寫

subject to
{ 
forall(i in t, j in n)
  if(soc[j][i]>0.7)
  pevch[i][j]==soc[j][i]*100000;
 }

那么你的 model 工作正常

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM