Filtration.jl private functions

Index

Documentation

Base.showMethod
show(io::IO, z::Control)

Print a Control

Base.showMethod
show(io::IO, z::Costate)

Print a Costate

Base.showMethod
show(io::IO, z::Extremal)

Print an Extremal

Base.showMethod
show(io::IO, model::Model)

Print a Model. It provide the print given by ModelingToolkit.jl for the associated ODE system.

Base.showMethod
show(io::IO, z::MultiModel)

Print a MultiModel

Base.showMethod
show(io::IO, z::MultiSynthesis)

Print a MultiSynthesis

Base.showMethod
show(io::IO, odelike::ODELike)

Print an ODELike

Base.showMethod
show(io::IO, z::Pareto)

Print a Pareto

Base.showMethod
show(io::IO, z::SimulationModel)

Print a SimulationModel

Base.showMethod
show(io::IO, z::Solution)

Print a Solution

Base.showMethod
show(io::IO, z::State)

Print a State

Base.showMethod
show(io::IO, z::Synthesis)

Print a Synthesis

Filtration.__AichoucheModelMethod
__AichoucheModel(p::Vector{<:Real}; initial_guess) -> Model

Create the Aichouche model.

Arguments

  • p : Parameter vector for the Aichouche model.

Keyword Arguments (optional)

  • initial_guess : initial guess forwarded to the constructed Model.

Return

  • model : the constructed Model.
Filtration.__BenyahiaModelMethod
__BenyahiaModel(p::Vector{<:Real}; initial_guess) -> Model

Create the Benyahia model.

Arguments

  • p : Parameter vector for the Benyahia model.

Keyword Arguments (optional)

  • initial_guess : initial guess forwarded to the constructed Model.

Return

  • model : the constructed Model.
Filtration.__CoganModelMethod
__CoganModel(p::Vector{<:Real}; initial_guess) -> Model

Create the Cogan model.

Arguments

  • p : Parameter vector for the Cogan model.

Keyword Arguments (optional)

  • initial_guess : initial guess forwarded to the constructed Model.

Return

  • model : the constructed Model.
Filtration.__bound_valueMethod
__bound_value(bound::Real, t::Real) -> Real

Evaluate a bound (a constant, a ODESolution cut, or another ODELike) at a given $t$.

Filtration.__compute_phiMethod
__compute_phi(
    t::Real,
    extremal::Extremal,
    model::Model;
    p
) -> Real

Compute the value of the function $t \mapsto \phi(x(t), p(t))$ on a given time $t$ of an Extremal computed on a Model.

Arguments

  • t : a real time $t$
  • extremal : the Extremal
  • model : the Model

Keyword arguments (optional)

  • p : a vector of parameter for the model (default is the parametes of the model).

Return

  • phi : the value of $\phi(t)$.
Filtration.__get_mMethod
__get_m(
    synthesis1::Synthesis,
    synthesis2::Synthesis
) -> Real

Get the end of the DL2 curve of synthesis1, ie. the value of $x_1$ at which it meets synthesis2's cut₊ curve.

Arguments

  • synthesis1 : the below Synthesis
  • synthesis2 : the above Synthesis

Return

  • m : the value of $x_1$ at the junction
Filtration.classification_plotMethod
classification_plot(
    s::Synthesis;
    SL_nb_points,
    kwargs...
) -> Plots.Plot

Plot a Synthesis, in a classification of optimal control form

Arguments

  • s : a Synthesis

Keyword arguments (optional)

  • SLnbpoints : Number of points for the switching locus curve. Initialized to nothing (points of the ODESolution)
  • kwargs... : keyword arguments for plot

Returns

  • plt : the plot
Filtration.dispersal_locus_2_continuation_methodMethod
dispersal_locus_2_continuation_method(
    model::Model,
    xlim::Tuple{Real, Real},
    ylim::Tuple{Real, Real},
    DL::Union{ODELike, SciMLBase.ODESolution}
) -> SciMLBase.ODESolution

Compute the second dispersal locus by continuation method.

Warning

This function must be used only when a second dispersal locus happened, ie. when the end of the first dispersal locus is below ylim[2].

Arguments

  • model : a Model
  • xlim : the limits of state $x_2$
  • ylim : the limits of state $x_1$
  • DL : the first dispersal locus curve

Returns

  • DL2 : the second dispersal locus curve
Filtration.dispersal_locus_2_directMethod
dispersal_locus_2_direct(
    model::Model,
    xlim::Tuple{Real, Real},
    ylim::Tuple{Real, Real},
    DL::Union{ODELike, SciMLBase.ODESolution},
    cutSL::SciMLBase.ODESolution;
    n
) -> ODELike

Compute the second dispersal locus by direct method.

Warning

This function must be used only when a second dispersal locus happened, ie. when the end of the first dispersal locus is below ylim[2].

Arguments

  • model : a Model
  • xlim : the limits of state $x_2$
  • ylim : the limits of state $x_1$
  • DL : the first dispersal locus curve
  • cutSL : the cutSL curve

Returns

  • DL2 : the second dispersal locus curve
Filtration.dispersal_locus_continuation_methodMethod
dispersal_locus_continuation_method(
    model::Model,
    xlim::Tuple{Real, Real},
    ylim::Tuple{Real, Real},
    SL::SciMLBase.ODESolution,
    cut₋::SciMLBase.ODESolution
) -> SciMLBase.ODESolution

Compute the first dispersal locus by continuation method.

Warning

This function must be used only when a dispersal locus happened, ie. when the end of the switching curve is below ylim[2].

Arguments

  • model : a Model
  • xlim : the limits of state $x_2$
  • ylim : the limits of state $x_1$
  • SL : the switching locus curve
  • cut₋ : the cut₋ curve

Returns

  • DL : the dispersal locus curve
Filtration.dispersal_locus_directMethod

Compute the dispersal locus with a direct method.

Arguments

  • model : the Model
  • xlim : the limits of state $x_2$
  • ylim : the limits of state $x_1$
  • SL : the switching locus curve
  • cut₋ : the cut₋ curve

Returns

  • DL : the dispersal locus curve, as an ODELike solution
Filtration.fit_knownMethod
fit_known(
    model::Model,
    control::Control,
    time::Vector{<:Real},
    data_x0::Vector{<:Real},
    initial_p::Vector{<:Real},
    x0::Vector{<:Real};
    lb,
    ub,
    verbose
) -> Any

Fit the model parameters to the given data by minimizing the least square error between the simulated and observed data. The initial state is supposed to be known.

Arguments

  • model : a Model
  • control : a Control
  • time : vector of time points where data are observed
  • datax0 : vector of observed data for state ``x0``
  • initial_p : initial guess for the model parameters
  • x0 : initial state

Keyword Arguments

  • lb : lower bounds for the model parameters (default : zeros)
  • ub : upper bounds for the model parameters (default : Inf)
  • verbose : whether to print optimization details (default : false)
Filtration.fit_unknownMethod
fit_unknown(
    model::Model,
    control::Control,
    time::Vector{<:Real},
    data_x0::Vector{<:Real},
    initial_p::Vector{<:Real},
    x0::Vector{<:Real},
    get_m::Function,
    u::Real,
    slope::Real;
    lb,
    ub,
    verbose
) -> Any

Fit the model parameters to the given data by minimizing the least square error between the simulated and observed data. The initial state is supposed to be partially unknown, with one unknown state variable being fitted via a constraint on its derivative at initial time. See here for more information.

Arguments

  • model : a Model
  • control : a Control
  • time : vector of time points where data are observed
  • datax0 : vector of observed data for state ``x0``
  • initial_p : initial guess for the model parameters
  • x0 : initial state and initial guess for the unknown state variables
  • get_m : function to compute the unknown initial state variable from control and parameters
  • u : singular control applied before initial time
  • slope : slope of state $x_0$ before initial time

Keyword Arguments

  • lb : lower bounds for the model parameters (default : zeros)
  • ub : upper bounds for the model parameters (default : Inf)
  • verbose : whether to print optimization details (default : false)
Filtration.get_arrow_timeMethod
get_arrow_time(
    value::Vector{<:Real},
    sol::SciMLBase.ODESolution,
    axis::Symbol
) -> Vector{<:Real}

Compute the time $t$ for which sol(t) ∈ value, along the given axis.

Arguments

  • value : vector of coordinate values to locate on the trajectory
  • sol : state trajectory as an ODESolution
  • axis : the axis on which value is expressed, either :x or :y

Return

  • times : Vector of times
Filtration.get_yMethod

Get the y-coordinate of the ode at a given x-coordinate.

Arguments

  • x : the x-coordinate
  • ode : the ode solution

Returns

  • y : the y-coordinate
Filtration.real_solve_controlMethod
real_solve_control(
    model::Model,
    init_x₂::Real,
    end_x₂::Real,
    init_x₁::Real,
    N::Int64
) -> Solution

Provide the real solution, where the control is only composed by -1 and 1 values. In this method, the control is approximated by -1 and 1 with respect to the value of uₛ.

Arguments

  • model : a Model
  • init_x₂ : the initial state $x_2(t_0)$
  • end_x₂ : the final state $x_2(t_f)$
  • init_x₁ : the initial state $x_1(t_0)$
  • N : the number of subdivision of the singular arc

Return

  • real_sol : the Solution
Filtration.real_solve_optimalMethod
real_solve_optimal(
    model::Model,
    init_x₂::Real,
    end_x₂::Real,
    init_x₁::Real,
    N::Int64;
    verbose
) -> Solution

Provide the optimal real solution, where the control is only composed by -1 and 1 values. In this method, the global constraints non linear optimization problem is constructed and solved.

Warning

This method must be long when N become large.

Arguments

  • model : a Model
  • init_x₂ : the initial state $x_2(t_0)$
  • end_x₂ : the final state $x_2(t_f)$
  • init_x₁ : the initial state $x_1(t_0)$
  • N : the number of subdivision of the singular arc

Keyword arguments (optional)

  • verbose : if true, print the optimization process (default is false)

Return

  • real_sol : the Solution
Filtration.real_solve_singularMethod
real_solve_singular(
    model::Model,
    init_x₂::Real,
    end_x₂::Real,
    init_x₁::Real,
    N::Int64;
    verbose
) -> Solution

Provide a real solution, where the control is only composed by -1 and 1 values. In this method, the singular arc is subdivided into N intervals. On each subintervals, we ensure that the solution minimize the cost and satisfy that the begining and the end of the state $x\_1$ on each subintervals corresponds to the value of the singular arc $x\_s$.

Arguments

  • model : a Model
  • init_x₂ : the initial state $x_2(t_0)$
  • end_x₂ : the final state $x_2(t_f)$
  • init_x₁ : the initial state $x_1(t_0)$
  • N : the number of subdivision of the singular arc

Keyword arguments (optional)

  • verbose : if true, print the optimization process (default is false)

Return

  • real_sol : the Solution
Filtration.synthesis_plotMethod
synthesis_plot(
    multisynthesis::MultiSynthesis;
    label_curve,
    colors,
    kwargs...
) -> Plots.Plot

Plot a MultiSynthesis, in a feedback form.

Arguments

  • multisynthesis : a MultiSynthesis

Keyword arguments (optional)

  • label_curve : labels of the curves. Initialized to ["u₋", "u₊", "uₛ", "switching locus", "dispersal locus", "dispersal locus", "dispersal locus"].
  • colors : colors of the curves. Initialized to [:green, :gold, :gray, :gray30, :gray15].
  • kwargs... : keyword arguments for plot

Returns

  • plt : the plot
Filtration.synthesis_plotMethod
synthesis_plot(
    s::Synthesis;
    SL_nb_points,
    label_curve,
    colors,
    kwargs...
) -> Plots.Plot

Plot a Synthesis, in a feedback form.

Arguments

  • s : a Synthesis

Keyword arguments (optional)

  • SLnbpoints : Number of points for the switching locus curve. Initialized to nothing (points of the ODESolution)
  • labelcurve : labels of the curves ``[u-, u+, us, \text{switching locus}, \text{dispersal locus}, \text{dispersal locus}]$. Initialized to$["u₋", "u₊", "uₛ", "switching locus", "dispersal locus", "dispersal locus"]``.
  • colors : colors of the curves for $u_s$ and the switching locus. Initialized to [:green, :gold, :gray20, :gray20].
  • kwargs... : keyword arguments for plot

Returns

  • plt : the plot