Eduardo Gouveia
2007-11-30 12:07:36 UTC
Hello.
Im writing to know if anyone can answer to the following problem:
Im working with two kinds of problems: linear and non linear optimization.
To linear optimization I generally use the linprog function of Matlab
To non linear optimization I generally use fmincon.
Both problems include inequalities and equalities constraints.
In both kinds of the referred problems I need to perform post optimization (- Sensitivity Analysis).
To perform this goal I will need the values of shadow prices.
At Matlab the shadow prices are obtained using lambda options:
lamda.ineqlin gives shadow prices of inequality constraints.
lamda.eqlin gives shadow prices of equality constraints.
lamda.lower gives lower bounds on variable
lamda.upper gives upper bounds on variable
As well known, the shadow price corresponds to the improvement at objective function when we increase the RHS value of one unit. However, this situation only is true if the increase of RHS value remains at the bounds of the constraint.
An example with linprog:
A=[
-1 0 0
1 0 0
0 -1 0
0 1 0
0 0 -1
0 0 1
0 0.2 -0.4
0 -0.2 0.4]
b=[-2; 4; -3; 5; 8; -5; 3.72; 3.72];
Aeq=[1 1 1];
beq=[0];
f=[0 -1 0];
[x,fval,exitflag,output,lambda] = linprog(f,A,b,Aeq,beq,[],[],options,opt)
shadow_price_inequalities=lambda.ineqlin
shadow_price_equalities =lambda.eqlin
The results:
x=[2.0000; 4.8667; -6.8667];
shadow_price_inequalities =[ 0.6667; 0.0000; 0.0000;
0.0000; 0.0000; 0.0000; 1.6667; 0.0000];
shadow_price_equalities =[ 0.6667];
For example, for constraint number 7 the shadow price is 1.6667. This constraint is bounded at 3.72. If I increase the RHS value (vector b) to 4.72 I will not obtain a improvement at objective function of 1.6667. In fact, objective function (max X2) is bounded at 5. So the increment allowed is the difference from 4.8667 to 5. Can not be 1.6667. That means that shadow price only are true if the increment of RHS value remains at the constraints boundaries.
I used another software to perform the same exercise and I obtained the boundary values of constraint 7 which were [2,6; 3,8]. That means that the increase for 4.72 of RHS value of constraint 7 will be outside of the boundaries.
My questions are:
The Matlab, by using lambda (as far as I know) only provides de values of shadow prices and the bounds of the variables. But how can I obtain the boundary values of the constraints to evaluate the “true” of the shadow prices?
There is any command that allows getting the true improvement at objective function when RHS value is increased to the extreme bounds (for the example 3.8)?
Thank you for any help.
Eduard
Im writing to know if anyone can answer to the following problem:
Im working with two kinds of problems: linear and non linear optimization.
To linear optimization I generally use the linprog function of Matlab
To non linear optimization I generally use fmincon.
Both problems include inequalities and equalities constraints.
In both kinds of the referred problems I need to perform post optimization (- Sensitivity Analysis).
To perform this goal I will need the values of shadow prices.
At Matlab the shadow prices are obtained using lambda options:
lamda.ineqlin gives shadow prices of inequality constraints.
lamda.eqlin gives shadow prices of equality constraints.
lamda.lower gives lower bounds on variable
lamda.upper gives upper bounds on variable
As well known, the shadow price corresponds to the improvement at objective function when we increase the RHS value of one unit. However, this situation only is true if the increase of RHS value remains at the bounds of the constraint.
An example with linprog:
A=[
-1 0 0
1 0 0
0 -1 0
0 1 0
0 0 -1
0 0 1
0 0.2 -0.4
0 -0.2 0.4]
b=[-2; 4; -3; 5; 8; -5; 3.72; 3.72];
Aeq=[1 1 1];
beq=[0];
f=[0 -1 0];
[x,fval,exitflag,output,lambda] = linprog(f,A,b,Aeq,beq,[],[],options,opt)
shadow_price_inequalities=lambda.ineqlin
shadow_price_equalities =lambda.eqlin
The results:
x=[2.0000; 4.8667; -6.8667];
shadow_price_inequalities =[ 0.6667; 0.0000; 0.0000;
0.0000; 0.0000; 0.0000; 1.6667; 0.0000];
shadow_price_equalities =[ 0.6667];
For example, for constraint number 7 the shadow price is 1.6667. This constraint is bounded at 3.72. If I increase the RHS value (vector b) to 4.72 I will not obtain a improvement at objective function of 1.6667. In fact, objective function (max X2) is bounded at 5. So the increment allowed is the difference from 4.8667 to 5. Can not be 1.6667. That means that shadow price only are true if the increment of RHS value remains at the constraints boundaries.
I used another software to perform the same exercise and I obtained the boundary values of constraint 7 which were [2,6; 3,8]. That means that the increase for 4.72 of RHS value of constraint 7 will be outside of the boundaries.
My questions are:
The Matlab, by using lambda (as far as I know) only provides de values of shadow prices and the bounds of the variables. But how can I obtain the boundary values of the constraints to evaluate the “true” of the shadow prices?
There is any command that allows getting the true improvement at objective function when RHS value is increased to the extreme bounds (for the example 3.8)?
Thank you for any help.
Eduard