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:
ModelAnalyzer.Numerical.Analyzer
— TypeAnalyzer() <: ModelAnalyzer.AbstractAnalyzer
The Analyzer
type is used to analyze the coefficients of a model for numerical issues.
Example
julia> data = ModelAnalyzer.analyze(
ModelAnalyzer.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:
ModelAnalyzer.Numerical.AbstractNumericalIssue
— TypeAbstractNumericalIssue <: AbstractNumericalIssue
Abstract type for numerical issues found during the analysis of a model.
Specifically the possible issues are:
ModelAnalyzer.Numerical.VariableNotInConstraints
— TypeVariableNotInConstraints <: AbstractNumericalIssue
The VariableNotInConstraints
issue is identified when a variable appears in no constraints.
For more information, run:
julia> ModelAnalyzer.summarize(ModelAnalyzer.Numerical.VariableNotInConstraints)
ModelAnalyzer.Numerical.EmptyConstraint
— TypeEmptyConstraint <: AbstractNumericalIssue
The EmptyConstraint
issue is identified when a constraint has no coefficients different from zero.
For more information, run:
julia> ModelAnalyzer.summarize(ModelAnalyzer.Numerical.EmptyConstraint)
ModelAnalyzer.Numerical.VariableBoundAsConstraint
— TypeVariableBoundAsConstraint <: AbstractNumericalIssue
The 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> ModelAnalyzer.summarize(ModelAnalyzer.Numerical.VariableBoundAsConstraint)
ModelAnalyzer.Numerical.DenseConstraint
— TypeDenseConstraint <: AbstractNumericalIssue
The 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> ModelAnalyzer.summarize(ModelAnalyzer.Numerical.DenseConstraint)
ModelAnalyzer.Numerical.SmallMatrixCoefficient
— TypeSmallMatrixCoefficient <: AbstractNumericalIssue
The SmallMatrixCoefficient
issue is identified when a matrix coefficient in a constraint is smaller than threshold_small
.
For more information, run:
julia> ModelAnalyzer.summarize(ModelAnalyzer.Numerical.SmallMatrixCoefficient)
ModelAnalyzer.Numerical.LargeMatrixCoefficient
— TypeLargeMatrixCoefficient <: AbstractNumericalIssue
The LargeMatrixCoefficient
issue is identified when a matrix coefficient in a constraint is larger than threshold_large
.
For more information, run:
julia> ModelAnalyzer.summarize(ModelAnalyzer.Numerical.LargeMatrixCoefficient)
ModelAnalyzer.Numerical.SmallBoundCoefficient
— TypeSmallBoundCoefficient <: AbstractNumericalIssue
The SmallBoundCoefficient
issue is identified when a variable's bound (coefficient) is smaller than threshold_small
.
For more information, run:
julia> ModelAnalyzer.summarize(ModelAnalyzer.Numerical.SmallBoundCoefficient)
ModelAnalyzer.Numerical.LargeBoundCoefficient
— TypeLargeBoundCoefficient <: AbstractNumericalIssue
The LargeBoundCoefficient
issue is identified when a variable's bound (coefficient) is larger than threshold_large
.
For more information, run:
julia> ModelAnalyzer.summarize(ModelAnalyzer.Numerical.LargeBoundCoefficient)
ModelAnalyzer.Numerical.SmallRHSCoefficient
— TypeSmallRHSCoefficient <: AbstractNumericalIssue
The SmallRHSCoefficient
issue is identified when the right-hand-side (RHS) coefficient of a constraint is smaller than threshold_small
.
For more information, run:
julia> ModelAnalyzer.summarize(ModelAnalyzer.Numerical.SmallRHSCoefficient)
ModelAnalyzer.Numerical.LargeRHSCoefficient
— TypeLargeRHSCoefficient <: AbstractNumericalIssue
The LargeRHSCoefficient
issue is identified when the right-hand-side (RHS) coefficient of a constraint is larger than threshold_large
.
For more information, run:
julia> ModelAnalyzer.summarize(ModelAnalyzer.Numerical.LargeRHSCoefficient)
ModelAnalyzer.Numerical.SmallObjectiveCoefficient
— TypeSmallObjectiveCoefficient <: AbstractNumericalIssue
The SmallObjectiveCoefficient
issue is identified when a coefficient in the objective function is smaller than threshold_small
.
For more information, run:
julia> ModelAnalyzer.summarize(ModelAnalyzer.Numerical.SmallObjectiveCoefficient)
ModelAnalyzer.Numerical.LargeObjectiveCoefficient
— TypeLargeObjectiveCoefficient <: AbstractNumericalIssue
The LargeObjectiveCoefficient
issue is identified when a coefficient in the objective function is larger than threshold_large
.
For more information, run:
julia> ModelAnalyzer.summarize(ModelAnalyzer.Numerical.LargeObjectiveCoefficient)
ModelAnalyzer.Numerical.SmallObjectiveQuadraticCoefficient
— TypeSmallObjectiveQuadraticCoefficient <: AbstractNumericalIssue
The SmallObjectiveQuadraticCoefficient
issue is identified when a quadratic coefficient in the objective function is smaller than threshold_small
.
For more information, run:
julia> ModelAnalyzer.summarize(
ModelAnalyzer.Numerical.SmallObjectiveQuadraticCoefficient
)
ModelAnalyzer.Numerical.LargeObjectiveQuadraticCoefficient
— TypeLargeObjectiveQuadraticCoefficient <: AbstractNumericalIssue
The LargeObjectiveQuadraticCoefficient
issue is identified when a quadratic coefficient in the objective function is larger than threshold_large
.
For more information, run:
julia> ModelAnalyzer.summarize(
ModelAnalyzer.Numerical.LargeObjectiveQuadraticCoefficient
)
ModelAnalyzer.Numerical.SmallMatrixQuadraticCoefficient
— TypeSmallMatrixQuadraticCoefficient <: AbstractNumericalIssue
The SmallMatrixQuadraticCoefficient
issue is identified when a quadratic coefficient in a constraint is smaller than threshold_small
.
For more information, run:
julia> ModelAnalyzer.summarize(
ModelAnalyzer.Numerical.SmallMatrixQuadraticCoefficient
)
ModelAnalyzer.Numerical.LargeMatrixQuadraticCoefficient
— TypeLargeMatrixQuadraticCoefficient <: AbstractNumericalIssue
The LargeMatrixQuadraticCoefficient
issue is identified when a quadratic coefficient in a constraint is larger than threshold_large
.
For more information, run:
julia> ModelAnalyzer.summarize(
ModelAnalyzer.Numerical.LargeMatrixQuadraticCoefficient
)
ModelAnalyzer.Numerical.NonconvexQuadraticObjective
— TypeNonconvexQuadraticObjective <: AbstractNumericalIssue
The NonconvexQuadraticObjective
issue is identified when a quadratic objective function is non-convex.
For more information, run:
julia> ModelAnalyzer.summarize(
ModelAnalyzer.Numerical.NonconvexQuadraticObjective
)
ModelAnalyzer.Numerical.NonconvexQuadraticConstraint
— TypeNonconvexQuadraticConstraint
The NonconvexQuadraticConstraint
issue is identified when a quadratic constraint is non-convex.
For more information, run:
julia> ModelAnalyzer.summarize(
ModelAnalyzer.Numerical.NonconvexQuadraticConstraint
)
These issues are saved in the data structure that is returned from the ModelAnalyzer.analyze
function:
ModelAnalyzer.Numerical.Data
— TypeData
The Data
structure holds the results of the analysis performed by the ModelAnalyzer.Numerical.Analyzer
. It contains various thresholds and the information about the model's variables, constraints, and objective function.