kalman_d (MathScript RT Module Function)
- Updated2023-03-14
- 2 minute(s) read
kalman_d (MathScript RT Module Function)
Owning Class: ssdesign
Requires: Control Design and Simulation Module and MathScript RT Module
Syntax
[SysKalDisc, L, P, M, Z] = kalman_d(SysInSSCont, Q, R, Ts)
[SysKalDisc, L, P, M, Z] = kalman_d(SysInSSCont, Q, R, N, Ts)
Legacy Name: kalmd
Description
Calculates the optimal steady-state Kalman gain L that minimizes the covariance of the state estimation error. The input system and noise covariance are based on a continuous system. All outputs are based on a discretized system SysKalDisc, which is based on the sample rate Ts.
Inputs
| Name | Description |
|---|---|
| SysInSSCont | Specifies a continuous linear time-invariant (LTI) model in state-space form. |
| Q | Specifies the auto-covariance matrix of the continuous process noise. Q is a real matrix that is symmetric and positive semi-definite. |
| R | Specifies the auto-covariance matrix of the continuous measurement noise. R is a real matrix that is symmetric and positive definite. |
| Ts | Specifies the sampling time this VI uses to discretize the SysInSSCont model. Ts is a real scalar. |
| N | Specifies the cross-covariance matrix between the process noise and measurement noise. The default is an appropriately-sized matrix of zeros, which specifies the process noise and measurement noise are uncorrelated. N must be valid such that (Q - N*inv(R)*N') is positive semi-definite. N is a real matrix. |
Outputs
| Name | Description |
|---|---|
| SysKalDisc | Returns the definition of the discrete Kalman filter with the gain matrix L applied. SysKalDisc is a discrete LTI model in state-space form. |
| L | Returns the gain matrix that minimizes the covariance of the state estimation error. L is a real matrix. |
| P | Returns the steady-state covariance of the estimation error. P is a real matrix. |
| M | Returns the steady-state innovation gain matrix. This gain matrix weights the difference between the observed and estimated outputs in the state update equation for discrete estimators. M is a real matrix. |
| Z | Returns the steady-state error covariance of the error between the actual states and the updated state estimates in the discrete estimation process. Z is a real matrix. |
Details
The following table lists the support characteristics of this function.
| Supported in the LabVIEW Run-Time Engine | Yes |
| Supported on RT targets | Yes |
| Suitable for bounded execution times on RT | Not characterized |
Examples
A = [-1 0.1; 0 -2]; B = [0; 1]; G = [1 0; 0 1];
C = [1 0]; D = [0]; H = [0 0];
Q = [0.1 0; 0 0.1]; R = [1];
N = [0; 0];
Ts = 1;
SysInSSCont = ss(A, [B G], C, [D H]);
[SysKalDisc, L, P, M, Z] = kalman_d(SysInSSCont, Q, R, N, Ts)