Private API

This page lists non-exported (internal) symbols of CTModels.


From CTModels

final

CTModels.finalFunction
final(
    model::CTModels.TimesModel{<:CTModels.AbstractTimeModel, TF<:CTModels.AbstractTimeModel}
) -> CTModels.AbstractTimeModel

Get the final time from the times model.

final_time_name

CTModels.final_time_nameFunction
final_time_name(model::CTModels.TimesModel) -> String

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

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

Return the name of the final time.

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

Return the name of the final time.

has_fixed_final_time

CTModels.has_fixed_final_timeFunction
has_fixed_final_time(
    times::CTModels.TimesModel{<:CTModels.AbstractTimeModel, <:CTModels.FixedTimeModel{T<:Real}}
) -> Bool

Check if the final time is fixed. Return true.

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

Check if the final time is free. Return false.

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

Check if the final time is fixed.

has_fixed_initial_time

CTModels.has_fixed_initial_timeFunction
has_fixed_initial_time(
    times::CTModels.TimesModel{<:CTModels.FixedTimeModel{T<:Real}}
) -> Bool

Check if the initial time is fixed. Return true.

has_fixed_initial_time(
    times::CTModels.TimesModel{CTModels.FreeTimeModel}
) -> Bool

Check if the initial time is free. Return false.

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

Check if the initial time is fixed.

has_free_final_time

CTModels.has_free_final_timeFunction
has_free_final_time(times::CTModels.TimesModel) -> Bool

Check if the final time is free.

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

Check if the final time is free.

has_free_initial_time

CTModels.has_free_initial_timeFunction
has_free_initial_time(times::CTModels.TimesModel) -> Bool

Check if the final time is free.

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

Check if the initial time is free.

index

CTModels.indexFunction
index(model::CTModels.FreeTimeModel) -> Int64

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

initial

CTModels.initialFunction
initial(
    model::CTModels.TimesModel{TI<:CTModels.AbstractTimeModel}
) -> CTModels.AbstractTimeModel

Get the initial time from the times model.

initial_time_name

CTModels.initial_time_nameFunction
initial_time_name(model::CTModels.TimesModel) -> String

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

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

Return the name of the initial time.

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

Return the name of the initial time.

time

CTModels.timeFunction
time(model::CTModels.FixedTimeModel{T<:Real}) -> Real

Get the time from the fixed time model.

time(
    model::CTModels.FreeTimeModel,
    variable::AbstractArray{T<:Real, 1}
) -> Any

Get the time from the free time model.

Exceptions

  • If the index of the time variable is not in [1, length(variable)], throw an error.

time!

CTModels.time!Function
time!(ocp::CTModels.PreModel; t0, tf, ind0, indf, time_name)

Set the initial and final times. We denote by t0 the initial time and tf the final time. The optimal control problem is denoted ocp. When a time is free, then, one must provide the corresponding index of the ocp variable.

Note

You must use time! only once to set either the initial or the final time, or both.

Examples

julia> time!(ocp, t0=0,   tf=1  ) # Fixed t0 and fixed tf
julia> time!(ocp, t0=0,   indf=2) # Fixed t0 and free  tf
julia> time!(ocp, ind0=2, tf=1  ) # Free  t0 and fixed tf
julia> time!(ocp, ind0=2, indf=3) # Free  t0 and free  tf

When you plot a solution of an optimal control problem, the name of the time variable appears. By default, the name is "t". Consider you want to set the name of the time variable to "s".

julia> time!(ocp, t0=0, tf=1, time_name="s") # time_name is a String
# or
julia> time!(ocp, t0=0, tf=1, time_name=:s ) # time_name is a Symbol  

time_name

CTModels.time_nameFunction
time_name(model::CTModels.TimesModel) -> String

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

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

Return the name of the time.

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

Return the name of the time component.