Concatenation
Index
- CTFlowsODE.__concat_feedback_control
- CTFlowsODE.__concat_jumps
- CTFlowsODE.__concat_rhs
- CTFlowsODE.__concat_rhs
- CTFlowsODE.__concat_rhs
- CTFlowsODE.__concat_tstops
- CTFlowsODE.concatenate
- CTFlowsODE.concatenate
- CTFlowsODE.concatenate
- CTFlowsODE.concatenate
- Base.:*
- Base.:*
In the examples in the documentation below, the methods are not prefixed by the module name even if they are private.
julia> using CTFlows
julia> x = 1
julia> private_fun(x) # throw an errormust be replaced by
julia> using CTFlows
julia> x = 1
julia> CTFlows.private_fun(x)However, if the method is reexported by another package, then, there is no need of prefixing.
julia> module OptimalControl
           import CTFlows: private_fun
           export private_fun
       end
julia> using OptimalControl
julia> x = 1
julia> private_fun(x)Documentation
Base.:* — Method*(
    F::CTFlowsODE.AbstractFlow,
    g::Tuple{Real, Any, TF<:CTFlowsODE.AbstractFlow}
) -> Any
Shorthand for concatenate(F, g) when g is a tuple (t_switch, η_switch, G) including a jump.
Arguments
- F::AbstractFlow: The first flow.
- g::Tuple{ctNumber, Any, AbstractFlow}: Tuple with switching time, jump value, and second flow.
Returns
- A flow with a jump at t_switchand a switch fromFtoG.
Example
julia> F * (1.0, η, G)Base.:* — Method*(
    F::CTFlowsODE.AbstractFlow,
    g::Tuple{Real, TF<:CTFlowsODE.AbstractFlow}
) -> Any
Shorthand for concatenate(F, g) when g is a tuple (t_switch, G).
Arguments
- F::AbstractFlow: The first flow.
- g::Tuple{ctNumber, AbstractFlow}: Tuple containing the switching time and second flow.
Returns
- A new flow that switches from FtoGatt_switch.
Example
julia> F * (1.0, G)CTFlowsODE.__concat_feedback_control — Method__concat_feedback_control(
    F::CTFlowsODE.AbstractFlow,
    G::CTFlowsODE.AbstractFlow,
    t_switch::Real
) -> CTFlows.ControlLaw{CTFlowsODE.var"#_feedback_control#75"{F, G, t_switch}, CTFlows.NonAutonomous, CTFlows.NonFixed} where {F, G, t_switch}
Concatenate feedback control laws of two optimal control flows.
Arguments
- F,- G: OptimalControlFlow instances.
- t_switch::Time: Switching time.
Returns
- A ControlLawthat dispatches toForGdepending ont.
Example
julia> u = __concat_feedback_control(F, G, 2.0)
julia> u(1.5, x, u, v)  # from F
julia> u(2.5, x, u, v)  # from GCTFlowsODE.__concat_jumps — Function__concat_jumps(
    F::CTFlowsODE.AbstractFlow,
    G::CTFlowsODE.AbstractFlow
) -> Any
__concat_jumps(
    F::CTFlowsODE.AbstractFlow,
    G::CTFlowsODE.AbstractFlow,
    jump::Union{Nothing, Tuple{Real, Any}}
) -> Any
Concatenate the jumps of two flows, with optional extra jump at t_switch.
Arguments
- F,- G: Flows with jump events.
- jump: Optional tuple- (t_switch, η_switch)to insert.
Returns
- Combined list of jumps.
Example
julia> __concat_jumps(F, G)
julia> __concat_jumps(F, G, (1.0, η))CTFlowsODE.__concat_rhs — Method__concat_rhs(
    F::CTFlowsODE.ODEFlow,
    G::CTFlowsODE.ODEFlow,
    t_switch::Real
) -> CTFlowsODE.var"#73#74"{CTFlowsODE.ODEFlow, CTFlowsODE.ODEFlow, <:Real}
Concatenate ODE right-hand sides with a switch at t_switch.
Arguments
- F,- G: ODEFlow instances.
- t_switch::Time: Time at which to switch between flows.
Returns
- A function of the form (x, v, t) -> ....
Example
julia> rhs = __concat_rhs(F, G, 0.5)
julia> rhs(x, v, 0.4)  # F.rhs
julia> rhs(x, v, 0.6)  # G.rhsCTFlowsODE.__concat_rhs — Method__concat_rhs(
    F::CTFlowsODE.VectorFieldFlow,
    G::CTFlowsODE.VectorFieldFlow,
    t_switch::Real
) -> CTFlowsODE.var"#71#72"{CTFlowsODE.VectorFieldFlow, CTFlowsODE.VectorFieldFlow, <:Real}
Concatenate vector field right-hand sides with time-based switching.
Arguments
- F,- G: VectorFieldFlow instances.
- t_switch::Time: Switching time.
Returns
- A function of the form (x, v, t) -> ....
Example
julia> rhs = __concat_rhs(F, G, 2.0)
julia> rhs(x, v, 1.0)  # uses F.rhs
julia> rhs(x, v, 3.0)  # uses G.rhsCTFlowsODE.__concat_rhs — Method__concat_rhs(
    F::CTFlowsODE.AbstractFlow{D, U},
    G::CTFlowsODE.AbstractFlow{D, U},
    t_switch::Real
) -> CTFlowsODE.var"#73#74"{CTFlowsODE.ODEFlow, CTFlowsODE.ODEFlow, <:Real}
Concatenate the right-hand sides of two flows F and G, switching at time t_switch.
Arguments
- F,- G: Two flows of the same type.
- t_switch::Time: The switching time.
Returns
- A function rhs!that dispatches toF.rhs!beforet_switch, and toG.rhs!after.
Example
julia> rhs = __concat_rhs(F, G, 1.0)
julia> rhs!(du, u, p, 0.5)  # uses F.rhs!
julia> rhs!(du, u, p, 1.5)  # uses G.rhs!CTFlowsODE.__concat_tstops — Method__concat_tstops(
    F::CTFlowsODE.AbstractFlow,
    G::CTFlowsODE.AbstractFlow,
    t_switch::Real
) -> Any
Concatenate the tstops (discontinuity times) of two flows and add the switching time.
Arguments
- F,- G: Flows with- tstopsvectors.
- t_switch::Time: Switching time to include.
Returns
- A sorted vector of unique tstops.
Example
julia> __concat_tstops(F, G, 1.0)CTFlowsODE.concatenate — Methodconcatenate(
    F::CTFlowsODE.AbstractFlow,
    g::Tuple{Real, Any, TF<:CTFlowsODE.AbstractFlow}
) -> CTFlowsODE.OptimalControlFlow
Concatenate two AbstractFlows and insert a jump at the switching time.
Arguments
- F::AbstractFlow
- g::Tuple{ctNumber,Any,AbstractFlow}:- (t_switch, η_switch, G)
Returns
- A concatenated flow with the jump included.
Example
julia> F * (1.0, η, G)CTFlowsODE.concatenate — Methodconcatenate(
    F::CTFlowsODE.OptimalControlFlow,
    g::Tuple{Real, Any, TF<:CTFlowsODE.OptimalControlFlow}
) -> CTFlowsODE.OptimalControlFlow
Concatenate two OptimalControlFlows and a jump at switching time.
Arguments
- F::OptimalControlFlow
- g::Tuple{ctNumber,Any,OptimalControlFlow}
Returns
- A combined flow with jump and control law switching.
Example
julia> F * (1.0, η, G)CTFlowsODE.concatenate — Methodconcatenate(
    F::CTFlowsODE.AbstractFlow,
    g::Tuple{Real, TF<:CTFlowsODE.AbstractFlow}
) -> CTFlowsODE.OptimalControlFlow
Concatenate two AbstractFlow instances with a prescribed switching time.
Arguments
- F::AbstractFlow: First flow.
- g::Tuple{ctNumber,AbstractFlow}: Switching time and second flow.
Returns
- A new flow that transitions from FtoGatt_switch.
Example
julia> F * (1.0, G)CTFlowsODE.concatenate — Methodconcatenate(
    F::CTFlowsODE.OptimalControlFlow,
    g::Tuple{Real, TF<:CTFlowsODE.OptimalControlFlow}
) -> CTFlowsODE.OptimalControlFlow
Concatenate two OptimalControlFlows at a switching time.
Arguments
- F::OptimalControlFlow
- g::Tuple{ctNumber,OptimalControlFlow}
Returns
- A combined flow with switched dynamics and feedback control.
Example
julia> F * (1.0, G)