Numerical Analysis
This module provides functionality to perform numerical analysis on a JuMP model. This module follows the main API and is activated by the struct:
MathOptAnalyzer.Numerical.Analyzer — Type
Analyzer() <: MathOptAnalyzer.AbstractAnalyzerThe Analyzer type is used to analyze the coefficients of a model for numerical issues.
Example
julia> data = MathOptAnalyzer.analyze(
MathOptAnalyzer.Numerical.Analyzer(),
model;
threshold_dense_fill_in = 0.10,
threshold_dense_entries = 1000,
threshold_small = 1e-5,
threshold_large = 1e+5,
threshold_dynamic_range_single = 1e+6,
threshold_dynamic_range_matrix = 1e+8,
)The additional parameters:
threshold_dense_fill_in: The threshold for the fraction of non-zero entries in a constraint to be considered dense.threshold_dense_entries: The minimum number of non-zero entries for a constraint to be considered dense.threshold_small: The threshold for small coefficients in the model.threshold_large: The threshold for large coefficients in the model.threshold_dynamic_range_single: The threshold for the range of coefficients in the model with respect with individual columns, rows, objective coefficients and rhs coefficients.threshold_dynamic_range_matrix: The threshold for the range of coefficients in the model with respect to the matrix of coefficients.
The analysis will return issues of the abstract type:
MathOptAnalyzer.Numerical.AbstractNumericalIssue — Type
AbstractNumericalIssue <: AbstractNumericalIssueAbstract type for numerical issues found during the analysis of a model.
sourceSpecifically the possible issues are:
MathOptAnalyzer.Numerical.VariableNotInConstraints — Type
VariableNotInConstraints <: AbstractNumericalIssueThe VariableNotInConstraints issue is identified when a variable appears in no constraints.
For more information, run:
julia> MathOptAnalyzer.summarize(MathOptAnalyzer.Numerical.VariableNotInConstraints)sourceMathOptAnalyzer.Numerical.EmptyConstraint — Type
EmptyConstraint <: AbstractNumericalIssueThe EmptyConstraint issue is identified when a constraint has no coefficients different from zero.
For more information, run:
julia> MathOptAnalyzer.summarize(MathOptAnalyzer.Numerical.EmptyConstraint)sourceMathOptAnalyzer.Numerical.VariableBoundAsConstraint — Type
VariableBoundAsConstraint <: AbstractNumericalIssueThe VariableBoundAsConstraint issue is identified when a constraint is equivalent to a variable bound, that is, the constraint has only one non-zero coefficient, and this coefficient is equal to one.
For more information, run:
julia> MathOptAnalyzer.summarize(MathOptAnalyzer.Numerical.VariableBoundAsConstraint)sourceMathOptAnalyzer.Numerical.DenseConstraint — Type
DenseConstraint <: AbstractNumericalIssueThe DenseConstraint issue is identified when a constraint has a fraction of non-zero entries greater than threshold_dense_fill_in and the number of non-zero entries is greater than threshold_dense_entries.
For more information, run:
julia> MathOptAnalyzer.summarize(MathOptAnalyzer.Numerical.DenseConstraint)sourceMathOptAnalyzer.Numerical.SmallMatrixCoefficient — Type
SmallMatrixCoefficient <: AbstractNumericalIssueThe SmallMatrixCoefficient issue is identified when a matrix coefficient in a constraint is smaller than threshold_small.
For more information, run:
julia> MathOptAnalyzer.summarize(MathOptAnalyzer.Numerical.SmallMatrixCoefficient)sourceMathOptAnalyzer.Numerical.LargeMatrixCoefficient — Type
LargeMatrixCoefficient <: AbstractNumericalIssueThe LargeMatrixCoefficient issue is identified when a matrix coefficient in a constraint is larger than threshold_large.
For more information, run:
julia> MathOptAnalyzer.summarize(MathOptAnalyzer.Numerical.LargeMatrixCoefficient)sourceMathOptAnalyzer.Numerical.SmallBoundCoefficient — Type
SmallBoundCoefficient <: AbstractNumericalIssueThe SmallBoundCoefficient issue is identified when a variable's bound (coefficient) is smaller than threshold_small.
For more information, run:
julia> MathOptAnalyzer.summarize(MathOptAnalyzer.Numerical.SmallBoundCoefficient)sourceMathOptAnalyzer.Numerical.LargeBoundCoefficient — Type
LargeBoundCoefficient <: AbstractNumericalIssueThe LargeBoundCoefficient issue is identified when a variable's bound (coefficient) is larger than threshold_large.
For more information, run:
julia> MathOptAnalyzer.summarize(MathOptAnalyzer.Numerical.LargeBoundCoefficient)sourceMathOptAnalyzer.Numerical.SmallRHSCoefficient — Type
SmallRHSCoefficient <: AbstractNumericalIssueThe SmallRHSCoefficient issue is identified when the right-hand-side (RHS) coefficient of a constraint is smaller than threshold_small.
For more information, run:
julia> MathOptAnalyzer.summarize(MathOptAnalyzer.Numerical.SmallRHSCoefficient)sourceMathOptAnalyzer.Numerical.LargeRHSCoefficient — Type
LargeRHSCoefficient <: AbstractNumericalIssueThe LargeRHSCoefficient issue is identified when the right-hand-side (RHS) coefficient of a constraint is larger than threshold_large.
For more information, run:
julia> MathOptAnalyzer.summarize(MathOptAnalyzer.Numerical.LargeRHSCoefficient)sourceMathOptAnalyzer.Numerical.SmallObjectiveCoefficient — Type
SmallObjectiveCoefficient <: AbstractNumericalIssueThe SmallObjectiveCoefficient issue is identified when a coefficient in the objective function is smaller than threshold_small.
For more information, run:
julia> MathOptAnalyzer.summarize(MathOptAnalyzer.Numerical.SmallObjectiveCoefficient)sourceMathOptAnalyzer.Numerical.LargeObjectiveCoefficient — Type
LargeObjectiveCoefficient <: AbstractNumericalIssueThe LargeObjectiveCoefficient issue is identified when a coefficient in the objective function is larger than threshold_large.
For more information, run:
julia> MathOptAnalyzer.summarize(MathOptAnalyzer.Numerical.LargeObjectiveCoefficient)sourceMathOptAnalyzer.Numerical.SmallObjectiveQuadraticCoefficient — Type
SmallObjectiveQuadraticCoefficient <: AbstractNumericalIssueThe SmallObjectiveQuadraticCoefficient issue is identified when a quadratic coefficient in the objective function is smaller than threshold_small.
For more information, run:
julia> MathOptAnalyzer.summarize(
MathOptAnalyzer.Numerical.SmallObjectiveQuadraticCoefficient
)sourceMathOptAnalyzer.Numerical.LargeObjectiveQuadraticCoefficient — Type
LargeObjectiveQuadraticCoefficient <: AbstractNumericalIssueThe LargeObjectiveQuadraticCoefficient issue is identified when a quadratic coefficient in the objective function is larger than threshold_large.
For more information, run:
julia> MathOptAnalyzer.summarize(
MathOptAnalyzer.Numerical.LargeObjectiveQuadraticCoefficient
)sourceMathOptAnalyzer.Numerical.SmallMatrixQuadraticCoefficient — Type
SmallMatrixQuadraticCoefficient <: AbstractNumericalIssueThe SmallMatrixQuadraticCoefficient issue is identified when a quadratic coefficient in a constraint is smaller than threshold_small.
For more information, run:
julia> MathOptAnalyzer.summarize(
MathOptAnalyzer.Numerical.SmallMatrixQuadraticCoefficient
)sourceMathOptAnalyzer.Numerical.LargeMatrixQuadraticCoefficient — Type
LargeMatrixQuadraticCoefficient <: AbstractNumericalIssueThe LargeMatrixQuadraticCoefficient issue is identified when a quadratic coefficient in a constraint is larger than threshold_large.
For more information, run:
julia> MathOptAnalyzer.summarize(
MathOptAnalyzer.Numerical.LargeMatrixQuadraticCoefficient
)sourceMathOptAnalyzer.Numerical.NonconvexQuadraticObjective — Type
NonconvexQuadraticObjective <: AbstractNumericalIssueThe NonconvexQuadraticObjective issue is identified when a quadratic objective function is non-convex.
For more information, run:
julia> MathOptAnalyzer.summarize(
MathOptAnalyzer.Numerical.NonconvexQuadraticObjective
)sourceMathOptAnalyzer.Numerical.NonconvexQuadraticConstraint — Type
NonconvexQuadraticConstraintThe NonconvexQuadraticConstraint issue is identified when a quadratic constraint is non-convex.
For more information, run:
julia> MathOptAnalyzer.summarize(
MathOptAnalyzer.Numerical.NonconvexQuadraticConstraint
)sourceMathOptAnalyzer.Numerical.LargeDynamicRangeConstraint — Type
LargeDynamicRangeConstraint <: AbstractNumericalIssueThe LargeDynamicRangeConstraint issue is identified when the dynamic range of a constraint is larger than threshold_dynamic_range_single. The dynamic range is defined as the ratio between the largest and smallest coefficients of the constraint.
For more information, run:
julia> MathOptAnalyzer.summarize(
MathOptAnalyzer.Numerical.LargeDynamicRangeConstraint
)sourceMathOptAnalyzer.Numerical.LargeDynamicRangeMatrix — Type
LargeDynamicRangeMatrix <: AbstractNumericalIssueThe LargeDynamicRangeMatrix issue is identified when the dynamic range of the matrix is larger than threshold_dynamic_range_matrix. The dynamic range is defined as the ratio between the largest and smallest coefficients of the matrix.
For more information, run:
julia> MathOptAnalyzer.summarize(
MathOptAnalyzer.Numerical.LargeDynamicRangeMatrix
)sourceMathOptAnalyzer.Numerical.LargeDynamicRangeObjective — Type
LargeDynamicRangeObjective <: AbstractNumericalIssueThe LargeDynamicRangeObjective issue is identified when the dynamic range of the objective function is larger than threshold_dynamic_range_single. The dynamic range is defined as the ratio between the largest and smallest coefficients of the objective function.
For more information, run:
julia> MathOptAnalyzer.summarize(
MathOptAnalyzer.Numerical.LargeDynamicRangeObjective
)sourceMathOptAnalyzer.Numerical.LargeDynamicRangeRHS — Type
LargeDynamicRangeRHS <: AbstractNumericalIssueThe LargeDynamicRangeRHS issue is identified when the dynamic range of the right-hand side (RHS) vector is larger than threshold_dynamic_range_rhs. The dynamic range is defined as the ratio between the largest and smallest coefficients of the RHS vector.
For more information, run:
julia> MathOptAnalyzer.summarize(
MathOptAnalyzer.Numerical.LargeDynamicRangeRHS
)sourceMathOptAnalyzer.Numerical.LargeDynamicRangeVariable — Type
LargeDynamicRangeVariable <: AbstractNumericalIssueThe LargeDynamicRangeVariable issue is identified when the dynamic range of a variable is larger than threshold_dynamic_range_single. The dynamic range is defined as the ratio between the largest and smallest coefficients of the variable inall constraint it appears.
For more information, run:
julia> MathOptAnalyzer.summarize(
MathOptAnalyzer.Numerical.LargeDynamicRangeVariable
)sourceMathOptAnalyzer.Numerical.LargeDynamicRangeBound — Type
LargeDynamicRangeBound <: AbstractNumericalIssueThe LargeDynamicRangeBound issue is identified when the dynamic range of the variables bounds is larger than threshold_dynamic_range_single. The dynamic range is defined as the ratio between the largest and smallest bounds of all variables. For more information, run:
julia> MathOptAnalyzer.summarize(
MathOptAnalyzer.Numerical.LargeDynamicRangeBound
)sourceThese issues are saved in the data structure that is returned from the MathOptAnalyzer.analyze function:
MathOptAnalyzer.Numerical.Data — Type
DataThe Data structure holds the results of the analysis performed by the MathOptAnalyzer.Numerical.Analyzer. It contains various thresholds and the information about the model's variables, constraints, and objective function.