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 — TypeAnalyzer() <: 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,
)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.
The analysis will return issues of the abstract type:
MathOptAnalyzer.Numerical.AbstractNumericalIssue — TypeAbstractNumericalIssue <: AbstractNumericalIssueAbstract type for numerical issues found during the analysis of a model.
Specifically the possible issues are:
MathOptAnalyzer.Numerical.VariableNotInConstraints — TypeVariableNotInConstraints <: AbstractNumericalIssueThe VariableNotInConstraints issue is identified when a variable appears in no constraints.
For more information, run:
julia> MathOptAnalyzer.summarize(MathOptAnalyzer.Numerical.VariableNotInConstraints)MathOptAnalyzer.Numerical.EmptyConstraint — TypeEmptyConstraint <: AbstractNumericalIssueThe EmptyConstraint issue is identified when a constraint has no coefficients different from zero.
For more information, run:
julia> MathOptAnalyzer.summarize(MathOptAnalyzer.Numerical.EmptyConstraint)MathOptAnalyzer.Numerical.VariableBoundAsConstraint — TypeVariableBoundAsConstraint <: 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)MathOptAnalyzer.Numerical.DenseConstraint — TypeDenseConstraint <: 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)MathOptAnalyzer.Numerical.SmallMatrixCoefficient — TypeSmallMatrixCoefficient <: 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)MathOptAnalyzer.Numerical.LargeMatrixCoefficient — TypeLargeMatrixCoefficient <: 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)MathOptAnalyzer.Numerical.SmallBoundCoefficient — TypeSmallBoundCoefficient <: 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)MathOptAnalyzer.Numerical.LargeBoundCoefficient — TypeLargeBoundCoefficient <: 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)MathOptAnalyzer.Numerical.SmallRHSCoefficient — TypeSmallRHSCoefficient <: 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)MathOptAnalyzer.Numerical.LargeRHSCoefficient — TypeLargeRHSCoefficient <: 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)MathOptAnalyzer.Numerical.SmallObjectiveCoefficient — TypeSmallObjectiveCoefficient <: 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)MathOptAnalyzer.Numerical.LargeObjectiveCoefficient — TypeLargeObjectiveCoefficient <: 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)MathOptAnalyzer.Numerical.SmallObjectiveQuadraticCoefficient — TypeSmallObjectiveQuadraticCoefficient <: 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
)MathOptAnalyzer.Numerical.LargeObjectiveQuadraticCoefficient — TypeLargeObjectiveQuadraticCoefficient <: 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
)MathOptAnalyzer.Numerical.SmallMatrixQuadraticCoefficient — TypeSmallMatrixQuadraticCoefficient <: 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
)MathOptAnalyzer.Numerical.LargeMatrixQuadraticCoefficient — TypeLargeMatrixQuadraticCoefficient <: 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
)MathOptAnalyzer.Numerical.NonconvexQuadraticObjective — TypeNonconvexQuadraticObjective <: AbstractNumericalIssueThe NonconvexQuadraticObjective issue is identified when a quadratic objective function is non-convex.
For more information, run:
julia> MathOptAnalyzer.summarize(
MathOptAnalyzer.Numerical.NonconvexQuadraticObjective
)MathOptAnalyzer.Numerical.NonconvexQuadraticConstraint — TypeNonconvexQuadraticConstraintThe NonconvexQuadraticConstraint issue is identified when a quadratic constraint is non-convex.
For more information, run:
julia> MathOptAnalyzer.summarize(
MathOptAnalyzer.Numerical.NonconvexQuadraticConstraint
)These issues are saved in the data structure that is returned from the MathOptAnalyzer.analyze function:
MathOptAnalyzer.Numerical.Data — TypeDataThe 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.