functionEKF
Extended Kalman filter design function
Information
Syntax
(x_est, y_est, M, K) = DiscreteStateSpace.Design.EKF(x_pre, u_pre, y, M_pre, Q, R, Ts)
Description
Function EKF computes one recursion of the Kalman filter or the extended Kalman filter equations respectively, i.e updating the Riccati difference equation and the Kalman filter gain and correction of the predicted state.
The system functions are defined in function ekfFunction(), which is to provide by the user. Matrices A_k and C_k are the Jacobians F_x and H_x of the system equations f and h
x_k = f(x_k-1, u_k-1) y_k = h(x_k, u_k)
i.e., in the case of linear systems the system matrix A and the output matrix C.
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| DiscreteStateSpace.Internal.ekfSystemBase | ekfFunction | Integrand function | |
| Real[:] | xpre | State at instant k-1 | |
| Real[:] | upre | Input at instant k-1 | |
| Real[:] | u | Input at instant k | |
| Real[:] | y | Output at instant k | |
| Real[size(xpre, 1),size(xpre, 1)] | Mpre | Solution of the discrete Riccati equation at instant k-1 | |
| Real[size(xpre, 1),size(xpre, 1)] | Q | identity(size(xpre, 1)) | Weighted covariance matrix of the associated process noise (F*Q*F') |
| Real[size(y, 1),size(y, 1)] | R | identity(size(y, 1)) | Covariance matrix of the measurement noise |
| Modelica.Units.SI.Time | Ts | Sample time |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[size(xpre, 1)] | x_est | Estimated state vector | |
| Real[size(y, 1)] | y_est | Estimated output | |
| Real[size(Mpre, 1),size(Mpre, 1)] | M | Solution of the discrete Riccati equation | |
| Real[size(xpre, 1),size(y, 1)] | K | Kalman filter gain matrix | |
| Real[size(xpre, 1)] | x_cont | Value of continuous state | |
| Real[size(y, 1)] | y_cont | Value of continuous output |
Revisions
| Date | Author | Comment |
|---|---|---|
| 2010-06-11 | Marcus Baur, DLR-RM | Realization |