LinearSystemModel

The LinearSystemModel class describes the temporal evolution of a system state \(x_k \in \mathbb{R}^N\) in the form of $$x_k = \mathbf{A}_k x_{k-1} + \mathbf{B}_k w_k + u_k \enspace,$$ with

  • system matrix \(\mathbf{A}_k \in \mathbb{R}^{N \times N}\),

  • system noise matrix \(\mathbf{B}_k \in \mathbb{R}^{N \times W} \),

  • system noise \(w_k \in \mathbb{R}^W \), and

  • system input vector \(u_k \in \mathbb{R}^N\).

The LinearSystemModel class also implements a SystemModel.

Usage

Configure a LinearSystemModel instance using the respective set* methods:

  • Set the system matrix \(\mathbf{A}_k\) with setSystemMatrix()

    If no system matrix is set, the LinearSystemModel instance uses an identity matrix of appropriate dimensions as system matrix.

  • Set the system noise matrix \(\mathbf{B}_k\) with setSystemNoiseMatrix()

    If no system noise matrix is set, the LinearSystemModel instance uses an identity matrix of appropriate dimensions as system noise matrix.

  • Set the system noise \(w_k\) with setNoise()

    You have to pass an instance of a Distribution subclass, e.g., a Gaussian. See also the list of available Probability Distributions.

  • Set the system input vector \(u_k\) with setSystemInput()

    Set an empty matrix if no input has to be used. If no system input is set, the LinearSystemModel instance uses an empty matrix.

You can pass a system matrix \(\mathbf{A}_k\) and a system noise matrix \(\mathbf{B}_k\) also to the LinearSystemModel's constructor.

You can access the set matrices and noise through the LinearSystemModel's properties.

Example

We implement a constant acceleration model for a 2D target described by the system state $$x_k = [p^x_k, p^y_k, \dot{p}^x_k, \dot{p}^y_k, \ddot{p}^x_k, \ddot{p}^y_k]^\top \enspace.$$ The model is given by $$x_k = \mathbf{A} x_{k-1} + \mathbf{B} w_k \enspace,$$ with matrices $$\mathbf{A} = \begin{bmatrix} \mathbf{I}_2 & T \, \mathbf{I}_2 & \frac{1}{2} T^2 \, \mathbf{I}_2 \\ \mathbf{0} & \mathbf{I}_2 & T \, \mathbf{I}_2 \\ \mathbf{0} & \mathbf{0} & \mathbf{I}_2 \end{bmatrix} \enspace,\quad \mathbf{B} = \begin{bmatrix} \frac{1}{2} T^2 \, \mathbf{I}_2 \\ T \, \mathbf{I}_2 \\ \mathbf{I}_2 \end{bmatrix} \enspace,$$ time period \(T = 0.01\), and zero-mean white Gaussian noise \(w_k\) with covariance matrix \(\mathbf{Q} = 0.1\mathbf{I}_2\).

T = 0.01;

A = [eye(2)   T * eye(2) 0.5 * T^2 * eye(2)
     zeros(2) eye(2)     T * eye(2)
     zeros(2) zeros(2)   eye(2)            ];

B = [0.5 * T^2 * eye(2)
     T * eye(2)
     eye(2)            ];

w = Gaussian(zeros(2, 1), 0.1*eye(2));

sysModel = LinearSystemModel();

sysModel.setSystemMatrix(A);
sysModel.setSystemNoiseMatrix(B);
sysModel.setNoise(w);

% Alternative construction:
sysModel = LinearSystemModel(A, B);

sysModel.setNoise(w);