Filtration.jl API

For the developers, here are the private methods.

Index

Documentation

Filtration.FiltrationModule

Filtration module.

Lists all the imported modules and packages:

  • Base
  • DiffEqCallbacks
  • DocStringExtensions
  • ForwardDiff
  • Ipopt
  • LaTeXStrings
  • ModelingToolkit
  • NonlinearSolve
  • Optimization
  • OptimizationMOI
  • OptimizationOptimJL
  • OrdinaryDiffEq
  • Plots
  • Roots
  • StructuralIdentifiability

List of all the exported names:

Filtration.ControlType

Structure of a Control, composed by

  • control : a vector of functions
  • time : a vector of times
  • N : the number of intervals
  • m : size of the control
Filtration.ControlMethod

Callable method for the Control structure. This return the value of the control at time t.

Arguments

  • t : the time $t$

Return

  • u : the value of the control $u(t)$ at the time $t$
Filtration.CostateType

Structure for a Costate, composed by

  • z : state-costate as a vector of ODESolution
  • time : a vector of times
  • N : the number of intervals
  • n : size of the co-state, which is also the size of the state
Filtration.CostateMethod

Callable method for the Costate structure. This return the value of the costate at time t.

Arguments

  • t : the time $t$

Return

  • x : the value of the costate $\lambda(t)$ at the time $t \in [t_0, tf]$
Filtration.ExtremalType

Structure of an Extremal, composed by

  • state : a State
  • costate : a Costate
  • control : a Control
  • time : a vector of times
  • N : the number of intervals
Filtration.ModelType

Structure of a Model, composed by:

  • p : parameters of the model
  • criteria_type : either :min or :max
  • λ₀ : the constant of the Hamiltonian assiciated to the cost
  • F₊ : vector field with control u=+1
  • F₋ : vector field with control u=-1
  • F₀ : drift vector field
  • F₁ : control vector field
  • dF₊ : derivative of F₊
  • dF₋ : derivative of F₋
  • dF₀ : derivative of F₀
  • dF₁ : derivative of F₁
  • H₀ : Hamiltonian lift of F₀
  • H₁ : Hamiltonian lift of F₁
  • H₀₁ : Lie bracket of H₀ and H₁
  • H : Pseudo-Hamiltonian
  • dynamic! : function for the state dynamics
  • singular_dynamic! : function for the singular state dynamics
  • extremal_dynamic! : function for the extremal dynamics
  • singular_extremal_dynamic! : function for the singular extremal dynamics
  • λₛ_ : function to compute the singular costate
  • xₛ : singular state
  • λₛ : singular costate
  • uₛ : singular control
  • Δx₂ : value of the end of the singular arc
  • Δt : time of the end of the singular arc
  • n : dimension of the state space
  • m : dimension of the control space
Filtration.ModelMethod
Model(
    e⁺::Function,
    e⁻::Function,
    f⁺::Function,
    f⁻::Function,
    g⁺::Function,
    g⁻::Function,
    p::Vector{<:Real},
    criteria_type::Symbol;
    initial_guess,
    n,
    m
) -> Model

Constructor for Model.

Arguments

  • e⁺ : the function $e^+(x_1, p)$
  • e⁻ : the function $e^-(x_1, p)$
  • f⁺ : the function $f^+(x_1, p)$
  • f⁻ : the function $f^-(x_1, p)$
  • g⁺ : the function $g^+(x_1, p)$
  • g⁻ : the function $g^-(x_1, p)$
  • p : parameters of previous functions
  • criteria_type : the criteria type, either :min or :max

Keyword arguments (optional)

  • initial_guess : initial guess for the singular state $x_s$, initialized to 1.
  • n : dimension of the state space, initialized to 3.
  • m : dimension of the control space, initialized to 1.

Returns

  • model : the Model
Filtration.ModelMethod
Model(
    e₊::Function,
    e₋::Function,
    f⁺::Function,
    f⁻::Function,
    p::Vector{<:Real},
    criteria_type::Symbol;
    initial_guess,
    n,
    m
) -> Model

Constructor for a Model.

Note

This function is a wrapper of Model function, where the functions $g_1$ and $g_2$ are set to 1. This leads to $\dot x_2 = 1$ with $x_2(t_0) = 0$, ie. $x_2(t) = t$.

Arguments

  • e₊ : the function $e_^+(x_1, p)$
  • e₋ : the function $e_^-(x_1, p)$
  • f⁺ : the function $f_^+(x_1, p)$
  • f⁻ : the function $f_^-(x_1, p)$
  • p : parameters of previous functions
  • criteria_type : the criteria type, either :min or :max

Keyword arguments (optional)

  • initial_guess : initial guess for the singular state $x_s$, initialized to 1.
  • n : dimension of the state space, initialized to 2.
  • m : dimension of the control space, initialized to 1.
Filtration.MultiModelType

Structure of a MultiModel, composed by

  • models : a vector of Models, which corresponds to turnpike
  • __models : a vector of Models, which corresponds to anti-turnpike
  • xₛ : vector of singular state value, which corresponds to turnpike
  • __xₛ : vector of singular state value, which corresponds to anti-turnpike
  • N : number of models
  • __N : numbers of __models
Filtration.MultiModelMethod
MultiModel(
    e₁::Function,
    e₂::Function,
    f₁::Function,
    f₂::Function,
    g₁::Function,
    g₂::Function,
    p::Vector{<:Real},
    criteria_type::Symbol,
    initial_guesses::Vector{<:Real}
) -> MultiModel

Constructor for MultiModel

Arguments

  • e₁ : the function $e_1(x₁)$
  • e₂ : the function $e_2(x₁)$
  • f₁ : the function $f_1(x₁)$
  • f₂ : the function $f_2(x₁)$
  • g₁ : the function $g_1(x₁)$
  • g₂ : the function $g_2(x₁)$
  • p : parameters of previous functions
  • criteria_type : the criteria type, either :min or :max
  • initial_guesses : initial guesses for all singular states $x_s$

Returns

  • multimodel : the MultiModel
Filtration.MultiModelMethod
MultiModel(
    e₁::Function,
    e₂::Function,
    f₁::Function,
    f₂::Function,
    p::Vector{<:Real},
    criteria_type::Symbol,
    initial_guesses::Vector{<:Real}
) -> MultiModel

Constructor for a MultiModel.

Note

This function is a wrapper of MultiModel function, where the functions $g_1$ and $g_2$ are set to 1. This leads to $\dot x_2 = 1$ with $x_2(t_0) = 0$, ie. $x_2(t) = t$.

Arguments

  • e₁ : the function $e_1(x_1)$
  • e₂ : the function $e_2(x_1)$
  • f₁ : the function $f_1(x_1)$
  • f₂ : the function $f_2(x_1)$
  • p : parameters of previous functions
  • criteria_type : the criteria type, either :min or :max`
  • initial_guesses : initial guesses for all singular states $x_s$.

Keyword arguments (optional)

Returns

  • multimodel : the MultiModel
Filtration.MultiSynthesisType

Structure of a MultiSynthesis, composed by

  • synthesis : the vector of Synthesis
  • sep : a vector of ODESolution that connect synthesis
  • N : number of Synthesis
Filtration.MultiSynthesisMethod
MultiSynthesis(
    multimodel::MultiModel,
    xlim::Tuple{Real, Real},
    ylim::Tuple{Real, Real}
) -> MultiSynthesis

Constructor for MultiSynthesis

Arguments

  • multimodel : a MultiModel
  • xlim : limits of x-axis
  • ylim : limits of y-axis

Return

  • multisynthesis : a MultiSynthesis
Filtration.ODELikeType

Structure of a ODELike, composed by

  • u : a vector of controls
  • t : a vector of times
  • S : a function
  • lb : the lower bound used to bracket the root search when evaluating the curve, either a constant, a ODESolution (a cut) or another ODELike
  • ub : the upper bound used to bracket the root search when evaluating the curve, either a constant, a ODESolution (a cut) or another ODELike
Filtration.ParetoType

Structure representing a Pareto front for a given model, composed by ;

  • model : a Model
  • get_sol : function to get the optimal solution for a given λ
Filtration.ParetoMethod
Pareto(model::Model) -> Pareto

Constructor for Pareto

Arguments

  • model : a Model

Returns

  • pareto : the Pareto
Filtration.SimulationModelType

Structure of a SimulationModel, a lightweight model used only to simulate a Control on a control-affine system (no synthesis / optimality machinery), composed by:

  • p : parameters of the model
  • F₊ : vector field with control u=+1
  • F₋ : vector field with control u=-1
  • F₀ : drift vector field
  • F₁ : control vector field
  • dynamic : function for the state dynamics
  • dynamic! : in-place function for the state dynamics
  • n : dimension of the state space
  • m : dimension of the control space
Filtration.SimulationModelMethod
SimulationModel(
    p::Vector{<:Real},
    F₊::Function,
    F₋::Function,
    n::Int64,
    m::Int64
) -> SimulationModel

Build a SimulationModel from the two mode vector fields F₊ (u=+1) and F₋ (u=-1), deriving the drift F₀ and control F₁ vector fields.

Arguments

  • p : parameters of the model
  • F₊ : vector field with control u=+1
  • F₋ : vector field with control u=-1
  • n : dimension of the state space
  • m : dimension of the control space

Return

  • model : the SimulationModel
Filtration.SolutionType

Structure of a Solution, composed by

  • state : a State
  • control : a Control
  • time : a vector of times
  • N : the number of intervals
  • x0 : the initial state $x(t_0) = x_0$
Filtration.StateType

Structure of a State, composed by

  • state : a vector of ODESolution
  • time : a vector of times
  • N : the number of intervals
  • n : number of states
Filtration.StateMethod

Callable method for the State structure. This return the value of the state at time t.

Arguments

  • t : the time $t$

Return

  • x : the value of the state $x(t)$ at the time $t$
Filtration.SynthesisType

Structure of a optimal synthesis, composed by:

  • model : a Model
  • xlim : the limits of the x-axis
  • ylim : the limits of the y-axis
  • cut₋ : the cut₋ function
  • cut₊ : the cut₊ function
  • SL : the switching locus
  • DL : the dispersal locus with the switching locus
  • DL2 : the dispersal locus with the singular curve
Filtration.SynthesisMethod
Synthesis(
    model::Model,
    xlim::Tuple{Real, Real},
    ylim::Tuple{Real, Real}
) -> Synthesis

Constructor of a Synthesis.

Arguments

  • model : a Model
  • xlim : the limits of x-axis
  • ylim : the limits of y-axis

Returns

  • synthesis : the Synthesis
Filtration.__sepMethod
__sep(
    synthesis1::Synthesis,
    synthesis2::Synthesis,
    xmax::Real
) -> SciMLBase.ODESolution

Provide the separation curve of two synthesis by diffetial continuation method.

Arguments

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

Return

  • sol : the separation curve, as an ODESolution
Filtration.add_solution_to_synthesis!Method
add_solution_to_synthesis!(
    plt::Plots.Plot,
    solution::Solution;
    element,
    axis_arrow,
    arrow,
    color,
    nb_pts,
    label,
    kwargs...
) -> Plots.Plot

Add a Solution to a synthesis plot.

Arguments

  • plt : the synthesis plot
  • solution : the Solution

Keyword arguments (optional)

  • element : list of index of solution.state to plot, initialized to [1, ..., solution.N]
  • axis_arrow: symbol to indicate the axis for the arrow, initialized to nothing (no arrow). This symbol must be :x or :y.
  • arrow : vector of axis_arrow coordinates to make arrows, initialized to nothing
  • color : color of trajectory, initialized to the first color of the classical theme palette
  • nb_pts : number of points for each sub-segments, initialized to 5
  • label : the label of the trajectory, initialized to an empty string
  • kwargs... : keyword arguments for plot

Return

  • plt : the plot
Filtration.check_rootMethod
check_root(
    e⁺::Function,
    e⁻::Function,
    f⁺::Function,
    f⁻::Function,
    g⁺::Function,
    g⁻::Function,
    p::Union{Nothing, Vector{<:Real}},
    criteria_type::Symbol;
    xlim,
    initial_guess,
    kwargs...
) -> Plots.Plot

Plot a function where we need to ensure that there is only one zero of it, on the domain of interest. An initial guess of this zero can be provided to the construtor of the Model type.

Arguments

  • e⁺ : the function $e^+(x_1, p)$
  • e⁻ : the function $e^-(x_1, p)$
  • f⁺ : the function $f^+(x_1, p)$
  • f⁻ : the function $f^-(x_1, p)$
  • g⁺ : the function $g^+(x_1, p)$
  • g⁻ : the function $g^-(x_1, p)$
  • p : parameters of previous functions
  • criteria_type : the criteria type, either :min or :max

Keyword arguments (optional)

  • xlim : limits for x axis, initialized to (0,10)
  • initial_guess : initial guess(es) for zero of the function. Initialized to nothing.
  • kwargs... : keyword arguments for plot

Return

  • plt : the plot
Filtration.check_rootMethod
check_root(
    e⁺::Function,
    e⁻::Function,
    f⁺::Function,
    f⁻::Function,
    p::Vector{<:Real},
    criteria_type::Symbol;
    xlim,
    initial_guess,
    kwargs...
) -> Plots.Plot

Plot a function where we need to ensure that there is only one zero of it, on the domain of interest. An initial guess of this zero can be provided to the construtor of the Model type.

Arguments

  • e⁺ : the function $e^+(x_1, p)$
  • e⁻ : the function $e^-(x_1, p)$
  • f⁺ : the function $f^+(x_1, p)$
  • f⁻ : the function $f^-(x_1, p)$
  • p : parameters of previous functions
  • criteria_type : the criteria type, either :min or :max

Keyword arguments (optional)

  • xlim : limits for x axis, initialized to (0,10)
  • initial_guess : initial guess(es) for zero of the function. Initialized to nothing.
  • kwargs... : keyword arguments for plot

Return

  • plt : the plot
Filtration.compute_phiMethod
compute_phi(
    extremal::Extremal,
    model::Model;
    p
) -> Filtration.var"#phi#138"{Vector{var"#s280"}, Extremal, Model} where var"#s280"<:Real

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

Arguments

  • extremal : the Extremal
  • model : the Model

Keyword arguments (optional)

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

Return

  • phi : the function $\phi$.
Filtration.construct_extremalMethod
construct_extremal(
    model::Model,
    solution::Solution;
    p
) -> Extremal

Construct an Extremal from a Solution from a Model.

Arguments

  • model : a Model
  • solution: a Solution

Keyword arguments (optional)

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

Return

  • extremal : the Extremal
Filtration.controlMethod
control(extremal::Extremal) -> Control

Getter for the Control of an Extremal.

Arguments

  • extremal : an Extremal

Return

  • control : the Control of the Extremal
Filtration.controlMethod
control(solution::Solution) -> Control

Getter for the Control of a Solution.

Arguments

  • solution : a Solution

Return

  • control : the Control of the Solution
Filtration.costateMethod
costate(extremal::Extremal) -> Costate

Getter for the Costate of an Extremal.

Arguments

  • extremal : an Extremal

Return

  • costate : the Costate of the Extremal
Filtration.cut_SLMethod
cut_SL(
    model::Model,
    SL::SciMLBase.ODESolution,
    xlim::Tuple{Real, Real},
    ylim::Tuple{Real, Real}
) -> Any

Comute the cut associated to the switching locus which corresponds to the trajectory which leads to the point $(x,y)$ at the final time, where $(x,y)$ is the last point of the switching locus.

Arguments

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

Returns

  • cut_SL : the cut associated to the switching locus
Filtration.cutsMethod
cuts(
    model::Model,
    xlim::Tuple{Real, Real},
    ylim::Tuple{Real, Real}
) -> Tuple{SciMLBase.ODESolution, SciMLBase.ODESolution}

Compute the cuts $c_-(t)$ and $c_+(t)$, which corresponds to the curves which leads to the last point of the singular locus. Function $c_-(t)$ is associated to the control $u = -1$ and $c_+(t)$ is associated to the control $u = 1$.

Warning

The cost at the final time is set to 0.

Arguments

  • model : a Model
  • xlim : the limits of state $x_2$
  • ylim : the limits of state $x_1$

Returns

  • cut₋ : the function $c_-$
  • cut₊ : the function $c_+$
Filtration.dispersal_locusMethod
dispersal_locus(
    model::Model,
    xlim::Tuple{Real, Real},
    ylim::Tuple{Real, Real},
    SL::SciMLBase.ODESolution,
    cut₋::SciMLBase.ODESolution;
    method,
    cutSL,
    n
) -> Union{ODELike, SciMLBase.ODESolution}

Compute the dispersal locus curve with a direct or a continuation method. The method is initialized to $:direct$.

Note

If you have already computed the cut associated to the switching locus with the function cut_SL and want to use the method $:direct$, please provide it in order to avoid computing it again.

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

Keyword arguments

  • method : the method used to compute the dispersal locus
  • cutSL : the cut associated to the switching locus
  • n : the number of points used to compute the dispersal locus

Returns

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

Compute the second dispersal locus curve with a direct or a continuation method. The method is initialized to $:continuation$.

Arguments

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

Keyword arguments

  • method : the method used to compute the second dispersal locus, either :continuation or :direct
  • cutSL : the cut associated to the switching locus, required for the :direct method
  • n : the number of points used to compute the second dispersal locus with the :direct method

Returns

  • DL2 : the second dispersal locus curve
Filtration.fitMethod
fit(
    model::Model,
    control::Control,
    time::Vector{<:Real},
    data_x0::Vector{<:Real},
    initial_p::Vector{<:Real},
    x0::Vector{<:Real};
    method,
    get_m,
    u,
    slope,
    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 can be either known or partially unknown. 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

Keyword Arguments

  • method : either $:known$ or $:unknown$ (default : $:known$)
  • get_m : function to compute the unknown initial state variable from control and parameters (required if $method == :unknown$)
  • u : singular control applied before initial time (required if $method == :unknown$)
  • slope : slope of state $x_0$ before initial time (required if $method == :unknown$)
  • 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.interpolate_cutMethod
interpolate_cut(cut, y) -> Any

Interpolate a cut at a given $y$, and provide the associated $x$.

Arguments

  • cut : a ODESolution
  • y : the value of $y$

Returns

  • x : the value of $x$
Filtration.real_solveMethod
real_solve(
    model::Model,
    init_x₂::Real,
    end_x₂::Real,
    init_x₁::Real,
    N::Int64;
    method,
    verbose
) -> Solution

Provide a real solution, where the control is only composed by -1 and 1 values, by the method. method can be :control, :singular or :optimal.

Warning

If method = :optimal, the computation 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)

  • method : method used to get the real solution. Can be :control, :singular or :optimal. Initialized to :singular
  • verbose : if true, print the optimization process (default is false)

Return

  • real_sol : the Solution
Filtration.simulateMethod
simulate(
    model::Model,
    control::Control,
    x0::Vector{<:Real};
    p
) -> Solution

Simulate a Control on a Model, starting from an initial state $x(t_0) = x_0$.

Arguments

  • model : a Model
  • control : a Control
  • x0: an initial state $x(t_0) = x_0$

Keyword arguments (optional)

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

Return

  • solution : the Solution
Filtration.simulateMethod
simulate(
    model::SimulationModel,
    u::Control,
    x0::Vector{<:Real}
) -> Solution

Simulate a Control on a SimulationModel, starting from an initial state $x(t_0) = x_0$.

Arguments

  • model : a SimulationModel
  • u : a Control
  • x0 : an initial state $x(t_0) = x_0$

Return

  • solution : the Solution
Filtration.solutionMethod
solution(
    synthesis::Synthesis,
    init_x₂::Real,
    end_x₂::Real,
    init_x₁::Real
) -> Solution

Wrapper to get solution from synthesis.

Arguments

  • synthesis : a Synthesis
  • 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)$

Returns

  • sol: the Solution
Filtration.solveMethod
solve(
    model::Model,
    init_x₂::Real,
    end_x₂::Real,
    init_x₁::Real;
    cut₋,
    cut₊,
    cutSL,
    SL,
    DL,
    DL2
) -> Solution

Solve the optimal control problem associated to a Model model by indirect shooting.

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)$

Returns

  • sol: the Solution
Filtration.solve_MPMethod
solve_MP(
    model::Model,
    init_x₂::Real,
    end_x₂::Real,
    init_x₁::Real;
    SL
) -> Solution

Solve the optimal control problem associated to a Model model by indirect method, with the structure given by $u_- \circ u_+$, and when the change is done by intersection with the switching curve

Warning

This function must be used only if we know the structure. If you don't know the structure of the solution, use solve function instead.

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)$

Returns

  • sol: the Solution
Filtration.solve_MSPMethod
solve_MSP(
    model::Model,
    init_x₂::Real,
    end_x₂::Real,
    init_x₁::Real
) -> Solution

Solve the optimal control problem associated to a Model model, with the structure given by $u_- \circ u_s \circ u_+$.

Warning

This function must be used only if we know the structure. If you don't know the structure of the solution, use solve function instead.

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)$

Returns

  • sol: the Solution
Filtration.solve_PMethod
solve_P(
    model::Model,
    init_x₂::Real,
    end_x₂::Real,
    init_x₁::Real
) -> Solution

Solve the optimal control problem associated to a Model model, with the structure given by $u_+$.

Warning

This function must be used only if we know the structure. If you don't know the structure of the solution, use solve function instead.

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)$

Returns

  • sol: the Solution
Filtration.solve_PSPMethod
solve_PSP(
    model::Model,
    init_x₂::Real,
    end_x₂::Real,
    init_x₁::Real
) -> Solution

Solve the optimal control problem associated to the membrane filtration model by indirect shooting, with the structure given by $u_+ \circ u_s \circ u_+$

Warning

This function must be used only if we know the structure. If you don't know the structure of the solution, use solve function instead.

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)$

Returns

  • sol: the Solution
Filtration.solve_SPMethod
solve_SP(
    model::Model,
    init_x₂::Real,
    end_x₂::Real,
    init_x₁::Real
) -> Solution

Solve the optimal control problem associated to the membrane filtration model by indirect shooting, with the structure given by $u_s \circ u_+$

Warning

This function must be used only if we know the structure. If you don't know the structure of the solution, use solve function instead.

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)$

Returns

  • sol: the Solution
Filtration.stateMethod
state(extremal::Extremal) -> State

Getter for the State of an Extremal.

Arguments

  • extremal : an Extremal

Return

  • state : the State of the Extremal
Filtration.stateMethod
state(solution::Solution) -> State

Getter for the State of a Solution.

Arguments

  • solution : a Solution

Return

  • state : the State of the Solution
Filtration.switching_locusMethod
switching_locus(
    model::Model,
    xlim::Tuple{Real, Real},
    ylim::Tuple{Real, Real}
) -> SciMLBase.ODESolution

Switching locus function computed by continuation method.

A state $[x_1, x_2]$ belongs to the switching curve if $S(x_2, x_1) = 0$, where $S \colon \mathbb R^2 \to \mathbb R$ is defined by

\[S(x_2, x_1) = H(x_1, \varphi_1(x_1, x_2))\]

The function $\varphi_1$ coresponds to the solution at the final time of the state $x_1$ by applying the control $u_+$, and the function $H$ is defined by

\[ H(x_1, x_{1,f}) = \lambda_1(x_1, x_{1,f}) (f_+(x_1) + f_-(x_1)) + \lambda_2(x_{1,f})(g_+(x_1) + g_-(x_1)) - (e_+(x_1) + e_-(x_1))\]

where

\[ \lambda_1(x_1, x_{1,f}) = \frac{e_+(x_1) - \lambda_2(x_{1,f}) g_+(x_1)}{f_+(x_1)}\]

and

\[ \lambda_2(x_{1,f}) = \frac{e_+(x_1) + e_-(x_1)}{g_+(x_1) + g_-(x_1)}. \]

We suppose that there exsits the switching locus $SL(x_1)$ such that $S(x_1, SL(x_1)) = 0$. Since $S$ is constant, we have

\[ \frac{\partial S}{\partial x_1}(x_1, SL(x_1)) + \frac{\partial S}{\partial x_2}(x_1, SL(x_1)) SL'(x_1) = 0\]

By the previous hypothesis, $\frac{\partial S}{\partial x_2}(x_1, SL(x_1))$ is invertible. We have so

\[SL'(x_1) = -\left( \frac{\partial S}{\partial x_2}(x_1, SL(x_1)) \right)^{-1} \frac{\partial S}{\partial x_1}(x_1, SL(x_1)).\]

The continuation method consists to solve this ODE with the initial condition $SL(x_s) = x_f - \Delta x_2$. Thanks to the combinaison of ForwardDiff and OrdinaryDiffEq package, the derivative of $\varphi_1$ is computed by automatic differentiation methods by using the variatomal equations.

Arguments

  • model: a Model
  • xlim : the limits of the state $x_2$
  • ylim : the limits of the state $x_1$

Return

  • SL : the switching locus function, as an ODESolution
RecipesBase.plot!Method
plot!(
    plt::Plots.Plot,
    control::Control;
    color,
    label,
    kwargs...
)

Add a Control to a plot

Arguments

  • plt : a Plot
  • control : a Control

Keyword arguments (optional)

  • color : the color of the plot (default is the first color of the classical theme palette)
  • label : the label of the plot (default is an empy string)
  • kwargs... : keyword arguments for plot

Return

  • plt : the plot
RecipesBase.plot!Method
plot!(
    plt::Plots.Plot,
    costate::Costate;
    color,
    label,
    subplot,
    kwargs...
)

Plot a Costate

Arguments

  • costate : a Costate

Keyword arguments (optional)

  • color : the color of the plot (default is the first color of the classical theme palette)
  • label : the label of the plot (default is an empy string)
  • subplot : the initial subplot number (default is 1)
  • kwargs... : keyword arguments for plot

Return

  • plt : the plot
RecipesBase.plot!Method
plot!(
    plt::Plots.Plot,
    extremal::Extremal;
    color,
    label,
    kwargs...
)

Add an Extremal on a Plot

Arguments

  • plt : a Plots.Plot
  • extremal : an Extremal

Keyword arguments (optional)

  • color : the color of the plot (default is the first color of the theme palette)
  • label : the label of the plot (default is "")
  • kwargs... : keyword arguments for plot

Return

  • plt : the plot
RecipesBase.plot!Method
plot!(
    plt::Plots.Plot,
    solution::Solution;
    color,
    kwargs...
) -> Plots.Plot

Add a Solution on a plot

Arguments

  • plt : a Plots.Plot
  • solution : a Solution

Keyword arguments (optional)

  • color : the color of the plot (default is the first color of the theme palette)
  • label : the label of the plot (default is "")
  • kwargs... : keyword arguments for plot

Return

  • plt : the plot
RecipesBase.plot!Method
plot!(
    plt::Plots.Plot,
    state::State;
    color,
    subplot,
    label,
    kwargs...
)

Add a State to a plot

Arguments

  • state : a State

Keyword arguments (optional)

  • color : the color of the plot (default is the first color of the classical theme palette)
  • label : the label of the plot (default is an empy string)
  • subplot : the initial subplot number (default is 1)
  • kwargs... : keyword arguments for plot

Return

  • plt : the plot
RecipesBase.plotMethod
plot(
    control::Control;
    color,
    ylim,
    label,
    titlefontsize,
    kwargs...
) -> Plots.Plot

Plot a Control

Arguments

  • control : a Control

Keyword arguments (optional)

  • color : the color of the plot (default is the first color of the classical theme palette)
  • ylim : the y limits of the plot (default is (-1.1, 1.1))
  • label : the label of the plot (default is an empy string)
  • titlefontsize : size of the title (default is 9)
  • kwargs... : keyword arguments for plot

Return

  • plt : the plot
RecipesBase.plotMethod
plot(
    costate::Costate;
    color,
    label,
    kwargs...
) -> Plots.Plot

Plot a Costate

Arguments

  • costate : a Costate

Keyword arguments (optional)

  • color : the color of the plot (default is the first color of the classical theme palette)
  • label : the label of the plot (default is an empy string)
  • kwargs... : keyword arguments for plot

Return

  • plt : the plot
RecipesBase.plotMethod
plot(
    extremal::Extremal;
    size,
    color,
    label,
    kwargs...
) -> Plots.Plot

Plot an Extremal

Arguments

  • extremal : an Extremal

Keyword arguments (optional)

  • size : the size of the plot (default is (600, 350))
  • color : the color of the plot (default is the first color of the classical theme palette)
  • label : the label of the plot (default is empty string)
  • kwargs... : keyword arguments for plot

Return

  • plt : the plot
RecipesBase.plotMethod
plot(
    s::MultiSynthesis;
    feedback_form,
    label_curve,
    colors,
    kwargs...
) -> Plots.Plot

Plot a MultiSynthesis, in a feedback form.

Warning

The classification of optimal control form (feedback_form = false) is not implemented yet and raises an error.

Arguments

  • s : a MultiSynthesis

Keyword arguments (optional)

  • feedback_form : if true, plot in a feedback form. If false, an error is raised (not implemented). Initialized to true
  • 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
RecipesBase.plotMethod
plot(pareto::Pareto; kwargs...) -> Plots.Plot

Plot the Pareto front.

Arguments

  • pareto : a Pareto

Keyword Arguments

  • kwargs... : keyword arguments for the plot

Returns

  • plt : the plot of the Pareto front
RecipesBase.plotMethod
plot(
    solution::Solution;
    state_ylabels,
    size,
    color,
    label,
    kwargs...
) -> Plots.Plot

Plot a Solution

Arguments

  • solution : a Solution

Keyword arguments (optional)

  • size : the size of the plot (default is (600, 350))
  • color : the color of the plot (default is the first color of the theme palette)
  • label : the label of the plot (default is "")
  • kwargs... : keyword arguments for plot

Return

  • plt : the plot
RecipesBase.plotMethod
plot(
    state::State;
    ylabels,
    color,
    label,
    kwargs...
) -> Plots.Plot

Plot a State

Arguments

  • state : a State

Keyword arguments (optional)

  • ylabels : the y-axis label for each state component (default is ["x₀", "x₁", "x₂", "x₃"])
  • color : the color of the plot (default is the first color of the classical theme palette)
  • label : the label of the plot (default is an empy string)
  • kwargs... : keyword arguments for plot

Return

  • plt : the plot
RecipesBase.plotMethod
plot(
    s::Synthesis;
    feedback_form,
    SL_nb_points,
    label_curve,
    colors,
    kwargs...
) -> Plots.Plot

Plot a Synthesis, in a classification of optimal control form or in a feedback form.

Arguments

  • s : a Synthesis

Keyword arguments (optional)

  • feedback_form : if true, plot in a feedback form. If false, in a classification of optimal control form. Initialized to false
  • 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"]$. Only used when$feedback_form`` is true.
  • colors : colors of the curves for $u_s$ and the switching locus. Initialized to [:green, :gold, :gray20, :gray20]. Only used when feedback_form is true.
  • kwargs... : keyword arguments for plot

Returns

  • plt : the plot
StructuralIdentifiability.assess_identifiabilityMethod
assess_identifiability(
    model::Model
) -> OrderedCollections.OrderedDict

Assess the structural identifiability of a Model's parameters, by building the associated ODE system with ModelingToolkit and delegating to StructuralIdentifiability.assess_identifiability.

Arguments

  • model : a Model

Return

  • report : the identifiability report returned by StructuralIdentifiability.assess_identifiability
StructuralIdentifiability.reparametrize_globalMethod
reparametrize_global(
    model::Model
) -> NamedTuple{(:new_ode, :new_vars, :implicit_relations), <:Tuple{StructuralIdentifiability.ODE{Nemo.QQMPolyRingElem}, Dict, Vector}}

Compute a globally identifiable reparametrization of a Model, by building the associated ODE system with ModelingToolkit and delegating to StructuralIdentifiability.reparametrize_global.

Arguments

  • model : a Model

Return

  • reparametrization : the result returned by StructuralIdentifiability.reparametrize_global