[AMPL 15222] Sensitivity Analysis

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[AMPL 15222] Sensitivity Analysis

Ratna S
I am trying to do sensitivity analysis of the MILP attached. I followed the instructions in this video https://vimeo.com/140224142
Please tell me what I am doing wrong.

Here is what I am getting:

ampl: option presolve 0;
ampl: option cplex_options 'presolve 0 sensitivity';
ampl: model OperationalFL.run;

Presolve eliminates 0 constraints and 1188 variables.
Adjusted problem:
43181 variables:
1035 binary variables
345 integer variables
41801 linear variables
42499 constraints, all linear; 215976 nonzeros
6673 equality constraints
35826 inequality constraints
1 linear objective; 20890 nonzeros.

CPLEX 12.7.0.0: timing=1
timelimit=3600
mipdisplay=2
lpdisplay=1
mipgap=.005
MIP Presolve eliminated 38278 rows and 33329 columns.
MIP Presolve modified 595 coefficients.
Reduced MIP has 2501 rows, 8132 columns, and 28997 nonzeros.
Reduced MIP has 0 binaries, 134 generals, 0 SOSs, and 0 indicators.
Reduced MIP has 2501 rows, 8132 columns, and 28997 nonzeros.
Reduced MIP has 0 binaries, 134 generals, 0 SOSs, and 0 indicators.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: deterministic, using up to 4 threads.
Root relaxation solution time = 0.56 sec. (126.00 ticks)

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                     -4.15099e+007  2.48426e+008           698.47%
      0     0  -487793.3881    59 -4.15099e+007  -487793.3881     4780   98.82%
*     0+    0                      -519950.7937  -487793.3881             6.18%
      0     0  -489716.5666    54  -519950.7937     Cuts: 126     4880    5.81%
      0     0  -489905.9992    52  -519950.7937      Cuts: 43     4913    5.78%
*     0+    0                      -493154.7878  -489905.9992             0.66%
      0     0  -489907.5943    52  -493154.7878    MIRcuts: 2     4919    0.66%
      0     0  -489907.6812    52  -493154.7878    MIRcuts: 6     4921    0.66%
      0     2  -489907.6812    52  -493154.7878  -490254.5734     4921    0.59%
Elapsed time = 3.61 sec. (976.04 ticks, tree = 0.01 MB)
    176   146  -491973.8983    28  -493154.7878  -490254.5734     7525    0.59%
    340   254  -491884.1090    27  -493154.7878  -490254.5734    10120    0.59%
    400   275  -491407.8291    34  -493154.7878  -490254.5734    10326    0.59%
    576   427  -490815.6776    38  -493154.7878  -490254.5734    13152    0.59%
    907   696  -490650.3744    39  -493154.7878  -490254.5734    17314    0.59%
   1280   945  -490534.4355    46  -493154.7878  -490254.5734    21705    0.59%
   1317  1115  -490422.1013    48  -493154.7878  -490425.0380    28740    0.55%
   1337  1125  -491979.6159    33  -493154.7878  -490427.3616    29103    0.55%
   1356    51  -490829.5329    41  -493154.7878  -490427.3616    29364    0.55%

Mixed integer rounding cuts applied:  44
Lift and project cuts applied:  59
Gomory fractional cuts applied:  9

Root node processing (before b&c):
  Real time             =    3.61 sec. (974.32 ticks)
Parallel b&c, 4 threads:
  Real time             =    8.31 sec. (4756.69 ticks)
  Sync time (average)   =    0.51 sec.
  Wait time (average)   =    0.01 sec.
                          ------------
Total (root+branch&cut) =   11.92 sec. (5731.00 ticks)

Times (seconds):
Input =  0.15625
Solve =  41.3125
Output = 0
CPLEX 12.7.0.0: optimal integer solution within mipgap or absmipgap; objective -493154.7878
30380 MIP simplex iterations
1397 branch-and-bound nodes
absmipgap = 2464.36, relmipgap = 0.00499714
No basis.

[....]

Presolve eliminates 0 constraints and 1200 variables.
Adjusted problem:
43181 variables:
1035 binary variables
345 integer variables
41801 linear variables
42499 constraints, all linear; 215976 nonzeros
6673 equality constraints
35826 inequality constraints
1 linear objective; 20890 nonzeros.

[....]

ampl: display _varname, _var, _var.rc, _var.current, _var.up, _var.down;

Bad suffix .current for _var
context:  display _varname, _var, _var.rc,  >>> _var.current, <<<  _var.up, _var.down;
Possible suffix values for _var.suffix:
astatus   defeqn   derstage   dual
init      init0    int        lb
lb0       lb1      lb2        lrc
lslack    no       rc         relax
slack     sno      sstatus    stage
status    ub       ub0        ub1
ub2       urc      uslack     val

Bad suffix .up for _var
context:  display _varname, _var, _var.rc, _var.current,  >>> _var.up, <<<  _var.down;
Possible suffix values for _var.suffix:
astatus   defeqn   derstage   dual
init      init0    int        lb
lb0       lb1      lb2        lrc
lslack    no       rc         relax
slack     sno      sstatus    stage
status    ub       ub0        ub1
ub2       urc      uslack     val

Bad suffix .down for _var
context:  display _varname, _var, _var.rc, _var.current, _var.up,  >>> _var.down; <<< 
Possible suffix values for _var.suffix:
astatus   defeqn   derstage   dual
init      init0    int        lb
lb0       lb1      lb2        lrc
lslack    no       rc         relax
slack     sno      sstatus    stage
status    ub       ub0        ub1
ub2       urc      uslack     val
ampl: display _conname, _con.body, _con.slack, _con.dual, _con.current, _con.up, _con.down;

Bad suffix .current for _con
context:  display _conname, _con.body, _con.slack, _con.dual,  >>> _con.current, <<<  _con.up, _con.down;
Possible suffix values for _con.suffix:
astatus   body      defvar   derstage
dinit     dinit0    dual     lb
lbs       lbs1      lbs2     ldual
lslack    no        relax    slack
sno       sstatus   stage    status
ub        ubs       ubs1     ubs2
udual     uslack 

Bad suffix .up for _con
context:  display _conname, _con.body, _con.slack, _con.dual, _con.current,  >>> _con.up, <<<  _con.down;
Possible suffix values for _con.suffix:
astatus   body      defvar   derstage
dinit     dinit0    dual     lb
lbs       lbs1      lbs2     ldual
lslack    no        relax    slack
sno       sstatus   stage    status
ub        ubs       ubs1     ubs2
udual     uslack 

Bad suffix .down for _con
context:  display _conname, _con.body, _con.slack, _con.dual, _con.current, _con.up,  >>> _con.down; <<< 
Possible suffix values for _con.suffix:
astatus   body      defvar   derstage
dinit     dinit0    dual     lb
lbs       lbs1      lbs2     ldual
lslack    no        relax    slack
sno       sstatus   stage    status
ub        ubs       ubs1     ubs2
udual     uslack 


 

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.

OperationalFL.run (5K) Download Attachment
OperfinFL.mod (19K) Download Attachment
Tomatopostday.xls (7M) Download Attachment
test.dsn (99 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: [AMPL 15237] Sensitivity Analysis

Robert Fourer-2
Add 'mipbasis 1' to your cplex_options string.  (For the current version of CPLEX this is the default, but earlier versions defaulted to 'mipbasis 0'.)

Be aware however that you will only get a sensitivity analysis of the linear program that results after all of the binary & integer variables have been fixed at their optimal values.  If you want to know how a change to some objective coefficient or right-hand side constant affects the solution to the overall mixed-integer problem, you will need to make the change yourself and then re-solve.

Bob Fourer
[hidden email]

=======
       
From: [hidden email] [mailto:[hidden email]] On Behalf Of Ratna S
Sent: Monday, November 27, 2017 1:50 AM
To: AMPL Modeling Language
Subject: [AMPL 15222] Sensitivity Analysis

I am trying to do sensitivity analysis of the MILP attached. I followed the instructions in this video https://vimeo.com/140224142
Please tell me what I am doing wrong.

Here is what I am getting:

ampl: option presolve 0;
ampl: option cplex_options 'presolve 0 sensitivity';
ampl: model OperationalFL.run;

.......

ampl: display _varname, _var, _var.rc, _var.current, _var.up, _var.down;

Bad suffix .current for _var
...


--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [AMPL 15244] Sensitivity Analysis

Ratna S
I was getting this error

Bad suffix .current for _var
context:  display _varname, _var, _var.rc,  >>> _var.current, <<<  _var.up, _var.down;
Possible suffix values for _var.suffix:
astatus   defeqn   derstage   dual
init      init0    int        lb
lb0       lb1      lb2        lrc
lslack    no       rc         relax
slack     sno      sstatus    stage
status    ub       ub0        ub1
ub2       urc      uslack     val

So I changed it to the following and it works:

display _varname, _var, _var.rc, _var.val, _var.ub, _var.lb;

Does .current and .val give the same attribute?

what is the equivalent suffix for constraint?

because I am getting this error for constraint


Bad suffix .val for _con
context:  display _conname, _con.body, _con.slack, _con.dual,  >>> _con.val, <<<  _con.ub, _con.lb;
Possible suffix values for _con.suffix:
astatus   body      defvar   derstage
dinit     dinit0    dual     lb
lbs       lbs1      lbs2     ldual
lslack    no        relax    slack
sno       sstatus   stage    status
ub        ubs       ubs1     ubs2
udual     uslack 



On Tuesday, November 28, 2017 at 10:40:01 PM UTC-5, Robert Fourer wrote:
Add 'mipbasis 1' to your cplex_options string.  (For the current version of CPLEX this is the default, but earlier versions defaulted to 'mipbasis 0'.)

Be aware however that you will only get a sensitivity analysis of the linear program that results after all of the binary & integer variables have been fixed at their optimal values.  If you want to know how a change to some objective coefficient or right-hand side constant affects the solution to the overall mixed-integer problem, you will need to make the change yourself and then re-solve.

Bob Fourer
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="axkSxlc9AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">am...@...

=======
        
From: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="axkSxlc9AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">am...@... [mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="axkSxlc9AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">am...@...] On Behalf Of Ratna S
Sent: Monday, November 27, 2017 1:50 AM
To: AMPL Modeling Language
Subject: [AMPL 15222] Sensitivity Analysis

I am trying to do sensitivity analysis of the MILP attached. I followed the instructions in this video <a href="https://vimeo.com/140224142" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fvimeo.com%2F140224142\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFB0TL9lgLQ2uqhkLKi6ZDjt7tNrA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fvimeo.com%2F140224142\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFB0TL9lgLQ2uqhkLKi6ZDjt7tNrA&#39;;return true;">https://vimeo.com/140224142
Please tell me what I am doing wrong.

Here is what I am getting:

ampl: option presolve 0;
ampl: option cplex_options 'presolve 0 sensitivity';
ampl: model OperationalFL.run;

.......

ampl: display _varname, _var, _var.rc, _var.current, _var.up, _var.down;

Bad suffix .current for _var
...


--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: [AMPL 15253] Sensitivity Analysis

Robert Fourer-2
.current, .up, and .down are sensitivity analysis values returned by CPLEX: for variables, .current is the value of the variable's coefficient in the objective function, .up is the largest value that the coefficient can take before the current basis becomes suboptimal, and .down is the smallest value that the coefficient can take before the current basis becomes suboptimal.  If you do not see these in the list of "Possible suffix values for var.suffix" in the error message, then CPLEX has not run the sensitivity analysis.  You will need to include 'sensitivity' in the cplex_options string to get a sensitivity analysis, and for MIPs you may need to also include 'mipbasis=1' (depending on your CPLEX version).

.val, .ub, and .lb are not related to the sensitivity analysis: .val is the value of the variable, .ub is its upper bound in the problem, and .ub is its lower bound in the problem.  _var alone is equivalent to _var.val, and also _con alone is equivalent to _con.dual.  You cannot determine any sensitivity ranges from these suffixes.

Bob Fourer
[hidden email]

=======

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ratna S
Sent: Wednesday, November 29, 2017 10:26 AM
To: AMPL Modeling Language
Subject: Re: [AMPL 15244] Sensitivity Analysis

I was getting this error

Bad suffix .current for _var
context:  display _varname, _var, _var.rc,  >>> _var.current, <<<  _var.up, _var.down;
Possible suffix values for _var.suffix:
        astatus   defeqn   derstage   dual
        init      init0    int        lb
        lb0       lb1      lb2        lrc
        lslack    no       rc         relax
        slack     sno      sstatus    stage
        status    ub       ub0        ub1
        ub2       urc      uslack     val

So I changed it to the following and it works:

display _varname, _var, _var.rc, _var.val, _var.ub, _var.lb;

Does .current and .val give the same attribute?

what is the equivalent suffix for constraint?
because I am getting this error for constraint

Bad suffix .val for _con
context:  display _conname, _con.body, _con.slack, _con.dual,  >>> _con.val, <<<  _con.ub, _con.lb;
Possible suffix values for _con.suffix:
        astatus   body      defvar   derstage
        dinit     dinit0    dual     lb
        lbs       lbs1      lbs2     ldual
        lslack    no        relax    slack
        sno       sstatus   stage    status
        ub        ubs       ubs1     ubs2
        udual     uslack


--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [AMPL 15268] Sensitivity Analysis

Ratna S
Does this change in the string need to be made in my .run file?

This is what I have in my .run file:

# Options Selected for CPLEX Solver #
option solver cplexamp;

option cplex_options 'timing=1 timelimit=3600 mipdisplay=2 lpdisplay=1 mipgap=.005 sensitivity';

solve;

And I am getting the errorr:

Bad suffix .current for _con
context:  display _conname, _con.body, _con.slack, _con.dual,  >>> _con.current, <<<  _con.up, _con.down;
Possible suffix values for _con.suffix:
astatus   body      defvar   derstage
dinit     dinit0    dual     lb
lbs       lbs1      lbs2     ldual
lslack    no        relax    slack
sno       sstatus   stage    status
ub        ubs       ubs1     ubs2
udual     uslack 

So it is still not running sensitivity analysis even though I put 'sensitivity' in the string???


On Thursday, November 30, 2017 at 12:15:51 PM UTC-5, Robert Fourer wrote:
.current, .up, and .down are sensitivity analysis values returned by CPLEX: for variables, .current is the value of the variable's coefficient in the objective function, .up is the largest value that the coefficient can take before the current basis becomes suboptimal, and .down is the smallest value that the coefficient can take before the current basis becomes suboptimal.  If you do not see these in the list of "Possible suffix values for var.suffix" in the error message, then CPLEX has not run the sensitivity analysis.  You will need to include 'sensitivity' in the cplex_options string to get a sensitivity analysis, and for MIPs you may need to also include 'mipbasis=1' (depending on your CPLEX version).

.val, .ub, and .lb are not related to the sensitivity analysis: .val is the value of the variable, .ub is its upper bound in the problem, and .ub is its lower bound in the problem.  _var alone is equivalent to _var.val, and also _con alone is equivalent to _con.dual.  You cannot determine any sensitivity ranges from these suffixes.

Bob Fourer
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="gDRIe3G4AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">am...@...

=======

From: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="gDRIe3G4AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">am...@... [mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="gDRIe3G4AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">am...@...] On Behalf Of Ratna S
Sent: Wednesday, November 29, 2017 10:26 AM
To: AMPL Modeling Language
Subject: Re: [AMPL 15244] Sensitivity Analysis

I was getting this error

Bad suffix .current for _var
context:  display _varname, _var, _var.rc,  >>> _var.current, <<<  _var.up, _var.down;
Possible suffix values for _var.suffix:
        astatus   defeqn   derstage   dual
        init      init0    int        lb
        lb0       lb1      lb2        lrc
        lslack    no       rc         relax
        slack     sno      sstatus    stage
        status    ub       ub0        ub1
        ub2       urc      uslack     val

So I changed it to the following and it works:

display _varname, _var, _var.rc, _var.val, _var.ub, _<a href="http://var.lb" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fvar.lb\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGWjmF1r4nCJfWveARa3dDEuhj2LQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fvar.lb\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGWjmF1r4nCJfWveARa3dDEuhj2LQ&#39;;return true;">var.lb;

Does .current and .val give the same attribute?

what is the equivalent suffix for constraint?
because I am getting this error for constraint

Bad suffix .val for _con
context:  display _conname, _con.body, _con.slack, _con.dual,  >>> _con.val, <<<  _con.ub, _<a href="http://con.lb" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fcon.lb\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEDIOacoLia-72TTkc5FVmBeQ-xBg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fcon.lb\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEDIOacoLia-72TTkc5FVmBeQ-xBg&#39;;return true;">con.lb;
Possible suffix values for _con.suffix:
        astatus   body      defvar   derstage
        dinit     dinit0    dual     lb
        lbs       lbs1      lbs2     ldual
        lslack    no        relax    slack
        sno       sstatus   stage    status
        ub        ubs       ubs1     ubs2
        udual     uslack


--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: [AMPL 15281] Sensitivity Analysis

Robert Fourer-2
Yes, you should include mipbasis=1 in your "option cplex_options ..." statement in your .run file.

Bob Fourer
[hidden email]

=======

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ratna S
Sent: Friday, December 1, 2017 3:13 PM
To: AMPL Modeling Language
Subject: Re: [AMPL 15268] Sensitivity Analysis

Does this change in the string need to be made in my .run file?

This is what I have in my .run file:

# Options Selected for CPLEX Solver #
option solver cplexamp;

option cplex_options 'timing=1 timelimit=3600 mipdisplay=2 lpdisplay=1 mipgap=.005 sensitivity';

solve;

And I am getting the errorr:

Bad suffix .current for _con
context:  display _conname, _con.body, _con.slack, _con.dual,  >>> _con.current, <<<  _con.up, _con.down;
Possible suffix values for _con.suffix:
        astatus   body      defvar   derstage
        dinit     dinit0    dual     lb
        lbs       lbs1      lbs2     ldual
        lslack    no        relax    slack
        sno       sstatus   stage    status
        ub        ubs       ubs1     ubs2
        udual     uslack

So it is still not running sensitivity analysis even though I put 'sensitivity' in the string???


--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.