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:
objectClass 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:
- 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:
- 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:
- 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:
subclassofLinearOperatororndarray
- 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:
ndarrayofbooleanorlist
- 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 (
subclassofLinearOperatororndarrayorNone, 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 (
ndarrayofbooleanorlist, 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()orMeshRect2Dcalc_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
Sof the given object of the classDiffusionConvectionReaction2DEquationwith the current value of the control variable contained in the attributevalue.