Function File: **lsim** (`sys1, sys2, ..., sysN, u`)

Function File: **lsim** (`sys1, 'style1', ..., sysN, 'styleN', u`)

Function File: **lsim** (`sys1, ..., u, t`)

Function File: **lsim** (`sys1, ..., u, t, x0`)

Function File: [`y`, `t`, `x`] = **lsim** (`sys, u`)

Function File: [`y`, `t`, `x`] = **lsim** (`sys, u, t`)

Function File: [`y`, `t`, `x`] = **lsim** (`sys, u, t, x0`)

Simulate LTI model response to arbitrary inputs. If no output arguments are given, the system response is plotted on the screen.

Inputs

sys- LTI model. System must be proper, i.e. it must not have more zeros than poles.
u- Vector or array of input signal. Needs
`length(t)`

rows and as many columns as there are inputs. Ifsysis a single-input system, row vectorsuof length`length(t)`

are accepted as well.t- Time vector. Should be evenly spaced. If
sysis a continuous-time system andtis a real scalar,sysis discretized with sampling time`tsam = t/(rows(u)-1)`

. Ifsysis a discrete-time system andtis not specified, vectortis assumed to be`0 : tsam : tsam*(rows(u)-1)`

.x0- Vector of initial conditions for each state. If not specified, a zero vector is assumed.
'style'- Line style and color, e.g. 'r' for a solid red line or '-.k' for a dash-dotted black line. See
help plotfor details.

Outputs

y- Output response array. Has as many rows as time samples (length of t) and as many columns as outputs.
t- Time row vector. It is always evenly spaced.
x- State trajectories array. Has
`length (t)`

rows and as many columns as states.

See also:impulse, initial, step.

Package: control