DynamicBoundsBase.jl: An extensible abstraction layer for DynamicBounds
Current supported problem types and constructors:
DynamicBoundsBase.AbstractDERelaxProblem — Typeabstract type AbstractDERelaxProblemAbstract supertype for all relaxation problems.
DynamicBoundsBase.AbstractODERelaxProblem — TypeAbstractODERelaxProblem
Abstract type for problems used to construct relaxations of parametric ODEs.
DynamicBoundsBase.ODERelaxProb — Typemutable struct ODERelaxProb{F, JX, JP, xType, K} <: AbstractODERelaxProblemA structure used to hold a parametric ODEs problem.
f::AnyRight-hand side function.
Jx!::AnyJacobian of rhs w.r.t x.
Jp!::AnyJacobian of rhs w.r.t p.
x0::AnyInitial condition function.
xL::Vector{Float64}Lower constant state bound storage.
xU::Vector{Float64}Upper constant state bound storage.
tspan::Tuple{Float64, Float64}Time span of integration.
tsupports::Vector{Float64}Support points: Points 'x' values will be queried.
p::Vector{Float64}Point to relax/bound in over the decision space.
pL::Vector{Float64}Lower bounds of the decision space.
pU::Vector{Float64}Upper bounds of the decision space.
user_Jx::BoolProblem has a user-defined Jacobian of the rhs w.r.t x
user_Jp::BoolProblem has a user-defined Jacobian of the rhs w.r.t p
user_state_bnd::BoolConstant user state bounds have been set
variable_state_bnd::BoolVariable user state bounds have been set
nx::Int64State space dimension
np::Int64Decision space dimension
params::Vector{Float64}Optional keywork argument: Indicates the rhs function and the initial condition function take an additional argument
param. For example, it is nowf!(dx, x, p, param).polyhedral_constraint::Union{Nothing, PolyhedralConstraint}Storage for polyhedral constraint, if any
constant_state_bounds::Union{Nothing, ConstantStateBounds}Storage for the constant state bounds, if any
support_set::SupportSet{Float64}The support set if used
kwargs::AnyAdditional keyword arguments
Problem attributes
DynamicBoundsBase.AbstractRelaxProblemAttribute — Typeabstract type AbstractRelaxProblemAttributeAbstract supertype for all problem attributes.
DynamicBoundsBase.HasStateBounds — Typestruct HasStateBounds <: AbstractRelaxProblemAttributeA problem attribute used to check whether state bounds are defined.
DynamicBoundsBase.HasConstantStateBounds — Typestruct HasConstantStateBounds <: AbstractRelaxProblemAttributeA problem attribute used to check whether state bounds are defined as constant.
DynamicBoundsBase.HasVariableStateBounds — Typestruct HasVariableStateBounds <: AbstractRelaxProblemAttributeA problem attribute used to check whether variable state bounds are defined.
DynamicBoundsBase.HasUserJacobian — Typestruct HasUserJacobian <: AbstractRelaxProblemAttributeA problem attribute used to check whether a user-defined jacobian was specified.
DynamicBoundsBase.AbstractPathConstraint — Typeabstract type AbstractPathConstraint <: AbstractRelaxProblemAttributeAn abstract supertype for all manners of path constraints.
DynamicBoundsBase.ConstantStateBounds — Typestruct ConstantStateBounds <: AbstractRelaxProblemAttributeA problem attribute used to store constant state bounds.
xL::Vector{Float64}Lower state variable bounds
xU::Vector{Float64}Upper state variable bounds
DynamicBoundsBase.VariableStateBounds — Typestruct VariableStateBounds{F1<:Function, F2<:Function} <: AbstractRelaxProblemAttributeA problem attribute used to store time-varying state bounds.
xL::FunctionLower state variable bounds
xU::FunctionUpper state variable bounds
DynamicBoundsBase.PolyhedralConstraint — Typestruct PolyhedralConstraint <: AbstractPathConstraintAn object used to specify that the invariant Ax(t,p) <= b is valid fo all t.
DynamicBoundsBase.StateNumber — Typestruct StateNumberAn integrator attribute retrieving the number of state variables (x) aka nx.
DynamicBoundsBase.ConstantParameterValue — Typestruct ConstantParameterValue <: AbstractIntegratorAttributeA integrator attribute used to access the constant parameter values.
DynamicBoundsBase.ParameterNumber — Typestruct ParameterNumberAn integrator attribute retrieving the number of parameter variables (p) aka np.
DynamicBoundsBase.SupportNumber — Typestruct SupportNumberAn integrator attribute retrieving the number of points in the support set of (x) aka nt.
Abstract Integrator Types
DynamicBoundsBase.AbstractDERelaxIntegrator — Typeabstract type AbstractDERelaxIntegratorAbstract supertype for any integrator that constructs relaxations of a differential equation problem.
DynamicBoundsBase.AbstractODERelaxIntegrator — Typeabstract type AbstractODERelaxIntegrator <: AbstractDERelaxIntegratorAbstract supertype for any integrator that constructs relaxations of an ordinary differential equation problem.
Bound locations for use with attributes such as Relaxation, Bound, Gradient. For Gradient{T<:AbstractBoundLoc}, T = Lower indicates the gradient of the lower relaxation (that is the convex relaxation) should be returned, T = Upper indicates that the upper relaxation (the concave relaxation) should be returned, T = Nominal indicates that the gradient of the local evaluation of the relaxation should be returned at the present parameter value.
DynamicBoundsBase.AbstractBoundLoc — Typeabstract type AbstractBoundLocAbstract supertype indicating the type of value returned at a specific index.
DynamicBoundsBase.Lower — Typestruct Lower <: AbstractBoundLocIndicates the lower bound, relaxation, or (sub)gradient should be returned.
DynamicBoundsBase.Upper — Typestruct Upper <: AbstractBoundLocIndicates the upper bound, relaxation, or (sub)gradient should be returned.
DynamicBoundsBase.Nominal — Typestruct Nominal <: AbstractBoundLocIndicates the nominal value or (sub)gradient should be returned.
DynamicBoundsBase.Undefined — Typestruct Undefined <: AbstractBoundLocThe variety of the attribute is unspecified.
Integrator attributes
DynamicBoundsBase.AbstractIntegratorAttribute — Typeabstract type AbstractIntegratorAttributeAbstract supertype for attributes that can be used to set or get attributes (properties) of variables in the model.
DynamicBoundsBase.AbstractDynamicIndex — Typeabstract type AbstractDynamicIndexAn abstract supertype for index structures needed to reference parameters or time.
DynamicBoundsBase.TimeIndex — Typestruct TimeIndexA time index t used to access the value at t.i-th time point.
DynamicBoundsBase.IntegratorName — Typestruct IntegratorName <: AbstractIntegratorAttributeAn integrator attribute for the string identifying the integration scheme.
DynamicBoundsBase.IsNumeric — Typestruct IsNumeric <: AbstractIntegratorAttributeAn integrator attribute for indicating bounds/relaxations are of numeric solution.
DynamicBoundsBase.IsSolutionSet — Typestruct IsSolutionSet <: AbstractIntegratorAttributeAn integrator attribute for indicating bounds & relaxations are of exact solution.
DynamicBoundsBase.TerminationStatus — Typestruct TerminationStatus <: AbstractIntegratorAttributeA integrator attribute used to query the TerminationStatusCode of the integrator on completion. Current termination status codes are:
COMPLETED: The algorithm terminate successfully with bounds and relaxations.EMPTY: The algorithm terminated successfully but the solution set was empty for some points intspan.NAN: The algorithm terminated but some values are not a number (usually indicating a domain violation was encoutered when computing relaxations).RELAXATION_NOT_CALLED: The relaxation has not yet been computed.NUMERICAL_ERROR: A numerical error was encountered.LIMIT_EXCEEDED: A preset limit was exceeded (number of steps and so on).INVALID_OPTION: An invalid option was set.OTHER_ERROR: Another error was encountered.
DynamicBoundsBase.Value — Typestruct Value <: AbstractIntegratorAttributeAn integrator attribute for value of local solution bounds.
DynamicBoundsBase.SupportSet — Typestruct SupportSet{T<:AbstractFloat} <: AbstractIntegratorAttributeA integrator attribute used to access independent variable support set.
DynamicBoundsBase.ParameterValue — Typestruct ParameterValue <: AbstractIntegratorAttributeA integrator attribute used to access the current parameter value.
DynamicBoundsBase.ParameterBound — Typestruct ParameterBound{T<:AbstractBoundLoc} <: AbstractIntegratorAttributeA integrator attribute used to access the current parameter value.
DynamicBoundsBase.Bound — Typestruct Bound{T<:AbstractBoundLoc} <: AbstractIntegratorAttributeAn integrator attribute for state bounds.
DynamicBoundsBase.Relaxation — Typestruct Relaxation{T<:AbstractBoundLoc} <: AbstractIntegratorAttributeAn integrator attribute for relaxations.
DynamicBoundsBase.Gradient — Typestruct Gradient{T<:AbstractBoundLoc} <: AbstractIntegratorAttributeAn integrator attribute for the Gradient.
DynamicBoundsBase.Subgradient — Typestruct Subgradient{T<:AbstractBoundLoc} <: AbstractIntegratorAttributeAn integrator attribute for the Subgradient.
DynamicBoundsBase.LocalIntegrator — Typestruct LocalIntegrator <: AbstractIntegratorAttributeRetreives the LocalIntegrator that corresponds to the integration method used by the integrator.
DynamicBoundsBase.AttachedProblem — Typestruct AttachedProblem <: AbstractIntegratorAttributeRetreives the problem used by the integrator.
DynamicBoundsBase.LocalSensitivityOn — Typestruct LocalSensitivityOn <: AbstractIntegratorAttributeSet to true if integrator should compute derivatives wrt p for the local ode integration.
The following constructors for integrator attributes are given below with T<:AbstractBoundLoc. The TimeIndex constructor is used to specify that the time point referenced using an integer (i.e. the first, second, or fifth time in the support set). The subgradient of the concave relaxation at the third point in the support set is then referenced using the command Subgradient{Upper}(TimeIndex(3)) whereas the subgradient of the concave relaxation at time 0.35 is referenced using Subgradient{Upper}(0.35). A full list of the AbstractIntegratorAttribute structures using this constructor are list below:
Gradient{T}(i::TimeIndex)
Gradient{T}(x::Float64)
Subgradient{T}(i::TimeIndex)
Subgradient{T}(x::Float64)
Bound{T}(i::TimeIndex)
Bound{T}(x::Float64)
Relaxation{T}(i::TimeIndex)
Relaxation{T}(x::Float64)Access and Interface Functions:
DynamicBoundsBase.supports — Functionsupports
Return a Bool indicating whether ::AbstractDERelaxIntegrator supports the ::Union{AbstractDERelaxIntegrator, AbstractDERelaxProblem}.
Base.get — Functionget
Returns the value of attribute set for the ::Union{AbstractDERelaxIntegrator, AbstractDERelaxProblem}. May be vector valued.
DynamicBoundsBase.getall — Functiongetall
An version of get which retreives all data asssociated with a particular integrator attribute.
DynamicBoundsBase.getall! — Functiongetall!
An in-place version of get! which retreives all data asssociated with a particular integrator attribute.
DynamicBoundsBase.set! — Functionset!
Assigns a value to the attr attribute of the integrator, problem, or relaxation.
DynamicBoundsBase.setall! — Functionsetall!
An in-place version of set! which sets all data asssociated with a particular integrator attribute.
DynamicBoundsBase.relax! — Functionrelax!
Computes the relaxation at the current parameter value with the current parameter and state bounds.
DynamicBoundsBase.integrate! — Functionintegrate!
Provides a real-value integration at the current value set for each parameter.
General utilities:
DynamicBoundsBase.IntegratorStates — Typemutable struct IntegratorStatesA structure that holds the state of the integrator.
first_pnt_eval::BoolHas the first point been evaluated
new_decision_box::BoolHave the box-constraints changed since the last evaluation
new_decision_pnt::BoolHas the decision point changed since the last evaluation
set_lower_state::BoolThe relaxed problem has been updated
set_upper_state::BoolThe local problem has been updated
termination_status::TerminationStatusCodeHow did the integrator terminate
DynamicBoundsBase.UnsupportedError — TypeUnsupportedError <: Exception
Abstract type for error thrown when an element is not supported by the integrator.
DynamicBoundsBase.NotAllowedError — TypeNotAllowedError <: Exception
Abstract type for error thrown when an operation is supported but cannot be applied in the current state of the integrator .
DynamicBoundsBase.UnsupportedRelaxAttribute — Typestruct UnsupportedRelaxAttribute{AttrType<:Union{AbstractIntegratorAttribute, AbstractRelaxProblemAttribute}} <: UnsupportedErrorAn error indicating that the attribute attr is unsupported.
DynamicBoundsBase.SetRelaxAttributeNotAllowed — Typestruct SetRelaxAttributeNotAllowed{AttrType<:Union{AbstractIntegratorAttribute, AbstractRelaxProblemAttribute}} <: NotAllowedErrorAn error indicating that the attribute attr is supported but cannot be set for some reason given in the error string.