Constraint shadow prices for MIP models

Archive of Gamsworld Google Group
Post Reply
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Constraint shadow prices for MIP models

Post by Archiver »


Hi,

Can anyone let me know if its possible to display constraint equation shadow prices for MIP models? In the MIP model I am executing, I find that the constraint equations have no data to display.

Regards,
Srikkanth M

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: Constraint shadow prices for MIP models

Post by Archiver »

Srikkanth,

It is possible to get shadow prices for the equations in a MIP model. Here is one example I just ran on my Linux machine:

gamslib rotdk
gams rotdk.gms mip=cplex gdx=results
gdxdump results.gdx symb=capbal

with the gdxdump output below:

Equation capbal(t) capacity balance /
't1'.M -1.81,
't2'.M -1.81,
't3'.M -1.805,
't4'.M -1.705,
't5'.M -0.785,
't6'.M -0.695,
't7'.M -0.67,
't8'.M -0.67,
't9'.M -0.3,
't10'.M -0.19,
't11'.M -0.12,
't12'.M -0.055 /;

Hope this helps,

-Steve


On Wed, Apr 13, 2016 at 5:02 PM, srikkanth madhavan wrote:

Hi,

Can anyone let me know if its possible to display constraint equation shadow prices for MIP models? In the MIP model I am executing, I find that the constraint equations have no data to display.

Regards,
Srikkanth M

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.




--
Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdirkse@gams.com
http://www.gams.com
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: Constraint shadow prices for MIP models

Post by Archiver »


Steven,

Thanks for getting back. I do see it does produce the shadow prices for equations in the MIP model you sent as an example. But in the model below with binary variables, I either find the equations shadow prices to be empty or having level, lower and upper values but no marginal values. How do I interpret the results?

$gdxin CapacityModInputData.gdx

sets
wmid(*) Unit WM ID
dstep(*) Demand Steps
;

$load wmid dstep

Parameters
cap(wmid) Capacity of each unit
bid(wmid) Bid price per MW for each unit
delta(wmid) Delta MW for each unit
ajunit(wmid) Ajunit ON or OFF
dmd(dstep) Demand per step
dprice(dstep) Price per each demand step

$load cap bid delta ajunit dmd dprice
$gdxin
;

VARIABLES
z objective function value;

BINARY VARIABLES
units_vars(wmid) Unit ON OR OFF
dmd_steps_vars(dstep) DMD ON OR OFF
ajunits_vars(wmid) AJUNIT ON OR OFF

EQUATIONS
OBJ Total Cost of operating the units(Bid cost + AJ Unit cost) - Total Area under demand curve
Supply_EQ_Demand_CONST Supply equals demand constraint
AJ_UNIT_CONST AJ UNIT Demand Constraint
NON_AJ_UNIT_CONST(wmid) NON AJ UNIT Demand Constraint
Unit_Var_Unique_CONST(wmid) EITHER AJ OR NON AJ
;

OBJ.. z =E= sum(wmid , bid(wmid)*cap(wmid)*units_vars(wmid))+sum(wmid, delta(wmid)*cap(wmid)*ajunits_vars(wmid))-sum(dstep, dprice(dstep)*dmd(dstep)*dmd_steps_vars(dstep));

Supply_EQ_Demand_CONST.. sum(wmid,(ajunits_vars(wmid)+units_vars(wmid))*cap(wmid)) =e= sum(dstep,dmd_steps_vars(dstep)*dmd(dstep));

AJ_UNIT_CONST.. sum(wmid,ajunits_vars(wmid)*cap(wmid)) =g= 0.8*sum(dstep,dmd_steps_vars(dstep)*dmd(dstep));

NON_AJ_UNIT_CONST(wmid).. ajunits_vars(wmid)$(ajunit(wmid) = 0) =e= 0;

Unit_Var_Unique_CONST(wmid).. ajunits_vars(wmid)+units_vars(wmid) =l= 1;

MODEL PJMCapacityMOD /all/;

SOLVE PJMCapacityMOD using MIP minimizing z;

Regards,
Srikkanth M

On Thursday, 14 April 2016 01:00:06 UTC-5, srikkanth madhavan wrote:

Hi,

Can anyone let me know if its possible to display constraint equation shadow prices for MIP models? In the MIP model I am executing, I find that the constraint equations have no data to display.

Regards,
Srikkanth M

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: Constraint shadow prices for MIP models

Post by Archiver »

Srikkanth,

I don't see any results, so I can't help interpret them. If you send the GDX input I could try to run this and offer more help.

-Steve

On Fri, Apr 15, 2016 at 5:58 PM, srikkanth madhavan wrote:

Steven,

Thanks for getting back. I do see it does produce the shadow prices for equations in the MIP model you sent as an example. But in the model below with binary variables, I either find the equations shadow prices to be empty or having level, lower and upper values but no marginal values. How do I interpret the results?

$gdxin CapacityModInputData.gdx

sets
wmid(*) Unit WM ID
dstep(*) Demand Steps
;

$load wmid dstep

Parameters
cap(wmid) Capacity of each unit
bid(wmid) Bid price per MW for each unit
delta(wmid) Delta MW for each unit
ajunit(wmid) Ajunit ON or OFF
dmd(dstep) Demand per step
dprice(dstep) Price per each demand step

$load cap bid delta ajunit dmd dprice
$gdxin
;

VARIABLES
z objective function value;

BINARY VARIABLES
units_vars(wmid) Unit ON OR OFF
dmd_steps_vars(dstep) DMD ON OR OFF
ajunits_vars(wmid) AJUNIT ON OR OFF

EQUATIONS
OBJ Total Cost of operating the units(Bid cost + AJ Unit cost) - Total Area under demand curve
Supply_EQ_Demand_CONST Supply equals demand constraint
AJ_UNIT_CONST AJ UNIT Demand Constraint
NON_AJ_UNIT_CONST(wmid) NON AJ UNIT Demand Constraint
Unit_Var_Unique_CONST(wmid) EITHER AJ OR NON AJ
;

OBJ.. z =E= sum(wmid , bid(wmid)*cap(wmid)*units_vars(wmid))+sum(wmid, delta(wmid)*cap(wmid)*ajunits_vars(wmid))-sum(dstep, dprice(dstep)*dmd(dstep)*dmd_steps_vars(dstep));

Supply_EQ_Demand_CONST.. sum(wmid,(ajunits_vars(wmid)+units_vars(wmid))*cap(wmid)) =e= sum(dstep,dmd_steps_vars(dstep)*dmd(dstep));

AJ_UNIT_CONST.. sum(wmid,ajunits_vars(wmid)*cap(wmid)) =g= 0.8*sum(dstep,dmd_steps_vars(dstep)*dmd(dstep));

NON_AJ_UNIT_CONST(wmid).. ajunits_vars(wmid)$(ajunit(wmid) = 0) =e= 0;

Unit_Var_Unique_CONST(wmid).. ajunits_vars(wmid)+units_vars(wmid) =l= 1;

MODEL PJMCapacityMOD /all/;

SOLVE PJMCapacityMOD using MIP minimizing z;

Regards,
Srikkanth M

On Thursday, 14 April 2016 01:00:06 UTC-5, srikkanth madhavan wrote:

Hi,

Can anyone let me know if its possible to display constraint equation shadow prices for MIP models? In the MIP model I am executing, I find that the constraint equations have no data to display.

Regards,
Srikkanth M

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.




--
Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdirkse@gams.com
http://www.gams.com
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: Constraint shadow prices for MIP models

Post by Archiver »


In general the shadow price of the MIP problem is invalid.
First, you should find the equivalent LP problem and use its shadow prices.


On Friday, April 15, 2016, srikkanth madhavan wrote:

Steven,

Thanks for getting back. I do see it does produce the shadow prices for equations in the MIP model you sent as an example. But in the model below with binary variables, I either find the equations shadow prices to be empty or having level, lower and upper values but no marginal values. How do I interpret the results?

$gdxin CapacityModInputData.gdx

sets
wmid(*) Unit WM ID
dstep(*) Demand Steps
;

$load wmid dstep

Parameters
cap(wmid) Capacity of each unit
bid(wmid) Bid price per MW for each unit
delta(wmid) Delta MW for each unit
ajunit(wmid) Ajunit ON or OFF
dmd(dstep) Demand per step
dprice(dstep) Price per each demand step

$load cap bid delta ajunit dmd dprice
$gdxin
;

VARIABLES
z objective function value;

BINARY VARIABLES
units_vars(wmid) Unit ON OR OFF
dmd_steps_vars(dstep) DMD ON OR OFF
ajunits_vars(wmid) AJUNIT ON OR OFF

EQUATIONS
OBJ Total Cost of operating the units(Bid cost + AJ Unit cost) - Total Area under demand curve
Supply_EQ_Demand_CONST Supply equals demand constraint
AJ_UNIT_CONST AJ UNIT Demand Constraint
NON_AJ_UNIT_CONST(wmid) NON AJ UNIT Demand Constraint
Unit_Var_Unique_CONST(wmid) EITHER AJ OR NON AJ
;

OBJ.. z =E= sum(wmid , bid(wmid)*cap(wmid)*units_vars(wmid))+sum(wmid, delta(wmid)*cap(wmid)*ajunits_vars(wmid))-sum(dstep, dprice(dstep)*dmd(dstep)*dmd_steps_vars(dstep));

Supply_EQ_Demand_CONST.. sum(wmid,(ajunits_vars(wmid)+units_vars(wmid))*cap(wmid)) =e= sum(dstep,dmd_steps_vars(dstep)*dmd(dstep));

AJ_UNIT_CONST.. sum(wmid,ajunits_vars(wmid)*cap(wmid)) =g= 0.8*sum(dstep,dmd_steps_vars(dstep)*dmd(dstep));

NON_AJ_UNIT_CONST(wmid).. ajunits_vars(wmid)$(ajunit(wmid) = 0) =e= 0;

Unit_Var_Unique_CONST(wmid).. ajunits_vars(wmid)+units_vars(wmid) =l= 1;

MODEL PJMCapacityMOD /all/;

SOLVE PJMCapacityMOD using MIP minimizing z;

Regards,
Srikkanth M

On Thursday, 14 April 2016 01:00:06 UTC-5, srikkanth madhavan wrote:

Hi,

Can anyone let me know if its possible to display constraint equation shadow prices for MIP models? In the MIP model I am executing, I find that the constraint equations have no data to display.

Regards,
Srikkanth M

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Post Reply