05 lp iii handout

Upload: shotorbari

Post on 03-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 05 LP III Handout

    1/6

    Linear Programming (LP): Sensitivity Analysis

    Benot Chachuat

    McMaster UniversityDepartment of Chemical Engineering

    ChE 4G03: Optimization in Chemical Engineering

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 1 / 23

    Linear Programming

    Problem Statement

    max z= x1 + x2

    s.t. x

    1 +x

    2 0x1 2

    x2 3

    x1, x2 0

    Simplex

    =Search

    Solution

    z = 5 Optimal value

    x1 + x2 = 1 0 Inactive

    x1 = 2 2 Active

    x2 = 3 3 Active

    x1 = 2 0 Inactive

    x2 = 3 0 Inactive

    Is there more about the solution that we would like to know?

    Mathematical optima do not suffice because such data as costs,

    profits, yields, supplies and demands are always uncertain (at the timethe model is solved) Sometimes within a factor of 10!

    How can we trust the outcome of imperfectly parameterized models? Maybe a cost and demand controls everything, or has no impact?

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 2 / 23

    Linear Programming

    Yes, sensitivity or what if analysis!

    Mathematical optima simply provide a best choice of decisionvariables for one fixing of the inputs (nominal values)

    Sensitivity analysis then tries to complete the picture by studying how

    results would vary with changes in parameter values

    Problem Statement

    max z= x1 + x2

    s.t. x1 + x2 0

    x1 2 =

    x2 3

    x1, x2 0

    Example of SensitivityInformation

    What is the effect of a changein this parameter on the optimal

    cost z

    and on the optimal solu-tion point x = (x1 x

    2 )?

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 3 / 23

    Linear Programming

    Yes, sensitivity or what if analysis!

    Mathematical optima simply provide a best choice of decisionvariables for one fixing of the inputs (nominal values)

    Sensitivity analysis then tries to complete the picture by studying how

    results would vary with changes in parameter values We could always change parameter values and resolve the LP This

    is a lot of work for large models! Sensitivity analysis yields useful information with little computation and

    helps build insight

    Parameter StructureChange Change

    Qualitative

    Sensitivity

    direction of z change Yes Yes

    QuantitativeSensitivity

    magnitude of change in z limited range of validity

    Yes No

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 3 / 23

  • 7/28/2019 05 LP III Handout

    2/6

    Outline

    1 Motivations

    2 Qualitative Sensitivity

    3 Quantitative Sensitivity

    For additional examples, see Rardin (1998), Chapter 7

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 4 / 23

    Qualitative Sensitivity: Relaxing vs. Tightening Constraints

    1 Relaxing the constraints of an optimization model either makes theoptimal value better (higher for a maximize, lower for a minimize) orleave it unchanged.

    2 Tightening the constraints of an optimization model either makesthe optimal value worse or leave it unchanged.

    x2 x2x2

    x1 x1x1

    (a) Nominal (b) Relaxed (c) Tightened

    Warning: Tightening the constraints too much can make the problembecome infeasible!

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 5 / 23

    Qualitative Sensitivity: Relaxing vs. Tightening Constraints

    Class Exercise: For each of the following single changes to amaximization problem, indicate the effect on the optimal solution value:

    Problem Statement

    max z = x1 + x2

    s.t. x1 + x2 0

    x1 2

    x2 3

    x1, x2 0

    Change the RHS of the 1st constraint to -1

    Eliminate the 2nd constraint

    Add the constraint 7x1 + 3x2 8

    Allow variable x2 to be unrestricted (URS)

    Change the 1st constraint to an equality

    Change the coefficient of x1 in the LHS ofthe 1st constraint to -2

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 6 / 23

    Change in Feasible Region: Direction of Change

    1 The optimal solution value z changes monotonically as the feasibleregion is enlarged (constraint relaxation) or reduced (tightening)

    2 The rate of change of z decreases in absolute value as the feasibleregion increases (no matter if active constraints change or not)

    nominal optimal

    solution point

    nominal optimal

    solution point

    perturbed optimal

    solution point

    perturbed optimal

    solution point

    bi bi

    zz

    (a) without change in active set (b) with change in active setzbi

    = i < i

    z

    bi

    = i

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 7 / 23

  • 7/28/2019 05 LP III Handout

    3/6

    Change in Feasible Region: Direction of ChangeClass Exercise: Sketch the typical qualitative behavior of the optimalsolution value z as the RHS value bi of an active constraint is increasedor decreased from the nominal case; assume that the active set changesover the range of bi See Rardin (1998) for further discussion

    a1ix1 + + anixn bi a1ix1 + + anixn bi

    bi

    bi bi

    bi

    zz

    z zmax.

    min.objective

    objective

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 8 / 23

    Change in Cost Coefficients: Direction of Change1 Over a limited range of cost coefficients ci, the actual extreme point

    x (optimal solution) does not change2 Changes that help the optimal value z help more and more as the

    change becomes bigger (no matter if active constraints change or not)

    x2 x2

    x1x1

    nominal=perturbedoptimal point

    perturbedoptimal point

    cici

    zz

    (a) without change in active set (b) with change in active setzci

    = i >

    iz

    ci

    = i

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 9 / 23

    Change in Cost Coefficients: Direction of Change

    Class Exercise: Sketch the typical qualitative behavior of the optimalsolution value z as the cost coefficient ci is increased or decreased fromthe nominal case; assume that the active set changes over the range of ci See Rardin (1998) for further discussion

    ci ci

    z z

    max. objective min. objective

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 10 / 23

    Quantitative Sensitivity1 Quantitative sensitivity analysis is limited to optima with the same

    active constraints as the nominal case.2 Quantitative sensitivity analysis provides an exact value of the

    sensitivity z

    parameter .3 Quantitative sensitivity analysis provides the range of parameter

    changes which result in no change to the active constraint.

    Marginal Price

    The change in optimal solution value z per unit increase in the right-handside bi of a main constraint

    nj=1 aijxj , =, bi is called a marginal price

    (or shadow price or dual variable)

    There is one marginal price i for each main constraint

    Constraint i is: =

    min. objective i 0 i 0 i URSmax. objective i 0 i 0 i URS

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 11 / 23

  • 7/28/2019 05 LP III Handout

    4/6

    Calculating Marginal Prices

    Consider the partitioning of x, A, c into basic and nonbasiccomponents (at the nominal solution):

    x= [xB | x

    NB], A= [AB | A

    NB], c= [cB | c

    NB]

    If the active constraints remain identical, a change bi in the RHS ofconstraint i induces basic/nonbasic variable changes as:

    xNB = 0

    xB = (A

    B)1 0 0 bi 0 0

    T

    Why?

    The marginal price i is therefore obtained as:

    i = cTB (A

    B)1 0 0 bi 0 0

    T

    Why?

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 12 / 23

    Calculating Marginal Prices

    Class Exercise: For the following LP problem, what are the marginalprices for unit changes in the RHS of the first and second constraints?

    x1 x2 x3 x4 x5max c 1 1 0 0 0 b

    A -1 1 -1 0 0 01 0 0 1 0 20 1 0 0 1 3

    B B B B N Nx 2 3 1 0 0 z = 5

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 13 / 23

    Range of Validity of Marginal Prices

    How much can the right-hand

    side bi of constraint i bechanged without modifying theset of active constraints?

    bi

    Both the optimal point x and optimal solution value z change, eventhough the active set does not change

    On the other hand, the marginal price i does not change when biremains in the allowable range

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 14 / 23

    Sensitivity to Change in Cost Coefficients

    In the case that the active constraints remain identical:

    A change ci in the costcoefficient of variable xi incursa change in optimal cost as:

    z = 0 if xi is nonbasic Why?

    z = xi ci if xi is basic

    The solution point remainsidentical:

    x = 0

    The feasible region remainsunaffected

    x2

    x1

    nominal=perturbedoptimal point

    ci

    z

    No change in active set

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 15 / 23

  • 7/28/2019 05 LP III Handout

    5/6

    Range of Validity of Cost Sensitivity

    How much can the cost coefficient ci of variable i be changed withoutmodifying the set of active constraints?

    x2

    x1

    nominaloptimal point

    perturbedoptimal points

    ci

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 16 / 23

    Computer Outputs and What If Questions

    Software products (such as the solvers in GAMS) report:

    1 the marginal price and the associated range of validity for everyconstraint

    2

    the sensitivity to change in cost coefficient and the associated rangeof validity

    Outside of this range, the set of active constraints changes What canwe do?

    Typical (Constraint) Sensitivity Analysis Output:

    Constraint ID Status Slack Marginal Lower Upper

    Price Range Range

    Max. reflux flow Active 0 3.74 123 47

    Max. Pump 7 Inactive 321 0 321 1.0E+30

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 17 / 23

    Answering What If Questions (for Single Parameter)

    Class Exercise: Use the table on the preceeding slide to answer thefollowing questions:

    What is the effect on the profit of changing the reflux flow rate

    capacity by 2.1?

    Are the slack and marginal price values consistent for Pump 7?

    What does a maximum allowable increase of 1.0E + 30 mean?

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 18 / 23

    Answering What If Questions (for Single Parameter)

    Class Exercise: Use the table on the preceeding slide to answer thefollowing questions:

    A proposal has been made to increase the capacity of Pump 7.What is your response to the proposal?

    What is the effect of reducing the reflux flow by 125?

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 19 / 23

  • 7/28/2019 05 LP III Handout

    6/6

    The Case of Multiple Parameter ChangesIn certain cases, it is possible to predict the effect of changing:

    multiple RHS coefficients bi; or

    multiple cost coefficients cj

    The 100% Rule (Worst-Case Rule)Consider the percentage of allowable change being made, and add all thesepercentages.

    If the sum is no more than 100%, then the current active constraintswill remain identical

    If the sum is more than 100%, the current active constraints may notremain optimal

    Caution:The 100% rule does not apply to mixed changes in

    the constraint RHS coefficients bi and the cost coefficients cj

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 20 / 23

    Answering What If Questions (for Multiple Parameters)

    Class Exercise: Answer the following questions based on the data givenin the table:

    Constraint ID Status Slack Marginal Lower Upper

    Price Range RangeMax. reflux flow Active 0 3.74 123 47

    Max. Pump 7 Inactive 321 0 321 1.0E+30

    Max. Pump 5 Active 0 1.27 55 23

    What is the effect on the profit of changing the reflux flow ratecapacity by 35 and reducing the capacity of Pump 5 by 14 atthe same time?

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 21 / 23

    Quantitative Sensitivity Analysis in a Nutshell

    Question that can sometimes be answered with quantitative sensitivityanalysis:

    Change in a single RHS coefficient bi or cost coefficient cj

    Change in multiple RHS coefficients

    Change in multiple cost coefficients

    If quantitative sensitivity analysis does not apply, the model has to beresolve for quantitative results:

    Single large changes in RHS or cost coefficients

    Multiple changes in RHS and cost coefficients simultaneously

    Changes in LHS coefficients (A matrix)

    max z= cTx

    s.t. A x = b

    x 0

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 22 / 23

    Sensitivity Analysis The Final Words

    We have covered the interpretation of the qualitative and quantitativesensitivity results for LP.

    These are critical skills for the engineer!

    We have not covered the details regarding the computation ofquantitative sensitivity results.

    For an introduction to the dual formulation, see Rardin (1998)

    Benot Chachuat (McMaster University) LP: Sensitivity Analysis 4G03 23 / 23