problem with no superbasic variables(simple model)

Problems with modeling
Post Reply
piglet
User
User
Posts: 4
Joined: 5 years ago

problem with no superbasic variables(simple model)

Post by piglet »

Dear all,
I establish a model recently. The code runs successfully but the solution is infeasible. GAMS shows that there are no superbasic variables. This is a quite simple model but I don't know what the problems is after checking for several time. Could anyone help me?
Thanks for your prompt attention.

Set
i 'nodenumber' /1,11*13/;

Parameter
Sl(i) 'load capacity'
/1 900
11 300
12 200
13 400/
uav /0.5/

Positive Variable
Sd(i) 'compensate compacity'
u(i) 'node voltage'
ud(i) 'compensate voltage'
Variable
z 'total cost';
Binary Variable sigma(i)'install or not';

u.UP(i)=1.05;
u.LO('1')=0.3;
u.LO('11')=0.3;
u.LO('12')=0.8;
u.LO('13')=0.71;

Equation
v1
v2
v3
v4
v5
compacity(i);
v1..u('1')=e=uav+sigma('1')*ud('1');
v2..u('11')=e=u('1')+sigma('11')*ud('11');
v3..u('12')=e=u('1')+sigma('12')*ud('12');
v4..u('13')=e=u('1')+sigma('13')*ud('13');
compacity(i)..Sd(i)=e=sigma(i)*ud(i)*Sl(i)/u(i);
v5..z=e=sum(i,Sd(i));
Model beiqi/all/;
solve beiqi using rminlp minimizing z;
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: problem with no superbasic variables(simple model)

Post by bussieck »

You probably solved the non-convex model with a local solver (CONOPT) that gets stuck. The model is small enough to ask a global solver if the model is truly infeasible or if you need to pay more attention in setting a good starting point for your local solver. It turns out the latter is true. I solved with global solver Couenne and got the following solution (just solve summary and variable section):

Code: Select all

               S O L V E      S U M M A R Y

     MODEL   beiqi               OBJECTIVE  z
     TYPE    RMINLP              DIRECTION  MINIMIZE
     SOLVER  COUENNE             FROM LINE  40

**** SOLVER STATUS     1 Normal Completion         
**** MODEL STATUS      1 Optimal                   
**** OBJECTIVE VALUE              193.3099

 RESOURCE USAGE, LIMIT          0.546      1000.000
 ITERATION COUNT, LIMIT         0    2000000000
 EVALUATION ERRORS              0             0

...

---- VAR Sd  compensate compacity

          LOWER          LEVEL          UPPER

1           .              .            +INF         
11          .              .            +INF         
12          .            75.0000        +INF         
13          .           118.3099        +INF         

---- VAR u  node voltage

          LOWER          LEVEL          UPPER

1          0.3000         0.5000         1.0500      
11         0.3000         0.5000         1.0500      
12         0.8000         0.8000         1.0500      
13         0.7100         0.7100         1.0500      

---- VAR ud  compensate voltage

          LOWER          LEVEL          UPPER

1           .         81129.3556        +INF         
11          .         61375.9878        +INF         
12          .           173.1841        +INF         
13          .           145.2858        +INF         

                           LOWER          LEVEL          UPPER

---- VAR z                 -INF          193.3099        +INF         

  z  total cost

---- VAR sigma  install or not

          LOWER          LEVEL          UPPER

1           .              .             1.0000      
11          .              .             1.0000      
12          .             0.0017         1.0000      
13          .             0.0014         1.0000      
-Michael
piglet
User
User
Posts: 4
Joined: 5 years ago

Re: problem with no superbasic variables(simple model)

Post by piglet »

bussieck wrote: 5 years ago You probably solved the non-convex model with a local solver (CONOPT) that gets stuck. The model is small enough to ask a global solver if the model is truly infeasible or if you need to pay more attention in setting a good starting point for your local solver. It turns out the latter is true. I solved with global solver Couenne and got the following solution (just solve summary and variable section):

Code: Select all

               S O L V E      S U M M A R Y

     MODEL   beiqi               OBJECTIVE  z
     TYPE    RMINLP              DIRECTION  MINIMIZE
     SOLVER  COUENNE             FROM LINE  40

**** SOLVER STATUS     1 Normal Completion         
**** MODEL STATUS      1 Optimal                   
**** OBJECTIVE VALUE              193.3099

 RESOURCE USAGE, LIMIT          0.546      1000.000
 ITERATION COUNT, LIMIT         0    2000000000
 EVALUATION ERRORS              0             0

...

---- VAR Sd  compensate compacity

          LOWER          LEVEL          UPPER

1           .              .            +INF         
11          .              .            +INF         
12          .            75.0000        +INF         
13          .           118.3099        +INF         

---- VAR u  node voltage

          LOWER          LEVEL          UPPER

1          0.3000         0.5000         1.0500      
11         0.3000         0.5000         1.0500      
12         0.8000         0.8000         1.0500      
13         0.7100         0.7100         1.0500      

---- VAR ud  compensate voltage

          LOWER          LEVEL          UPPER

1           .         81129.3556        +INF         
11          .         61375.9878        +INF         
12          .           173.1841        +INF         
13          .           145.2858        +INF         

                           LOWER          LEVEL          UPPER

---- VAR z                 -INF          193.3099        +INF         

  z  total cost

---- VAR sigma  install or not

          LOWER          LEVEL          UPPER

1           .              .             1.0000      
11          .              .             1.0000      
12          .             0.0017         1.0000      
13          .             0.0014         1.0000      
-Michael
Thanks for your prompt reply. At the beginning of the model, the sigma(i) is defined as a binary variable. However, sigma(12)、sigma(13) turn out to be 0.0017 and 0.0014 in the solution.
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: problem with no superbasic variables(simple model)

Post by bussieck »

Your solve statement solves the model as an RMINLP (see https://www.gams.com/latest/docs/UG_Mod ... odel_types). This relaxes the integral requirement. If you solve as MINLP you get:

Code: Select all

               S O L V E      S U M M A R Y

     MODEL   beiqi               OBJECTIVE  z
     TYPE    MINLP               DIRECTION  MINIMIZE
     SOLVER  COUENNE             FROM LINE  40

**** SOLVER STATUS     1 Normal Completion         
**** MODEL STATUS      1 Optimal                   
**** OBJECTIVE VALUE              193.3099
...
---- VAR sigma  install or not

          LOWER          LEVEL          UPPER

1           .              .             1.0000      
11          .              .             1.0000      
12          .             1.0000         1.0000      
13          .             1.0000         1.0000      
-Michael
Post Reply