CTModels
Index
CTModels.CTModelsCTModels.AbstractTagCTModels.ConstraintsDictTypeCTModels.DimensionCTModels.JLD2TagCTModels.JSON3TagCTModels.TimeCTModels.TimesCTModels.TimesDiscCTModels.ctNumberCTModels.ctVectorCTModels.export_ocp_solutionCTModels.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 errormust 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 AbstractTagAbstract type for export/import functions, used to choose between JSON or JLD extensions.
CTModels.ConstraintsDictType — TypeType alias for a dictionary 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 = IntegerCTModels.JLD2Tag — Typestruct JLD2Tag <: CTModels.AbstractTagJLD tag for export/import functions.
CTModels.JSON3Tag — Typestruct JSON3Tag <: CTModels.AbstractTagJSON tag for export/import functions.
CTModels.Time — TypeCTModels.Times — TypeCTModels.ctNumber — TypeType alias for a real number.
julia> const ctNumber = RealCTModels.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 defaultCTModels.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