Difference between revisions of "Error Messages/40699"

(Created page with '= Error Text = The shadow price (dual of constraints) is not available for non-linear problems. = Cause = The LpShadow function can only be used to compute the [[LpShadow…')
 
Line 11: Line 11:
 
  [[Var]] delta := 1e-6;
 
  [[Var]] delta := 1e-6;
 
  [[Var]] obj := [[LpOpt]](my_qp);
 
  [[Var]] obj := [[LpOpt]](my_qp);
  [[For]] i:=@constraint do (
+
  [[For]] i:=@constraint Do (
 
     [[WhatIf]]( ([[LpOpt]](my_qp), [[If]] @constraint=i Then rhs+delta else rhs ) - obj) / delta
 
     [[WhatIf]]( ([[LpOpt]](my_qp), [[If]] @constraint=i Then rhs+delta else rhs ) - obj) / delta
 
  )
 
  )
  
where ''my_qp'' is the variable defined by [[QpDefine]], ''constraint'' is the constraint index passed to [[QpDefine]] in ''my_qp]], and ''rhs'' is a variable passed as the «rhs» parameter to [[QpDefine]].  This causes the QP to be solved multiple times to compute these shadow prices.
+
where ''my_qp'' is the variable defined by [[QpDefine]], ''constraint'' is the constraint index passed to [[QpDefine]] in ''my_qp'', and ''rhs'' is a variable passed as the «rhs» parameter to [[QpDefine]].  This causes the QP to be solved multiple times to compute these shadow prices.
  
 
= See Also =
 
= See Also =
  
 
* [[LpShadow]]
 
* [[LpShadow]]

Revision as of 19:48, 28 January 2010

Error Text

The shadow price (dual of constraints) is not available for non-linear problems.

Cause

The LpShadow function can only be used to compute the shadow price (or dual value of constraints) for a linear program created via a call to LpDefine. It cannot be used with quadratic programs or NLPs.

The concept of a shadow price is meaningful in the context of QP or NLP, but not computed by this function. You could compute the shadow price of a QP, for example, by using:

Var delta := 1e-6;
Var obj := LpOpt(my_qp);
For i:=@constraint Do (
   WhatIf( (LpOpt(my_qp), If @constraint=i Then rhs+delta else rhs ) - obj) / delta
)

where my_qp is the variable defined by QpDefine, constraint is the constraint index passed to QpDefine in my_qp, and rhs is a variable passed as the «rhs» parameter to QpDefine. This causes the QP to be solved multiple times to compute these shadow prices.

See Also

Comments


You are not allowed to post comments.