Filtration.jl private functions

Index

Documentation

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.__compute_phiMethod
__compute_phi(t::Real, extremal::Extremal, model::Model; p)

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.classification_plotMethod
classification_plot(
    s::Synthesis;
    SL_nb_points,
    kwargs...
) -> Plots.Plot

Plot a Synthesis, in a classification of optimal control form

Arguments

  • synthesis : 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_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) ∈ y_value

Arguments

  • y_value : vector of y-axis value
  • sol : state trajectory as an ODESolution

Return

  • times : Vector of times
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

  • synthesis : a MultiSynthesis

Keyword arguments (optional)

  • 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 : label of curves. Initialized to ```["u₋, u₊, uₛ, switching locus, dispersallocus, dispersal_locus"]```.
  • kwargs... : keyword arguments for plot

Returns

  • plt : the plot