Difference between revisions of "Optimization Status Functions"

Line 145: Line 145:
 
|-
 
|-
 
|<code>"All"</code>
 
|<code>"All"</code>
|*
+
| <ul><li></ul>
|
+
| <ul><li></ul>
|
+
| <ul><li></ul>
|
+
| <ul><li></ul>
 
|Returns a compregenive view inside the optimization, listing most items shown here.
 
|Returns a compregenive view inside the optimization, listing most items shown here.
You can see the same information by double-clicking the Optimization object
+
You can see the same information by double-clicking the Optimization object displayed when the DefineOptimization() function is evaluated: («LP», «NLP», etc.)
 
 
displayed when the DefineOptimization() function is evaluated:
 
 
 
(«LP», «NLP», etc.)
 
 
|-
 
|-
 
|<code>"DecisionVector"</code>
 
|<code>"DecisionVector"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Lists all scalar decision variables in a one-dimenansional list.
 
|Lists all scalar decision variables in a one-dimenansional list.
 
|-
 
|-
 
|<code>"ConstraintVector"</code>
 
|<code>"ConstraintVector"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Lists all scalar scalar constraints in a one-dimenansional list.
 
|Lists all scalar scalar constraints in a one-dimenansional list.
 
|-
 
|-
 
|<code>"Decisions"</code>
 
|<code>"Decisions"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Lists the names of each structured decision array in the optimization.
 
|Lists the names of each structured decision array in the optimization.
 
|-
 
|-
 
|<code>"Constraints"</code>
 
|<code>"Constraints"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Lists the names of each structured constraint array in the optimization.
 
|Lists the names of each structured constraint array in the optimization.
 
|-
 
|-
 
|<code>"ObjCoef"</code>
 
|<code>"ObjCoef"</code>
|
+
| <ul><li></ul>
|
+
| <ul><li></ul>
|
+
| <ul><li></ul>
 
|
 
|
 
|Lists scalar objective linear coefficients.
 
|Lists scalar objective linear coefficients.
Line 193: Line 189:
 
|<code>"Q"</code>
 
|<code>"Q"</code>
 
|
 
|
|
+
| <ul><li></ul>
|
+
| <ul><li></ul>
 
|
 
|
 
|Displays the matrix of coefficients in the quatratic objective matrix.
 
|Displays the matrix of coefficients in the quatratic objective matrix.
 
|-
 
|-
 
|<code>"Lhs"</code>
 
|<code>"Lhs"</code>
|
+
| <ul><li></ul>
|
+
| <ul><li></ul>
|
+
| <ul><li></ul>
 
|
 
|
 
|Displays the matrix of linear constraint coefficients. You may optionally specify
 
|Displays the matrix of linear constraint coefficients. You may optionally specify
Line 213: Line 209:
 
|
 
|
 
|
 
|
|
+
|<ul><li></ul>
 
|
 
|
 
|Displays the matrix of quadratic constraint coefficients for QCP programs. Dense
 
|Displays the matrix of quadratic constraint coefficients for QCP programs. Dense
matrixes may be too large to fit in memory for some large QCPs. You may optionally
+
matrixes may be too large to fit in memory for some large QCPs. You may optionally  
 
+
specify «decision» and/or «constraint» to obtain the quadratic coefficients for just that  
specify «decision» and/or «constraint» to obtain the quadratic coefficients for just that
 
 
 
 
structured decision and constraint.
 
structured decision and constraint.
 
|-
 
|-
 
|<code>"Rhs"</code>
 
|<code>"Rhs"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Displays right-hand side coefficients for all scalar constraints. You may optionally
 
|Displays right-hand side coefficients for all scalar constraints. You may optionally
 
specify <<constraint>> to obtain the coefficients for just one constraint corresponsing
 
specify <<constraint>> to obtain the coefficients for just one constraint corresponsing
 
+
to all scalar decision variables. Or you may specify both <<decision>> and  
to all scalar decision variables. Or you may specify both <<decision>> and
+
<<constraint>> to get the coefficients for one decision and one constraint. For a linear  
 
+
or quadratic constraint, the RHS will be the constant term. There is no guarantee of  
<<constraint>> to get the coefficients for one decision and one constraint. For a linear
+
the sign, since it depends on how DefineOptimization re-arranges the constraint when  
 
+
it processes the coefficients. For a non-linear constraint, Rhs will usually be 0. For a  
or quadratic constraint, the RHS will be the constant term. There is no guarantee of
 
 
 
the sign, since it depends on how DefineOptimization re-arranges the constraint when
 
 
 
it processes the coefficients. For a non-linear constraint, Rhs will usually be 0. For a
 
 
 
 
range constraint, e.g., a <= f(x) <= b, the far right constant (b) is returned. It is better to
 
range constraint, e.g., a <= f(x) <= b, the far right constant (b) is returned. It is better to
  
Line 245: Line 233:
 
|-
 
|-
 
|<code>"ConstraintUb"</code>
 
|<code>"ConstraintUb"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Upper bound for each scalar constraint. You may optionally specify «constraint» to
 
|Upper bound for each scalar constraint. You may optionally specify «constraint» to
 
obtain the values for a single structured constraint.
 
obtain the values for a single structured constraint.
 
|-
 
|-
 
|<code>"ConstraintLb"</code>
 
|<code>"ConstraintLb"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>|
 
|Lower bound for each scalar constraint. You may optionally specify «constraint» to
 
|Lower bound for each scalar constraint. You may optionally specify «constraint» to
 
obtain the values for a single structured constraint.
 
obtain the values for a single structured constraint.
 
|-
 
|-
 
|<code>"Sense"</code>
 
|<code>"Sense"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Shows the inequality operator for each scalar constraint (’<=’,’<=’,’=’) or ’R’ for Range
 
|Shows the inequality operator for each scalar constraint (’<=’,’<=’,’=’) or ’R’ for Range
 
(lb & ub). You may optionally specify «constraint» to obtain the values for a single
 
(lb & ub). You may optionally specify «constraint» to obtain the values for a single
 
 
structured constraint.
 
structured constraint.
 
|-
 
|-
 
|<code>"Lb"</code>
 
|<code>"Lb"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Lower bound for each scalar variable. You may optionally specify «decision» to obtain
 
|Lower bound for each scalar variable. You may optionally specify «decision» to obtain
 
the value for a single decision array.
 
the value for a single decision array.
 
|-
 
|-
 
|<code>"Ub"</code>
 
|<code>"Ub"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Upper bound for each scalar variable. You may optionally specify «decision» to obtain
 
|Upper bound for each scalar variable. You may optionally specify «decision» to obtain
 
the value for a single decision array.
 
the value for a single decision array.
 
|-
 
|-
 
|<code>"IntegerType"</code>
 
|<code>"IntegerType"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|The type of all scalar decision variables. Optionally you may specify «decision» to get
 
|The type of all scalar decision variables. Optionally you may specify «decision» to get
 
the integer type(s) for a single decision array. Possible values are:
 
the integer type(s) for a single decision array. Possible values are:
 
 
(’Continuous’,’Integer’,’Boolean’,’Grouped Integer’, or ’Semi-Continuous)’
 
(’Continuous’,’Integer’,’Boolean’,’Grouped Integer’, or ’Semi-Continuous)’
 
|-
 
|-
 
|<code>"Group"</code>
 
|<code>"Group"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Applies only to a grouped integer variable, returns the group number for each scalar
 
|Applies only to a grouped integer variable, returns the group number for each scalar
 
decision variable. You may optionally specify «decision» to obtain the groups for a
 
decision variable. You may optionally specify «decision» to obtain the groups for a
 
 
single decision array.
 
single decision array.
 
|-
 
|-
 
|<code>"Maximize"</code>
 
|<code>"Maximize"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Indicates whether the optimization maximizes an objective (’TRUE’) or minimizes an
 
|Indicates whether the optimization maximizes an objective (’TRUE’) or minimizes an
 
objective (’FALSE’), or whether there is no objective at all for a constraints-only
 
objective (’FALSE’), or whether there is no objective at all for a constraints-only
 
 
problem (’null’)
 
problem (’null’)
 
|-
 
|-
 
|<code>"Engine"</code>
 
|<code>"Engine"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Indicates the engine chosen by Analytica or by user override.
 
|Indicates the engine chosen by Analytica or by user override.
 
|-
 
|-
 
|<code>"Settings"</code>
 
|<code>"Settings"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Displays a list of engine setting names and corresponsing setting values.
 
|Displays a list of engine setting names and corresponsing setting values.
 
|-
 
|-
 
|<code>"Type"</code>
 
|<code>"Type"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|The problem type. This matches the object displayed when DefineOptimization() is
 
|The problem type. This matches the object displayed when DefineOptimization() is
 
evaluated: (’LP’,’QP’,’QCP’,’CQCP’,’NCQCP’,’NLP’,’NSP’)
 
evaluated: (’LP’,’QP’,’QCP’,’CQCP’,’NCQCP’,’NLP’,’NSP’)
 
|-
 
|-
 
|<code>"Intrinsic Indexes"</code>
 
|<code>"Intrinsic Indexes"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Displays a table of indexes of Decision and Constraint arrays that are intrinsic to the
 
|Displays a table of indexes of Decision and Constraint arrays that are intrinsic to the
 
 
optimization.
 
optimization.
 
|-
 
|-
 
|<code>"Extrinsic Indexes"</code>
 
|<code>"Extrinsic Indexes"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Displays a table of indexes of Decision and Constraint arrays that are abstracted,
 
|Displays a table of indexes of Decision and Constraint arrays that are abstracted,
 
 
resulting in multiple optimizations. You may optionally specify either <<decision>> or
 
resulting in multiple optimizations. You may optionally specify either <<decision>> or
 
 
<<constraint>> to get the extrinsic indexes for a single array. This option is very useful
 
<<constraint>> to get the extrinsic indexes for a single array. This option is very useful
 
 
when an index is abstracted unexpectedly. The Extrinsic Indexes display can point
 
when an index is abstracted unexpectedly. The Extrinsic Indexes display can point
 
 
you to the source of the extra dimension, just like Stephen Hawking.
 
you to the source of the extra dimension, just like Stephen Hawking.
 
|-
 
|-
 
|<code>"Decision Intrinsic</code><code>Indexes"</code>
 
|<code>"Decision Intrinsic</code><code>Indexes"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Lists all decision arrays in the optimization, and for each, a set containing the indexes
 
|Lists all decision arrays in the optimization, and for each, a set containing the indexes
 
that are intrinsic to the decision variable. You may optionally select a single decision
 
that are intrinsic to the decision variable. You may optionally select a single decision
 
 
node by specifying <<decision>>.
 
node by specifying <<decision>>.
 
|-
 
|-
 
|<code>"Decision Extrinsic</code><code>Indexes"</code>
 
|<code>"Decision Extrinsic</code><code>Indexes"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Lists all decision arrays in the optimization, and for each, a set containing the indexes
 
|Lists all decision arrays in the optimization, and for each, a set containing the indexes
 
that are extrinsic to the decision variable. You may optionally select a single decision
 
that are extrinsic to the decision variable. You may optionally select a single decision
 
 
node by specifying <<decision>>.
 
node by specifying <<decision>>.
 
|-
 
|-
 
|<code>"Objective Dims"</code>
 
|<code>"Objective Dims"</code>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
|
+
|<ul><li></ul>
 
|Lists all dimensions of the Objective that warrant array abstraction, resulting in an
 
|Lists all dimensions of the Objective that warrant array abstraction, resulting in an
 
array of optimizations. Since Parametric indexes of Decision variables are ignored by
 
array of optimizations. Since Parametric indexes of Decision variables are ignored by
 
 
the optimization, they are not listed in the OptInfo() result even though they can be
 
the optimization, they are not listed in the OptInfo() result even though they can be
 
 
seen in the evaluation of the Objective array.
 
seen in the evaluation of the Objective array.
 
|}
 
|}
 +
 +
==OptEngineInfo(Engine, Item, ''asRef'')==
 +
The SolverInfo function provides information about a specific optimizer engine, or about
 +
the solver engines that are currently installed and ready for use.'
 +
 +
<big>'''Parameters'''</big>
 +
 +
'''«Engine»'''
 +
 +
Type: ''text''
 +
 +
The name of a solver engine. The following are included with Analytica:
 +
* "Lp/Quadratic"
 +
* "SOCP Barrier"
 +
* "GRG Nonlinear"
 +
* "Evolutionary"
 +
 +
Various add-on engines can be purchased separately. These include:
 +
* "LSLP"
 +
* "LSGRG"
 +
* "LSSQP"
 +
* "Knitro"
 +
* "OptQuest"
 +
* "MOSEK"
 +
* "XPress"
 +
* "Gurobi"
 +
 +
The engine parameter can be specified as "All" to obtain the indicated information for
 +
every installed engine.
 +
 +
'''«Item»'''
 +
 +
Type: ''text''
 +
 +
 +
  
  

Revision as of 23:11, 30 December 2015


Optimization status functions can reveal important details such as the selected engine matrix coefficients, and other information that may be helpful with troubleshooting.

OptStatusNum(Opt) / OptStatusText(Opt)

Returns the status number as an integer and corresponding text message, respectively, of the optimization problem «Opt». It is wise to examine the status before evaluating [[Opt Solution]]() to avoid an error message. Possible results are shown in the table below.

Status Number Status Text
-3 Invalid status.
-2 Ignore status. Used when dummy result code needs to be overridden.
-1 Invalid license status. (License expired, missing, invalid, etc.)
0 Optimal solution has been found.
1 The Solver has converged to the current solution.
2 “No remedies” status. (All remedies failed to find better point.)
3 Iterates limit reached. Indicates an early exit of the algorithm.
4 Optimizing an unbounded objective function.
5 Feasible solution could not be found.
6 Optimization aborted by user. Indicates an early exit of the algorithm.
7 Invalid linear model. Returned when a linearity assumption renders incorrect.
8 Bad data set status. Returned when a problem data set renders inconsistent
9 Float error status. (Internal float error.)
10 Time out status. Returned when the maximum allowed time has been exceeded. Indicates an early exit of the algorithm.
11 Memory dearth status. Returned when the system cannot allocate enough memory to perform the optimization.
12 Interpretation error. (Parser, Diagnostics, or Executor error.)
13 Fatal API error. (API not responding.)
14 The Solver has found an integer solution within integer tolerance.
15 Branching and bounding node limit reached. Indicates an early exit of the algorithm.
16 Branching and bounding maximum number of incumbent points reached. Indicates an early exit of the algorithm.
17 Probable global optimum reached. Returned when MSL (Bayesian) global optimality test has been satisfied.
18 Missing bounds status. Returned for EV/MSL Require Bounds when bounds are missing.
19 Bounds conflict status. Indicates <=, =>, = bounds conflict with existing binary or all different constraints.
20 Bounds inconsistency status. Returned when the lower bound value of a variable is grater than the upper bound value, i.e., lb[i] > ub[i] for some variable bound i.
21 Derivative error. Returned when API_Jacobian has not been able to compute gradients.
22 Cone overlap status. Returned when a variable appears in more than one cone.
999 Exception occurred status. Returned when an exception has been caught by try/catch top-level.
1000 Custom base status. (Base for Solver engine custom results.)
1102 The quadratic constraints are non-convex, the SOCP engine cannot solve this problem.

OptInfo(Opt, Item, Decision, Constraint, asRef)

OptInfo() is a varsatile function that can reveal any available details of the optimization. The most common information available through OptInfo() can also be viewed by evaluating the DefineOptimization() function and doulble-clicking the encoded object (e.g. <<LP>>). This opens a hierarchy of information and click-able reference objects that reveal finer levels of detail.

Parameters

«Opt»

Type: variable

Identifies the node defined using DefineOptimization().

«Item»

Type: text

The characteristic of the optimization you are interested in.

«Decision», «Constraint»'

Type: variable, optional

Optional «Decision» and «Constraint» parameters can filter information to be relevant to individual decisions and constraints.

«asRef»

A Boolean value (0 or 1). If True (1), the result will be encoded in a clickable reference object.

The following table shows the relevance of various information items to optimization engines, along with a description of the information revealed.

Item LP QP QCP NLP Description
"All"
Returns a compregenive view inside the optimization, listing most items shown here.

You can see the same information by double-clicking the Optimization object displayed when the DefineOptimization() function is evaluated: («LP», «NLP», etc.)

"DecisionVector"
Lists all scalar decision variables in a one-dimenansional list.
"ConstraintVector"
Lists all scalar scalar constraints in a one-dimenansional list.
"Decisions"
Lists the names of each structured decision array in the optimization.
"Constraints"
Lists the names of each structured constraint array in the optimization.
"ObjCoef"
Lists scalar objective linear coefficients.
"Q"
Displays the matrix of coefficients in the quatratic objective matrix.
"Lhs"
Displays the matrix of linear constraint coefficients. You may optionally specify

«constraint» to obtain the coefficients for just one constraint corresponsing to all

scalar decision variables. Or you may specify both «decision» and «constraint» to get

the coefficients for one decision and one constraint.

"LhsQ"
Displays the matrix of quadratic constraint coefficients for QCP programs. Dense

matrixes may be too large to fit in memory for some large QCPs. You may optionally specify «decision» and/or «constraint» to obtain the quadratic coefficients for just that structured decision and constraint.

"Rhs"
Displays right-hand side coefficients for all scalar constraints. You may optionally

specify <<constraint>> to obtain the coefficients for just one constraint corresponsing to all scalar decision variables. Or you may specify both <<decision>> and <<constraint>> to get the coefficients for one decision and one constraint. For a linear or quadratic constraint, the RHS will be the constant term. There is no guarantee of the sign, since it depends on how DefineOptimization re-arranges the constraint when it processes the coefficients. For a non-linear constraint, Rhs will usually be 0. For a range constraint, e.g., a <= f(x) <= b, the far right constant (b) is returned. It is better to

use "constraintLb" and "constraintUb" for range constraint

"ConstraintUb"
Upper bound for each scalar constraint. You may optionally specify «constraint» to

obtain the values for a single structured constraint.

"ConstraintLb"
Lower bound for each scalar constraint. You may optionally specify «constraint» to

obtain the values for a single structured constraint.

"Sense"
Shows the inequality operator for each scalar constraint (’<=’,’<=’,’=’) or ’R’ for Range

(lb & ub). You may optionally specify «constraint» to obtain the values for a single structured constraint.

"Lb"
Lower bound for each scalar variable. You may optionally specify «decision» to obtain

the value for a single decision array.

"Ub"
Upper bound for each scalar variable. You may optionally specify «decision» to obtain

the value for a single decision array.

"IntegerType"
The type of all scalar decision variables. Optionally you may specify «decision» to get

the integer type(s) for a single decision array. Possible values are: (’Continuous’,’Integer’,’Boolean’,’Grouped Integer’, or ’Semi-Continuous)’

"Group"
Applies only to a grouped integer variable, returns the group number for each scalar

decision variable. You may optionally specify «decision» to obtain the groups for a single decision array.

"Maximize"
Indicates whether the optimization maximizes an objective (’TRUE’) or minimizes an

objective (’FALSE’), or whether there is no objective at all for a constraints-only problem (’null’)

"Engine"
Indicates the engine chosen by Analytica or by user override.
"Settings"
Displays a list of engine setting names and corresponsing setting values.
"Type"
The problem type. This matches the object displayed when DefineOptimization() is

evaluated: (’LP’,’QP’,’QCP’,’CQCP’,’NCQCP’,’NLP’,’NSP’)

"Intrinsic Indexes"
Displays a table of indexes of Decision and Constraint arrays that are intrinsic to the

optimization.

"Extrinsic Indexes"
Displays a table of indexes of Decision and Constraint arrays that are abstracted,

resulting in multiple optimizations. You may optionally specify either <<decision>> or <<constraint>> to get the extrinsic indexes for a single array. This option is very useful when an index is abstracted unexpectedly. The Extrinsic Indexes display can point you to the source of the extra dimension, just like Stephen Hawking.

"Decision IntrinsicIndexes"
Lists all decision arrays in the optimization, and for each, a set containing the indexes

that are intrinsic to the decision variable. You may optionally select a single decision node by specifying <<decision>>.

"Decision ExtrinsicIndexes"
Lists all decision arrays in the optimization, and for each, a set containing the indexes

that are extrinsic to the decision variable. You may optionally select a single decision node by specifying <<decision>>.

"Objective Dims"
Lists all dimensions of the Objective that warrant array abstraction, resulting in an

array of optimizations. Since Parametric indexes of Decision variables are ignored by the optimization, they are not listed in the OptInfo() result even though they can be seen in the evaluation of the Objective array.

OptEngineInfo(Engine, Item, asRef)

The SolverInfo function provides information about a specific optimizer engine, or about the solver engines that are currently installed and ready for use.'

Parameters

«Engine»

Type: text

The name of a solver engine. The following are included with Analytica:

  • "Lp/Quadratic"
  • "SOCP Barrier"
  • "GRG Nonlinear"
  • "Evolutionary"

Various add-on engines can be purchased separately. These include:

  • "LSLP"
  • "LSGRG"
  • "LSSQP"
  • "Knitro"
  • "OptQuest"
  • "MOSEK"
  • "XPress"
  • "Gurobi"

The engine parameter can be specified as "All" to obtain the indicated information for every installed engine.

«Item»

Type: text




See Also

Comments


You are not allowed to post comments.