Control Models
- class stonesoup.models.control.base.ControlModel[source]
Bases:
ModelControl Model base class
- abstractmethod function(control_input, prior=None, noise=False, **kwargs)[source]
Control Model function \(b_k(u(k),x(k),w(k))\)
- Parameters:
control_input (
State, optional) – \(\mathbf{u}_k\)prior (
State) – The prior state, \(\mathbf{x}_{k-1}\)noise (
numpy.ndarrayor bool) – An externally generated random process noise sample (the default is False, in which case no noise will be added if ‘True’, the output ofrvs()is used)
- Returns:
The StateVector(s) with the model function evaluated.
- Return type:
StateVectororStateVectors
- class stonesoup.models.control.linear.BaseLinearControlModel(seed: int | None = None, control_noise: ndarray = None)[source]
Bases:
ControlModel,LinearModel,GaussianModel,ABC- Parameters:
seed (
Optional[int], optional) – Seed for random number generationcontrol_noise (
numpy.ndarray, optional) – Control input noise covariance at time \(k\)
- function(control_input, prior=None, noise=False, **kwargs) StateVector[source]
Control Model function \(b_k(u(k),x(k),w(k))\)
- Parameters:
control_input (
State, optional) – \(\mathbf{u}_k\)prior (
State) – The prior state, \(\mathbf{x}_{k-1}\)noise (
numpy.ndarrayor bool) – An externally generated random process noise sample (the default is False, in which case no noise will be added if ‘True’, the output ofrvs()is used)
- Returns:
The StateVector(s) with the model function evaluated.
- Return type:
StateVectororStateVectors
- class stonesoup.models.control.linear.LinearControlModel(control_matrix: ndarray, seed: int | None = None, control_noise: ndarray = None)[source]
Bases:
BaseLinearControlModelImplements a linear effect to the state vector via,
\[\hat{x}_k = B_k (\mathbf{u}_k + \gamma_k)\]where \(B_k\) is the control-input model matrix (i.e. control matrix), \(\mathbf{u}_k\) is the control vector and \(\gamma_k\) is sampled from zero-mean white noise distribution \(\mathcal{N}(0,\Gamma_k)\)
- Parameters:
control_matrix (
numpy.ndarray) – Control input model matrix at time \(k\), \(B_k\)seed (
Optional[int], optional) – Seed for random number generationcontrol_noise (
numpy.ndarray, optional) – Control input noise covariance at time \(k\)
- property ndim_ctrl
Number of control input dimensions
- class stonesoup.models.control.linear.TransitionBasedLinearControlModel(transition_model: TransitionModel, mapping: Sequence[int], seed: int | None = None, control_noise: ndarray = None, output_in_state_vector: bool = False)[source]
Bases:
BaseLinearControlModelA model that applies an Nth Derivative Transition Model over a specified time period. This is just a
LinearControlModelwhich accepts a time_interval input to compute the control matrix.A derivative ordered state vector is assumed (e.g., \([x, \dot{x}, \ldots, y, \dot{y}, \dots]^T\)).:
- Parameters:
transition_model (
TransitionModel) – Transition model to applymapping (
collections.abc.Sequence) – Mapping to Nth Derivatives of transition modelseed (
Optional[int], optional) – Seed for random number generationcontrol_noise (
numpy.ndarray, optional) – Control input noise covariance at time \(k\)output_in_state_vector (
bool, optional) – This flag determines whether the control input is dimensions are already in the statevector (True) or not (False).
- transition_model: TransitionModel
Transition model to apply
- output_in_state_vector: bool
This flag determines whether the control input is dimensions are already in the statevector (True) or not (False).
- property ndim_ctrl
Number of control input dimensions
- matrix(time_interval, **kwargs) ndarray[source]
- Parameters:
time_interval (
datetime.timedelta) – A time interval. Note the units used are \(s\) so accelerations are implicitly per second squared.- Returns:
the control-input model matrix, \(B_k\)
- Return type: