Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Sensitivity analysis report

  • 1.  Sensitivity analysis report

    Posted 07/30/13 08:15 PM

    Originally posted by: IdoR


    Hi

    I'm relatively new with OPL.

    How can I see the allowable ranges for the right-hand side and for the coefficients of the objective function value after the problem is solved? these are usually called "maximum allowable increase" and "maximum allowable decrease". Is it possible to specify the constraints / coefficients of interest so not to try to display or print too much information?

    The allowable ranges are not displayed by clicking over the constraint / variable name in the Problem browser. And couldn't find neither a specific command to display this information. The only commands I could find are: dual, slack, UB and LB for the constraints, and reducedCost for the variables.

    Thanks in advance,

     

    Hernan


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Sensitivity analysis report

    Posted 07/31/13 02:13 AM

    Hi,

    let me give you an example:

     

    dvar float+ Gas[1..1];
    dvar float+ Chloride[1..1];

    maximize
      40 * Gas[1] + 50 * Chloride[1];
    subject to {
     
      ctMaxTotal:     
        Gas[1] + Chloride[1] <= 50;
      ctMaxTotal2:    
        3 * Gas[1] + 4 * Chloride[1] <= 180;
      ctMaxChloride:  
        Chloride[1] <= 40;
    }

     

    and then if you right click on Gas in the IDE you get sensitivity analysis.

    If you need more than what is available thru scripting you may use an external java call.

     

    Regards

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Sensitivity analysis report

    Posted 03/25/17 02:16 PM

    Originally posted by: pieterce


    Hi @AlexFleischer a1d4492b-6cf8-402d-ae3c-dd656c427dc7

     

    I have developed my MIP and want to check the sensitivity. I read a lot on this forum about different ways of doing this but am a bit confused now what is the easiest way.

    Shadow prices, reduced cost and sensitivity ranges should apparently be fairly easy to compute. However, I cannot make it work.

    Also, how can I see which constraints are binding and which are not?

     

    I am working in Cplex Version: 12.6.3.0.

     

    Attached you find an example of my model.

     

    Thanks in advance!!

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Sensitivity analysis report

    Posted 03/26/17 03:33 AM


  • 5.  Re: Sensitivity analysis report

    Posted 03/26/17 07:57 AM

    Originally posted by: pieterce


    Hi @AlexFleischer a1d4492b-6cf8-402d-ae3c-dd656c427dc7

    Thanks for the quick reply! However, CPLEX returns an error message when I run the following​:

     

    forall (t in T)

    {
              ct1: sum(k in 1..t) G[k] <= t * ravg + sqrt(t) * rstdev * Z_alpha_U;

    }

    execute
    {
             writeln( ct1.name," ",ct1.UB," ",ct1.LB," ",ct1.dual," ",ct1.slack);
    }

     

    On your link I read:

    For technical reasons, the lower and upper bound properties LB and UB are currently accessible only during postprocessing and flow control in constraints assigned in a forall declaration. The undefined value is returned instead.

     

    How can I get the UB, LB, dual and slack for forall loops?

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: Sensitivity analysis report

    Posted 03/26/17 11:47 AM

    Hi,

    for each constraint you have a slack, a UB and son on so you d rather write

    execute
    {
             for (var t in T) writeln( ct1[t].name," ",ct1[t].UB," ",ct1[t].LB," ",ct1[t].dual," ",ct1[t].slack);
    }

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: Sensitivity analysis report

    Posted 03/26/17 12:40 PM

    Originally posted by: pieterce


    Thanks @AlexFleischer a1d4492b-6cf8-402d-ae3c-dd656c427dc7​, it works! I am just wondering how to interpret the output for the following 4 constraints as it sometimes says undefined:

     

    ct1[1] 21.71 -Infinity undefined 1.71

    ct2[1] 0 -Infinity undefined 180
    ct6[5][1] 480 -Infinity undefined 0

    ct4[1][1] Infinity 77.4388 undefined -142.5612

     

    Thanks a lot!!


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 8.  Re: Sensitivity analysis report

    Posted 03/26/17 01:20 PM

    Hi,

    this is quite normal since you ve got integer decision variables.

    Now you can read https://www.ibm.com/developerworks/community/forums/html/threadTopic?id=77777777-0000-0000-0000-000014845703

    in order to get dual after relaxing the integrity constraints.

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 9.  Re: Sensitivity analysis report

    Posted 01/07/19 02:29 PM

    Originally posted by: JPatrick


    Hi,

    I am not sure what is meant by "if you right click on gas in the IDE".  I have tried right clicking in the "problem browser" but nothing happens and I can't think where else to right click.  I am using IBM ILOG CPLEX Optimization Studio v. 12.7


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 10.  Re: Sensitivity analysis report

    Posted 01/08/19 02:49 AM


  • 11.  Re: Sensitivity analysis report

    Posted 01/08/19 10:51 AM

    Originally posted by: JPatrick


    That little icon doesn't appear when I click on the decision variable.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 12.  Re: Sensitivity analysis report

    Posted 01/08/19 10:57 AM

    Hi,

    Do you have an array of decision variable  or a single  decision variable ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 13.  Re: Sensitivity analysis report

    Posted 01/08/19 11:01 AM

    Originally posted by: JPatrick


    I had two decision variables and 3 constraints.  The decision variables were not in an array though.  When I switched it to an array I got the icon.  No icons for the constraints though so I guess you can't do the same thing with them to get the sensitivity analysis.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 14.  Re: Sensitivity analysis report

    Posted 01/08/19 11:21 AM

    Hi,

    same for constraints.

    Moving from

    ctMaxTotal2: 3 * Gas + 4 * Chloride <= 180;

    to

    forall(i in 1..1)  ctMaxTotal2: 3 * Gas + 4 * Chloride <= 180;

    is enough to get the icon

     

    regards

     

    PS: If you have some wishes see https://ibmanalytics.ideas.aha.io/?project=CPLEX

     

    https://www.linkedin.com/pulse/what-optimization-how-can-help-you-do-more-less-zoo-buses-fleischer/


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 15.  Re: Sensitivity analysis report

    Posted 01/08/19 11:49 AM

    Originally posted by: JPatrick


    Perfect, thanks!  One last question... Any way to get the ranges for which the shadow price is valid as well as the ranges around the objective functions parameters for which the same solution remains valid?  I tried the UB and LB that you mention above but they appear to give something different.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 16.  Re: Sensitivity analysis report

    Posted 01/08/19 11:54 AM


  • 17.  Re: Sensitivity analysis report

    Posted 01/08/19 12:34 PM

    Originally posted by: JPatrick


    Is there really no simple way to get these ranges - similar to what Excel provides for sensitivity analysis?  I was wanting to get my class to go beyond Excel and start coding and since OPL studio is readily available I had thought to use it.  However, if there is no simple way to generate sensitivity analysis reports, it may not work.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 18.  Re: Sensitivity analysis report

    Posted 01/08/19 01:10 PM

    Hi,

    1) You can use an external java call

    2) Turn the RHS into decision variables and then you ll use the sensitivity analysis on those variables

    3) Log a wish

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer