CTModels

Index

Warning

In the examples in the documentation below, the methods are not prefixed by the module name even if they are private.

julia> using CTModels
julia> x = 1
julia> private_fun(x) # throw an error

must be replaced by

julia> using CTModels
julia> x = 1
julia> CTModels.private_fun(x)

However, if the method is reexported by another package, then, there is no need of prefixing.

julia> module OptimalControl
           import CTModels: private_fun
           export private_fun
       end
julia> using OptimalControl
julia> x = 1
julia> private_fun(x)

Documentation

CTModels.CTModelsModule

CTModels module.

Lists all the imported modules and packages:

  • Base
  • Core
  • DocStringExtensions
  • Interpolations
  • MLStyle
  • Parameters
  • PrettyTables

List of all the exported names:

CTModels.TimesDiscType

Type alias for a grid of times. This is used to define a discretization of time interval given to solvers.

julia> const TimesDisc = Union{Times, StepRangeLen}

See also: Time, Times.

CTModels.AbstractTagType
abstract type AbstractTag

Abstract type for export/import functions, used to choose between JSON or JLD extensions.

CTModels.DimensionType

Type alias for a dimension. This is used to define the dimension of the state space, the costate space, the control space, etc.

julia> const Dimension = Integer
CTModels.JLD2TagType
struct JLD2Tag <: CTModels.AbstractTag

JLD tag for export/import functions.

CTModels.JSON3TagType
struct JSON3Tag <: CTModels.AbstractTag

JSON tag for export/import functions.

CTModels.ctVectorType

Type alias for a vector of real numbers.

julia> const ctVector = AbstractVector{<:ctNumber}

See also: ctNumber.

CTModels.import_ocp_solutionMethod
import_ocp_solution(
    ocp::CTModels.AbstractModel;
    format,
    filename
) -> Any

Import a solution from a JLD or JSON file. Redirect to one of the methods:

Examples

julia> using JSON3
julia> sol = import_ocp_solution(ocp; filename="solution", format=:JSON)
julia> using JLD2
julia> sol = import_ocp_solution(ocp; filename="solution", format=:JLD)  # JLD is the default