User`s guide

Table Of Contents
lsim
11-126
11lsim
Purpose Simulate LTI model response to arbitrary inputs
Syntax lsim(sys,u,t)
lsim(sys,u,t,x0)
lsim(sys1,sys2,...,sysN,u,t)
lsim(sys1,sys2,...,sysN,u,t,x0)
lsim(sys1,'PlotStyle1',...,sysN,'PlotStyleN',u,t)
[y,t,x] = lsim(sys,u,t,x0)
Description lsim simulates the (time) response of continuous or discrete linear systems to
arbitrary inputs. When invoked without left-hand arguments,
lsim plots the
response on the screen.
lsim(sys,u,t) producesaplotofthezero-initialconditiontimeresponseof the
LTI model
sys to the input time hi story t,u.Thevectortspecifies the time
samples for the simulation and consists of regularly spaced time samples
t = T0:dt:Tfinal
The matrix u must have a s many rows as time samples ( length(t))andas
many columns as system inputs. Each row
u(i,:) specifies the i nput value (s)
at the t ime sam pl e
t(i).
The LTI model
sys can be continuous or discrete, SISO or MIMO. In discrete
time,
u mustbesampledatthesamerateasthesystem(tis then redundant
and can be omitted or set to the empty matrix). In continuous time, the time
sampling
dt=t(2)–t(1) is usedto discretize the continuousmodel. Automatic
resampling is performed if
dt is too large (undersampling)and may give rise to
hidden oscillations (see “Algorithm”).
lsim(sys,u,t,x0) specifies a nonzero initial condition x0 for the system
states. This initial condition is applied at
t(1). This syntax applies only to
state-space models.
Finally,
lsim(sys1,sys2,...,sysN,u,t)