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

TypeNameDefaultDescription
DiscreteStateSpace.Internal.ekfSystemBaseekfFunctionIntegrand function
Real[:]xpreState at instant k-1
Real[:]upreInput at instant k-1
Real[:]uInput at instant k
Real[:]yOutput at instant k
Real[size(xpre, 1),size(xpre, 1)]MpreSolution of the discrete Riccati equation at instant k-1
Real[size(xpre, 1),size(xpre, 1)]Qidentity(size(xpre, 1))Weighted covariance matrix of the associated process noise (F*Q*F')
Real[size(y, 1),size(y, 1)]Ridentity(size(y, 1))Covariance matrix of the measurement noise
Modelica.Units.SI.TimeTsSample time

Outputs

TypeNameDefaultDescription
Real[size(xpre, 1)]x_estEstimated state vector
Real[size(y, 1)]y_estEstimated output
Real[size(Mpre, 1),size(Mpre, 1)]MSolution of the discrete Riccati equation
Real[size(xpre, 1),size(y, 1)]KKalman filter gain matrix
Real[size(xpre, 1)]x_contValue of continuous state
Real[size(y, 1)]y_contValue of continuous output

Revisions

Date Author Comment
2010-06-11 Marcus Baur, DLR-RM Realization