Page 1 of 1

### cplex error 1217 :no solution exists.

Posted: Mon Aug 12, 2019 5:37 am
It's my code. but no answer there. they said problem is integer infeasible. but i cant understand what to do.
maybe lim7, lim8 has problem i think

Code: Select all

``````sets
i 'wind turbine' / T1*T4/
j 'region' / R1*R6 /
lr 'land region' /R1*R5/
sr 'shore region' /R6/;

parameters
NOC(i) 'operating cost of onshore wind turbine i'
/ T1 21000
T2 43000
T3 86000
T4 98000 / ;
parameters
FOC(i) 'operating cost of offshore wind turbine i'
/ T1 70000
T2 145000
T3 282000
T4 295000 / ;
parameters
NIC(i) 'capital cost of onshore wind turbine i'
/ T1 797000
T2 1633000
T3 3479000
T4 4186000 / ;
parameters
FIC(i) 'capital cost of offshore wind turbine i'
/ T1 2004000
T2 4208000
T3 8110000
T4 9273000 / ;
parameters
WE(i) 'rate power of wind turbine i'
/ T1 600
T2 1300
T3 11000
T4 9000 / ;
parameters
ED(j) 'demand of region j'
/ R1 49578
R2 52968
R3 86112
R4 175398
R5 108282
R6 0      / ;
parameters
GA(j) 'available land of region j'
/ R1 25420000
R2 53900000
R3 93040000
R4 99630000
R5 111750000
R6 0 / ;
parameters
D(i) 'diameter of wind turbine i'
/T1 43
T2 60
T3 90
T4 100 / ;

PARAMETERS NE(i,j)
\$call GDXXRW ffe.XLSX  PAR=NE RNG fe!A1 RDIM=1 CDIM=1
\$GDXIN ffe.GDX
\$GDXIN

parameters FE(i,j)
\$call GDXXRW Fe.xlsx par=Fe rng Fe!A1 rdim=1 cdim=1
\$GDXIN Fe.GDX
\$GDXIN

scalar
CCF 'capital charge factor' / 0.154699 / ;
scalar
DB 'distance factor' / 0.013 / ;
scalar
LL 'land limitation regulatory' / 0.10 / ;

variables TCC
positive variables TIC, TOC, ICC, TNE(i,j), TFE(i,j)
integer variables NW(i,j), FW(i,j)
binary variables
Y(i,j) 'if wind turbine i is installed in R1*R5 = 1  and 0 otherwise'
X(i,j) 'if wind turbine i is installed in R6 = 1 and 0 otherwise' ;

Equations
objequ, cons1, cons2, cons3
lim1, lim2, lim3, lim4, lim5, lim6, lim7, lim8
aa1, aa2, aa3, aa4 ;

objequ.. TCC =E= TIC+TOC ;

cons1.. ICC =E= sum((i,j),NW(i,j)*NIC(i))+sum((i,j),FW(i,j)*FIC(i)) ;
cons2.. TIC =E= CCF*ICC ;
cons3.. TOC =E= sum((i,j),NW(i,j)*NOC(i))+sum((i,j),FW(i,j)*FOC(i)) ;

lim1(i,j)..TNE(i,j) =e= NW(i,j)*NE(i,j) ;
lim2(i,j)..TFE(i,j) =e= FW(i,j)*FE(i,j) ;
lim3.. sum((i,j),TNE(i,j))+sum((i,j),TFE(i,j))=g= sum(j,ED(j)) ;
lim4(j).. sum(i,NW(i,j)*7*D(i)*4*D(i)*(1+DB)) =l= LL*GA(j) ;

lim5(j)..sum(i,Y(i,j))*0.999999999999 =l= 1 ;
lim6(j)..sum(i,X(i,j))*0.999999999999 =l= 1 ;

lim7(i,j)..NE(i,j) =l= WE(i)*Y(i,j) ;
lim8(i,j)..FE(i,j) =l= WE(i)*X(i,j) ;

aa1(i,j)..Y(i,j) =l= NW(i,j) ;
aa2(i,j)..X(i,j) =l= FW(i,j) ;
aa3(i,j)..NW(i,j)-Y(i,j)=n=1 ;
aa4(i,j)..FW(i,j)-X(i,j)=n=1 ;

model practice / all / ;

solve practice using mip min TCC ;

display TCC.l;``````

### Re: cplex error 1217 :no solution exists.

Posted: Tue Aug 13, 2019 1:11 pm
Hi,

Your model is (integer) infeasible. So there is no feasible point to all the constraints and integrality requirements you have specified. You either made a mistake implementing some constraint, or the combination of model and data really allows for no feasible solution. This state of the optimization model is in general not a bug or problem. It is one of the possible theoretic outcomes of an optimization run: optimal/infeasible/unbounded.

The real work is to figure out where the infeasibility comes from. There is no single way of doing this. It very much depends on your knowledge and understanding of the original problem and it's implementation as a model. Often, agood way to go about analyzing infeasibilities is to provide a solution to the problem you expect to be feasible by manually setting the variable level values (x.l(i,j) = ...) and then generating the model with a full equation listing (https://www.gams.com/latest/docs/UG_GAM ... ionListing) (option limrow=1e9;) This will flag the constraints that are infeasible with your "feasible" solution. Apparently, that might not be possible if you have a large and complex model.

If you don't want to work with your own feasible solution, you can ask Cplex to provide you with the smallest set of constraints that are infeasible (you need to change the model type to rmip) via the iis option (see https://www.gams.com/latest/docs/S_CPLEX.html#CPLEXiis). You can also ask Cplex you give you the smallest relaxation of your model to make it feasible (look for option FeasOpt: https://www.gams.com/latest/docs/S_CPLE ... LEXfeasopt ).

Btw. The issue cannot be reproduced by other forum users because you did not provide the xlsx input files.

I hope this helps!

Fred