lsim
Plot simulated time response of dynamic system to arbitrary inputs.
Syntax
lsim(sys, u, t)
lsim(sys, u, t, x0)
[y, tOut, x] = lsim(SYS, U, T, X0)
Input argument
sys - a lti model.
u - Input signal: matrix or vector.
t - Time samples: vector.
x0 - Initial state values: vector.
Output argument
y - Simulated response data: matrix or vector.
tOut - Time vector: vector.
x - State trajectories: matrix or vector.
Description
The function lsim(sys, u, t) generates a plot illustrating the simulated time response of the dynamic system model sys to the input history (t, u).
The time samples for the simulation are specified by the vector t.
In the case of single-input systems, the input signal u is a vector with the same length as t.
For multi-input systems, u is an array with rows corresponding to time samples (length(t)) and columns corresponding to inputs to sys.
An additional usage of the function is demonstrated by the example lsim(sys, u, t, x0), where a vector x0 is provided to specify initial state values.
This is particularly relevant when sys is a state-space model.
Examples
See also
History
1.0.0
initial version
Author
Allan CORNET
Last updated