source_localization.control module

class source_localization.control.Control(background_source, msh, exclusion_domain=None, log_barrier_threshold=1e-10, population_dynamique_model=None)[source]

Bases: object

Class containing the control variable \(s(x,y,t)\) that is the quantity of pheromone emitted by the insects and all its prior known features.

value

The current estimation of the control variable \(s(x,y,t)\) raveled in a (msh.t_array.size * msh.y.size * msh.x.size,)-shape array. Initialized by zeros.

Type:

ndarray

background_value

The background/prior estimation of the control variable \(s_b(x,y,t)\) raveled in a (msh.t_array.size * msh.y.size * msh.x.size,)-shape array.

Type:

ndarray

C_inv

The inverse of the covariance matrix of the background error (error between the prior estatimation and the true value) \(\mathbf{C}^{-1}\). Initialized and by default the identity.

Type:

ndarray

population_dynamic_model

The population dynamique model \(\partial_ts+\mathcal{M}(s)=0\) that the control variable satisfies. Examples of population dynamique models can be found in the submodule population_dynamique. The user can easily provide its own population dynamic model as long as it contains a method _matvec() that estimate the residual of the model \(s\mapsto\partial_ts+\mathcal{M}(s)\) and a method _rmatvec() that estimate the adjoint of the derivative of the model with respect to the control variable \(\delta s\mapsto(\partial_t+d_s\mathcal{M}(s))^*\cdot\delta s\). If no population dynamic models are a priori known, set to None.

Type:

subclass of LinearOperator or ndarray

exclusion_domain

The exclusion domain \(\Omega_{exc}\) corresponding to the time and places where it is a prior known that no insects will emit pheromones for the log-barrier regularization term. Is True where the pheromone emissions should be excluded. If no exclusion zones are a priori known, set to an empty list.

Type:

ndarray of boolean or list

log_barrier_threshold

The threshold of the log-barrier regularization \(\epsilon\).

Type:

float

__init__(background_source, msh, exclusion_domain=None, log_barrier_threshold=1e-10, population_dynamique_model=None)[source]

Constructor method

Parameters:
  • background_source (Source) – The background value of the source term \(s_b(x,y,t)\).

  • msh (MeshRect2D) – The geometry of the domain.

  • population_dynamic_model (subclass of LinearOperator or ndarray or None, optional, default: None) – The population dynamique model \(\partial_ts+\mathcal{M}(s)=0\) that the control variable satisfies. None if no population dynamic models are known.

  • exclusion_domain (ndarray of boolean or list, optional, default: None) – The exclusion domain \(\Omega_{exc}\). None if no exclusion domain are known.

  • log_barrier_threshold (float, optional, default: 1e-10) – The threshold of the log-barrier regularization \(\epsilon\).

Raises:

ValueError – if the time array has not been initialized using the methods calc_dt_explicit_solver() or MeshRect2Dcalc_dt_implicit_solver().

apply_control(direct_model)[source]

apply the current value of the control variable as source term \(s(x,y,t)\) of the given pheromone propagation model

Parameters:

direct_model (DiffusionConvectionReaction2DEquation) – The pheromone propagation model

Notes

Update the attribute S of the given object of the class DiffusionConvectionReaction2DEquation with the current value of the control variable contained in the attribute value.