Difference between revisions of "Error Messages/40699"

 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
= Example Text =
+
[[Category: Error messages]]
  
 +
== Example text ==
 +
 +
<pre style="background:white; border:white; margin-left: 1em; font-style:italic">
 
  The shadow price (dual of constraints) is not available for non-linear problems.
 
  The shadow price (dual of constraints) is not available for non-linear problems.
  
  The shadow price (dual of constraints) can only be computed for an LP or QP with all linear constraints and all continuous variables.
+
  The shadow price (dual of constraints) can only be computed for an LP or QP with all linear constraints and  
 +
all continuous variables.
 +
</pre>
  
= Cause =
+
== Cause ==
  
 
The [[LpShadow]] function can only be used to compute the [[LpShadow|shadow price]] (or dual value of constraints) for a linear program, or quadratic program with linear constraints, and all continuous variables, created via a call to [[LpDefine]] or [[QpDefine]].  It cannot be used with [[QpDefine|quadratic programs]] when quadratic constraints are present, or with [[NlpDefine|NLPs]], or when integer or grouped-integer decision variables are present.
 
The [[LpShadow]] function can only be used to compute the [[LpShadow|shadow price]] (or dual value of constraints) for a linear program, or quadratic program with linear constraints, and all continuous variables, created via a call to [[LpDefine]] or [[QpDefine]].  It cannot be used with [[QpDefine|quadratic programs]] when quadratic constraints are present, or with [[NlpDefine|NLPs]], or when integer or grouped-integer decision variables are present.
Line 11: Line 16:
 
The concept of a shadow price is meaningful in the context of a QCP or NLP with continuous variables, but not computed by this function.  You could compute the shadow price of a QCP (i.e., with convex quadratic constraints), for example, by using:
 
The concept of a shadow price is meaningful in the context of a QCP or NLP with continuous variables, but not computed by this function.  You could compute the shadow price of a QCP (i.e., with convex quadratic constraints), for example, by using:
  
  [[Var]] delta := 1e-6;
+
<pre style="background:white; border:white; margin-left: 1em;">
  [[Var]] obj := [[LpOpt]](my_qp);
+
  Var delta := 1e-6;
  [[For]] i:=@constraint Do (
+
  Var obj := LpOpt(my_qp);
     [[WhatIf]]( ([[LpOpt]](my_qp), [[If]] @constraint=i Then rhs+delta else rhs ) - obj) / delta
+
  For i := @constraint Do (
 +
     WhatIf((LpOpt(my_qp), If @constraint = i Then rhs + delta else rhs) - obj)/delta
 
  )
 
  )
 +
</pre>
  
 
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 QCP 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 QCP to be solved multiple times to compute these shadow prices.   
  
= See Also =
+
== See Also ==
 
+
* [[LpOpt]]
 
* [[LpShadow]]
 
* [[LpShadow]]
 +
* [[LpDefine]]
 +
* [[QpDefine]]
 +
* [[NlpDefine]]
 +
* [[DefineOptimization]]

Latest revision as of 19:26, 14 March 2016


Example text

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

 The shadow price (dual of constraints) can only be computed for an LP or QP with all linear constraints and 
 all continuous variables.

Cause

The LpShadow function can only be used to compute the shadow price (or dual value of constraints) for a linear program, or quadratic program with linear constraints, and all continuous variables, created via a call to LpDefine or QpDefine. It cannot be used with quadratic programs when quadratic constraints are present, or with NLPs, or when integer or grouped-integer decision variables are present.

The concept of a shadow price is meaningful in the context of a QCP or NLP with continuous variables, but not computed by this function. You could compute the shadow price of a QCP (i.e., with convex quadratic constraints), 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 QCP to be solved multiple times to compute these shadow prices.

See Also

Comments


You are not allowed to post comments.