ltitr

Response of a discrete linear system to an input sequence.

Category: Other public functions: matfun

Syntax

x = ltitr(a, b, u)

Simulates x(k+1) = a*x(k) + b*u(k) from a zero initial state.

x = ltitr(a, b, u, x0)

Starts from the state x0.

Description

ltitr is the simple iteration behind the simulation of state-space models. Each row of the output is computed from the previous one, so the first row is the initial state itself. With a = 0.5, b = 1 and a constant input of 1, the state approaches the fixed point 2.

Input arguments

a
n-by-n state matrix.
b
n-by-m input matrix.
u
Input sequence: one row per time step, one column per input.
x0
Initial state, a column of length n.

Output arguments

x
State history, one row per step. Row k is the state before input u(k) is applied.

Example

Step response of a first-order system

x = ltitr(0.5, 1, ones(5, 1))
Output
x = 5×1

         0
    1.0000
    1.5000
    1.7500
    1.8750

See also

filter