Difference between revisions of "Display of constraint results"

(Created page with "Category:Analytica User Guide <languages /> <translate> Analytica User Guide > Constraint nodes are used in Analytica Optimizer models, and are defined as a compariso...")
 
m (Actual identifier of Sys_ComparisonTolerance)
 
(18 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
[[Category:Analytica User Guide]]
 
[[Category:Analytica User Guide]]
<languages />
+
<breadcrumbs>Analytica User Guide > Number and table formats > {{PAGENAME}}</breadcrumbs>
<translate>
 
[[Analytica User Guide]] >
 
  
Constraint nodes are used in Analytica Optimizer models, and are defined as a comparison such as '''x+y <= z'''. When the result of a constraint node is displayed, both the left-hand and right-hand side values of the comparison are displayed using the selected number format. For example, the constraint might contain the definition:
 
  
'''GetFract(Expenses,75%) <= GetFract(Revenue,25%)'''
+
Constraint nodes are used in [[Analytica_Optimizer_Guide|Analytica Optimizer]] models (not usable in lower [[editions of Analytica]]). The Definition of a Constraint is a comparison such as <code>x + y <= z</code>.
  
but when the result of the constraint is displayed, a cell in the result displays might display as:
+
When displaying the result of a constraint it evaluates and displays the result of the left-hand and right-hand side values, which it displays along with the [[Comparison Operators|comparison operator]] using the selected number format. For example, the constraint [[Definition|defined]] as
 +
:<code>GetFract(Expenses, 75%) <= GetFract(Revenue, 25%)</code>
  
'''845.1 <= 12.3K'''
+
might show as a result as:
 +
:<code>845.1 <= 12.3K</code>
  
Not that in a non-constraint node, the result of a comparison would display as a boolean value, i.e., 0 or 1.
+
Note that in a non-constraint node, the result of a comparison would display as a [[Boolean or truth values|Boolean value]], i.e., <code>0</code> or <code>1</code> (False or True).
  
When the constraint is violated the display is proceeded by '''{!}''', e.g., '''{!}28<=21'''. This display is helpful when debugging optimization models, since it allows you to see the actual values of each side of the constraint. When the '''Boolean '''number format is selected, the comparison display is not used -- '''True '''is displayed when the constraint is satisfied, '''False '''when it is violated. Beware that the optimizer solver engines generally find solutions that are within an epsilon of satisfying each constraint, but when displaying the constraint result, you will see '''False '''when the constraint is violated only by epsilon and the solver engine considers it satisfied.
+
When the constraint is violated the display is preceded by <code>{!}</code>, e.g.,  
 +
 
 +
:<code>{!}28 <= 21</code>.
 +
 
 +
(''New to [[Analytica 5.0]]'') When the system variable [[Sys_ComparisonTolerance]] (actual identifier=<code>Sys_ComparisonTolera</code>) has a non-zero value, the <code>{!}</code> only appears when the amount of violation exceeds the value in [[Sys_ComparisonTolerance]], which defaults to <code>1e-6</code>. For example, this slight violation does not display <code>{!}</code>:
 +
 
 +
:<code>28.0000001 <= 28</code>
 +
 
 +
This information can help you debug an optimization model by showing the actual values of each side of the constraint. If you select the '''Boolean '''[[Number formats|number format]], it doesn't show the comparison display but rather <code>True</code> is displayed when the constraint is satisfied, <code>False</code> when it is violated. Beware that the [[Selecting the Optimization Engine|optimizer solver engines]] sometimes find solutions that are within an epsilon (tiny number) of satisfying each constraint, and may show the constraint result as <code>False</code> because the constraint is violated only by epsilon, even though the solver engine considers it satisfied. The setting <code>'Precision'</code> controls the amount by which the solver engines tolerate a constraint to be not-perfectly-satisfied, so if you set [[Sys_ComparisonTolerance]] to match, the display of <code>{!}</code> will come out consistently.
  
 
==See Also==
 
==See Also==
{| style="margin: 1em auto 1em auto;width: 100%;border:0;table-layout: fixed;" cellpadding=5
+
* [[Introduction to Optimizer]]
|- style="text-align: center"
+
* [[DefineOptimization#Constraints|Constraints]]
| [[Date formats]] <- || [[Display of constraint results]] || -> [[Multiple formats in one table]]
+
* [[DefineOptimization]]
|}
+
* [[Comparison Operators]]
</translate>
+
* [[ComparisonPart]]
 +
* [[Boolean or truth values]]
 +
 
 +
 
 +
<footer>Date formats / {{PAGENAME}} / Multiple formats in one table</footer>

Latest revision as of 22:05, 21 November 2017


Constraint nodes are used in Analytica Optimizer models (not usable in lower editions of Analytica). The Definition of a Constraint is a comparison such as x + y <= z.

When displaying the result of a constraint it evaluates and displays the result of the left-hand and right-hand side values, which it displays along with the comparison operator using the selected number format. For example, the constraint defined as

GetFract(Expenses, 75%) <= GetFract(Revenue, 25%)

might show as a result as:

845.1 <= 12.3K

Note that in a non-constraint node, the result of a comparison would display as a Boolean value, i.e., 0 or 1 (False or True).

When the constraint is violated the display is preceded by {!}, e.g.,

{!}28 <= 21.

(New to Analytica 5.0) When the system variable Sys_ComparisonTolerance (actual identifier=Sys_ComparisonTolera) has a non-zero value, the {!} only appears when the amount of violation exceeds the value in Sys_ComparisonTolerance, which defaults to 1e-6. For example, this slight violation does not display {!}:

28.0000001 <= 28

This information can help you debug an optimization model by showing the actual values of each side of the constraint. If you select the Boolean number format, it doesn't show the comparison display but rather True is displayed when the constraint is satisfied, False when it is violated. Beware that the optimizer solver engines sometimes find solutions that are within an epsilon (tiny number) of satisfying each constraint, and may show the constraint result as False because the constraint is violated only by epsilon, even though the solver engine considers it satisfied. The setting 'Precision' controls the amount by which the solver engines tolerate a constraint to be not-perfectly-satisfied, so if you set Sys_ComparisonTolerance to match, the display of {!} will come out consistently.

See Also


Comments


You are not allowed to post comments.