Skip to content

Problem

CTModels.Models.state_dimension Function
julia
state_dimension(ocp::CTModels.Models.Model) -> Int64

Return the state dimension.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Dimension: The state dimension.

See also: CTModels.Components.state, CTModels.Models.state_name, CTModels.Models.state_components.

julia
state_dimension(ocp::CTModels.Building.PreModel) -> Int64

Return the state dimension of the PreModel.

Arguments

  • ocp::PreModel: The pre-model to query.

Throws

  • Exceptions.PreconditionError: if the state has not been set yet.
julia
state_dimension(sol::CTModels.Solutions.Solution) -> Int64

Return the dimension of the state.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • Dimension: The state dimension.

See also: CTModels.Components.state, CTModels.Models.state_components.

CTModels.Models.state_name Function
julia
state_name(ocp::CTModels.Models.Model) -> String

Return the name of the state.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • String: The state name.

See also: CTModels.Components.state, CTModels.Models.state_components, CTModels.Models.state_dimension.

julia
state_name(sol::CTModels.Solutions.Solution) -> String

Return the name of the state.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • String: The state name.

See also: CTModels.Models.state_components, CTModels.Models.state_dimension.

CTModels.Models.state_components Function
julia
state_components(
    ocp::CTModels.Models.Model
) -> Vector{String}

Return the names of the components of the state.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Vector{String}: The state component names.

See also: CTModels.Components.state, CTModels.Models.state_name, CTModels.Models.state_dimension.

julia
state_components(
    sol::CTModels.Solutions.Solution
) -> Vector{String}

Return the names of the components of the state.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • Vector{String}: The state component names.

See also: CTModels.Models.state_dimension, CTModels.Models.state_name.

CTModels.Models.control_dimension Function
julia
control_dimension(ocp::CTModels.Models.Model) -> Int64

Return the control dimension.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Dimension: The control dimension.

See also: CTModels.Components.control, CTModels.Models.control_name, CTModels.Models.control_components.

julia
control_dimension(ocp::CTModels.Building.PreModel) -> Int64

Return the control dimension of the PreModel.

control defaults to CTModels.Components.EmptyControlModel (dimension 0), so — unlike state_dimension — no precondition on control having been set is required.

Arguments

  • ocp::PreModel: The pre-model to query.
julia
control_dimension(sol::CTModels.Solutions.Solution) -> Int64

Return the dimension of the control.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • Dimension: The control dimension.

See also: CTModels.Components.control, CTModels.Models.control_components.

CTModels.Models.control_name Function
julia
control_name(ocp::CTModels.Models.Model) -> String

Return the name of the control.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • String: The control name.

See also: CTModels.Components.control, CTModels.Models.control_components, CTModels.Models.control_dimension.

julia
control_name(sol::CTModels.Solutions.Solution) -> String

Return the name of the control.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • String: The control name.

See also: CTModels.Models.control_components, CTModels.Models.control_dimension.

CTModels.Models.control_components Function
julia
control_components(
    ocp::CTModels.Models.Model
) -> Vector{String}

Return the names of the components of the control.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Vector{String}: The control component names.

See also: CTModels.Components.control, CTModels.Models.control_name, CTModels.Models.control_dimension.

julia
control_components(
    sol::CTModels.Solutions.Solution
) -> Vector{String}

Return the names of the components of the control.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • Vector{String}: The control component names.

See also: CTModels.Models.control_dimension, CTModels.Models.control_name.

CTModels.Models.variable_dimension Function
julia
variable_dimension(ocp::CTModels.Models.Model) -> Int64

Return the variable dimension.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Dimension: The variable dimension.

See also: CTModels.Components.variable, CTModels.Models.variable_name, CTModels.Models.variable_components.

julia
variable_dimension(ocp::CTModels.Building.PreModel) -> Int64

Return the variable dimension of the PreModel.

variable defaults to CTModels.Components.EmptyVariableModel (dimension 0), so — unlike state_dimension — no precondition on variable having been set is required.

Arguments

  • ocp::PreModel: The pre-model to query.
julia
variable_dimension(
    sol::CTModels.Solutions.Solution
) -> Int64

Return the dimension of the variable.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • Dimension: The variable dimension.

See also: CTModels.Components.variable, CTModels.Models.variable_components.

CTModels.Models.variable_name Function
julia
variable_name(ocp::CTModels.Models.Model) -> String

Return the name of the variable.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • String: The variable name.

See also: CTModels.Components.variable, CTModels.Models.variable_components, CTModels.Models.variable_dimension.

julia
variable_name(sol::CTModels.Solutions.Solution) -> String

Return the name of the variable.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • String: The variable name.

See also: CTModels.Models.variable_components, CTModels.Models.variable_dimension.

CTModels.Models.variable_components Function
julia
variable_components(
    ocp::CTModels.Models.Model
) -> Vector{String}

Return the names of the components of the variable.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Vector{String}: The variable component names.

See also: CTModels.Components.variable, CTModels.Models.variable_name, CTModels.Models.variable_dimension.

julia
variable_components(
    sol::CTModels.Solutions.Solution
) -> Vector{String}

Return the names of the components of the variable.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • Vector{String}: The variable component names.

See also: CTModels.Models.variable_dimension, CTModels.Models.variable_name.

CTModels.Components.components Function
julia
components(
    model::CTModels.Components.StateModel
) -> Vector{String}

Get the component names of the state from the state model.

Returns

  • Vector{String}: The state component names.

See also: CTModels.Components.name, CTModels.Components.dimension.

julia
components(
    model::CTModels.Components.StateModelSolution
) -> Vector{String}

Get the component names of the state from the state model solution.

Returns

  • Vector{String}: The state component names.

See also: CTModels.Components.name, CTModels.Components.dimension, CTModels.Components.value.

julia
components(
    model::CTModels.Components.ControlModel
) -> Vector{String}

Get the names of the control components.

Returns

  • Vector{String}: The control component names.

See also: CTModels.Components.name, CTModels.Components.dimension.

julia
components(
    model::CTModels.Components.ControlModelSolution
) -> Vector{String}

Get the names of the control components from the solution.

Returns

  • Vector{String}: The control component names.

See also: CTModels.Components.name, CTModels.Components.dimension, CTModels.Components.value, CTModels.Components.interpolation.

julia
components(
    _::CTModels.Components.EmptyControlModel
) -> Vector{String}

Return an empty vector since there are no control components defined.

Returns

  • Vector{String}: An empty vector.
julia
components(
    model::CTModels.Components.VariableModel
) -> Vector{String}

Return the names of the components of the variable.

Returns

  • Vector{String}: The variable component names.

See also: CTModels.Components.name, CTModels.Components.dimension.

julia
components(
    model::CTModels.Components.VariableModelSolution
) -> Vector{String}

Return the names of the components from the variable solution.

Returns

  • Vector{String}: The variable component names.

See also: CTModels.Components.name, CTModels.Components.dimension, CTModels.Components.value.

julia
components(
    _::CTModels.Components.EmptyVariableModel
) -> Vector{String}

Return an empty vector since there are no variable components defined.

Returns

  • Vector{String}: An empty vector.
CTModels.Components.dimension Function
julia
dimension(model::CTModels.Components.StateModel) -> Int64

Get the dimension of the state from the state model.

Returns

  • Dimension: The state dimension (number of components).

See also: CTModels.Components.name, CTModels.Components.components.

julia
dimension(
    model::CTModels.Components.StateModelSolution
) -> Int64

Get the dimension of the state from the state model solution.

Returns

  • Dimension: The state dimension (number of components).

See also: CTModels.Components.name, CTModels.Components.components, CTModels.Components.value.

julia
dimension(model::CTModels.Components.ControlModel) -> Int64

Get the control input dimension.

Returns

  • Dimension: The control dimension (number of components).

See also: CTModels.Components.name, CTModels.Components.components.

julia
dimension(
    model::CTModels.Components.ControlModelSolution
) -> Int64

Get the control input dimension from the solution.

Returns

  • Dimension: The control dimension (number of components).

See also: CTModels.Components.name, CTModels.Components.components, CTModels.Components.value, CTModels.Components.interpolation.

julia
dimension(_::CTModels.Components.EmptyControlModel) -> Int64

Return 0 since no control is defined.

Returns

  • Dimension: Zero.
julia
dimension(model::CTModels.Components.VariableModel) -> Int64

Return the dimension (number of components) of the variable.

Returns

  • Dimension: The variable dimension.

See also: CTModels.Components.name, CTModels.Components.components.

julia
dimension(
    model::CTModels.Components.VariableModelSolution
) -> Int64

Return the number of components in the variable solution.

Returns

  • Dimension: The variable dimension.

See also: CTModels.Components.name, CTModels.Components.components, CTModels.Components.value.

julia
dimension(
    _::CTModels.Components.EmptyVariableModel
) -> Int64

Return 0 since no variable is defined.

Returns

  • Dimension: Zero.
CTModels.Components.name Function
julia
name(model::CTModels.Components.StateModel) -> String

Get the name of the state from the state model.

Returns

  • String: The state name.

See also: CTModels.Components.components, CTModels.Components.dimension.

julia
name(
    model::CTModels.Components.StateModelSolution
) -> String

Get the name of the state from the state model solution.

Returns

  • String: The state name.

See also: CTModels.Components.components, CTModels.Components.dimension, CTModels.Components.value.

julia
name(model::CTModels.Components.ControlModel) -> String

Get the name of the control variable.

Returns

  • String: The control name.

See also: CTModels.Components.components, CTModels.Components.dimension.

julia
name(
    model::CTModels.Components.ControlModelSolution
) -> String

Get the name of the control variable from the solution.

Returns

  • String: The control name.

See also: CTModels.Components.components, CTModels.Components.dimension, CTModels.Components.value, CTModels.Components.interpolation.

julia
name(_::CTModels.Components.EmptyControlModel) -> String

Return an empty string, since no control is defined.

Returns

  • String: An empty string.
julia
name(model::CTModels.Components.VariableModel) -> String

Return the name of the variable stored in the model.

Returns

  • String: The variable name.

See also: CTModels.Components.components, CTModels.Components.dimension.

julia
name(
    model::CTModels.Components.VariableModelSolution
) -> String

Return the name of the variable stored in the model solution.

Returns

  • String: The variable name.

See also: CTModels.Components.components, CTModels.Components.dimension, CTModels.Components.value.

julia
name(_::CTModels.Components.EmptyVariableModel) -> String

Return an empty string, since no variable is defined.

Returns

  • String: An empty string.
julia
name(model::CTModels.Components.FixedTimeModel) -> String

Get the name of the time from the fixed time model.

Returns

  • String: The time name.

See also: CTModels.Components.initial_time.

julia
name(model::CTModels.Components.FreeTimeModel) -> String

Get the name of the time from the free time model.

Returns

  • String: The time name.

See also: CTModels.Components.index, CTModels.Components.initial_time.

CTModels.Components.index Function
julia
index(model::CTModels.Components.FreeTimeModel) -> Int64

Get the index of the time variable from the free time model.

Returns

  • Int: The index into the optimisation variable.

See also: CTModels.Components.name, CTModels.Components.initial_time.

CTModels.Components.expression Function
julia
expression(_::CTModels.Components.EmptyDefinition) -> Expr

Return an empty block expression for an CTModels.Components.EmptyDefinition.

Returns

  • Expr: An empty block expression :(begin end).

See also: CTModels.Components.expression.

julia
expression(d::CTModels.Components.Definition) -> Expr

Return the symbolic expression wrapped by a CTModels.Components.Definition.

Returns

  • Expr: The symbolic expression defining the problem.

See also: CTModels.Components.expression.

julia
expression(ocp::CTModels.Models.Model) -> Expr

Return the symbolic expression of the model definition.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Expr: The symbolic expression of the model definition.

See also: CTModels.Models.definition.

CTModels.Components.criterion Function
julia
criterion(
    model::CTModels.Components.MayerObjectiveModel
) -> Symbol

Return the criterion (:min or :max).

Returns

  • Symbol: The optimisation criterion (:min or :max).

See also: CTModels.Components.mayer, CTModels.Components.has_mayer_cost.

julia
criterion(
    model::CTModels.Components.LagrangeObjectiveModel
) -> Symbol

Return the criterion (:min or :max).

Returns

  • Symbol: The optimisation criterion (:min or :max).

See also: CTModels.Components.lagrange, CTModels.Components.has_lagrange_cost.

julia
criterion(
    model::CTModels.Components.BolzaObjectiveModel
) -> Symbol

Return the criterion (:min or :max).

Returns

  • Symbol: The optimisation criterion (:min or :max).

See also: CTModels.Components.mayer, CTModels.Components.lagrange, CTModels.Components.has_mayer_cost.

julia
criterion(ocp::CTModels.Models.Model) -> Symbol

Return the type of criterion (:min or :max).

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Symbol: The criterion type (:min or :max).

See also: CTModels.Components.objective, CTModels.Components.mayer, CTModels.Components.lagrange.

CTModels.Components.initial_time Function
julia
initial_time(
    model::CTModels.Components.TimesModel{<:CTModels.Components.FixedTimeModel{T<:Real}}
) -> Any

Get the initial time from the times model, from a fixed initial time model.

Returns

  • T: The fixed initial time value.

See also: CTModels.Components.final_time, CTModels.Components.has_fixed_initial_time.

julia
initial_time(
    model::CTModels.Components.TimesModel{CTModels.Components.FreeTimeModel},
    variable::AbstractArray{T<:Real, 1}
) -> Any

Get the initial time from the times model, from a free initial time model.

Arguments

  • model::TimesModel{FreeTimeModel,<:AbstractTimeModel}: The times model with free initial time.

  • variable::AbstractVector{T}: The optimisation variable vector.

Returns

  • T: The initial time value from the variable.

See also: CTModels.Components.final_time, CTModels.Components.has_free_initial_time.

julia
initial_time(_::CTModels.Models.AbstractModel) -> Any

Throw an error for unsupported initial time access.

julia
initial_time(
    _::CTModels.Models.AbstractModel,
    _::AbstractVector
) -> Any

Throw an error for unsupported initial time access with variable.

julia
initial_time(
    ocp::CTModels.Models.Model{<:CTBase.Traits.TimeDependence, <:CTModels.Components.TimesModel{CTModels.Components.FixedTimeModel{T<:Real}}}
) -> Any

Return the initial time, for a fixed initial time.

Arguments

  • ocp::Model: The optimal control problem with fixed initial time.

Returns

  • T: The initial time value.

See also: CTModels.Components.final_time, CTModels.Components.has_fixed_initial_time.

julia
initial_time(
    ocp::CTModels.Models.Model{<:CTBase.Traits.TimeDependence, <:CTModels.Components.TimesModel{CTModels.Components.FreeTimeModel}},
    variable::AbstractArray{T<:Real, 1}
) -> Any

Return the initial time, for a free initial time.

Arguments

  • ocp::Model: The optimal control problem with free initial time.

  • variable::AbstractVector{T}: The variable vector.

Returns

  • T: The initial time value.

See also: CTModels.Components.final_time, CTModels.Components.has_free_initial_time.

julia
initial_time(
    ocp::CTModels.Models.Model{<:CTBase.Traits.TimeDependence, <:CTModels.Components.TimesModel{CTModels.Components.FreeTimeModel}},
    variable::Real
) -> Real

Return the initial time, for a free initial time (scalar variable).

Arguments

  • ocp::Model: The optimal control problem with free initial time.

  • variable::T: The variable scalar.

Returns

  • T: The initial time value.

See also: CTModels.Components.final_time, CTModels.Components.has_free_initial_time.

julia
initial_time(sol::CTModels.Solutions.Solution) -> Real

Return the initial time of the solution.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • Real: The initial time.

See also: CTModels.Components.final_time, CTModels.Components.initial_time_name.

CTModels.Components.final_time Function
julia
final_time(
    model::CTModels.Components.TimesModel{<:CTModels.Components.AbstractTimeModel, <:CTModels.Components.FixedTimeModel{T<:Real}}
) -> Any

Get the final time from the times model, from a fixed final time model.

Returns

  • T: The fixed final time value.

See also: CTModels.Components.initial_time, CTModels.Components.has_fixed_final_time.

julia
final_time(
    model::CTModels.Components.TimesModel{<:CTModels.Components.AbstractTimeModel, CTModels.Components.FreeTimeModel},
    variable::AbstractArray{T<:Real, 1}
) -> Any

Get the final time from the times model, from a free final time model.

Arguments

  • model::TimesModel{<:AbstractTimeModel,FreeTimeModel}: The times model with free final time.

  • variable::AbstractVector{T}: The optimisation variable vector.

Returns

  • T: The final time value from the variable.

See also: CTModels.Components.initial_time, CTModels.Components.has_free_final_time.

julia
final_time(_::CTModels.Models.AbstractModel) -> Any

Throw an error for unsupported final time access.

julia
final_time(
    _::CTModels.Models.AbstractModel,
    _::AbstractVector
) -> Any

Throw an error for unsupported final time access with variable.

julia
final_time(
    ocp::CTModels.Models.Model{<:CTBase.Traits.TimeDependence, <:CTModels.Components.TimesModel{<:CTModels.Components.AbstractTimeModel, CTModels.Components.FixedTimeModel{T<:Real}}}
) -> Any

Return the final time, for a fixed final time.

Arguments

  • ocp::Model: The optimal control problem with fixed final time.

Returns

  • T: The final time value.

See also: CTModels.Components.initial_time, CTModels.Components.has_fixed_final_time.

julia
final_time(
    ocp::CTModels.Models.Model{<:CTBase.Traits.TimeDependence, <:CTModels.Components.TimesModel{<:CTModels.Components.AbstractTimeModel, CTModels.Components.FreeTimeModel}},
    variable::AbstractArray{T<:Real, 1}
) -> Any

Return the final time, for a free final time.

Arguments

  • ocp::Model: The optimal control problem with free final time.

  • variable::AbstractVector{T}: The variable vector.

Returns

  • T: The final time value.

See also: CTModels.Components.initial_time, CTModels.Components.has_free_final_time.

julia
final_time(
    ocp::CTModels.Models.Model{<:CTBase.Traits.TimeDependence, <:CTModels.Components.TimesModel{<:CTModels.Components.AbstractTimeModel, CTModels.Components.FreeTimeModel}},
    variable::Real
) -> Real

Return the final time, for a free final time (scalar variable).

Arguments

  • ocp::Model: The optimal control problem with free final time.

  • variable::T: The variable scalar.

Returns

  • T: The final time value.

See also: CTModels.Components.initial_time, CTModels.Components.has_free_final_time.

julia
final_time(sol::CTModels.Solutions.Solution) -> Real

Return the final time of the solution.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • Real: The final time.

See also: CTModels.Components.initial_time, CTModels.Components.final_time_name.

CTModels.Components.times Function

Return the CTModels.Components.AbstractTimesModel from a CTModels.Models.Model.

See also: CTModels.Components.initial_time, CTModels.Components.final_time.

CTModels.Components.time_name Function
julia
time_name(model::CTModels.Components.TimesModel) -> String

Get the name of the time variable from the times model.

Returns

  • String: The time variable name.

See also: CTModels.Components.initial_time_name, CTModels.Components.final_time_name.

julia
time_name(ocp::CTModels.Models.Model) -> String

Return the name of the time.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • String: The time name.

See also: CTModels.Components.times, CTModels.Components.initial_time, CTModels.Components.final_time.

julia
time_name(sol::CTModels.Solutions.Solution) -> String

Return the name of the time component.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • String: The time component name.

See also: CTModels.Components.initial_time_name, CTModels.Components.final_time_name.

CTModels.Components.initial_time_name Function
julia
initial_time_name(
    model::CTModels.Components.TimesModel
) -> String

Get the name of the initial time from the times model.

Returns

  • String: The initial time name.

See also: CTModels.Components.time_name, CTModels.Components.final_time_name.

julia
initial_time_name(ocp::CTModels.Models.Model) -> String

Return the name of the initial time.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • String: The initial time name.

See also: CTModels.Components.times, CTModels.Components.initial_time, CTModels.Components.final_time.

julia
initial_time_name(
    sol::CTModels.Solutions.Solution
) -> String

Return the name of the initial time.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • String: The initial time name.

See also: CTModels.Components.final_time_name, CTModels.Components.time_name.

CTModels.Components.final_time_name Function
julia
final_time_name(
    model::CTModels.Components.TimesModel
) -> String

Get the name of the final time from the times model.

Returns

  • String: The final time name.

See also: CTModels.Components.time_name, CTModels.Components.initial_time_name.

julia
final_time_name(ocp::CTModels.Models.Model) -> String

Return the name of the final time.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • String: The final time name.

See also: CTModels.Components.times, CTModels.Components.initial_time, CTModels.Components.final_time.

julia
final_time_name(sol::CTModels.Solutions.Solution) -> String

Return the name of the final time.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • String: The final time name.

See also: CTModels.Components.initial_time_name, CTModels.Components.time_name.

CTModels.Components.has_fixed_initial_time Function
julia
has_fixed_initial_time(
    _::CTModels.Components.TimesModel{<:CTModels.Components.FixedTimeModel{T<:Real}}
) -> Bool

Check if the initial time is fixed. Return true.

Returns

  • Bool: true if the initial time is fixed.

See also: CTModels.Components.has_free_initial_time, CTModels.Components.initial_time.

julia
has_fixed_initial_time(
    _::CTModels.Components.TimesModel{CTModels.Components.FreeTimeModel}
) -> Bool

Check if the initial time is free. Return false.

Returns

  • Bool: false (initial time is not fixed).

See also: CTModels.Components.has_free_initial_time, CTModels.Components.initial_time.

julia
has_fixed_initial_time(ocp::CTModels.Models.Model) -> Bool

Check if the initial time is fixed.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Bool: true if the initial time is fixed, false otherwise.

See also: CTModels.Components.has_free_initial_time, CTModels.Components.initial_time.

julia
has_fixed_initial_time(
    sol::CTModels.Solutions.Solution
) -> Bool

Check if the initial time is fixed.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • Bool: true if the initial time is fixed, false otherwise.

See also: CTModels.Components.has_free_initial_time, CTModels.Components.initial_time.

CTModels.Components.has_free_initial_time Function
julia
has_free_initial_time(
    times::CTModels.Components.TimesModel
) -> Bool

Check if the initial time is free.

Returns

  • Bool: true if the initial time is free.

See also: CTModels.Components.has_fixed_initial_time, CTModels.Components.initial_time.

julia
has_free_initial_time(ocp::CTModels.Models.Model) -> Bool

Check if the initial time is free.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Bool: true if the initial time is free, false otherwise.

See also: CTModels.Components.has_fixed_initial_time, CTModels.Components.initial_time.

julia
has_free_initial_time(
    sol::CTModels.Solutions.Solution
) -> Bool

Check if the initial time is free.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • Bool: true if the initial time is free, false otherwise.

See also: CTModels.Components.has_fixed_initial_time, CTModels.Components.initial_time.

CTModels.Components.has_fixed_final_time Function
julia
has_fixed_final_time(
    _::CTModels.Components.TimesModel{<:CTModels.Components.AbstractTimeModel, <:CTModels.Components.FixedTimeModel{T<:Real}}
) -> Bool

Check if the final time is fixed. Return true.

Returns

  • Bool: true if the final time is fixed.

See also: CTModels.Components.has_free_final_time, CTModels.Components.final_time.

julia
has_fixed_final_time(
    _::CTModels.Components.TimesModel{<:CTModels.Components.AbstractTimeModel, CTModels.Components.FreeTimeModel}
) -> Bool

Check if the final time is free. Return false.

Returns

  • Bool: false (final time is not fixed).

See also: CTModels.Components.has_free_final_time, CTModels.Components.final_time.

julia
has_fixed_final_time(ocp::CTModels.Models.Model) -> Bool

Check if the final time is fixed.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Bool: true if the final time is fixed, false otherwise.

See also: CTModels.Components.has_free_final_time, CTModels.Components.final_time.

julia
has_fixed_final_time(
    sol::CTModels.Solutions.Solution
) -> Bool

Check if the final time is fixed.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • Bool: true if the final time is fixed, false otherwise.

See also: CTModels.Components.has_free_final_time, CTModels.Components.final_time.

CTModels.Components.has_free_final_time Function
julia
has_free_final_time(
    times::CTModels.Components.TimesModel
) -> Bool

Check if the final time is free.

Returns

  • Bool: true if the final time is free.

See also: CTModels.Components.has_fixed_final_time, CTModels.Components.final_time.

julia
has_free_final_time(ocp::CTModels.Models.Model) -> Bool

Check if the final time is free.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Bool: true if the final time is free, false otherwise.

See also: CTModels.Components.has_fixed_final_time, CTModels.Components.final_time.

julia
has_free_final_time(
    sol::CTModels.Solutions.Solution
) -> Bool

Check if the final time is free.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • Bool: true if the final time is free, false otherwise.

See also: CTModels.Components.has_fixed_final_time, CTModels.Components.final_time.

CTModels.Components.is_initial_time_fixed Function

Alias for has_fixed_initial_time.

See also: CTModels.Components.has_fixed_initial_time.

CTModels.Components.is_initial_time_free Function

Alias for has_free_initial_time.

See also: CTModels.Components.has_free_initial_time.

CTModels.Components.is_final_time_fixed Function

Alias for has_fixed_final_time.

See also: CTModels.Components.has_fixed_final_time.

CTModels.Components.is_final_time_free Function

Alias for has_free_final_time.

See also: CTModels.Components.has_free_final_time.

CTModels.Models.dynamics Function
julia
dynamics(
    ocp::CTModels.Models.Model{<:CTBase.Traits.TimeDependence, <:CTModels.Components.AbstractTimesModel, <:CTModels.Components.AbstractStateModel, <:CTModels.Components.AbstractControlModel, <:CTModels.Components.AbstractVariableModel, D<:Function}
) -> Function

Return the dynamics.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • D: The dynamics function.

See also: CTModels.Components.state, CTModels.Components.control.

CTModels.Components.mayer Function
julia
mayer(
    model::CTModels.Components.MayerObjectiveModel{M<:Function}
) -> Function

Return the Mayer function.

Returns

  • M: The Mayer cost function (x0, xf, v) -> g(x0, xf, v).

See also: CTModels.Components.criterion, CTModels.Components.has_mayer_cost.

julia
mayer(
    model::CTModels.Components.BolzaObjectiveModel{M<:Function}
) -> Function

Return the Mayer function.

Returns

  • M: The Mayer cost function.

See also: CTModels.Components.criterion, CTModels.Components.lagrange, CTModels.Components.has_mayer_cost.

julia
mayer(_::CTModels.Models.AbstractModel) -> Any

Throw an error when accessing Mayer cost on a model without one.

julia
mayer(
    ocp::CTModels.Models.Model{<:CTBase.Traits.TimeDependence, <:CTModels.Components.AbstractTimesModel, <:CTModels.Components.AbstractStateModel, <:CTModels.Components.AbstractControlModel, <:CTModels.Components.AbstractVariableModel, <:Function, <:CTModels.Components.MayerObjectiveModel{M<:Function}}
) -> Any

Return the Mayer cost.

Arguments

  • ocp::Model: The optimal control problem with Mayer objective.

Returns

  • M: The Mayer cost function.

See also: CTModels.Components.objective, CTModels.Components.lagrange, CTModels.Components.has_mayer_cost.

julia
mayer(
    ocp::CTModels.Models.Model{<:CTBase.Traits.TimeDependence, <:CTModels.Components.AbstractTimesModel, <:CTModels.Components.AbstractStateModel, <:CTModels.Components.AbstractControlModel, <:CTModels.Components.AbstractVariableModel, <:Function, <:CTModels.Components.BolzaObjectiveModel{M<:Function}}
) -> Any

Return the Mayer cost.

Arguments

  • ocp::Model: The optimal control problem with Bolza objective (Mayer + Lagrange).

Returns

  • M: The Mayer cost function.

See also: CTModels.Components.objective, CTModels.Components.lagrange, CTModels.Components.has_mayer_cost.

CTModels.Components.lagrange Function
julia
lagrange(
    model::CTModels.Components.LagrangeObjectiveModel{L<:Function}
) -> Function

Return the Lagrange function.

Returns

  • L: The Lagrange integrand (t, x, u, v) -> f⁰(t, x, u, v).

See also: CTModels.Components.criterion, CTModels.Components.has_lagrange_cost.

julia
lagrange(
    model::CTModels.Components.BolzaObjectiveModel{<:Function, L<:Function}
) -> Function

Return the Lagrange function.

Returns

  • L: The Lagrange integrand.

See also: CTModels.Components.criterion, CTModels.Components.mayer, CTModels.Components.has_lagrange_cost.

julia
lagrange(_::CTModels.Models.AbstractModel) -> Function

Throw an error when accessing Lagrange cost on a model without one.

julia
lagrange(
    ocp::CTModels.Models.Model{<:CTBase.Traits.TimeDependence, <:CTModels.Components.AbstractTimesModel, <:CTModels.Components.AbstractStateModel, <:CTModels.Components.AbstractControlModel, <:CTModels.Components.AbstractVariableModel, <:Function, CTModels.Components.LagrangeObjectiveModel{L<:Function}}
) -> Function

Return the Lagrange cost.

Arguments

  • ocp::Model: The optimal control problem with Lagrange objective.

Returns

  • L: The Lagrange cost function.

See also: CTModels.Components.objective, CTModels.Components.mayer, CTModels.Components.has_lagrange_cost.

julia
lagrange(
    ocp::CTModels.Models.Model{<:CTBase.Traits.TimeDependence, <:CTModels.Components.AbstractTimesModel, <:CTModels.Components.AbstractStateModel, <:CTModels.Components.AbstractControlModel, <:CTModels.Components.AbstractVariableModel, <:Function, <:CTModels.Components.BolzaObjectiveModel{<:Function, L<:Function}}
) -> Any

Return the Lagrange cost.

Arguments

  • ocp::Model: The optimal control problem with Bolza objective (Mayer + Lagrange).

Returns

  • L: The Lagrange cost function.

See also: CTModels.Components.objective, CTModels.Components.mayer, CTModels.Components.has_lagrange_cost.

CTModels.Components.has_mayer_cost Function
julia
has_mayer_cost(
    _::CTModels.Components.MayerObjectiveModel
) -> Bool

Return true.

Returns

  • Bool: true (Mayer cost is defined).

See also: CTModels.Components.has_lagrange_cost, CTModels.Components.mayer.

julia
has_mayer_cost(
    _::CTModels.Components.LagrangeObjectiveModel
) -> Bool

Return false.

Returns

  • Bool: false (Mayer cost is not defined).

See also: CTModels.Components.has_lagrange_cost, CTModels.Components.mayer.

julia
has_mayer_cost(
    _::CTModels.Components.BolzaObjectiveModel
) -> Bool

Return true.

Returns

  • Bool: true (Mayer cost is defined).

See also: CTModels.Components.has_lagrange_cost, CTModels.Components.mayer.

julia
has_mayer_cost(ocp::CTModels.Models.Model) -> Bool

Check if the model has a Mayer cost.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Bool: true if the model has a Mayer cost, false otherwise.

See also: CTModels.Components.mayer, CTModels.Components.has_lagrange_cost.

CTModels.Components.has_lagrange_cost Function
julia
has_lagrange_cost(
    _::CTModels.Components.MayerObjectiveModel
) -> Bool

Return false.

Returns

  • Bool: false (Lagrange cost is not defined).

See also: CTModels.Components.has_mayer_cost, CTModels.Components.lagrange.

julia
has_lagrange_cost(
    _::CTModels.Components.LagrangeObjectiveModel
) -> Bool

Return true.

Returns

  • Bool: true (Lagrange cost is defined).

See also: CTModels.Components.has_mayer_cost, CTModels.Components.lagrange.

julia
has_lagrange_cost(
    _::CTModels.Components.BolzaObjectiveModel
) -> Bool

Return true.

Returns

  • Bool: true (Lagrange cost is defined).

See also: CTModels.Components.has_mayer_cost, CTModels.Components.lagrange.

julia
has_lagrange_cost(ocp::CTModels.Models.Model) -> Bool

Check if the model has a Lagrange cost.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Bool: true if the model has a Lagrange cost, false otherwise.

See also: CTModels.Components.lagrange, CTModels.Components.has_mayer_cost.

CTModels.Components.is_mayer_cost_defined Function

Alias for has_mayer_cost.

See also: CTModels.Components.has_mayer_cost.

CTModels.Components.is_lagrange_cost_defined Function

Alias for has_lagrange_cost.

See also: CTModels.Components.has_lagrange_cost.

CTModels.Models.constraint Function
julia
constraint(
    model::CTModels.Models.Model,
    label::Symbol
) -> Tuple{Symbol, Any, Any, Any}

Get a labelled constraint from the model. Returns a tuple of the form (type, f, lb, ub) where type is the type of the constraint, f is the function, lb is the lower bound and ub is the upper bound.

The function returns an exception if the label is not found in the model.

Arguments

  • model::Model: The optimal control problem.

  • label::Symbol: The constraint label.

Returns

  • Tuple: A tuple of the form (type, f, lb, ub).

See also: CTModels.Models.constraints, CTModels.Components.path_constraints_nl.

CTModels.Models.constraints Function
julia
constraints(
    ocp::CTModels.Models.Model{<:CTBase.Traits.TimeDependence, <:CTModels.Components.AbstractTimesModel, <:CTModels.Components.AbstractStateModel, <:CTModels.Components.AbstractControlModel, <:CTModels.Components.AbstractVariableModel, <:Function, <:CTModels.Components.AbstractObjectiveModel, C<:CTModels.Components.AbstractConstraintsModel}
) -> CTModels.Components.AbstractConstraintsModel

Return the constraints struct.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • C: The constraints model.

See also: CTModels.Models.isempty_constraints, CTModels.Models.constraint.

CTModels.Components.path_constraints_nl Function
julia
path_constraints_nl(
    model::CTModels.Components.ConstraintsModel{TP<:Tuple}
) -> Tuple

Get the nonlinear path constraints from the model.

Returns

  • TP: Tuple of nonlinear path constraints (lb, f!, ub, labels).

See also: CTModels.Components.boundary_constraints_nl, CTModels.Components.dim_path_constraints_nl.

julia
path_constraints_nl(ocp::CTModels.Models.Model) -> Tuple

Return the nonlinear path constraints.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Function: The nonlinear path constraints function.

See also: CTModels.Models.constraints, CTModels.Components.boundary_constraints_nl.

CTModels.Components.boundary_constraints_nl Function
julia
boundary_constraints_nl(
    model::CTModels.Components.ConstraintsModel{<:Tuple, TB<:Tuple}
) -> Tuple

Get the nonlinear boundary constraints from the model.

Returns

  • TB: Tuple of nonlinear boundary constraints (lb, f!, ub, labels).

See also: CTModels.Components.path_constraints_nl, CTModels.Components.dim_boundary_constraints_nl.

julia
boundary_constraints_nl(ocp::CTModels.Models.Model) -> Tuple

Return the nonlinear boundary constraints.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Function: The nonlinear boundary constraints function.

See also: CTModels.Models.constraints, CTModels.Components.path_constraints_nl.

CTModels.Components.state_constraints_box Function
julia
state_constraints_box(
    model::CTModels.Components.ConstraintsModel{<:Tuple, <:Tuple, TS<:Tuple}
) -> Tuple

Get the state box constraints from the model.

Returns

  • TS: Tuple of state box constraints (lb, ind, ub, labels, aliases).

See also: CTModels.Components.control_constraints_box, CTModels.Components.dim_state_constraints_box.

julia
state_constraints_box(ocp::CTModels.Models.Model) -> Tuple

Return the box constraints on state.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • BoxConstraints: The box constraints on state.

See also: CTModels.Models.constraints, CTModels.Components.control_constraints_box.

CTModels.Components.control_constraints_box Function
julia
control_constraints_box(
    model::CTModels.Components.ConstraintsModel{<:Tuple, <:Tuple, <:Tuple, TC<:Tuple}
) -> Tuple

Get the control box constraints from the model.

Returns

  • TC: Tuple of control box constraints (lb, ind, ub, labels, aliases).

See also: CTModels.Components.state_constraints_box, CTModels.Components.dim_control_constraints_box.

julia
control_constraints_box(ocp::CTModels.Models.Model) -> Tuple

Return the box constraints on control.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • BoxConstraints: The box constraints on control.

See also: CTModels.Models.constraints, CTModels.Components.state_constraints_box.

CTModels.Components.variable_constraints_box Function
julia
variable_constraints_box(
    model::CTModels.Components.ConstraintsModel{<:Tuple, <:Tuple, <:Tuple, <:Tuple, TV<:Tuple}
) -> Tuple

Get the variable box constraints from the model.

Returns

  • TV: Tuple of variable box constraints (lb, ind, ub, labels, aliases).

See also: CTModels.Components.state_constraints_box, CTModels.Components.dim_variable_constraints_box.

julia
variable_constraints_box(
    ocp::CTModels.Models.Model
) -> Tuple

Return the box constraints on variable.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • BoxConstraints: The box constraints on variable.

See also: CTModels.Models.constraints, CTModels.Components.state_constraints_box.

CTModels.Components.dim_path_constraints_nl Function
julia
dim_path_constraints_nl(
    model::CTModels.Components.ConstraintsModel
) -> Int64

Return the dimension of nonlinear path constraints.

Returns

  • Dimension: The number of nonlinear path constraints.

See also: CTModels.Components.path_constraints_nl, CTModels.Components.dim_boundary_constraints_nl.

julia
dim_path_constraints_nl(ocp::CTModels.Models.Model) -> Int64

Return the dimension of nonlinear path constraints.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Dimension: The dimension of nonlinear path constraints.

See also: CTModels.Components.path_constraints_nl, CTModels.Components.dim_boundary_constraints_nl.

julia
dim_path_constraints_nl(
    sol::CTModels.Solutions.Solution
) -> Int64

Return the dimension of the path constraints.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • Dimension: The path constraints dimension.

See also: CTModels.Components.path_constraints_nl, CTModels.Components.dim_boundary_constraints_nl.

CTModels.Components.dim_boundary_constraints_nl Function
julia
dim_boundary_constraints_nl(
    model::CTModels.Components.ConstraintsModel
) -> Int64

Return the dimension of nonlinear boundary constraints.

Returns

  • Dimension: The number of nonlinear boundary constraints.

See also: CTModels.Components.boundary_constraints_nl, CTModels.Components.dim_path_constraints_nl.

julia
dim_boundary_constraints_nl(
    ocp::CTModels.Models.Model
) -> Int64

Return the dimension of the boundary constraints.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Dimension: The dimension of boundary constraints.

See also: CTModels.Components.boundary_constraints_nl, CTModels.Components.dim_path_constraints_nl.

julia
dim_boundary_constraints_nl(
    sol::CTModels.Solutions.Solution
) -> Int64

Return the dimension of the boundary constraints.

Arguments

  • sol::Solution: The optimal control solution.

Returns

  • Dimension: The boundary constraints dimension.

See also: CTModels.Components.boundary_constraints_nl, CTModels.Components.dim_path_constraints_nl.

CTModels.Components.dim_state_constraints_box Function
julia
dim_state_constraints_box(
    model::CTModels.Components.ConstraintsModel
) -> Int64

Return the dimension of state box constraints.

Returns

  • Dimension: The number of state box constraints.

See also: CTModels.Components.state_constraints_box, CTModels.Components.dim_control_constraints_box.

julia
dim_state_constraints_box(
    ocp::CTModels.Models.Model
) -> Int64

Return the dimension of box constraints on state.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Dimension: The dimension of box constraints on state.

See also: CTModels.Components.state_constraints_box, CTModels.Components.dim_control_constraints_box.

CTModels.Components.dim_control_constraints_box Function
julia
dim_control_constraints_box(
    model::CTModels.Components.ConstraintsModel
) -> Int64

Return the dimension of control box constraints.

Returns

  • Dimension: The number of control box constraints.

See also: CTModels.Components.control_constraints_box, CTModels.Components.dim_state_constraints_box.

julia
dim_control_constraints_box(
    ocp::CTModels.Models.Model
) -> Int64

Return the dimension of box constraints on control.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Dimension: The dimension of box constraints on control.

See also: CTModels.Components.control_constraints_box, CTModels.Components.dim_state_constraints_box.

CTModels.Components.dim_variable_constraints_box Function
julia
dim_variable_constraints_box(
    model::CTModels.Components.ConstraintsModel
) -> Int64

Return the dimension of variable box constraints.

Returns

  • Dimension: The number of variable box constraints.

See also: CTModels.Components.variable_constraints_box, CTModels.Components.dim_state_constraints_box.

julia
dim_variable_constraints_box(
    ocp::CTModels.Models.Model
) -> Int64

Return the dimension of box constraints on variable.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Dimension: The dimension of box constraints on variable.

See also: CTModels.Components.variable_constraints_box, CTModels.Components.dim_state_constraints_box.

CTModels.Models.definition Function
julia
definition(
    ocp::CTModels.Models.Model{<:CTBase.Traits.TimeDependence, <:CTModels.Components.TimesModel, <:CTModels.Components.AbstractStateModel, <:CTModels.Components.AbstractControlModel, <:CTModels.Components.AbstractVariableModel, <:Function, <:CTModels.Components.AbstractObjectiveModel, <:CTModels.Components.AbstractConstraintsModel, D<:CTModels.Components.AbstractDefinition}
) -> CTModels.Components.AbstractDefinition

Return the model definition.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • D: The model definition.

See also: CTModels.Components.expression.

CTModels.Models.has_abstract_definition Function
julia
has_abstract_definition(ocp::CTModels.Models.Model) -> Bool

Check whether the problem has an abstract definition.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Bool: true if the problem has an abstract definition, false otherwise.

See also: CTModels.Models.is_abstractly_defined, CTModels.Models.definition.

CTModels.Models.is_abstractly_defined Function
julia
is_abstractly_defined(ocp::CTModels.Models.Model) -> Bool

Check whether the problem is abstractly defined.

Arguments

  • ocp::Model: The optimal control problem.

Returns

  • Bool: true if the problem is abstractly defined, false otherwise.

See also: CTModels.Models.has_abstract_definition.

CTBase.Traits.is_autonomous Function
julia
is_autonomous(obj) -> Bool

Return true if the object is autonomous (time-independent).

Checks that the object has the time-dependence trait, then returns true if time_dependence(obj) is Autonomous.

Arguments

  • obj::Any: The object to check.

Returns

  • Bool: true if the object is autonomous.

Throws

See also: CTBase.Traits.TimeDependence, CTBase.Traits.time_dependence.

CTBase.Traits.is_nonautonomous Function
julia
is_nonautonomous(obj) -> Bool

Return true if the object is non-autonomous (time-dependent).

Checks that the object has the time-dependence trait, then returns true if time_dependence(obj) is NonAutonomous.

Arguments

  • obj::Any: The object to check.

Returns

  • Bool: true if the object is non-autonomous.

Throws

See also: CTBase.Traits.TimeDependence, CTBase.Traits.time_dependence.

CTBase.Traits.is_variable Function
julia
is_variable(obj) -> Bool

Return true if the object depends on variable parameters.

Checks that the object has the variable-dependence trait, then returns true if variable_dependence(obj) is NonFixed.

Arguments

  • obj::Any: The object to check.

Returns

  • Bool: true if the object depends on variable parameters.

Throws

See also: CTBase.Traits.VariableDependence, CTBase.Traits.variable_dependence.

CTBase.Traits.is_nonvariable Function
julia
is_nonvariable(obj) -> Bool

Return true if the object does not depend on variable parameters.

Checks that the object has the variable-dependence trait, then returns true if variable_dependence(obj) is Fixed.

Arguments

  • obj::Any: The object to check.

Returns

  • Bool: true if the object does not depend on variable parameters.

Throws

See also: CTBase.Traits.VariableDependence, CTBase.Traits.variable_dependence.

CTBase.Traits.has_variable Function
julia
has_variable(obj) -> Bool

Return true if the object depends on variable parameters.

Checks that the object has the variable-dependence trait, then returns true if variable_dependence(obj) is NonFixed.

Arguments

  • obj::Any: The object to check.

Returns

  • Bool: true if the object depends on variable parameters.

Throws

See also: CTBase.Traits.is_variable, CTBase.Traits.VariableDependence.

CTBase.Traits.has_control Function
julia
has_control(obj) -> Bool

Return true if the object has a control input.

Checks that the object has the control-dependence trait, then returns true if control_dependence(obj) is WithControl.

Arguments

  • obj::Any: The object to check.

Returns

  • Bool: true if the object has a control input.

Throws

See also: CTBase.Traits.ControlDependence, CTBase.Traits.is_control_free.

CTBase.Traits.is_control_free Function
julia
is_control_free(obj) -> Bool

Return true if the object is control-free (has no control input).

Checks that the object has the control-dependence trait, then returns true if control_dependence(obj) is ControlFree.

Arguments

  • obj::Any: The object to check.

Returns

  • Bool: true if the object has no control input.

Throws

See also: CTBase.Traits.ControlDependence, CTBase.Traits.has_control.