Filtration.jl private functions
Index
Filtration.__AichoucheModelFiltration.__BenyahiaModelFiltration.__CoganModelFiltration.__bound_valueFiltration.__compute_phiFiltration.__get_mFiltration.classification_plotFiltration.dispersal_locus_2_continuation_methodFiltration.dispersal_locus_2_directFiltration.dispersal_locus_continuation_methodFiltration.dispersal_locus_directFiltration.fit_knownFiltration.fit_unknownFiltration.get_arrow_timeFiltration.get_yFiltration.real_solve_controlFiltration.real_solve_optimalFiltration.real_solve_singularFiltration.synthesis_plotFiltration.synthesis_plot
Documentation
Base.show — Method
show(io::IO, z::Control)
Print a Control
Base.show — Method
show(io::IO, z::Costate)
Print a Costate
Base.show — Method
show(io::IO, z::Extremal)
Print an Extremal
Base.show — Method
show(io::IO, model::Model)
Print a Model. It provide the print given by ModelingToolkit.jl for the associated ODE system.
Base.show — Method
show(io::IO, z::MultiModel)
Print a MultiModel
Base.show — Method
show(io::IO, z::MultiSynthesis)
Print a MultiSynthesis
Base.show — Method
show(io::IO, odelike::ODELike)
Print an ODELike
Base.show — Method
show(io::IO, z::Pareto)
Print a Pareto
Base.show — Method
show(io::IO, z::SimulationModel)
Print a SimulationModel
Base.show — Method
show(io::IO, z::Solution)
Print a Solution
Base.show — Method
show(io::IO, z::State)
Print a State
Base.show — Method
show(io::IO, z::Synthesis)
Print a Synthesis
Filtration.__AichoucheModel — Method
__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.__BenyahiaModel — Method
__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.__CoganModel — Method
__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_value — Method
__bound_value(bound::Real, t::Real) -> Real
Evaluate a bound (a constant, a ODESolution cut, or another ODELike) at a given $t$.
Filtration.__compute_phi — Method
__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_m — Method
__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_plot — Method
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 theODESolution) - kwargs... : keyword arguments for plot
Returns
- plt : the plot
Filtration.dispersal_locus_2_continuation_method — Method
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.
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_direct — Method
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.
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_method — Method
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.
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_direct — Method
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
ODELikesolution
Filtration.fit_known — Method
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_unknown — Method
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_time — Method
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
valueis expressed, either:xor:y
Return
- times : Vector of times
Filtration.get_y — Method
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_control — Method
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_optimal — Method
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.
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_singular — Method
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_plot — Method
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_plot — Method
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 theODESolution) - 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