yaocptool.estimation package¶
Submodules¶
yaocptool.estimation.estimator_abstract module¶
yaocptool.estimation.extended_kalman_filter module¶
-
class
ExtendedKalmanFilter(model, **kwargs)[source]¶ Bases:
yaocptool.estimation.estimator_abstract.EstimatorAbstract-
__init__(model, **kwargs)[source]¶ Extended Kalman Filter for ODE and DAE systems implementation based on (1)
(1) Mandela, R. K., Narasimhan, S., & Rengaswamy, R. (2009). Nonlinear State Estimation of Differential Algebraic Systems. Proceedings of the 2009 ADCHEM (Vol. 42). IFAC. http://doi.org/10.3182/20090712-4-TR-2008.00129
Parameters: - model (SystemModel) – filter model
- t_s (float) – sampling time
- t (float) – current estimator time
- x_mean (DM) – current state estimation
- p_k (DM) – current covariance estimation
- r_v (DM) – process noise covariance matrix
- r_n (DM) – measurement noise covariance matrix
- y_guess (DM) – initial guess of the algebraic variables for the model simulation
-
estimate(t_k, y_k, u_k)[source]¶ Estimate the state given the measurement y_k and the control u_k :param DM t_k: time of the measurements :param DM y_k: measurement :param DM u_k: control
-
n_meas¶ Number of measurements
Return type: int Returns: Number of measurements
-
yaocptool.estimation.pce_kalman_filter module¶
-
class
PCEKalmanFilter(model, **kwargs)[source]¶ Bases:
yaocptool.estimation.estimator_abstract.EstimatorAbstract-
__init__(model, **kwargs)[source]¶ Parameters: - model (SystemModel) – estimator model
- x_mean – a initial guess for the mean
- p_k – a initial guess for the covariance of the estimator
- h_function – a function that receives 3 parameters (x, y_algebraic, u) and returns an measurement.
- c_matrix – if h_function is not give, c_matrix is “C” from the measurement equation: y_meas = C*[x y_alg] + D*u. note that it has to have n_x + n_y (algebraic) columns.
- r_v (DM) – process noise matrix
- r_n (DM) – measurement noise matrix
- pc_order (int) – Polynomial chaos order
- n_samples (int) – Number of samples to be used
-
estimate(t_k, y_k, u_k)[source]¶ Estimate the state given the measurement y_k and the control u_k :param DM t_k: time of the measurements :param DM y_k: measurement :param DM u_k: control
-
n_pol_parameters¶
-
yaocptool.estimation.unscented_kalman_filter module¶
-
class
UnscentedKalmanFilter(model, **kwargs)[source]¶ Bases:
yaocptool.estimation.estimator_abstract.EstimatorAbstract-
__init__(model, **kwargs)[source]¶ - Unscented Kalman Filter. Two versions are implemented standard and square-root. Implemented based on [1] and [2].
References:
[1] Wan, E. A., & Van Der Merwe, R. (2000). The unscented Kalman filter for nonlinear estimation. In Proceedings of the IEEE 2000 Adaptive Systems for Signal Processing, Communications, and Control Symposium (Cat. No.00EX373) (Vol. v, pp. 153–158). IEEE. http://doi.org/10.1109/ASSPCC.2000.882463
[2] Merwe, R. Van Der, & Wan, E. a. (2001). The square-root unscented Kalman filter for state and parameter-estimation. 2001 IEEE International Conference on Acoustics, Speech, and Signal Processing. Proceedings (Cat. No.01CH37221), 6, 1–4. http://doi.org/10.1109/ICASSP.2001.940586
Parameters: - model (SystemModel) – estimator model
- x_mean – a initial guess for the mean
- p_k – a initial guess for the covariance of the estimator
- h_function – a function that receives 3 parameters (x, y_algebraic, u) and returns an measurement.
- c_matrix – if h_function is not give, c_matrix is “C” from the measurement equation: y_meas = C*[x y_alg] + D*u. note that it has to have n_x + n_y (algebraic) columns.
- r_v (DM) – process noise matrix
- r_n (DM) – measurement noise matrix
- implementation – options: ‘standard’ or ‘square-root’. (default: ‘standard’)
-
estimate(t_k, y_k, u_k)[source]¶ Estimate the state given the measurement y_k and the control u_k :param DM t_k: time of the measurements :param DM y_k: measurement :param DM u_k: control
-
n_meas¶ Number of measurements
Return type: int Returns: Number of measurements
-