Public API

This page lists exported symbols of CTModels.Solutions.


From CTModels.Solutions

AbstractDualModel [Abstract Type]

AbstractSolution [Abstract Type]

AbstractSolverInfos [Abstract Type]

AbstractTimeGridModel [Abstract Type]

DualModel [Struct]

CTModels.Solutions.DualModelType
struct DualModel{PC_Dual<:Union{Nothing, Function}, BC_Dual<:Union{Nothing, AbstractVector{<:Real}}, SC_LB_Dual<:Union{Nothing, Function}, SC_UB_Dual<:Union{Nothing, Function}, CC_LB_Dual<:Union{Nothing, Function}, CC_UB_Dual<:Union{Nothing, Function}, VC_LB_Dual<:Union{Nothing, AbstractVector{<:Real}}, VC_UB_Dual<:Union{Nothing, AbstractVector{<:Real}}} <: CTModels.Solutions.AbstractDualModel

Dual variables (Lagrange multipliers) for all constraints in an optimal control solution.

Fields

  • path_constraints_dual::PC_Dual: Multipliers for path constraints t -> μ(t), or nothing.
  • boundary_constraints_dual::BC_Dual: Multipliers for boundary constraints (vector), or nothing.
  • state_constraints_lb_dual::SC_LB_Dual: Multipliers for state lower bounds t -> ν⁻(t), or nothing.
  • state_constraints_ub_dual::SC_UB_Dual: Multipliers for state upper bounds t -> ν⁺(t), or nothing.
  • control_constraints_lb_dual::CC_LB_Dual: Multipliers for control lower bounds t -> ω⁻(t), or nothing.
  • control_constraints_ub_dual::CC_UB_Dual: Multipliers for control upper bounds t -> ω⁺(t), or nothing.
  • variable_constraints_lb_dual::VC_LB_Dual: Multipliers for variable lower bounds (vector), or nothing.
  • variable_constraints_ub_dual::VC_UB_Dual: Multipliers for variable upper bounds (vector), or nothing.

Example

julia> using CTModels

julia> # Typically constructed internally by the solver
julia> dm = CTModels.DualModel(nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing)

EmptyTimeGridModel [Struct]

CTModels.Solutions.EmptyTimeGridModelType
struct EmptyTimeGridModel <: CTModels.Solutions.AbstractTimeGridModel

Sentinel type representing an empty or uninitialised time grid.

Used when a solution does not yet have an associated time discretisation.

Example

julia> using CTModels

julia> etg = CTModels.EmptyTimeGridModel()

MultipleTimeGridModel [Struct]

CTModels.Solutions.MultipleTimeGridModelType
struct MultipleTimeGridModel <: CTModels.Solutions.AbstractTimeGridModel

Multiple time grid model storing different time grids for each solution component.

Used when variables have different discretisations (e.g., different grid densities for state vs control).

Fields

  • grids::NamedTuple: Named tuple with time grids for each component:
    • state::TimesDisc: Time grid for state and state box constraint duals
    • control::TimesDisc: Time grid for control and control box constraint duals
    • costate::TimesDisc: Time grid for costate
    • path::TimesDisc: Time grid for path constraints and their duals

Example

julia> using CTModels

julia> T_state = LinRange(0, 1, 101)
julia> T_control = LinRange(0, 1, 51)
julia> T_costate = LinRange(0, 1, 76)
julia> tg = CTModels.MultipleTimeGridModel(
    state=T_state, control=T_control, costate=T_costate, path=T_state
)
julia> length(tg.grids.state)
101

Solution [Struct]

CTModels.Solutions.SolutionType
struct Solution{TimeGridModelType<:CTModels.Solutions.AbstractTimeGridModel, TimesModelType<:CTModels.Components.AbstractTimesModel, StateModelType<:CTModels.Components.AbstractStateModel, ControlModelType<:CTModels.Components.AbstractControlModel, VariableModelType<:CTModels.Components.AbstractVariableModel, ModelType<:CTModels.Models.AbstractModel, CostateModelType<:Function, ObjectiveValueType<:Real, DualModelType<:CTModels.Solutions.AbstractDualModel, SolverInfosType<:CTModels.Solutions.AbstractSolverInfos} <: CTModels.Solutions.AbstractSolution

Complete solution of an optimal control problem.

Stores the optimal state, control, and costate trajectories, the optimisation variable value, objective value, dual variables, and solver information.

Fields

  • time_grid::TimeGridModelType: Discretised time points.
  • times::TimesModelType: Initial and final time specification.
  • state::StateModelType: State trajectory t -> x(t) with metadata.
  • control::ControlModelType: Control trajectory t -> u(t) with metadata.
  • variable::VariableModelType: Optimisation variable value with metadata.
  • model::ModelType: Reference to the optimal control problem model.
  • costate::CostateModelType: Costate (adjoint) trajectory t -> p(t).
  • objective::ObjectiveValueType: Optimal objective value.
  • dual::DualModelType: Dual variables for all constraints.
  • solver_infos::SolverInfosType: Solver statistics and status.

Example

julia> using CTModels

julia> # Solutions are typically returned by solvers
julia> sol = solve(ocp, ...)  # Returns a Solution
julia> CTModels.objective(sol)

SolverInfos [Struct]

CTModels.Solutions.SolverInfosType
struct SolverInfos{V, TI<:Dict{Symbol, V}} <: CTModels.Solutions.AbstractSolverInfos

Solver information and statistics from the numerical solution process.

Fields

  • iterations::Int: Number of iterations performed by the solver.
  • status::Symbol: Termination status (e.g., :first_order, :max_iter).
  • message::String: Human-readable message describing the termination status.
  • successful::Bool: Whether the solver converged successfully.
  • constraints_violation::Float64: Maximum constraint violation at the solution.
  • infos::TI: Dictionary of additional solver-specific information.

Example

julia> using CTModels

julia> si = CTModels.SolverInfos(100, :first_order, "Converged", true, 1e-8, Dict{Symbol,Any}())
julia> si.successful
true

TimeGridModel [Struct]

UnifiedTimeGridModel [Struct]

CTModels.Solutions.UnifiedTimeGridModelType
struct UnifiedTimeGridModel{T<:Union{StepRangeLen, AbstractVector{<:Real}}} <: CTModels.Solutions.AbstractTimeGridModel

Unified time grid model storing a single discretised time grid for all solution components.

Used when all variables (state, control, costate, duals) share the same time grid.

Fields

  • value::T: Vector or range of time points (e.g., LinRange(0, 1, 100)).

Example

julia> using CTModels

julia> tg = CTModels.UnifiedTimeGridModel(LinRange(0, 1, 101))
julia> length(tg.value)
101

boundary_constraints_dual [Function]

CTModels.Solutions.boundary_constraints_dualFunction
boundary_constraints_dual(
    model::CTModels.Solutions.DualModel{<:Union{Nothing, Function}, BC_Dual<:Union{Nothing, AbstractVector{<:Real}}}
) -> Union{Nothing, AbstractVector{<:Real}}

Return the dual vector associated with the boundary constraints.

Arguments

  • model::DualModel: A model including dual variables for boundary constraints.

Returns

  • BC_Dual: A vector of dual values, or nothing if not set.

See also: CTModels.Solutions.path_constraints_dual, CTModels.Solutions.state_constraints_lb_dual.

boundary_constraints_dual(
    sol::CTModels.Solutions.Solution
) -> Union{Nothing, AbstractVector{<:Real}}

Return the dual of the boundary constraints.

build_solution [Function]

CTModels.Solutions.build_solutionFunction
build_solution(
    ocp::CTModels.Models.Model,
    T_state::Vector{Float64},
    T_control::Vector{Float64},
    T_costate::Vector{Float64},
    T_path::Union{Nothing, Vector{Float64}},
    X::Union{Function, Matrix{Float64}},
    U::Union{Function, Matrix{Float64}},
    v::Vector{Float64},
    P::Union{Function, Matrix{Float64}};
    objective,
    iterations,
    constraints_violation,
    message,
    status,
    successful,
    path_constraints_dual,
    boundary_constraints_dual,
    state_constraints_lb_dual,
    state_constraints_ub_dual,
    control_constraints_lb_dual,
    control_constraints_ub_dual,
    variable_constraints_lb_dual,
    variable_constraints_ub_dual,
    infos,
    control_interpolation
)

Build a solution from an optimal control problem with independent time grids for each component.

This function constructs a Solution object by assembling trajectory data (state, control, costate, path constraint duals) defined on potentially different time discretizations. The solution automatically creates interpolated functions to evaluate trajectories at arbitrary time points, and optimizes storage when all grids are identical.

Time Grid Semantics

The solution supports four independent time grids, each associated with a specific trajectory component:

  • T_state: Time grid for the state trajectory X and state box constraint duals
    • Defines discretization points where state values are known
    • State box constraint duals (state_constraints_lb_dual, state_constraints_ub_dual) share this grid
  • T_control: Time grid for the control trajectory U and control box constraint duals
    • Defines discretization points where control values are known
    • Control box constraint duals (control_constraints_lb_dual, control_constraints_ub_dual) share this grid
    • May differ from T_state (e.g., coarser discretization for piecewise constant controls)
  • T_costate: Time grid for the costate (adjoint) trajectory P
    • Defines discretization points where costate values are known
    • Independent from state grid to accommodate different numerical schemes
    • Example: symplectic integrators may use different grids for state and costate
  • T_path: Time grid for path constraint duals (can be nothing)
    • Defines discretization points for path constraint dual variables
    • Set to nothing if no path constraints exist
    • When nothing, internally defaults to T_state for consistency

Grid Optimization: If all non-nothing grids are identical, the solution uses UnifiedTimeGridModel for memory efficiency. Otherwise, it uses MultipleTimeGridModel to store each grid separately.

Trajectory Data Formats

Trajectory data (X, U, P, path_constraints_dual) can be provided in two formats:

  1. Matrix format: Matrix{Float64} with dimensions (n_points, n_dim)

    • Each row corresponds to a time point in the associated grid
    • Each column corresponds to a component dimension
    • Example: X is (length(T_state), state_dimension(ocp))
  2. Function format: Function that takes time t::Float64 and returns a vector

    • Allows analytical or pre-interpolated trajectories
    • Function signature: t -> Vector{Float64} of appropriate dimension
    • Useful for exact solutions or when data is already interpolated

Arguments

Required Positional Arguments

  • ocp::Model: The optimal control problem model defining dimensions and structure
  • T_state::Vector{Float64}: Time grid for state trajectory (must be strictly increasing)
  • T_control::Vector{Float64}: Time grid for control trajectory (must be strictly increasing)
  • T_costate::Vector{Float64}: Time grid for costate trajectory (must be strictly increasing)
  • T_path::Union{Vector{Float64},Nothing}: Time grid for path constraint duals (or nothing)
  • X::Union{Matrix{Float64},Function}: State trajectory data
  • U::Union{Matrix{Float64},Function}: Control trajectory data
  • v::Vector{Float64}: Variable values (static optimization variables, not time-dependent)
  • P::Union{Matrix{Float64},Function}: Costate (adjoint) trajectory data

Required Keyword Arguments

  • objective::Float64: Optimal objective function value
  • iterations::Int: Number of solver iterations performed
  • constraints_violation::Float64: Maximum constraint violation (feasibility measure)
  • message::String: Solver status message (e.g., "SolveSucceeded", "IterationLimit")
  • status::Symbol: Solver termination status (e.g., :Solve_Succeeded, :Iteration_Limit)
  • successful::Bool: Whether the solve was successful (true/false)

Optional Keyword Arguments (Dual Variables)

All dual variable arguments default to nothing if not provided:

  • path_constraints_dual::Union{Matrix{Float64},Function,Nothing}: Path constraint duals on T_path grid
  • boundary_constraints_dual::Union{Vector{Float64},Nothing}: Boundary constraint duals (time-independent)
  • state_constraints_lb_dual::Union{Matrix{Float64},Nothing}: State lower bound duals on T_state grid
  • state_constraints_ub_dual::Union{Matrix{Float64},Nothing}: State upper bound duals on T_state grid
  • control_constraints_lb_dual::Union{Matrix{Float64},Nothing}: Control lower bound duals on T_control grid
  • control_constraints_ub_dual::Union{Matrix{Float64},Nothing}: Control upper bound duals on T_control grid
  • variable_constraints_lb_dual::Union{Vector{Float64},Nothing}: Variable lower bound duals (time-independent)
  • variable_constraints_ub_dual::Union{Vector{Float64},Nothing}: Variable upper bound duals (time-independent)
  • infos::Dict{Symbol,Any}: Additional solver-specific information (default: empty dict)

Returns

  • sol::Solution: Complete solution object with interpolated trajectory functions and metadata

Example

using CTModels

# Build OCP
ocp = Model(...)
state!(ocp, 2)
control!(ocp, 1)
# ... define dynamics, objective, etc.

# Define independent time grids
T_state = collect(LinRange(0.0, 1.0, 101))    # Fine state grid (101 points)
T_control = collect(LinRange(0.0, 1.0, 51))   # Coarser control grid (51 points)
T_costate = collect(LinRange(0.0, 1.0, 76))   # Custom costate grid (76 points)
T_path = collect(LinRange(0.0, 1.0, 61))      # Path constraint grid (61 points)

# Trajectory data (matrix format)
X = rand(101, 2)  # State on T_state grid
U = rand(51, 1)   # Control on T_control grid
P = rand(76, 2)   # Costate on T_costate grid
v = [0.5, 1.2]    # Static variables

# Build solution
sol = build_solution(
    ocp,
    T_state, T_control, T_costate, T_path,
    X, U, v, P;
    objective=1.23,
    iterations=50,
    constraints_violation=1e-8,
    message="Optimal",
    status=:first_order,
    successful=true
)

# Access trajectories (automatically interpolated)
x_at_t = state(sol)(0.5)      # Interpolated from T_state grid
u_at_t = control(sol)(0.5)    # Interpolated from T_control grid
p_at_t = costate(sol)(0.5)    # Interpolated from T_costate grid

# Query time grids
time_grid(sol, :state)    # Returns T_state
time_grid(sol, :control)  # Returns T_control
time_grid(sol, :costate)  # Returns T_costate

Notes

Box Constraint Dual Dimensions

The dimensions of box constraint dual variables correspond to the component dimension, not the number of constraint declarations:

  • state_constraints_*_dual: Dimension (length(T_state), state_dimension(ocp))
  • control_constraints_*_dual: Dimension (length(T_control), control_dimension(ocp))
  • variable_constraints_*_dual: Dimension variable_dimension(ocp)

If multiple constraints are declared on the same component (e.g., x₂(t) ≤ 1.2 and x₂(t) ≤ 2.0), only the last bound value is retained, and a warning is emitted during model construction.

Grid Validation

All time grids must be:

  • Strictly increasing: T[i] < T[i+1] for all i
  • Non-empty: At least one time point
  • Finite: No Inf or NaN values

The function automatically validates and fixes grids (e.g., converts ranges to vectors).

Automatic Grid Extension

When time grids differ by only the last element (e.g., T_control = T_state[1:end-1]), the function automatically extends the shorter grid to match the longest one. This enables the use of UnifiedTimeGridModel for memory optimization without modifying trajectory data.

The extension condition is:

  • The shorter grid must be a strict prefix of the longest grid
  • Only the last element may be missing: length(T_short) == length(T_long) - 1
  • All other elements must match exactly: T_short == T_long[1:end-1]

If extended, the interpolation automatically uses only the available data points via T[1:N], so trajectory data matrices do not need to be extended.

Memory Optimization

When all grids are identical, the solution uses UnifiedTimeGridModel to store a single grid, reducing memory overhead. This is detected automatically.

Backward Compatibility

A legacy signature build_solution(ocp, T, X, U, v, P; ...) exists for single-grid solutions. It internally calls this multi-grid version with T_state = T_control = T_costate = T_path = T.

See also: CTModels.Solutions.Solution, CTModels.Solutions.UnifiedTimeGridModel, CTModels.Solutions.MultipleTimeGridModel, CTModels.Solutions.time_grid, CTModels.Models.state, CTModels.Models.control, CTModels.Solutions.costate.

build_solution(
    ocp::CTModels.Models.Model,
    T::Vector{Float64},
    X::Union{Function, Matrix{Float64}},
    U::Union{Function, Matrix{Float64}},
    v::Vector{Float64},
    P::Union{Function, Matrix{Float64}};
    objective,
    iterations,
    constraints_violation,
    message,
    status,
    successful,
    path_constraints_dual,
    boundary_constraints_dual,
    state_constraints_lb_dual,
    state_constraints_ub_dual,
    control_constraints_lb_dual,
    control_constraints_ub_dual,
    variable_constraints_lb_dual,
    variable_constraints_ub_dual,
    infos,
    control_interpolation
)

Build a solution from the optimal control problem, the time grid, the state, control, variable, and dual variables.

Arguments

  • ocp::Model: the optimal control problem.
  • T::Vector{Float64}: the time grid.
  • X::Matrix{Float64}: the state trajectory.
  • U::Matrix{Float64}: the control trajectory.
  • v::Vector{Float64}: the variable trajectory.
  • P::Matrix{Float64}: the costate trajectory.
  • objective::Float64: the objective value.
  • iterations::Int: the number of iterations.
  • constraints_violation::Float64: the constraints violation.
  • message::String: the message associated to the status criterion.
  • status::Symbol: the status criterion.
  • successful::Bool: the successful status.
  • path_constraints_dual::Matrix{Float64}: the dual of the path constraints.
  • boundary_constraints_dual::Vector{Float64}: the dual of the boundary constraints.
  • state_constraints_lb_dual::Matrix{Float64}: the lower bound dual of the state constraints.
  • state_constraints_ub_dual::Matrix{Float64}: the upper bound dual of the state constraints.
  • control_constraints_lb_dual::Matrix{Float64}: the lower bound dual of the control constraints.
  • control_constraints_ub_dual::Matrix{Float64}: the upper bound dual of the control constraints.
  • variable_constraints_lb_dual::Vector{Float64}: the lower bound dual of the variable constraints.
  • variable_constraints_ub_dual::Vector{Float64}: the upper bound dual of the variable constraints.
  • infos::Dict{Symbol,Any}: additional solver information dictionary.

Returns

  • sol::Solution: the optimal control solution.

Notes

The dimensions of box constraint dual variables (state_constraints_*_dual, control_constraints_*_dual, variable_constraints_*_dual) correspond to the state/control/variable dimension, not the number of constraint declarations. If multiple constraints are declared on the same component (e.g., x₂(t) ≤ 1.2 and x₂(t) ≤ 2.0), only the last bound value is retained, and a warning is emitted during model construction.

clean_component_symbols [Function]

CTModels.Solutions.clean_component_symbolsFunction
clean_component_symbols(
    description
) -> Tuple{Vararg{Symbol}}

Clean and standardize component symbols for time grid access.

Behavior

  • Maps all component symbols to their canonical time grid: :state, :control, :costate, or :path.
  • :costate, :costates map to :costate (costate has its own grid).
  • :dual, :duals, :constraint, :constraints, :cons map to :path.
  • :state_box_constraint(s) maps to :state.
  • :control_box_constraint(s) maps to :control.
  • Removes duplicate symbols.

Arguments

  • description: A tuple of symbols passed by the user, typically from time grid access.

Returns

  • A cleaned Tuple{Symbol...} of unique, standardized symbols.

Example

julia> clean_component_symbols((:states, :controls, :costate, :constraint, :duals))
# → (:state, :control, :costate, :path)

constraints_violation [Function]

control_constraints_lb_dual [Function]

CTModels.Solutions.control_constraints_lb_dualFunction
control_constraints_lb_dual(
    model::CTModels.Solutions.DualModel{<:Union{Nothing, Function}, <:Union{Nothing, AbstractVector{<:Real}}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, CC_LB_Dual<:Union{Nothing, Function}}
) -> Union{Nothing, Function}

Return the dual function associated with the lower bounds of control constraints.

Arguments

  • model::DualModel: A model including dual variables for control lower bounds.

Returns

  • CC_LB_Dual: A function mapping time t to a vector of dual values, or nothing if not set.

See also: CTModels.Solutions.control_constraints_ub_dual, CTModels.Solutions.state_constraints_lb_dual.

control_constraints_lb_dual(
    sol::CTModels.Solutions.Solution
) -> Union{Nothing, Function}

Return the lower bound dual of the control constraints.

control_constraints_ub_dual [Function]

CTModels.Solutions.control_constraints_ub_dualFunction
control_constraints_ub_dual(
    model::CTModels.Solutions.DualModel{<:Union{Nothing, Function}, <:Union{Nothing, AbstractVector{<:Real}}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, CC_UB_Dual<:Union{Nothing, Function}}
) -> Union{Nothing, Function}

Return the dual function associated with the upper bounds of control constraints.

Arguments

  • model::DualModel: A model including dual variables for control upper bounds.

Returns

  • CC_UB_Dual: A function mapping time t to a vector of dual values, or nothing if not set.

See also: CTModels.Solutions.control_constraints_lb_dual, CTModels.Solutions.state_constraints_ub_dual.

control_constraints_ub_dual(
    sol::CTModels.Solutions.Solution
) -> Union{Nothing, Function}

Return the upper bound dual of the control constraints.

control_interpolation [Function]

dim_dual_control_constraints_box [Function]

dim_dual_state_constraints_box [Function]

dim_dual_variable_constraints_box [Function]

dual [Function]

CTModels.Solutions.dualFunction
dual(
    sol::CTModels.Solutions.Solution,
    model::CTModels.Models.Model,
    label::Symbol
) -> Any

Return the dual variable associated with a constraint identified by its label.

Searches through all constraint types (path, boundary, state, control, and variable constraints) defined in the model and returns the corresponding dual value from the solution.

Arguments

  • sol::Solution: Solution object containing dual variables.
  • model::Model: Model containing constraint definitions.
  • label::Symbol: Symbol corresponding to a constraint label.

Returns

A function of time t for time-dependent constraints, or a scalar/vector for time-invariant duals. If the label is not found, throws an IncorrectArgument exception.

Notes

  • For path/boundary constraints, duals are indexed per declaration (one column per row of the stacked nonlinear constraint vector).
  • For box constraints (state/control/variable), the dual matrices/vectors stored in the Solution are indexed by primal component (i.e. state_dimension(model) columns for state, etc.), following the CTDirect convention. For a label targeting component indices rg, this function returns duals_lb[:, rg] - duals_ub[:, rg] (or the time-independent analogue for variables). Components never constrained carry a zero multiplier.
  • If several labels target the same component, dual(sol, model, :label) returns the (same) per-component multiplier for each: CTModels does not track which declaration "owns" the multiplier, because the solver only sees the effective (intersected) bound.

infos [Function]

CTModels.Solutions.infosFunction
infos(sol::CTModels.Solutions.Solution) -> Dict{Symbol, Any}

Return a dictionary of additional infos depending on the solver or nothing.

is_empty_time_grid [Function]

iterations [Function]

CTModels.Solutions.iterationsFunction
iterations(sol::CTModels.Solutions.Solution) -> Int64

Return the number of iterations (if solved by an iterative method).

message [Function]

CTModels.Solutions.messageFunction
message(sol::CTModels.Solutions.Solution) -> String

Return the message associated to the status criterion.

model [Function]

CTModels.Solutions.modelFunction
model(
    sol::CTModels.Solutions.Solution{<:CTModels.Solutions.AbstractTimeGridModel, <:CTModels.Components.AbstractTimesModel, <:CTModels.Components.AbstractStateModel, <:CTModels.Components.AbstractControlModel, <:CTModels.Components.AbstractVariableModel, M<:CTModels.Models.AbstractModel}
) -> CTModels.Models.AbstractModel

Return the model of the optimal control problem.

path_constraints_dual [Function]

CTModels.Solutions.path_constraints_dualFunction
path_constraints_dual(
    model::CTModels.Solutions.DualModel{PC_Dual<:Union{Nothing, Function}}
) -> Union{Nothing, Function}

Return the dual function associated with the nonlinear path constraints.

Arguments

  • model::DualModel: A model including dual variables for path constraints.

Returns

  • PC_Dual: A function mapping time t to the vector of dual values, or nothing if not set.

See also: CTModels.Solutions.boundary_constraints_dual, CTModels.Solutions.state_constraints_lb_dual.

path_constraints_dual(
    sol::CTModels.Solutions.Solution
) -> Union{Nothing, Function}

Return the dual of the path constraints.

state_constraints_lb_dual [Function]

CTModels.Solutions.state_constraints_lb_dualFunction
state_constraints_lb_dual(
    model::CTModels.Solutions.DualModel{<:Union{Nothing, Function}, <:Union{Nothing, AbstractVector{<:Real}}, SC_LB_Dual<:Union{Nothing, Function}}
) -> Union{Nothing, Function}

Return the dual function associated with the lower bounds of state constraints.

Arguments

  • model::DualModel: A model including dual variables for state lower bounds.

Returns

  • SC_LB_Dual: A function mapping time t to a vector of dual values, or nothing if not set.

See also: CTModels.Solutions.state_constraints_ub_dual, CTModels.Solutions.control_constraints_lb_dual.

state_constraints_lb_dual(
    sol::CTModels.Solutions.Solution
) -> Union{Nothing, Function}

Return the lower bound dual of the state constraints.

state_constraints_ub_dual [Function]

CTModels.Solutions.state_constraints_ub_dualFunction
state_constraints_ub_dual(
    model::CTModels.Solutions.DualModel{<:Union{Nothing, Function}, <:Union{Nothing, AbstractVector{<:Real}}, <:Union{Nothing, Function}, SC_UB_Dual<:Union{Nothing, Function}}
) -> Union{Nothing, Function}

Return the dual function associated with the upper bounds of state constraints.

Arguments

  • model::DualModel: A model including dual variables for state upper bounds.

Returns

  • SC_UB_Dual: A function mapping time t to a vector of dual values, or nothing if not set.

See also: CTModels.Solutions.state_constraints_lb_dual, CTModels.Solutions.control_constraints_ub_dual.

state_constraints_ub_dual(
    sol::CTModels.Solutions.Solution
) -> Union{Nothing, Function}

Return the upper bound dual of the state constraints.

status [Function]

CTModels.Solutions.statusFunction
status(sol::CTModels.Solutions.Solution) -> Symbol

Return the status criterion (a Symbol).

successful [Function]

time_grid_model [Function]

CTModels.Solutions.time_grid_modelFunction
time_grid_model(
    sol::CTModels.Solutions.Solution
) -> CTModels.Solutions.AbstractTimeGridModel

Get the time grid model from a solution.

Returns

  • AbstractTimeGridModel: The time grid model (UnifiedTimeGridModel or MultipleTimeGridModel)

variable_constraints_lb_dual [Function]

CTModels.Solutions.variable_constraints_lb_dualFunction
variable_constraints_lb_dual(
    model::CTModels.Solutions.DualModel{<:Union{Nothing, Function}, <:Union{Nothing, AbstractVector{<:Real}}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, VC_LB_Dual<:Union{Nothing, AbstractVector{<:Real}}}
) -> Union{Nothing, AbstractVector{<:Real}}

Return the dual vector associated with the lower bounds of variable constraints.

Arguments

  • model::DualModel: A model including dual variables for variable lower bounds.

Returns

  • VC_LB_Dual: A vector of dual values, or nothing if not set.

See also: CTModels.Solutions.variable_constraints_ub_dual, CTModels.Solutions.state_constraints_lb_dual.

variable_constraints_lb_dual(
    sol::CTModels.Solutions.Solution
) -> Union{Nothing, AbstractVector{<:Real}}

Return the lower bound dual of the variable constraints.

variable_constraints_ub_dual [Function]

CTModels.Solutions.variable_constraints_ub_dualFunction
variable_constraints_ub_dual(
    model::CTModels.Solutions.DualModel{<:Union{Nothing, Function}, <:Union{Nothing, AbstractVector{<:Real}}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, <:Union{Nothing, Function}, <:Union{Nothing, AbstractVector{<:Real}}, VC_UB_Dual<:Union{Nothing, AbstractVector{<:Real}}}
) -> Union{Nothing, AbstractVector{<:Real}}

Return the dual vector associated with the upper bounds of variable constraints.

Arguments

  • model::DualModel: A model including dual variables for variable upper bounds.

Returns

  • VC_UB_Dual: A vector of dual values, or nothing if not set.

See also: CTModels.Solutions.variable_constraints_lb_dual, CTModels.Solutions.state_constraints_ub_dual.

variable_constraints_ub_dual(
    sol::CTModels.Solutions.Solution
) -> Union{Nothing, AbstractVector{<:Real}}

Return the upper bound dual of the variable constraints.