CTModels
Index
CTModels.CTModels
CTModels.AbstractTag
CTModels.ConstraintsDictType
CTModels.Dimension
CTModels.JLD2Tag
CTModels.JSON3Tag
CTModels.Time
CTModels.Times
CTModels.TimesDisc
CTModels.ctNumber
CTModels.ctVector
CTModels.export_ocp_solution
CTModels.import_ocp_solution
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.CTModels
— ModuleCTModels.TimesDisc
— TypeCTModels.AbstractTag
— Typeabstract type AbstractTag
Abstract type for export/import functions, used to choose between JSON or JLD extensions.
CTModels.ConstraintsDictType
— TypeType alias for a dictionnary of constraints. This is used to store constraints before building the model.
julia> const TimesDisc = Union{Times, StepRangeLen}
See also: ConstraintsModel
, PreModel
and Model
.
CTModels.Dimension
— TypeType 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.JLD2Tag
— Typestruct JLD2Tag <: CTModels.AbstractTag
JLD tag for export/import functions.
CTModels.JSON3Tag
— Typestruct JSON3Tag <: CTModels.AbstractTag
JSON tag for export/import functions.
CTModels.Time
— TypeCTModels.Times
— TypeCTModels.ctNumber
— TypeType alias for a real number.
julia> const ctNumber = Real
CTModels.ctVector
— TypeType alias for a vector of real numbers.
julia> const ctVector = AbstractVector{<:ctNumber}
See also: ctNumber
.
CTModels.export_ocp_solution
— Methodexport_ocp_solution(
sol::CTModels.AbstractSolution;
format,
filename
)
Export a solution in JLD or JSON formats. Redirect to one of the methods:
export_ocp_solution(JLD2Tag(), sol, filename=filename)
export_ocp_solution(JSON3Tag(), sol, filename=filename)
Examples
julia> using JSON3
julia> export_ocp_solution(sol; filename="solution", format=:JSON)
julia> using JLD2
julia> export_ocp_solution(sol; filename="solution", format=:JLD) # JLD is the default
CTModels.import_ocp_solution
— Methodimport_ocp_solution(
ocp::CTModels.AbstractModel;
format,
filename
) -> Any
Import a solution from a JLD or JSON file. Redirect to one of the methods:
import_ocp_solution(JLD2Tag(), ocp, filename=filename)
import_ocp_solution(JSON3Tag(), ocp, filename=filename)
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